DPDK usage discussions
 help / color / mirror / Atom feed
From: Alan Arondel <arondel.alan@gmail.com>
To: users@dpdk.org
Subject: rte_eth_tx_burst return 0 after some time
Date: Mon, 9 Sep 2024 15:25:23 +0200	[thread overview]
Message-ID: <CAGhLx=k7-BWDrwpyLykpxDTAHdgDw3-AuRrpC36tbkvJCLaXtA@mail.gmail.com> (raw)

Hello Everyone,

I'm trying to add an export module to my application. I use DPDK
version 20.11, a 82599ES 10-Gigabit SFI/SFP+ Network Connection 10fb
and the vfio-pci driver.
port configuration is the following:

port_conf->txmode.mq_mode = ETH_MQ_TX_NONE;
port_conf->txmode.offloads = DEV_TX_OFFLOAD_MULTI_SEGS;

I use only 1 queue on the card and the configuration is the following :
    nb_desc : 4096
    rs_threshold : 32
    free_threshold : 32

I have an issue where at some point during the lifetime of the
application, the rte_eth_tx_burst return only 0 and nothing can be
done once it is stuck after several seconds of the beginning of
transmission.

I have checked couple of things :
- i still get burst of packets to send
- i still have lot of mbuf in my mempool
- i use t-rex to generate traffic to forward and one of them have lot
of small packet and i can support up to 2,8Mpps (roughly 7,8Gbps)
sadly with another traffic i can't go up more than 200Kpps at best
(roughly 2Gbps if not less)

once the application is stuck, I tried to stop the traffic and restart
it with a very low bandwidth like 40Mbps but it changes nothing

here is a code snippet of what i'm trying to do :

nb_rx = rte_ring_sc_dequeue_burst(od_h->rx_rings[i], (void **) pkts_burst,

OUTPUT_DPDK_BURST_SIZE, NULL);

for (j = 0; j < nb_rx; j++) {

  if (!rte_pktmbuf_is_contiguous(pkts_burst[j])) {
      stats->jumbo_frame ++; /* i got some jumbo frame in both traffic
which i want to track, mbuf size is 1512 + RTE_PKTMBUF_HEADROOM */
   }

   ret = rte_eth_tx_burst(port_id, 0, &pkts_burst[j], 1); /* i know
this is weird but i have another issue with the order of the packets
when sending more than 1 packet even if the mbuf inside pkts_burst are
ordered correctly */
        if (unlikely(! ret)) {
              /* packet not sent, just drop it */
              rte_pktmbuf_free(pkts_burst[j]);
              stats->freed_mbuf ++;

               int flushed = rte_eth_tx_done_cleanup(port_id, 0, 0);
/* this is my last test since i saw we could flush the mbuf stuck in
the cache of the driver */
               if (flushed >= 0) {
                    stats->mbuf_flushed += flushed; /* i can see some
of them but not moving once the application do not send anymore
packets */
                } else {
                   stats->mbuf_flushed = flushed;
                }
          } else {
                stats->nb_sent ++;
                 sent = 1;
          }
     }
  i ++;
}

As far as I understand, the logic of the code seems to be ok since it
works on another type of traffic.
However i have no clue why it is stuck at some point. If you got some
insight to dig further on this i'm all ears.
Also, I would like to understand the free_threshold. As far as i
understand, mbuf will "stay" in the driver into there is not enough
descriptor available regarding the threshold hence the mbuf return to
the mempool. Is that right ?

Thank you for any help i will have on this.

Regards,
Alan.

             reply	other threads:[~2024-09-09 13:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-09 13:25 Alan Arondel [this message]
2024-09-09 16:39 ` Stephen Hemminger

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='CAGhLx=k7-BWDrwpyLykpxDTAHdgDw3-AuRrpC36tbkvJCLaXtA@mail.gmail.com' \
    --to=arondel.alan@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).