ring: fix return value for single dequeue function
PATCH 1/1 ring: fix return value for single dequeue function
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 <[email protected]>
Signed-off-by Bruce Richardson <[email protected]>
--- lib/librte_ring/rte_ring.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_ring/rte_ring.h +1 -1
@@ -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 ; }/**
Signature · 1 line
2.9.3
Thomas Monjalon
Applied2017-04-13 10:42, Bruce Richardson:
Quoted 7 lines
The error return code for
rte_ring_dequeue()function should be-ENOENTrather than-ENOBUFS(which is the error value from theenqueue()fn).Fixes cfa7c9e6fc1f ("ring: make bulk and burst return values consistent")Reported-by Zhihong Wang <[email protected]>Signed-off-by Bruce Richardson <[email protected]>
Applied, thanks