All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konstantin Ananyev <konstantin.ananyev@huawei.com>
To: "Konstantin Ananyev" <konstantin.ananyev@huawei.com>,
	"Morten Brørup" <mb@smartsharesystems.com>,
	"thomas@monjalon.net" <thomas@monjalon.net>,
	"Bruce Richardson" <bruce.richardson@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: RE: [RFC] ethdev: TX mbuf fast release optimization
Date: Sat, 5 Jul 2025 07:44:34 +0000	[thread overview]
Message-ID: <cefc9412679c4257bed9e604b86f5a9c@huawei.com> (raw)
In-Reply-To: <395df6c41a554ee29b122d7f85950690@huawei.com>



> -----Original Message-----
> From: Konstantin Ananyev <konstantin.ananyev@huawei.com>
> Sent: Friday, July 4, 2025 5:20 PM
> To: Morten Brørup <mb@smartsharesystems.com>; thomas@monjalon.net; Bruce Richardson <bruce.richardson@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [RFC] ethdev: TX mbuf fast release optimization
> 
> 
> > For TX mbuf fast release offload, I propose to add the mbuf mempool
> > pointer to the ethdev tx queue configuration structure,
> > so the ethdev TX burst operation doesn't need to fetch it from the
> > first mbuf of each burst being fast free'd to the mempool.
> >
> > This modification of the struct rte_eth_txconf, and the requirement
> > to set the mempool pointer if the RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE
> > flag is set, will be an API+ABI change in 25.11.
> > Should it be announced in the 25.07 release notes?
> >
> > Note: We could phase it in softly by letting the ethdev drivers
> > check if the pointer has been set, and fall back to fetching it
> > from mbuf[0] if not.
> >
> > /**
> >  * A structure used to configure a Tx ring of an Ethernet port.
> >  */
> > struct rte_eth_txconf {
> > 	struct rte_eth_thresh tx_thresh; /**< Tx ring threshold registers. */
> > 	uint16_t tx_rs_thresh; /**< Drives the setting of RS bit on TXDs. */
> > 	uint16_t tx_free_thresh; /**< Start freeing Tx buffers if there are
> > 				      less free descriptors than this value. */
> >
> > 	uint8_t tx_deferred_start; /**< Do not start queue with rte_eth_dev_start(). */
> > 	/**
> > 	 * Per-queue Tx offloads to be set  using RTE_ETH_TX_OFFLOAD_* flags.
> > 	 * Only offloads set on tx_queue_offload_capa or tx_offload_capa
> > 	 * fields on rte_eth_dev_info structure are allowed to be set.
> > 	 */
> > 	uint64_t offloads;
> >
> > +	/**
> > +	 * Per-queue mempool to release the mbufs to; required for
> > +	 * RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE offload.
> > +	 */
> > +	struct rte_mempool *mp;
> > +
> 
> Even though I usually recommend to use MBUF_FAST_FREE -

Correction, meant to say: I usually recommend not to use MBUF_FAST_FREE.
The rest remains the same :)

> that's probably a good change.
> At least people will realize that they have to provide a single mempool
> per TX queue when they enable FAST_FREE flag.
> One naming suggestion I have - can we name it somehow more informative:
> 'fast_free_mp' or so?
> Also, we can update tx_queue_setup() to catch the situation when FAST_FREE
> is set but mp is NULL, or visa-versa.
> Again drivers can probably add extra check when debug is enabled, that
> all mbufs are exactly from that mempool.
> 
> 
> > 	uint64_t reserved_64s[2]; /**< Reserved for future fields */
> > 	void *reserved_ptrs[2];   /**< Reserved for future fields */
> > };
> >


  reply	other threads:[~2025-07-05  7:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-03 13:59 [RFC] ethdev: TX mbuf fast release optimization Morten Brørup
2025-07-03 14:14 ` Bruce Richardson
2025-07-03 15:12   ` Morten Brørup
2025-07-03 15:21     ` Bruce Richardson
2025-07-03 15:29       ` Morten Brørup
2025-07-03 15:35         ` Bruce Richardson
2025-07-03 17:29           ` Morten Brørup
2025-07-04 16:20 ` Konstantin Ananyev
2025-07-05  7:44   ` Konstantin Ananyev [this message]
2025-07-05  7:58   ` Morten Brørup

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=cefc9412679c4257bed9e604b86f5a9c@huawei.com \
    --to=konstantin.ananyev@huawei.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=mb@smartsharesystems.com \
    --cc=thomas@monjalon.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.