X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fdistributor%2Fmain.c;h=537cee1f7c619db6b60152e8e50f237f71caf750;hb=e8c528cb92840ea334adf69f08264569710964c5;hp=24857f2d8f8ffaf89a1b337c1a03a50ccbcce513;hpb=d532ddccce0a8ccc350d6b5f9c89faf96fc9f923;p=dpdk.git diff --git a/examples/distributor/main.c b/examples/distributor/main.c index 24857f2d8f..537cee1f7c 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;