diff options
| author | Bruce Richardson <[email protected]> | 2017-03-29 16:21:24 +0100 |
|---|---|---|
| committer | Thomas Monjalon <[email protected]> | 2017-03-29 22:32:04 +0200 |
| commit | 14fbffb0aac971fd96718d292701645779597a7a (patch) | |
| tree | 1e5870418f69264cbbedb43b5f50fa8277947de6 /examples/server_node_efd | |
| parent | cfa7c9e6fc1f7b248d8f250966851bdd19d7b9c2 (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 <[email protected]>
Reviewed-by: Yuanhan Liu <[email protected]>
Acked-by: Olivier Matz <[email protected]>
Diffstat (limited to 'examples/server_node_efd')
| -rw-r--r-- | examples/server_node_efd/server/main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/server_node_efd/server/main.c b/examples/server_node_efd/server/main.c index 3eb7fac8d1..597b4c250d 100644 --- a/examples/server_node_efd/server/main.c +++ b/examples/server_node_efd/server/main.c @@ -247,7 +247,7 @@ flush_rx_queue(uint16_t node) cl = &nodes[node]; if (rte_ring_enqueue_bulk(cl->rx_q, (void **)cl_rx_buf[node].buffer, - cl_rx_buf[node].count) != cl_rx_buf[node].count){ + cl_rx_buf[node].count, NULL) != cl_rx_buf[node].count){ for (j = 0; j < cl_rx_buf[node].count; j++) rte_pktmbuf_free(cl_rx_buf[node].buffer[j]); cl->stats.rx_drop += cl_rx_buf[node].count; |
