DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] ring: fix return value for single dequeue function
@ 2017-04-13  9:42 Bruce Richardson
  2017-04-13 15:13 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Bruce Richardson @ 2017-04-13  9:42 UTC (permalink / raw)
  To: olivier.matz; +Cc: dev, zhihong.wang, Bruce Richardson

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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h
index 6642e18..d4d61b7 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;
 }
 
 /**
-- 
2.9.3

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] ring: fix return value for single dequeue function
  2017-04-13  9:42 [dpdk-dev] [PATCH] ring: fix return value for single dequeue function Bruce Richardson
@ 2017-04-13 15:13 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2017-04-13 15:13 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, olivier.matz, zhihong.wang

2017-04-13 10:42, Bruce Richardson:
> 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>

Applied, thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-13 15:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-13  9:42 [dpdk-dev] [PATCH] ring: fix return value for single dequeue function Bruce Richardson
2017-04-13 15:13 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).