[PATCH v2] examples/l3fwd: support setting the data size of mbuf
Stephen Hemminger
stephen at networkplumber.org
Fri Oct 18 17:59:05 CEST 2024
On Fri, 18 Oct 2024 05:50:20 +0000
Chaoyong He <chaoyong.he at corigine.com> wrote:
> > 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.
>
> Sorry, I am not quite understanding here.
> I can't find 'max_rx_pkt_len' in l3fwd app, instead it's exist testpmd app.
> Could you please explain a little more about the advice?
In rte_eth_dev_info, I meant the field max_rx_bufsize and there is also max_rx_pktlen.
>
> > 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