summaryrefslogtreecommitdiff
path: root/drivers/net/ring
diff options
context:
space:
mode:
authorBruce Richardson <bruce.richardson@intel.com>2017-03-29 16:21:25 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2017-03-29 22:32:20 +0200
commitecaed092b677d09b4b8645a3ddc38aac0ea929f7 (patch)
tree588653029d369f3c421f270504a567f091570432 /drivers/net/ring
parent14fbffb0aac971fd96718d292701645779597a7a (diff)
downloaddpdk-next-eventdev-ecaed092b677d09b4b8645a3ddc38aac0ea929f7.zip
dpdk-next-eventdev-ecaed092b677d09b4b8645a3ddc38aac0ea929f7.tar.gz
dpdk-next-eventdev-ecaed092b677d09b4b8645a3ddc38aac0ea929f7.tar.xz
ring: return remaining entry count when dequeuing
Add an extra parameter to the ring dequeue burst/bulk functions so that those functions can optionally return the amount of remaining objs in the ring. This information can be used by applications in a number of ways, for instance, with single-consumer queues, it provides a max dequeue size which is guaranteed to work. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
Diffstat (limited to 'drivers/net/ring')
-rw-r--r--drivers/net/ring/rte_eth_ring.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index adbf478..77ef3a1 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -88,7 +88,7 @@ eth_ring_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
void **ptrs = (void *)&bufs[0];
struct ring_queue *r = q;
const uint16_t nb_rx = (uint16_t)rte_ring_dequeue_burst(r->rng,
- ptrs, nb_bufs);
+ ptrs, nb_bufs, NULL);
if (r->rng->flags & RING_F_SC_DEQ)
r->rx_pkts.cnt += nb_rx;
else