From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id BA68A11F5 for ; Sun, 28 Sep 2014 02:32:17 +0200 (CEST) Received: from [2001:470:8:a08:215:ff:fecc:4872] (helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1XY2Vb-00080C-1N; Sat, 27 Sep 2014 20:38:44 -0400 Date: Sat, 27 Sep 2014 20:38:30 -0400 From: Neil Horman To: "Wiles, Roger Keith" Message-ID: <20140928003830.GB27849@localhost.localdomain> References: <82107A2E-6373-4A8E-9CDA-10FE18EDEFB6@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <82107A2E-6373-4A8E-9CDA-10FE18EDEFB6@windriver.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Score: -2.9 (--) X-Spam-Status: No Cc: "" Subject: Re: [dpdk-dev] [PATCH] Function __mempool_get_bulk() returns wrong count. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Sep 2014 00:32:18 -0000 On Sat, Sep 27, 2014 at 06:41:41PM +0000, Wiles, Roger Keith wrote: > > 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 > --- > 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 > > Acked-by: Neil Horman