path: root/examples/multi_process/client_server_mp
diff options
authorBruce Richardson <>2017-03-29 16:21:24 +0100
committerThomas Monjalon <>2017-03-29 22:32:04 +0200
commit14fbffb0aac971fd96718d292701645779597a7a (patch)
tree1e5870418f69264cbbedb43b5f50fa8277947de6 /examples/multi_process/client_server_mp
parentcfa7c9e6fc1f7b248d8f250966851bdd19d7b9c2 (diff)
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 <> Reviewed-by: Yuanhan Liu <> Acked-by: Olivier Matz <>
Diffstat (limited to 'examples/multi_process/client_server_mp')
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/multi_process/client_server_mp/mp_server/main.c b/examples/multi_process/client_server_mp/mp_server/main.c
index 19c95b2..c2b0261 100644
--- a/examples/multi_process/client_server_mp/mp_server/main.c
+++ b/examples/multi_process/client_server_mp/mp_server/main.c
@@ -227,7 +227,7 @@ flush_rx_queue(uint16_t client)
cl = &clients[client];
if (rte_ring_enqueue_bulk(cl->rx_q, (void **)cl_rx_buf[client].buffer,
- cl_rx_buf[client].count) == 0){
+ cl_rx_buf[client].count, NULL) == 0){
for (j = 0; j < cl_rx_buf[client].count; j++)
cl->stats.rx_drop += cl_rx_buf[client].count;