DPDK usage discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Filip Janiszewski <contact@filipjaniszewski.com>
Cc: "users@dpdk.org" <users@dpdk.org>
Subject: Re: rte_pktmbuf_free_bulk vs rte_pktmbuf_free
Date: Tue, 11 Jan 2022 10:02:25 -0800	[thread overview]
Message-ID: <20220111100225.53fd75d3@hermes.local> (raw)
In-Reply-To: <5ecf22af-ac38-7dd5-b3ce-5b2ccf60b32f@filipjaniszewski.com>

On Tue, 11 Jan 2022 13:12:24 +0100
Filip Janiszewski <contact@filipjaniszewski.com> wrote:

> Hi,
> 
> Is there any specific reason why using rte_pktmbuf_free_bulk seems to be
> much slower than rte_pktmbuf_free in a loop? (DPDK 21.11)
> 
> I ran a bunch of tests on a 50GbE link where I'm getting packet drops
> (running with too few RX cores on purpose, to make some performance
> verification) and when the time comes to release the packets, i did a
> quick change like this:
> 
> .
>             //rte_pktmbuf_free_bulk( data, pkt_cnt );
>             for( idx = 0 ; idx < pkt_cnt ; ++idx ) {
>                 rte_pktmbuf_free( data[ idx ] );
>             }
> .
> 
> And suddenly I'm dropping around 10% less packets (The traffic rate is
> around ~95Mpps). In case that's relevant, RX from the nic is done on a
> separate core than where the pkts are released (processed and released)
> 
> I did also the following experiment: Found the MPPs speed value where i
> get around 2-5% drops using rte_pktmbuf_free_bulk, executed a bunch of
> readings where I consistently get drops.. Then switched to the loop with
> rte_pktmbuf_free and executed the same tests again, of a sudden I can't
> drop anymore.
> 
> Isn't this strange? I was sure rte_pktmbuf_free_bulk would be kind of
> optimized for bulk releases so people don't have to loop themselves.
> 
> Thanks
> 

Is your mbuf pool close to exhausted? How big is your bulk size?
It might be with that with larger bulk sizes, the loop is giving packets
back that instantly get consumed by incoming packets. So either pool is almost
empty or the non-bulk is keeping packets in cache more.

  reply	other threads:[~2022-01-11 18:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-11 12:12 Filip Janiszewski
2022-01-11 18:02 ` Stephen Hemminger [this message]
2022-01-12  6:32   ` Filip Janiszewski

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=20220111100225.53fd75d3@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=contact@filipjaniszewski.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).