From patchwork Fri Oct 3 21:27:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wiles, Roger Keith" X-Patchwork-Id: 708 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 82CC368B9; Fri, 3 Oct 2014 23:21:06 +0200 (CEST) Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) by dpdk.org (Postfix) with ESMTP id 2123D5937 for ; Fri, 3 Oct 2014 23:21:04 +0200 (CEST) Received: from ALA-HCB.corp.ad.wrs.com (ala-hcb.corp.ad.wrs.com [147.11.189.41]) by mail.windriver.com (8.14.9/8.14.5) with ESMTP id s93LS0Gg016496 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for ; Fri, 3 Oct 2014 14:28:00 -0700 (PDT) Received: from ALA-MBB.corp.ad.wrs.com ([169.254.1.18]) by ALA-HCB.corp.ad.wrs.com ([147.11.189.41]) with mapi id 14.03.0174.001; Fri, 3 Oct 2014 14:28:00 -0700 From: "Wiles, Roger Keith" To: "" Thread-Topic: [PATCH] Remove n_orig from __mempool_get_bulk() routine, cleanup comment. Thread-Index: AQHP31DnxrjlkUC6kE23uhdZ2rk7Gw== Date: Fri, 3 Oct 2014 21:27:59 +0000 Message-ID: <1EEE2DAF-2F00-4B95-A1ED-262FA9E00077@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-ID: <3B4CAF98FE8B694989D08C943674EA29@local> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] Remove n_orig from __mempool_get_bulk() routine, cleanup comment. 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Cleanup the code some to remove n_orig variable that was not required. Update the comments to __mempool_get_bulk to state the correct return value. Signed-off-by: Keith Wiles --- lib/librte_mempool/rte_mempool.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h index 95f19f9..597cf4f 100644 --- a/lib/librte_mempool/rte_mempool.h +++ b/lib/librte_mempool/rte_mempool.h @@ -937,7 +937,7 @@ rte_mempool_put(struct rte_mempool *mp, void *obj) * @param is_mc * Mono-consumer (0) or multi-consumers (1). * @return - * - >=0: Success; number of objects supplied. + * - 0: Success; number of objects requested. * - <0: Error; code of ring dequeue function. */ static inline int __attribute__((always_inline)) @@ -945,9 +945,6 @@ __mempool_get_bulk(struct rte_mempool *mp, void **obj_table, unsigned n, int is_mc) { int ret; -#ifdef RTE_LIBRTE_MEMPOOL_DEBUG - unsigned n_orig = n; -#endif #if RTE_MEMPOOL_CACHE_MAX_SIZE > 0 struct rte_mempool_cache *cache; uint32_t index, len; @@ -988,7 +985,7 @@ __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; @@ -1002,9 +999,9 @@ ring_dequeue: ret = rte_ring_sc_dequeue_bulk(mp->ring, obj_table, n); if (ret < 0) - __MEMPOOL_STAT_ADD(mp, get_fail, n_orig); + __MEMPOOL_STAT_ADD(mp, get_fail, n); else - __MEMPOOL_STAT_ADD(mp, get_success, n_orig); + __MEMPOOL_STAT_ADD(mp, get_success, n); return ret; }