]> git.droids-corp.org - dpdk.git/commitdiff
ring: fix return value for single dequeue
authorBruce Richardson <bruce.richardson@intel.com>
Thu, 13 Apr 2017 09:42:56 +0000 (10:42 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 13 Apr 2017 15:18:27 +0000 (17:18 +0200)
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 <zhihong.wang@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
lib/librte_ring/rte_ring.h

index bd29a8afcc854f8b34dc06ca5f07a6f57844798b..97f025a1fb61968f5805483cf71c2d44e92053b0 100644 (file)
@@ -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;
 }
 
 /**