Skip to contentSkip to conversation

net/af_xdp: correct xdp frame size

PATCH Applied Xiaolong Ye 4 participants 4 messages Jul 8, 2019 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/af_xdp: correct xdp frame size

XSK_UMEM__DEFAULT_FRAME_SIZE has been changed to 4096 in kernel commit 123e8da1d330 (xsk: Change the default frame size to 4096 and allow controlling it), but we still need to keep ETH_AF_XDP_FRAME_SIZE as 2048 to fit most dpdk apps.

---
 drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/af_xdp/rte_eth_af_xdp.c +1 -1
index 5ce90a760..ff8e90589 100644
@@ -56,7 +56,7 @@ static int af_xdp_logtype;
 	rte_log(RTE_LOG_ ## level, af_xdp_logtype,	\
 		"%s(): " fmt, __func__, ##args)
 
-#define ETH_AF_XDP_FRAME_SIZE		XSK_UMEM__DEFAULT_FRAME_SIZE
+#define ETH_AF_XDP_FRAME_SIZE		2048
 #define ETH_AF_XDP_NUM_BUFFERS		4096
 #define ETH_AF_XDP_DATA_HEADROOM	0
 #define ETH_AF_XDP_DFLT_NUM_DESCS	XSK_RING_CONS__DEFAULT_NUM_DESCS
Signature · 1 line
2.17.0
#1 lore raw
Quoted 5 lines · Xiaolong Ye

XSK_UMEM__DEFAULT_FRAME_SIZE has been changed to 4096 in kernel commit 123e8da1d330 (xsk: Change the default frame size to 4096 and allow controlling it), but we still need to keep ETH_AF_XDP_FRAME_SIZE as 2048 to fit most dpdk apps.

I might have missed something, but can't you use the mbuf size from the packet mempool passed at rx_queue_setup?

Signature · 1 line
David Marchand
#2 lore raw
Quoted 11 lines · David Marchand
Quoted 5 lines · Xiaolong Ye

XSK_UMEM__DEFAULT_FRAME_SIZE has been changed to 4096 in kernel commit 123e8da1d330 (xsk: Change the default frame size to 4096 and allow controlling it), but we still need to keep ETH_AF_XDP_FRAME_SIZE as 2048 to fit most dpdk apps.

I might have missed something, but can't you use the mbuf size from the packet mempool passed at rx_queue_setup?

Sadly not - but we are working on ways to allow that. Right now, the kernel only allows 2k aligned buffers of 2k or 4k in size for packet IO, which prevents regular mbuf pools from working. There is work in progress to relax those restrictions, but it's not yet ready for kernel acceptance. The V1 of the set can be seen at: https://www.spinics.net/lists/netdev/msg579786.html