From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail1.windriver.com (mail1.windriver.com [147.11.146.13]) by dpdk.org (Postfix) with ESMTP id 090846848 for ; Sun, 5 Oct 2014 01:10:49 +0200 (CEST) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail1.windriver.com (8.14.9/8.14.5) with ESMTP id s94NHnPx003830 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for ; Sat, 4 Oct 2014 16:17:49 -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, 4 Oct 2014 16:17:49 -0700 From: "Wiles, Roger Keith" To: "dev@dpdk.org" Thread-Topic: [PATCH 1/2] Move the error check inside __mempool_check_cookies() Thread-Index: AQHP4ChnT59HsDbdp0aUsRddzYopwZwhB9oA Date: Sat, 4 Oct 2014 23:17:49 +0000 Message-ID: References: <1412464229-125521-1-git-send-email-keith.wiles@windriver.com> In-Reply-To: <1412464229-125521-1-git-send-email-keith.wiles@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: <86354E2BD5F9AB41A500028A640F4669@local> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 1/2] Move the error check inside __mempool_check_cookies() 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, 04 Oct 2014 23:10:50 -0000 Self Nack this one and will resend the patch as a single patch. :-( On Oct 4, 2014, at 6:10 PM, Keith Wiles wrote: > Three places check for the return value from __mempool_get_bulk to be zer= o > and then call the debug routine __mempool_check_cookies(). The test is > not required if moved into the debug routine. Minor cleanup and mostly > does not effect performance, unless the is not removed by the compiler > in the case where teh debug routine is not defined. >=20 > Signed-off-by: Keith Wiles > --- > lib/librte_mempool/rte_mempool.h | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) >=20 > diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_me= mpool.h > index 597cf4f..154fdd4 100644 > --- a/lib/librte_mempool/rte_mempool.h > +++ b/lib/librte_mempool/rte_mempool.h > @@ -325,6 +325,9 @@ static inline void __mempool_check_cookies(const stru= ct rte_mempool *mp, > void *obj; > void **obj_table; >=20 > + if ( n < 0 ) > + return; > + > /* Force to drop the "const" attribute. This is done only when > * DEBUG is enabled */ > tmp =3D (void *) obj_table_const; > @@ -1029,8 +1032,7 @@ rte_mempool_mc_get_bulk(struct rte_mempool *mp, voi= d **obj_table, unsigned n) > { > int ret; > ret =3D __mempool_get_bulk(mp, obj_table, n, 1); > - if (ret =3D=3D 0) > - __mempool_check_cookies(mp, obj_table, n, 1); > + __mempool_check_cookies(mp, obj_table, n, 1); > return ret; > } >=20 > @@ -1058,8 +1060,7 @@ rte_mempool_sc_get_bulk(struct rte_mempool *mp, voi= d **obj_table, unsigned n) > { > int ret; > ret =3D __mempool_get_bulk(mp, obj_table, n, 0); > - if (ret =3D=3D 0) > - __mempool_check_cookies(mp, obj_table, n, 1); > + __mempool_check_cookies(mp, obj_table, n, 1); > return ret; > } >=20 > @@ -1091,8 +1092,7 @@ rte_mempool_get_bulk(struct rte_mempool *mp, void *= *obj_table, unsigned n) > int ret; > ret =3D __mempool_get_bulk(mp, obj_table, n, > !(mp->flags & MEMPOOL_F_SC_GET)); > - if (ret =3D=3D 0) > - __mempool_check_cookies(mp, obj_table, n, 1); > + __mempool_check_cookies(mp, obj_table, n, 1); > return ret; > } >=20 > --=20 > 2.1.0 >=20 Keith Wiles, Principal Technologist with CTO office, Wind River mobile 972-= 213-5533