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 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-Type: text/plain; charset="us-ascii" Content-ID: <3B4CAF98FE8B694989D08C943674EA29@local> Content-Transfer-Encoding: quoted-printable 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: , X-List-Received-Date: Fri, 03 Oct 2014 21:21:05 -0000 Cleanup the code some to remove n_orig variable that was not required. = =20 Update the comments to __mempool_get_bulk to state the correct return value= . =20 Signed-off-by: Keith Wiles = =20 --- = =20 lib/librte_mempool/rte_mempool.h | 11 ++++------- = =20 1 file changed, 4 insertions(+), 7 deletions(-) = =20 diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_memp= ool.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 - * - >=3D0: 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_t= able, unsigned n, int is_mc) { int ret; -#ifdef RTE_LIBRTE_MEMPOOL_DEBUG - unsigned n_orig =3D 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_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; =20 @@ -1002,9 +999,9 @@ ring_dequeue: ret =3D rte_ring_sc_dequeue_bulk(mp->ring, obj_table, n); =20 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); =20 return ret; } --=20 2.1.0 Keith Wiles, Principal Technologist with CTO office, Wind River mobile 972-= 213-5533