summaryrefslogtreecommitdiff
path: root/examples/qos_sched
diff options
context:
space:
mode:
authorBruce Richardson <bruce.richardson@intel.com>2017-03-29 16:21:24 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2017-03-29 22:32:04 +0200
commit14fbffb0aac971fd96718d292701645779597a7a (patch)
tree1e5870418f69264cbbedb43b5f50fa8277947de6 /examples/qos_sched
parentcfa7c9e6fc1f7b248d8f250966851bdd19d7b9c2 (diff)
downloaddpdk-draft-windows-14fbffb0aac971fd96718d292701645779597a7a.zip
dpdk-draft-windows-14fbffb0aac971fd96718d292701645779597a7a.tar.gz
dpdk-draft-windows-14fbffb0aac971fd96718d292701645779597a7a.tar.xz
ring: return free space when enqueuing
Add an extra parameter to the ring enqueue burst/bulk functions so that those functions can optionally return the amount of free space in the ring. This information can be used by applications in a number of ways, for instance, with single-producer queues, it provides a max enqueue size which is guaranteed to work. It can also be used to implement watermark functionality in apps, replacing the older functionality with a more flexible version, which enables apps to implement multiple watermark thresholds, rather than just one. 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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/qos_sched/app_thread.c b/examples/qos_sched/app_thread.c
index dab4594..0c81a15 100644
--- a/examples/qos_sched/app_thread.c
+++ b/examples/qos_sched/app_thread.c
@@ -107,7 +107,7 @@ app_rx_thread(struct thread_conf **confs)
}
if (unlikely(rte_ring_sp_enqueue_bulk(conf->rx_ring,
- (void **)rx_mbufs, nb_rx) == 0)) {
+ (void **)rx_mbufs, nb_rx, NULL) == 0)) {
for(i = 0; i < nb_rx; i++) {
rte_pktmbuf_free(rx_mbufs[i]);
@@ -231,7 +231,7 @@ app_worker_thread(struct thread_conf **confs)
burst_conf.qos_dequeue);
if (likely(nb_pkt > 0))
while (rte_ring_sp_enqueue_bulk(conf->tx_ring,
- (void **)mbufs, nb_pkt) == 0)
+ (void **)mbufs, nb_pkt, NULL) == 0)
; /* empty body */
conf_idx++;