DPDK patches and discussions
 help / color / mirror / Atom feed
From: Younghwan Go <yhwan@ndsl.kaist.edu>
To: dev@dpdk.org
Subject: [dpdk-dev] Calling rte_eth_rx_burst() multiple times
Date: Thu, 15 Oct 2015 17:32:58 +0900	[thread overview]
Message-ID: <561F64BA.2000502@ndsl.kaist.edu> (raw)

Hi,

I'm pretty new to playing with DPDK. I was trying to see if I can always 
receive MAX_BURST packets by calling rte_eth_rx_burst() multiple times 
on same <port, queue> pair (code shown below). I'm using DPDK-2.1.0 on 2 
dual-port Intel 82599ES 10Gbps NICs with Ubuntu 14.04.3 (kernel 
3.13.0-63-generic).

Since packet processing is slower (~10 Gbps) than pure RX speed (~40 
Gbps), I assumed rte_eth_rx_burst() would always receive some number of 
packets, eventually filling up MAX_BURST. But for multi-core case (4 
CPUs, 4 ports), rte_eth_rx_burst() starts to always return 0 after some 
time, causing all cores to be blocked forever. Analyzing the DPDK code 
(drivers/net/ixgbe/ixgbe_rxtx.c), I'm seeing that inside 
ixgbe_rx_scan_hw_ring() function, "rxdp->wb.upper.status.error" always 
returns 0 (where is this value set by the way?).

I didn't see this problem for single-core case, in which it returned 
MAX_BURST packets at every rte_eth_rx_burst() call. Also, if I break out 
of while loop when I receive 0, I keep receiving packets in next <port, 
queue> pairs. Does anyone know why this block might happen? Or am I not 
allowed to call rte_eth_rx_burst() multiple times on same <port, queue> 
pair if I get 0? Any help will be great! Thank you!

------------------------------------------------------------------------
int cnt = MAX_BURST; // MAX_BURST = 32
int off = 0;
do {
     ret = rte_eth_rx_burst(port_id, queue_id, &m_table[off], cnt);
     if (ret == 0) {
         // don't break out but continue
     } else if (ret > 0) {
         off += ret;
         cnt -= ret;
     }
} while (cnt > 0);
------------------------------------------------------------------------

Best,
Younghwan

             reply	other threads:[~2015-10-15  8:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-15  8:32 Younghwan Go [this message]
2015-10-15 10:23 ` Zoltan Kiss
2015-10-15 10:43   ` Younghwan Go
2015-10-15 11:51     ` Zoltan Kiss

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=561F64BA.2000502@ndsl.kaist.edu \
    --to=yhwan@ndsl.kaist.edu \
    --cc=dev@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).