How can DPDK ACL library handle more than 16(RTE_ACL_MAX_CATEGORIES) categories?

Viewed 93

I'm using DPDK 20.08 and I need to copy and distribute packets to many targets, which involves the multi-category parallel classification feature on DPDK ACL. But according to the documentation and source code, one can only set up to RTE_ACL_MAX_CATEGORIES categories, which is 16. If I want to set more than 16, do I have to use at least 2 ACL context and lookup one by one?

1 Answers

Question> I need to copy and distribute packets to many targets

Caution> If the original content of the Ethernet frame is not modified at all, then one can use mbuf->ref_cnt to circumvent the overhead of mbuf copy. But if packet content will be different on each interface (such as dstmac or valn or ip headers) the one has to duplicate the packet. If mbuf->ref_cnt is used one can not use the NIC offload RX_MBUF_FAST_FREE too.

Solution 1: Depending upon the support of SIMD on the hardware (CPU) one can use RTE_ACL_CLASSIFY_AVX512X32. This allows 32 flow parallel lookup to be processed on CPU such skylake, cascadelake and icelake. refer Section 53.1.3 for more details.

Solution 2 (If there is no support for SIMD AVX512): is it worth to run all 16 or 32 flow lookup then copy mbuf into multiple targets, then modify the contents for each interface?

My suggestion is to use the HW (NIC or ASIC) or using SW (rx bridge driver) to create mirror on ingress traffic and sent to separate RX queue. By using separate CPU threads smaller ACL tables can be used.

Solution 3 (If there is no support for SIMD AVX512): One can start of modifying lib/acl/rte_acl.h for #define RTE_ACL_MAX_CATEGORIES 16 to #define RTE_ACL_MAX_CATEGORIES 32 as starting point of reference. There will be many other areas as mask which will also requires modification and support. Personally I do not recommend this option as it creates more out of tree dependency and needs to spend more time debugging the other issues.

Related