DPDK usage discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Maik Pfeil <maik.pfeil@gmail.com>
Cc: users@dpdk.org
Subject: Re: [dpdk-users] Using rte_eth_tx_burst in a loop with sleep()
Date: Tue, 16 Aug 2016 13:54:01 -0700	[thread overview]
Message-ID: <20160816135401.0032c1f8@xeon-e3> (raw)
In-Reply-To: <CAPM=O_uTg9v+0pmQU96vB_-1CWbjcCyyLaOECE-oQwHcb-gXzg@mail.gmail.com>

On Tue, 16 Aug 2016 22:47:06 +0200
Maik Pfeil <maik.pfeil@gmail.com> wrote:

> Hi,
> 
> if I am using rte_eth_tx_burst() in a loop:
> 
>        for(;;) {
>            count_tx = rte_eth_tx_burst(0, 0, frame_burst, 9);
>            sleep(1);
>            ltime=time(NULL);
>            printf("%s", asctime(localtime(&ltime)));
>            printf("`-- Sent %d packets.\n", asctime(localtime(&ltime)),
> count_tx);
>        }
> 
> The array frame_burst[] is filled with 10 packets.
> 
> I would expect to send every 1 second 10 frames.
> 
> But after first 10 packets sent out and 1 second sleep, DPDK starts sending
> out around 10k pps.
> 
> Do you have any idea how to solve?

When you pass frame_burst array to the device driver, the ownership of the mbuf's
changes and after sending, the device driver will free them.

Therefore you need to either:
create a new set of mbufs into frame_burst array for each iteration;
or increase the reference count on each mbuf in the frame_burst array
before sending.

      reply	other threads:[~2016-08-16 20:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-16 20:47 Maik Pfeil
2016-08-16 20:54 ` 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=20160816135401.0032c1f8@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=maik.pfeil@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).