DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Chaoyong He <chaoyong.he@corigine.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	oss-drivers <oss-drivers@corigine.com>,
	"Long Wu" <Long.Wu@nephogine.com>,
	"Morten Brørup" <mb@smartsharesystems.com>
Subject: Re: [PATCH v2] examples/l3fwd: support setting the data size of mbuf
Date: Mon, 21 Oct 2024 10:07:06 -0700	[thread overview]
Message-ID: <20241021100706.1994b924@hermes.local> (raw)
In-Reply-To: <SJ0PR13MB5545160D4227270E266DD0AB9E432@SJ0PR13MB5545.namprd13.prod.outlook.com>

On Mon, 21 Oct 2024 02:00:55 +0000
Chaoyong He <chaoyong.he@corigine.com> wrote:

> > On Fri, 18 Oct 2024 05:50:20 +0000
> > Chaoyong He <chaoyong.he@corigine.com> wrote:
> >   
> > > > On Fri, 18 Oct 2024 03:21:28 +0000
> > > > Chaoyong He <chaoyong.he@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  
> 
> Oh, I understand what you mean now, thanks for the clarification.
> But the solution you suppose is not flexible enough, thus can't satisfy our needs.
> 
> Follow your example and consider this situation:
> If max-pkt-len was 4000 and driver can only take 2K buffers, then
> use 2K mbuf size.
> 
> But we want to measure the performance when the mbuf size is 1024 and 512.
> 
> Then there is no way to do this in your solution, I suppose?
> 
> But with our '--mbuf-size' parameter, we can easily do that.
> Thanks for your hint, we realized our solution also has a little problem, which not 
> consider the 'max_rx_bufsize' of rte_eth_dev_info, and we will fix that in the next version patch.

It would be best if the default was to choose mbuf size automatically,
but since this is a test program having an override is also useful.

In general l3fwd is target at usability (less options) and test-pmd is focused on testing (lots of options).
There is a tradeoff here. l3fwd should not get as complex as test-pmd or there is no point.

      reply	other threads:[~2024-10-21 17:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-16  8:22 [PATCH] " Chaoyong He
2024-10-16  9:05 ` Morten Brørup
2024-10-16 15:02 ` Stephen Hemminger
2024-10-16 21:17 ` Patrick Robb
2024-10-17 19:12 ` Stephen Hemminger
2024-10-18  2:42 ` [PATCH v2] " Chaoyong He
2024-10-18  2:50   ` lihuisong (C)
2024-10-18  2:59   ` Stephen Hemminger
2024-10-18  3:21     ` Chaoyong He
2024-10-18  3:42       ` Stephen Hemminger
2024-10-18  5:50         ` Chaoyong He
2024-10-18 15:59           ` Stephen Hemminger
2024-10-21  2:00             ` Chaoyong He
2024-10-21 17:07               ` Stephen Hemminger [this message]

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=20241021100706.1994b924@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=Long.Wu@nephogine.com \
    --cc=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=mb@smartsharesystems.com \
    --cc=oss-drivers@corigine.com \
    /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).