From: Bruce Richardson Date: Thu, 13 Apr 2017 09:42:56 +0000 (+0100) Subject: ring: fix return value for single dequeue X-Git-Tag: spdx-start~3674 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=fc0ddc684877b7aa0c4733ab5619a2487e396155;p=dpdk.git ring: fix return value for single dequeue The error return code for rte_ring_dequeue() function should be -ENOENT rather than -ENOBUFS (which is the error value from the enqueue() fn). Fixes: cfa7c9e6fc1f ("ring: make bulk and burst return values consistent") Reported-by: Zhihong Wang Signed-off-by: Bruce Richardson --- diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h index bd29a8afcc..97f025a1fb 100644 --- a/lib/librte_ring/rte_ring.h +++ b/lib/librte_ring/rte_ring.h @@ -841,7 +841,7 @@ rte_ring_sc_dequeue(struct rte_ring *r, void **obj_p) static inline int __attribute__((always_inline)) rte_ring_dequeue(struct rte_ring *r, void **obj_p) { - return rte_ring_dequeue_bulk(r, obj_p, 1, NULL) ? 0 : -ENOBUFS; + return rte_ring_dequeue_bulk(r, obj_p, 1, NULL) ? 0 : -ENOENT; } /**