On Sun, 2 Feb 2025 08:53:42 +0200
Ofer Dagan <ofe...@claroty.com> wrote:

> Hi all,
> 
> We are trying to start using AF_XDP instead of libpcap (for use cases where
> dpdk drivers aren't a good fit for us). When using XDP, we can't set high
> MTU. How to still support jumbo packets in our application?
> 
> Thanks,
> Ofer

What error are you seeing?
What version of DPDK, and what version of kernel are you building for.

The current version of AF_XDP Poll mode driver supports larger mtu sizes.
It is constrained because the receive buffer has to fit on a single page
and there is overhead for the various headers.


        dev_info->min_mtu = RTE_ETHER_MIN_MTU;
#if defined(XDP_UMEM_UNALIGNED_CHUNK_FLAG)
        dev_info->max_rx_pktlen = getpagesize() -
                                  sizeof(struct rte_mempool_objhdr) -
                                  sizeof(struct rte_mbuf) -
                                  RTE_PKTMBUF_HEADROOM - XDP_PACKET_HEADROOM;
#else
        dev_info->max_rx_pktlen = ETH_AF_XDP_FRAME_SIZE - XDP_PACKET_HEADROOM;
#endif
        dev_info->max_mtu = dev_info->max_rx_pktlen - ETH_AF_XDP_ETH_OVERHEAD;

If you have a relatively recent kernel the UNALIGNED_CHUNK_FLAG should be set.
Stepping through the maths for that
        max_rx_pktlen = 4096 - 24 - 128 - 128 - 256 = 3560
        max_mtu = max_rx_pktlen - 14 - 4 = 3542

Reply via email to