summaryrefslogtreecommitdiff
path: root/examples/qos_sched
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 /examples/qos_sched
parent14fbffb0aac971fd96718d292701645779597a7a (diff)
downloaddpdk-draft-windows-ecaed092b677d09b4b8645a3ddc38aac0ea929f7.zip
dpdk-draft-windows-ecaed092b677d09b4b8645a3ddc38aac0ea929f7.tar.gz
dpdk-draft-windows-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 'examples/qos_sched')
-rw-r--r--examples/qos_sched/app_thread.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/qos_sched/app_thread.c b/examples/qos_sched/app_thread.c
index 0c81a15..15f117f 100644
--- a/examples/qos_sched/app_thread.c
+++ b/examples/qos_sched/app_thread.c
@@ -179,7 +179,7 @@ app_tx_thread(struct thread_conf **confs)
while ((conf = confs[conf_idx])) {
retval = rte_ring_sc_dequeue_bulk(conf->tx_ring, (void **)mbufs,
- burst_conf.qos_dequeue);
+ burst_conf.qos_dequeue, NULL);
if (likely(retval != 0)) {
app_send_packets(conf, mbufs, burst_conf.qos_dequeue);
@@ -218,7 +218,7 @@ app_worker_thread(struct thread_conf **confs)
/* Read packet from the ring */
nb_pkt = rte_ring_sc_dequeue_burst(conf->rx_ring, (void **)mbufs,
- burst_conf.ring_burst);
+ burst_conf.ring_burst, NULL);
if (likely(nb_pkt)) {
int nb_sent = rte_sched_port_enqueue(conf->sched_port, mbufs,
nb_pkt);
@@ -254,7 +254,7 @@ app_mixed_thread(struct thread_conf **confs)
/* Read packet from the ring */
nb_pkt = rte_ring_sc_dequeue_burst(conf->rx_ring, (void **)mbufs,
- burst_conf.ring_burst);
+ burst_conf.ring_burst, NULL);
if (likely(nb_pkt)) {
int nb_sent = rte_sched_port_enqueue(conf->sched_port, mbufs,
nb_pkt);