[PATCH v2] examples/l3fwd: support setting the data size of mbuf
Stephen Hemminger
stephen at networkplumber.org
Fri Oct 18 05:42:06 CEST 2024
On Fri, 18 Oct 2024 03:21:28 +0000
Chaoyong He <chaoyong.he at corigine.com> wrote:
> > RTE_PKTMBUF_HEADROOM); }
> > > +
> >
> > Not sure why this is needed? What is the problem with the original code?
> > Are you trying to force packets to be segmented?
>
> Actually, we are trying to force packets *not* segmented by making the mbuf size large enough to hold the packets.
>
> In our user case, we start l3fwd app with parameter '--max-pkt-len 4000', and obviously the original logic with RTE_MBUF_DEFAULT_DATAROOM mbuf size will cause the packets to be segmented.
> Which is not what we want, so we add this new '--mbuf-size=4096' parameter, the mbuf size will large enough to hold even the largest packet.
>
> Do you think this make sense?
Maybe query the driver, and use the max_rx_pkt_len as input to deciding the right mbuf size.
If max-pkt-len was 4000 and driver can only take 2K buffers, then use 2K mbuf size.
If max-pkt-len was 1500 then use mtu + headroom and round up
More information about the dev
mailing list