public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Bruce Richardson" <bruce.richardson@intel.com>
Cc: <dev@dpdk.org>
Subject: RE: [PATCH] net/intel: optimize for fast-free hint
Date: Fri, 23 Jan 2026 13:27:54 +0100	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35F65695@smartserver.smartshare.dk> (raw)
In-Reply-To: <aXNk6DRHvzH1WuK7@bricha3-mobl1.ger.corp.intel.com>

> From: Bruce Richardson [mailto:bruce.richardson@intel.com]
> Sent: Friday, 23 January 2026 13.09
> 
> On Fri, Jan 23, 2026 at 01:05:10PM +0100, Morten Brørup wrote:
> > I haven't looked into the details yet, but have a quick question
> inline below.
> >
> > > @@ -345,12 +345,20 @@ ci_txq_release_all_mbufs(struct ci_tx_queue
> *txq,
> > > bool use_ctx)
> > >  		return;
> > >
> > >  	if (!txq->vector_tx) {
> > > -		for (uint16_t i = 0; i < txq->nb_tx_desc; i++) {
> > > -			if (txq->sw_ring[i].mbuf != NULL) {
> >
> > You changed this loop to only operate on not-yet-cleaned descriptors.
> >
> > Here comes the first part of my question:
> > You removed the NULL check for txq->sw_ring[i].mbuf, thereby assuming
> that it is never NULL for not-yet-cleaned descriptors.
> >
> 
> Good point, I was quite focused on making this block and the vector
> block
> the same, I forgot that we can have NULL pointers for context
> descriptors.
> That was a silly mistake (and AI never caught it for me either.)
> 
> > > +		/* Free mbufs from (last_desc_cleaned + 1) to (tx_tail -
> > > 1). */
> > > +		const uint16_t start = (txq->last_desc_cleaned + 1) % txq-
> > > >nb_tx_desc;
> > > +		const uint16_t nb_desc = txq->nb_tx_desc;
> > > +		const uint16_t end = txq->tx_tail;
> > > +
> > > +		uint16_t i = start;

Suggest getting rid of "start"; it is only used for initializing "i".

> > > +		if (end < i) {
> > > +			for (; i < nb_desc; i++)
> > >  				rte_pktmbuf_free_seg(txq->sw_ring[i].mbuf);
> > > -				txq->sw_ring[i].mbuf = NULL;
> > > -			}
> > > +			i = 0;
> > >  		}
> > > +		for (; i < end; i++)
> > > +			rte_pktmbuf_free_seg(txq->sw_ring[i].mbuf);
> > > +		memset(txq->sw_ring, 0, sizeof(txq->sw_ring[0]) * nb_desc);

Consider also splitting this memset() into two, one for each of the two for loops.
Then you might need to keep "start" and make it non-const. :-)

> > >  		return;
> > >  	}

Or just keep the original version, looping over all descriptors.


  reply	other threads:[~2026-01-23 12:28 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-15 11:06 mbuf fast-free requirements analysis Morten Brørup
2025-12-15 11:46 ` Bruce Richardson
2026-01-14 15:31   ` Morten Brørup
2026-01-14 16:36     ` Bruce Richardson
2026-01-14 18:05       ` Morten Brørup
2026-01-15  8:46         ` Bruce Richardson
2026-01-15  9:04           ` Morten Brørup
2026-01-23 11:20     ` [PATCH] net/intel: optimize for fast-free hint Bruce Richardson
2026-01-23 12:05       ` Morten Brørup
2026-01-23 12:09         ` Bruce Richardson
2026-01-23 12:27           ` Morten Brørup [this message]
2026-01-23 12:53             ` Bruce Richardson
2026-01-23 13:06               ` Morten Brørup
2026-04-08 13:25       ` [PATCH v2] " Bruce Richardson
2026-04-08 19:27         ` Morten Brørup
2026-01-23 11:33     ` mbuf fast-free requirements analysis Bruce Richardson
2025-12-15 14:41 ` Konstantin Ananyev
2025-12-15 16:14   ` Morten Brørup
2025-12-19 17:08     ` Konstantin Ananyev
2025-12-20  7:33       ` Morten Brørup
2025-12-22 15:22         ` Konstantin Ananyev
2025-12-22 17:11           ` Morten Brørup
2025-12-22 17:43             ` Bruce Richardson
2026-01-13 14:48               ` Konstantin Ananyev
2026-01-13 16:07                 ` Stephen Hemminger
2026-01-14 17:01 ` Bruce Richardson
2026-01-14 17:31   ` Morten Brørup
2026-01-14 17:45     ` Bruce Richardson

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=98CBD80474FA8B44BF855DF32C47DC35F65695@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@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