DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Olivier Matz <olivier.matz@6wind.com>
Cc: "Wiles, Keith" <keith.wiles@intel.com>,
	"Damjan Marion (damarion)" <damarion@cisco.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] Adding API to force freeing consumed buffers in TX ring
Date: Mon, 21 Nov 2016 15:25:44 +0000	[thread overview]
Message-ID: <20161121152544.GA47052@bricha3-MOBL3.ger.corp.intel.com> (raw)
In-Reply-To: <aae1d111-4be0-4d5a-d436-6795cf18155e@6wind.com>

On Mon, Nov 21, 2016 at 04:06:32PM +0100, Olivier Matz wrote:
> Hi,
> 
> On 11/21/2016 03:33 PM, Wiles, Keith wrote:
> > 
> >> On Nov 21, 2016, at 4:48 AM, Damjan Marion (damarion) <damarion@cisco.com> wrote:
> >>
> >>
> >> Hi,
> >>
> >> Currently in VPP we do memcpy of whole packet when we need to do 
> >> replication as we cannot know if specific buffer is transmitted
> >> from tx ring before we update it again (i.e. l2 header rewrite).
> >>
> >> Unless there is already a way to address this issue in DPDK which I’m not aware
> >> of my proposal is that we provide mechanism for polling TX ring 
> >> for consumed buffers. This can be either completely new API or 
> >> extension of rte_etx_tx_burst (i.e. special case when nb_pkts=0).
> >>
> >> This will allows us to start polling tx ring when we expect some 
> >> mbuf back, instead of waiting for next tx burst (which we don’t know
> >> when it will happen) and hoping that we will reach free_threshold soon.
> > 
> > +1
> > 
> > In Pktgen I have the problem of not being able to reclaim all of the TX mbufs to update them for the next set of packets to send. I know this is not a common case, but I do see the case where the application needs its mbufs freed off the TX ring. Currently you need to have at least a TX ring size of mbufs on hand to make sure you can send to a TX ring. If you allocate too few you run into a deadlock case as the number of mbufs  on a TX ring does not hit the flush mark. If you are sending to multiple TX rings on the same numa node from the a single TX pool you have to understand the total number of mbufs you need to have allocated to hit the TX flush on each ring. Not a clean way to handle the problems as you may have limited memory or require some logic to add more mbufs for dynamic ports.
> > 
> > Anyway it would be great to require a way to clean up the TX done ring, using nb_pkts == 0 is the simplest way, but a new API is fine too.
> >>
> >> Any thoughts?
> 
> Yes, it looks useful to have a such API.
> 
> I would prefer another function instead of diverting the meaning of
> nb_pkts. Maybe this?
> 
>   void rte_eth_tx_free_bufs(uint8_t port_id, uint16_t queue_id);
> 

Third parameter for a limit(hint) of the number of bufs to free? If the
TX ring is big, we might not want to stall other work for a long time
while we free a huge number of buffers.

	/Bruce

  reply	other threads:[~2016-11-21 15:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-21 10:48 Damjan Marion (damarion)
2016-11-21 14:33 ` Wiles, Keith
2016-11-21 15:06   ` Olivier Matz
2016-11-21 15:25     ` Bruce Richardson [this message]
2016-11-22 20:41       ` Wiles, Keith

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=20161121152544.GA47052@bricha3-MOBL3.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=damarion@cisco.com \
    --cc=dev@dpdk.org \
    --cc=keith.wiles@intel.com \
    --cc=olivier.matz@6wind.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).