DPDK usage discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Ofer Dagan <ofer.d@claroty.com>
Cc: users@dpdk.org
Subject: Re: Support jumbo packets with XDP
Date: Sun, 2 Feb 2025 09:32:55 -0800	[thread overview]
Message-ID: <20250202093255.19da8189@hermes.local> (raw)
In-Reply-To: <CAJZ4YbNsNpbLSGhOvo07U_iZexmVKDZoJhb9m0t-Sx74+5CLgQ@mail.gmail.com>

On Sun, 2 Feb 2025 08:53:42 +0200
Ofer Dagan <ofer.d@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	other threads:[~2025-02-02 17:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-02  6:53 Ofer Dagan
2025-02-02 17:32 ` Stephen Hemminger [this message]
2025-02-03  7:16   ` [EXTERNAL] " Ofer Dagan
2025-02-04  2:43     ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250202093255.19da8189@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=ofer.d@claroty.com \
    --cc=users@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).