DPDK usage discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Lokesh Chakka <lvenkatakumarchakka@gmail.com>
Cc: users <users@dpdk.org>
Subject: Re: mbuf validity in conjunction with ref cnt
Date: Sat, 22 Feb 2025 08:18:27 -0800	[thread overview]
Message-ID: <20250222081827.20e992d5@hermes.local> (raw)
In-Reply-To: <CACh--siKEQFPxUuzt=QEWJSNp4_UOmb2wrFPGXP0HykSpjqDRQ@mail.gmail.com>

On Sat, 22 Feb 2025 10:22:51 +0530
Lokesh Chakka <lvenkatakumarchakka@gmail.com> wrote:

> My objective is to reuse mbuf unlimited number of times for a configurable
> amount of time.
> 
> rte_pktmbuf_alloc // after here refcnt is 1
> refcnt_update ( , 1) //after here refcnt is 2
> while( time still exists )
> {
>       tx_burst
> }
> 
> Will this approach work with all drivers/cards ?

For that kind of flood you need to get reference before tx_burst.
The driver will see mbuf with refcnt of 2 and decrement it to 1 when
done.

	mb = rte_pktmbuf_alloc();
	// setup the mbuf

	while (!stopped) {
		rte_mbuf_ref_update(mb, 1); // retain original
		... tx_burst
	}
	rte_pktmbuf_free(mb); // release original




      reply	other threads:[~2025-02-22 16:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-21  7:39 Lokesh Chakka
2025-02-21 18:46 ` Stephen Hemminger
2025-02-22  4:52   ` Lokesh Chakka
2025-02-22 16:18     ` 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=20250222081827.20e992d5@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=lvenkatakumarchakka@gmail.com \
    --cc=users@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;
as well as URLs for NNTP newsgroup(s).