[dpdk-dev,v1] ring: fix return value for sc and mc dequeue

Message ID 1496384991-156503-1-git-send-email-anand.b.jyoti@intel.com (mailing list archive)
State Accepted, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Jyoti, Anand B June 2, 2017, 6:29 a.m. UTC
  The error return code for rte_ring_sc_dequeue_bulk() and
rte_ring_mc_dequeue_bulk() function should be -ENOENT rather
than -ENOBUFS as described in the function description.

Signed-off-by: Anand B Jyoti <anand.b.jyoti@intel.com>
---
 lib/librte_ring/rte_ring.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Olivier Matz June 23, 2017, 8:43 a.m. UTC | #1
Hi Anand,

On Fri,  2 Jun 2017 11:59:51 +0530, Anand B Jyoti <anand.b.jyoti@intel.com> wrote:
> The error return code for rte_ring_sc_dequeue_bulk() and
> rte_ring_mc_dequeue_bulk() function should be -ENOENT rather
> than -ENOBUFS as described in the function description.

Fixes: cfa7c9e6fc1f ("ring: make bulk and burst return values consistent")


> Signed-off-by: Anand B Jyoti <anand.b.jyoti@intel.com>

Acked-by: Olivier Matz <olivier.matz@6wind.com>
  
Thomas Monjalon June 23, 2017, 12:43 p.m. UTC | #2
23/06/2017 10:43, Olivier Matz:
> Hi Anand,
> 
> On Fri,  2 Jun 2017 11:59:51 +0530, Anand B Jyoti <anand.b.jyoti@intel.com> wrote:
> > The error return code for rte_ring_sc_dequeue_bulk() and
> > rte_ring_mc_dequeue_bulk() function should be -ENOENT rather
> > than -ENOBUFS as described in the function description.
> 
> Fixes: cfa7c9e6fc1f ("ring: make bulk and burst return values consistent")

Cc: stable@dpdk.org

> > Signed-off-by: Anand B Jyoti <anand.b.jyoti@intel.com>
> 
> Acked-by: Olivier Matz <olivier.matz@6wind.com>

Applied, thanks
  

Patch

diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h
index 97f025a..3400ed8 100644
--- a/lib/librte_ring/rte_ring.h
+++ b/lib/librte_ring/rte_ring.h
@@ -801,7 +801,7 @@  rte_ring_dequeue_bulk(struct rte_ring *r, void **obj_table, unsigned int n,
 static inline int __attribute__((always_inline))
 rte_ring_mc_dequeue(struct rte_ring *r, void **obj_p)
 {
-	return rte_ring_mc_dequeue_bulk(r, obj_p, 1, NULL)  ? 0 : -ENOBUFS;
+	return rte_ring_mc_dequeue_bulk(r, obj_p, 1, NULL)  ? 0 : -ENOENT;
 }
 
 /**
@@ -819,7 +819,7 @@  rte_ring_mc_dequeue(struct rte_ring *r, void **obj_p)
 static inline int __attribute__((always_inline))
 rte_ring_sc_dequeue(struct rte_ring *r, void **obj_p)
 {
-	return rte_ring_sc_dequeue_bulk(r, obj_p, 1, NULL) ? 0 : -ENOBUFS;
+	return rte_ring_sc_dequeue_bulk(r, obj_p, 1, NULL) ? 0 : -ENOENT;
 }
 
 /**