DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] Function __mempool_get_bulk() returns wrong count.
@ 2014-09-27 18:41 Wiles, Roger Keith
  2014-09-28  0:38 ` Neil Horman
  2014-09-28 22:25 ` Ananyev, Konstantin
  0 siblings, 2 replies; 5+ messages in thread
From: Wiles, Roger Keith @ 2014-09-27 18:41 UTC (permalink / raw)
  To: <dev@dpdk.org>


When __mempool_get_bulk() grabs entries from the cache it
returns zero instead of the number of entries obtained. Plus
the stats were increased by the wrong count of objects.

Signed-off-by: Keith Wiles <keith.wiles@windriver.com>
---
 lib/librte_mempool/rte_mempool.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h
index 299d4d7..6750e78 100644
--- a/lib/librte_mempool/rte_mempool.h
+++ b/lib/librte_mempool/rte_mempool.h
@@ -988,9 +988,9 @@ __mempool_get_bulk(struct rte_mempool *mp, void **obj_table,
 
        cache->len -= n;
 
-       __MEMPOOL_STAT_ADD(mp, get_success, n_orig);
+       __MEMPOOL_STAT_ADD(mp, get_success, n);
 
-       return 0;
+       return n;
 
 ring_dequeue:
 #endif /* RTE_MEMPOOL_CACHE_MAX_SIZE > 0 */
@@ -1004,7 +1004,7 @@ ring_dequeue:
        if (ret < 0)
                __MEMPOOL_STAT_ADD(mp, get_fail, n_orig);
        else
-               __MEMPOOL_STAT_ADD(mp, get_success, n_orig);
+               __MEMPOOL_STAT_ADD(mp, get_success, ret);
 
        return ret;
 }
-- 
2.1.0Keith Wiles, Principal Technologist with CTO office, Wind River mobile 972-213-5533

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

end of thread, other threads:[~2014-09-28 22:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-27 18:41 [dpdk-dev] [PATCH] Function __mempool_get_bulk() returns wrong count Wiles, Roger Keith
2014-09-28  0:38 ` Neil Horman
2014-09-28 22:25 ` Ananyev, Konstantin
2014-09-28 22:57   ` Wiles, Roger Keith
2014-09-28 23:00     ` Ananyev, Konstantin

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).