From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 3DD5C6AE0 for ; Mon, 10 Oct 2016 17:37:29 +0200 (CEST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP; 10 Oct 2016 08:37:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,324,1473145200"; d="scan'208";a="18125724" Received: from irsmsx106.ger.corp.intel.com ([163.33.3.31]) by orsmga005.jf.intel.com with ESMTP; 10 Oct 2016 08:37:27 -0700 Received: from irsmsx101.ger.corp.intel.com ([169.254.1.224]) by IRSMSX106.ger.corp.intel.com ([169.254.8.209]) with mapi id 14.03.0248.002; Mon, 10 Oct 2016 16:37:26 +0100 From: "Trahe, Fiona" To: "Azarewicz, PiotrX T" CC: "dev@dpdk.org" Thread-Topic: [PATCH] app/test: fix crypto mbuf pool size Thread-Index: AQHSII8k7bUWXercakCsJOmqzRXa0aCh1jXQ Date: Mon, 10 Oct 2016 15:37:25 +0000 Message-ID: <348A99DA5F5B7549AA880327E580B435890EFFB6@IRSMSX101.ger.corp.intel.com> References: <1475840080-180796-1-git-send-email-piotrx.t.azarewicz@intel.com> In-Reply-To: <1475840080-180796-1-git-send-email-piotrx.t.azarewicz@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYWM4M2NiZmUtMDEzNy00NTlkLWEwNGQtMTM3ODEzZWY4MGQ1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IitObVNBTklXTlRSdGF3aWFORFY2Zit4ZDdDRndmMnZQQXN3R2J5ZUpuYjA9In0= x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] app/test: fix crypto mbuf pool size 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: Mon, 10 Oct 2016 15:37:29 -0000 Hi Piotr, > -----Original Message----- > From: Azarewicz, PiotrX T > Sent: Friday, October 7, 2016 12:35 PM > To: Trahe, Fiona > Cc: dev@dpdk.org > Subject: [PATCH] app/test: fix crypto mbuf pool size >=20 > This patch fix that created pool for crypto mbufs may be too big in some > environments. > To avoid the issue, mbuf pool is reverted to its previous size. > Moreover, here is added additional small pool with one large mbuf, what i= s > needed in large data test scenarios. >=20 > Fixes: 2070f885b76d ("app/test: added tests for libcrypto PMD") >=20 > Signed-off-by: Piotr Azarewicz > --- > app/test/test_cryptodev.c | 28 +++++++++++++++++++++++++--- > 1 file changed, 25 insertions(+), 3 deletions(-) >=20 > diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index > 2917454..914bb0b 100644 > --- a/app/test/test_cryptodev.c > +++ b/app/test/test_cryptodev.c > @@ -60,6 +60,7 @@ static enum rte_cryptodev_type gbl_cryptodev_type; >=20 > struct crypto_testsuite_params { > struct rte_mempool *mbuf_pool; > + struct rte_mempool *large_mbuf_pool; > struct rte_mempool *op_mpool; > struct rte_cryptodev_config conf; > struct rte_cryptodev_qp_conf qp_conf; > @@ -169,7 +170,7 @@ testsuite_setup(void) > /* Not already created so create */ > ts_params->mbuf_pool =3D rte_pktmbuf_pool_create( > "CRYPTO_MBUFPOOL", > - NUM_MBUFS, MBUF_CACHE_SIZE, 0, > UINT16_MAX, > + NUM_MBUFS, MBUF_CACHE_SIZE, 0, > MBUF_SIZE, > rte_socket_id()); > if (ts_params->mbuf_pool =3D=3D NULL) { > RTE_LOG(ERR, USER1, "Can't create > CRYPTO_MBUFPOOL\n"); @@ -177,6 +178,21 @@ testsuite_setup(void) > } > } >=20 > + ts_params->large_mbuf_pool =3D rte_mempool_lookup( > + "CRYPTO_LARGE_MBUFPOOL"); > + if (ts_params->large_mbuf_pool =3D=3D NULL) { > + /* Not already created so create */ > + ts_params->large_mbuf_pool =3D rte_pktmbuf_pool_create( > + "CRYPTO_LARGE_MBUFPOOL", > + 1, 0, 0, UINT16_MAX, > + rte_socket_id()); > + if (ts_params->large_mbuf_pool =3D=3D NULL) { > + RTE_LOG(ERR, USER1, > + "Can't create > CRYPTO_LARGE_MBUFPOOL\n"); > + return TEST_FAILED; > + } > + } > + > ts_params->op_mpool =3D rte_crypto_op_pool_create( > "MBUF_CRYPTO_SYM_OP_POOL", > RTE_CRYPTO_OP_TYPE_SYMMETRIC, > @@ -5149,7 +5165,10 @@ test_AES_GMAC_authentication(const struct > gmac_test_data *tdata) > if (retval < 0) > return retval; >=20 > - ut_params->ibuf =3D rte_pktmbuf_alloc(ts_params->mbuf_pool); > + if (tdata->aad.len =3D=3D GMAC_LARGE_PLAINTEXT_LENGTH) > + ut_params->ibuf =3D rte_pktmbuf_alloc(ts_params- > >large_mbuf_pool); > + else > + ut_params->ibuf =3D rte_pktmbuf_alloc(ts_params- > >mbuf_pool); >=20 It would be safer to test if aad.len > MBUF_SIZE, here and below. > memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, > rte_pktmbuf_tailroom(ut_params->ibuf)); > @@ -5233,7 +5252,10 @@ test_AES_GMAC_authentication_verify(const > struct gmac_test_data *tdata) > if (retval < 0) > return retval; >=20 > - ut_params->ibuf =3D rte_pktmbuf_alloc(ts_params->mbuf_pool); > + if (tdata->aad.len =3D=3D GMAC_LARGE_PLAINTEXT_LENGTH) > + ut_params->ibuf =3D rte_pktmbuf_alloc(ts_params- > >large_mbuf_pool); > + else > + ut_params->ibuf =3D rte_pktmbuf_alloc(ts_params- > >mbuf_pool); >=20 > memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, > rte_pktmbuf_tailroom(ut_params->ibuf)); > -- > 1.7.9.5