aboutsummaryrefslogtreecommitdiffstats
path: root/examples/distributor
diff options
context:
space:
mode:
authorRicardo Salveti <ricardo.salveti@linaro.org>2016-07-18 15:30:53 -0300
committerRicardo Salveti <ricardo.salveti@linaro.org>2016-07-18 15:31:22 -0300
commit5d4e5dcd8a186778b3d78e27c81550d07a288fd2 (patch)
treeb84800fce31e7233445a7997c19df409c2a364ea /examples/distributor
parenta41e6ff15809d40e0f9bbc9576bf8f7f80fbec1d (diff)
Imported Upstream version 16.07-rc3
Change-Id: I321148bfa234858ba1986d109470b7aa280cd429 Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Diffstat (limited to 'examples/distributor')
-rw-r--r--examples/distributor/main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/examples/distributor/main.c b/examples/distributor/main.c
index 24857f2d..537cee1f 100644
--- a/examples/distributor/main.c
+++ b/examples/distributor/main.c
@@ -221,14 +221,22 @@ lcore_rx(struct lcore_params *p)
struct rte_mbuf *bufs[BURST_SIZE*2];
const uint16_t nb_rx = rte_eth_rx_burst(port, 0, bufs,
BURST_SIZE);
+ if (unlikely(nb_rx == 0)) {
+ if (++port == nb_ports)
+ port = 0;
+ continue;
+ }
app_stats.rx.rx_pkts += nb_rx;
rte_distributor_process(d, bufs, nb_rx);
const uint16_t nb_ret = rte_distributor_returned_pkts(d,
bufs, BURST_SIZE*2);
app_stats.rx.returned_pkts += nb_ret;
- if (unlikely(nb_ret == 0))
+ if (unlikely(nb_ret == 0)) {
+ if (++port == nb_ports)
+ port = 0;
continue;
+ }
uint16_t sent = rte_ring_enqueue_burst(r, (void *)bufs, nb_ret);
app_stats.rx.enqueued_pkts += sent;