diff options
author | Bruce Richardson <bruce.richardson@intel.com> | 2017-03-29 16:21:25 +0100 |
---|---|---|
committer | Thomas Monjalon <thomas.monjalon@6wind.com> | 2017-03-29 22:32:20 +0200 |
commit | ecaed092b677d09b4b8645a3ddc38aac0ea929f7 (patch) | |
tree | 588653029d369f3c421f270504a567f091570432 /examples/packet_ordering/main.c | |
parent | 14fbffb0aac971fd96718d292701645779597a7a (diff) |
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 'examples/packet_ordering/main.c')
-rw-r--r-- | examples/packet_ordering/main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c index 569b6dadb0..49ae35b8ce 100644 --- a/examples/packet_ordering/main.c +++ b/examples/packet_ordering/main.c @@ -462,7 +462,7 @@ worker_thread(void *args_ptr) /* dequeue the mbufs from rx_to_workers ring */ burst_size = rte_ring_dequeue_burst(ring_in, - (void *)burst_buffer, MAX_PKTS_BURST); + (void *)burst_buffer, MAX_PKTS_BURST, NULL); if (unlikely(burst_size == 0)) continue; @@ -510,7 +510,7 @@ send_thread(struct send_thread_args *args) /* deque the mbufs from workers_to_tx ring */ nb_dq_mbufs = rte_ring_dequeue_burst(args->ring_in, - (void *)mbufs, MAX_PKTS_BURST); + (void *)mbufs, MAX_PKTS_BURST, NULL); if (unlikely(nb_dq_mbufs == 0)) continue; @@ -595,7 +595,7 @@ tx_thread(struct rte_ring *ring_in) /* deque the mbufs from workers_to_tx ring */ dqnum = rte_ring_dequeue_burst(ring_in, - (void *)mbufs, MAX_PKTS_BURST); + (void *)mbufs, MAX_PKTS_BURST, NULL); if (unlikely(dqnum == 0)) continue; |