From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) by dpdk.org (Postfix) with ESMTP id 59B71678C for ; Sat, 27 Sep 2014 20:35:15 +0200 (CEST) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail.windriver.com (8.14.9/8.14.5) with ESMTP id s8RIfgP0013715 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for ; Sat, 27 Sep 2014 11:41:42 -0700 (PDT) Received: from ALA-MBB.corp.ad.wrs.com ([169.254.1.18]) by ALA-HCA.corp.ad.wrs.com ([147.11.189.40]) with mapi id 14.03.0174.001; Sat, 27 Sep 2014 11:41:41 -0700 From: "Wiles, Roger Keith" To: "" Thread-Topic: [PATCH] Function __mempool_get_bulk() returns wrong count. Thread-Index: AQHP2oKtLICv7vWhf0Wg0zJjkh9qrQ== Date: Sat, 27 Sep 2014 18:41:41 +0000 Message-ID: <82107A2E-6373-4A8E-9CDA-10FE18EDEFB6@windriver.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.25.40.166] Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: [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: Sat, 27 Sep 2014 18:35:15 -0000 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_memp= ool.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_t= able, =20 cache->len -=3D n; =20 - __MEMPOOL_STAT_ADD(mp, get_success, n_orig); + __MEMPOOL_STAT_ADD(mp, get_success, n); =20 - return 0; + return n; =20 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); =20 return ret; } --=20 2.1.0Keith Wiles, Principal Technologist with CTO office, Wind River mobile= 972-213-5533