AltraMayor / gatekeeper

The first open-source DDoS protection system
https://github.com/AltraMayor/gatekeeper/wiki
GNU General Public License v3.0
1.33k stars 229 forks source link

Shouldn't mbuf pools account for MTU? #698

Open AltraMayor opened 3 months ago

AltraMayor commented 3 months ago

The current implementation of lib/net.c:create_pktmbuf_pool() ignores the interfaces' MTUs. This is not a problem because create_pktmbuf_pool() uses RTE_MBUF_DEFAULT_BUF_SIZE, which is ideal for the typical MTU of Gatekeeper, namely, 2048 bytes. Nevertheless, shouldn't create_pktmbuf_pool() account for the MTU instead of always using RTE_MBUF_DEFAULT_BUF_SIZE?

Once create_pktmbuf_pool() accounts for the MTU, can one remove the parameter .offloads = RTE_ETH_RX_OFFLOAD_SCATTER passed to KNI (i.e., Virtio-user) interfaces from cps/kni.c:setup_dpdk_interface()?

Onepamopa commented 3 months ago

I think having a static value makes it easier for the pool to be "memory-aligned" (if that's the correct way to describe it) - which makes it faster to access.

AltraMayor commented 3 months ago

Thanks for the feedback. Your feedback is well within the intention of opening this issue: accumulating information to decide how to address this question in the code. The code can adjust the size of that parameter to guarantee that the memory is aligned.

I'll wait for a production demand to drive the final solution.