From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0047.outbound.protection.outlook.com [104.47.38.47]) by dpdk.org (Postfix) with ESMTP id 68BA41BBA1 for ; Thu, 5 Jul 2018 13:27:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OOi1ZV+2XsUQyOEq4Jww7YlNfyNsdHYRWYn3LHmowtE=; b=fRSKlFuzJ715vu+FevNhMbmY3tvWGvIxmUAo7QcUSpe+rFAZj2uFnUkmWeRFk+hBZMnTmY97/wMy824B2QNONCqCBi6ZI69DDXLQR9ST6SHHT05SMHz21XQ4UMQJ6RX/gQcQbtTOffgp4/esxVExlc7UxoSMGWueA+hPtppusIs= Received: from CY4PR0701MB3634.namprd07.prod.outlook.com (52.132.101.164) by CY4PR0701MB3714.namprd07.prod.outlook.com (52.132.102.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.930.20; Thu, 5 Jul 2018 11:27:03 +0000 Received: from CY4PR0701MB3634.namprd07.prod.outlook.com ([fe80::f55a:7354:8d2f:cf0b]) by CY4PR0701MB3634.namprd07.prod.outlook.com ([fe80::f55a:7354:8d2f:cf0b%4]) with mapi id 15.20.0906.026; Thu, 5 Jul 2018 11:27:02 +0000 From: "Verma, Shally" To: Pablo de Lara , "declan.doherty@intel.com" , "akhil.goyal@nxp.com" , "ravi1.kumar@amd.com" , "Jacob, Jerin" , "roy.fan.zhang@intel.com" , "fiona.trahe@intel.com" , "tdu@semihalf.com" , "jianjay.zhou@huawei.com" CC: "dev@dpdk.org" Thread-Topic: [PATCH v5 04/16] test/crypto: limit number of sessions Thread-Index: AQHUFEjpfnUuk6cgWkGAROkGZF702aSAfVPw Date: Thu, 5 Jul 2018 11:27:02 +0000 Message-ID: References: <20180608220234.10170-1-pablo.de.lara.guarch@intel.com> <20180705020805.38308-1-pablo.de.lara.guarch@intel.com> <20180705020805.38308-5-pablo.de.lara.guarch@intel.com> In-Reply-To: <20180705020805.38308-5-pablo.de.lara.guarch@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Shally.Verma@cavium.com; x-originating-ip: [115.113.156.2] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY4PR0701MB3714; 7:UBdCZ2Dr+JKZRvuk4NZF+geCI8Pl3BUgwX1OUph7jI1wgBZ5zXqE2TVrl0r8+VHFaU64YlFmWGe7fg6exYlXVc2BkIynFdf9oKdXL41SoYgZWsv6ZM2NC6kEN2A3zyRJbWsBbFgXAzwEcaq1iCJhmDbNfu7FJpqkxbbmuolOmR6GhjXvcnbc5kDex/w8a1lvCbg2ZiUZ/0DzrdlkjRJ4NK2opCcO6SDbJ8Vvd9zRv9l85zyEasd+HtX9ar2iHy4y x-ms-exchange-antispam-srfa-diagnostics: SOS;SOR; x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10009020)(346002)(396003)(376002)(136003)(366004)(39860400002)(13464003)(189003)(199004)(486006)(2201001)(8936002)(6436002)(72206003)(7696005)(102836004)(76176011)(6246003)(4326008)(81166006)(97736004)(81156014)(476003)(8676002)(55016002)(316002)(305945005)(11346002)(14454004)(2900100001)(106356001)(86362001)(105586002)(446003)(33656002)(2501003)(9686003)(5660300001)(5250100002)(186003)(229853002)(26005)(99286004)(66066001)(3846002)(68736007)(74316002)(55236004)(25786009)(6506007)(7736002)(14444005)(5024004)(478600001)(256004)(2906002)(53936002)(110136005)(6116002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR0701MB3714; H:CY4PR0701MB3634.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-office365-filtering-correlation-id: fb8155ba-6f5a-42cb-579c-08d5e26a3b13 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:CY4PR0701MB3714; x-ms-traffictypediagnostic: CY4PR0701MB3714: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(185117386973197)(767451399110)(228905959029699)(50582790962513); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:CY4PR0701MB3714; BCL:0; PCL:0; RULEID:; SRVR:CY4PR0701MB3714; x-forefront-prvs: 0724FCD4CD received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: VttimmfKhOL3Ija5U93mLy3Q2eqHppTHjuGHC+GaeHqf3/ytfiUUi+gBQND8LFJ+S8IqQqA5VvmDSr9/N2mRvI4WJNcd6FAfTwDIaHHIcS8y+LcRIrVaTOA9ZDvaKiK4K6/7umJDj1QqdRSAi/ICPVEykeMGuX5fWD3HcbhsKtaNFv3yx+VMphnpxCWO62TARAqnjJNjQagzuDeMQqWULp/bco65++sVi/VFTF1zsYrr1TEAYLJISzIYppMgXGQ2m7UYv51/eicrIsywTfJ9MOWWsYgcAW3L5ri53RFRhL8WoMAOFimLpZrNhcxrbGyi9nFyF/05cco9Ie2piQkk1Tmqq4jTOPGNBBbLGupXJxw= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: fb8155ba-6f5a-42cb-579c-08d5e26a3b13 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jul 2018 11:27:02.6315 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0701MB3714 Subject: Re: [dpdk-dev] [PATCH v5 04/16] test/crypto: limit number of sessions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 11:27:05 -0000 >-----Original Message----- >From: Pablo de Lara [mailto:pablo.de.lara.guarch@intel.com] >Sent: 05 July 2018 07:38 >To: declan.doherty@intel.com; akhil.goyal@nxp.com; Verma, Shally ; ravi1.kumar@amd.com; Jacob, >Jerin ; roy.fan.zhang@intel.com; fion= a.trahe@intel.com; tdu@semihalf.com; >jianjay.zhou@huawei.com >Cc: dev@dpdk.org; Pablo de Lara >Subject: [PATCH v5 04/16] test/crypto: limit number of sessions > >External Email > >Instead of using the maximum number of sessions >allowed by the PMDs (which will change to unlimited most >of the PMDs), limit the number to a small sufficient amount. > >Signed-off-by: Pablo de Lara >Acked-by: Akhil Goyal >--- > test/test/test_cryptodev.c | 27 +++++++++++++++++++++------ > 1 file changed, 21 insertions(+), 6 deletions(-) > >diff --git a/test/test/test_cryptodev.c b/test/test/test_cryptodev.c >index 389f79677..5c906cfae 100644 >--- a/test/test/test_cryptodev.c >+++ b/test/test/test_cryptodev.c >@@ -39,6 +39,7 @@ > #include "test_cryptodev_hmac_test_vectors.h" > > #define VDEV_ARGS_SIZE 100 >+#define MAX_NB_SESSIONS 4 > > static int gbl_driver_id; > >@@ -435,9 +436,16 @@ testsuite_setup(void) > * Create mempool with maximum number of sessions * 2, > * to include the session headers > */ >+ if (info.sym.max_nb_sessions < MAX_NB_SESSIONS) { >+ RTE_LOG(ERR, USER1, "Device does not support " >+ "at least %u sessions\n", >+ MAX_NB_SESSIONS); >+ return TEST_FAILED; >+ } >+ If info.sym.max_nb_sessions =3D 0, won't it fail from here?=20 Thanks Shally > ts_params->session_mpool =3D rte_mempool_create( > "test_sess_mp", >- info.sym.max_nb_sessions * 2, >+ MAX_NB_SESSIONS * 2, > session_size, > 0, 0, NULL, NULL, NULL, > NULL, SOCKET_ID_ANY, >@@ -6499,10 +6507,10 @@ test_multi_session(void) > > sessions =3D rte_malloc(NULL, > (sizeof(struct rte_cryptodev_sym_session *) * >- dev_info.sym.max_nb_sessions) + 1, 0); >+ MAX_NB_SESSIONS) + 1, 0); > > /* Create multiple crypto sessions*/ >- for (i =3D 0; i < dev_info.sym.max_nb_sessions; i++) { >+ for (i =3D 0; i < MAX_NB_SESSIONS; i++) { > > sessions[i] =3D rte_cryptodev_sym_session_create( > ts_params->session_mpool); >@@ -6551,7 +6559,7 @@ test_multi_session(void) > TEST_ASSERT_NULL(sessions[i], > "Session creation succeeded unexpectedly!"); > >- for (i =3D 0; i < dev_info.sym.max_nb_sessions; i++) { >+ for (i =3D 0; i < MAX_NB_SESSIONS; i++) { > rte_cryptodev_sym_session_clear(ts_params->valid_devs[0], > sessions[i]); > rte_cryptodev_sym_session_free(sessions[i]); >@@ -6610,7 +6618,7 @@ test_multi_session_random_usage(void) > > sessions =3D rte_malloc(NULL, > (sizeof(struct rte_cryptodev_sym_session *) >- * dev_info.sym.max_nb_sessions) + = 1, 0); >+ * MAX_NB_SESSIONS) + 1, 0); > > for (i =3D 0; i < MB_SESSION_NUMBER; i++) { > sessions[i] =3D rte_cryptodev_sym_session_create( >@@ -8538,6 +8546,13 @@ test_scheduler_attach_slave_op(void) > unsigned int session_size =3D > rte_cryptodev_sym_get_private_session_size(i); > >+ if (info.sym.max_nb_sessions < MAX_NB_SESSIONS) { >+ RTE_LOG(ERR, USER1, >+ "Device does not support " >+ "at least %u sessions\n", >+ MAX_NB_SESSIONS); >+ return TEST_FAILED; >+ } > /* > * Create mempool with maximum number of sessions * 2, > * to include the session headers >@@ -8545,7 +8560,7 @@ test_scheduler_attach_slave_op(void) > if (ts_params->session_mpool =3D=3D NULL) { > ts_params->session_mpool =3D rte_mempool_create( > "test_sess_mp", >- info.sym.max_nb_sessions * 2, >+ MAX_NB_SESSIONS * 2, > session_size, > 0, 0, NULL, NULL, NULL, > NULL, SOCKET_ID_ANY, >-- >2.14.4