From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id E95E54C96 for ; Thu, 17 Jan 2019 12:20:24 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jan 2019 03:20:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,488,1539673200"; d="scan'208";a="108967832" Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by orsmga006.jf.intel.com with ESMTP; 17 Jan 2019 03:20:22 -0800 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.205]) by IRSMSX101.ger.corp.intel.com ([169.254.1.213]) with mapi id 14.03.0415.000; Thu, 17 Jan 2019 11:20:22 +0000 From: "Iremonger, Bernard" To: "Ananyev, Konstantin" , "dev@dpdk.org" Thread-Topic: [PATCH v2] test/ipsec: fix test suite setup function Thread-Index: AQHUrk2bOPJD6eIfsEqQCrgqxaknxKWzQ/EAgAALA+A= Date: Thu, 17 Jan 2019 11:20:21 +0000 Message-ID: <8CEF83825BEC744B83065625E567D7C260D508D2@IRSMSX108.ger.corp.intel.com> References: <1547551191-28863-1-git-send-email-bernard.iremonger@intel.com> <1547720125-32101-1-git-send-email-bernard.iremonger@intel.com> <2601191342CEEE43887BDE71AB977258010D904F2F@irsmsx105.ger.corp.intel.com> In-Reply-To: <2601191342CEEE43887BDE71AB977258010D904F2F@irsmsx105.ger.corp.intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiN2Y5M2I3N2MtMDdiZC00N2MxLWIwMDctZWQwYTFhNmU1ZjAzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiSmluTzFpMWZ3aGUzbDdcL25IU0o0SGdRVEIycHlZY0ZjbHNremVZRTZUN1R2RUpYNlVLS3ZEYkFjeG5QV3pMa3AifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action 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 v2] test/ipsec: fix test suite setup function 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, 17 Jan 2019 11:20:25 -0000 Hi Konstantin, > > Subject: [PATCH v2] test/ipsec: fix test suite setup function > > > > Check for valid crypto_null device before continuing. > > Use valid_dev instead of valid_devs[]. > > Call create_crypto_session for one driver only. > > > > Fixes: 05fe65eb66b2 ("test/ipsec: introduce functional test") > > Signed-off-by: Bernard Iremonger > > --- > > test/test/test_ipsec.c | 91 > > +++++++++++++++++++++++++------------------------- > > 1 file changed, 45 insertions(+), 46 deletions(-) > > > > diff --git a/test/test/test_ipsec.c b/test/test/test_ipsec.c index > > ff1a1c4..a5c1c4b 100644 > > --- a/test/test/test_ipsec.c > > +++ b/test/test/test_ipsec.c > > @@ -62,7 +62,7 @@ struct ipsec_testsuite_params { > > struct rte_cryptodev_config conf; > > struct rte_cryptodev_qp_conf qp_conf; > > > > - uint8_t valid_devs[RTE_CRYPTO_MAX_DEVS]; > > + uint8_t valid_dev; > > uint8_t valid_dev_count; > > }; > > > > @@ -218,8 +218,9 @@ testsuite_setup(void) { > > struct ipsec_testsuite_params *ts_params =3D &testsuite_params; > > struct rte_cryptodev_info info; > > - uint32_t nb_devs, dev_id; > > + uint32_t i, nb_devs, dev_id; > > size_t sess_sz; > > + int driver_id; > > > > memset(ts_params, 0, sizeof(*ts_params)); > > > > @@ -251,10 +252,24 @@ testsuite_setup(void) > > return TEST_FAILED; > > } > > > > - ts_params->valid_devs[ts_params->valid_dev_count++] =3D 0; > > + driver_id =3D rte_cryptodev_driver_id_get( > > + RTE_STR(CRYPTODEV_NAME_NULL_PMD)); >=20 >=20 > I still think that guessing device capabilities by driver name is not a r= ight > approach. > Please use check_device_capabilites() here. Ok, this will require some refactoring of the tests. =20 > > + > > + /* Find first valid crypto device */ > > + for (i =3D 0; i < nb_devs; i++) { > > + rte_cryptodev_info_get(i, &info); > > + if (info.driver_id =3D=3D driver_id) { > > + ts_params->valid_dev =3D i; > > + ts_params->valid_dev_count++; >=20 > As you use only one device now, I don't think you need valid_dev_count an= y > more. I will check if it is still needed.=20 =20 > > + break; > > + } > > + } > > + > > + if (ts_params->valid_dev_count < 1) > > + return TEST_FAILED; > > Regards, Bernard.