From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8E4E8A0563; Wed, 15 Apr 2020 11:16:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 72C861D607; Wed, 15 Apr 2020 11:16:20 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 7F6C21D5FB for ; Wed, 15 Apr 2020 11:16:18 +0200 (CEST) IronPort-SDR: b9n1zBrKOZvTo+EtfHT9zR9w7Uxx7vdjEjGZegCVsauWWPWGfu9dXZys04Daf3fJYa8JVjEp/0 y71FqhUU5/Pw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2020 02:16:17 -0700 IronPort-SDR: GOCWVAUpIAPWhLwG3nrmpER8drr29Fu30oBuWjym6H7rCmVL9csScvqXQEqCZEN9PCT8WdqR5a SMaSbeGgzkMw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,386,1580803200"; d="scan'208";a="245645005" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga008.fm.intel.com with ESMTP; 15 Apr 2020 02:16:12 -0700 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 15 Apr 2020 02:16:12 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.36.51) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 15 Apr 2020 02:16:11 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DSdeRQnRrnJMhudYFmIQiOkATyykLU6wCrnejTkuMZ1EiAw9cNEaAPZIvLXQtwurkTrAK+lWfxm6BpcMgok5WnZ8AHmXi6lmpa6FsYgxy0hrWdRGEQ+NvA9JGQuVfhziLk+dF6QWT0LDp1fBlYNPtE84dy+ErHligUHmJgvZKeqN3Z4pU9wA+v7XyFlfBHSOVl6e8eD/fbaaaVV+zonhHACZoP+aLL1ztMZdtwINB5dCl38Yhyv53jfrKJlM0tD433dAO4qrwBsRLshdyYUx5v+G/QFSa+UZf59LD8Bbqhmu0KGDHumRyVN51MpwaWMt3srFXmdJYbAW1/J6Q2RsRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yNKnQx2BWwzabh8wX4rWEGi2VTTZLRmH3cSJjXo4Tao=; b=MWOuph9AMLmiwDUAk1YtK/e6TjD8/t3omgR4ImMnl8tPmsrnb4AgSe0XfiCZ8KbQ5sDlXeFTVvUZNzqb9C4oH9q/ZzodgC9qjI7lOVZXBf93iRcR2z/II3jeHApo0tsbct+o4cgAMMMfuqLVyNa1QVooN5Stl3f248zkEZ2/q5tb0d5dE8d8QtLY522bJxOHvEmBIGFRjDEvfqqjR9DtcfznNaGt9vqKlbN9VbzbrvE1/ultnG8AeeoPlpGNX3LY1YhLvuOrrH9lqALhMDb1zTufIEkboWgsfp/3rMQ3tgDm85VmLlfeGu8uAVqI5a07LAM+wldlg2hf6Qt71hqBpA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yNKnQx2BWwzabh8wX4rWEGi2VTTZLRmH3cSJjXo4Tao=; b=gjBjXzLwBisd9BHnOBg4n0MIWRYkGRMSkkxOuC74JauIHTGXpeXpfKTqFZPry4SuUqZHEAS0xTN8w8RRUE4MUzknAkfHJdp94FE2IMQ9sAVWkt4CGLAHRIHxGJ+8J3yOfAmJdeV9q732CKGGlJRWUQOZ5p7ooRiDYWwVkXK8nzM= Received: from BY5PR11MB3910.namprd11.prod.outlook.com (2603:10b6:a03:185::13) by BY5PR11MB4452.namprd11.prod.outlook.com (2603:10b6:a03:1bf::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.28; Wed, 15 Apr 2020 09:16:10 +0000 Received: from BY5PR11MB3910.namprd11.prod.outlook.com ([fe80::ac53:aa6e:ae25:ac2c]) by BY5PR11MB3910.namprd11.prod.outlook.com ([fe80::ac53:aa6e:ae25:ac2c%3]) with mapi id 15.20.2900.028; Wed, 15 Apr 2020 09:16:10 +0000 From: "Dybkowski, AdamX" To: "De Lara Guarch, Pablo" CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 1/2] test/crypto: add capability check Thread-Index: AQHWEka4ICLTCSOLdkqs7e8OzhTPOah5507g Date: Wed, 15 Apr 2020 09:16:10 +0000 Message-ID: References: <1586859760-207446-1-git-send-email-pablo.de.lara.guarch@intel.com> In-Reply-To: <1586859760-207446-1-git-send-email-pablo.de.lara.guarch@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.2.0.6 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: spf=none (sender IP is ) smtp.mailfrom=adamx.dybkowski@intel.com; x-originating-ip: [192.198.151.43] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e667784c-9811-4039-217e-08d7e11da346 x-ms-traffictypediagnostic: BY5PR11MB4452: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-forefront-prvs: 0374433C81 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY5PR11MB3910.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10019020)(366004)(39860400002)(136003)(396003)(376002)(346002)(66476007)(186003)(5660300002)(6862004)(6636002)(86362001)(478600001)(4326008)(26005)(81156014)(8936002)(7696005)(8676002)(9686003)(66556008)(55016002)(53546011)(2906002)(52536014)(71200400001)(316002)(33656002)(76116006)(66446008)(6506007)(66946007)(64756008); DIR:OUT; SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 0GREIfO+Z211/GSDtMkVhsvkC6tDUzRTuK4t7XetAJAPi/W6qNzq93Fvt+dA4VnWFTeo+IPWiYjVNnPsaeVmzXqLSqtBp91OFgwemgnYspFRh4b7kfuiTQzk/Wa5x0+5o9f+wU+tt3SBDFrqfhcjEf0Zckty6hvOCHm023sRIE9MXldEdX/F0Sp9Ibl3N5VXLdQTQuO7nXICs//6Y7/KJkyqPHCD4f/3U49cDwBvLu4wKTlwv7D9DcBFeoxBYLUxZwHdafpMPG6eEL7/ur1boSNwCWBhaF3+h5+dIgIwiiRyz0JhgvbH8FZCdc0oty8tosgvD5OASg8Wi9BZZQCpdd2nRT6GJL0nVOJoDHHQheguDvHg+XaBAlhxGyYNHOfCUnWu+s+Za3qZ9cjsKg73E1dWjPZmLosWYzIyF9j83lzNIbJp+0aCwzsQi5xK0epq x-ms-exchange-antispam-messagedata: 5225jZWEoAAa1fLhEvU81XeKBQBVhmQz2XBwm6g+wVxJLQw6GVkewvwRdrU01xAhApP/yJARm1zpRy4IvCO4KhLhBOhnWQdtHlf78oOpQKlGm6ucM2jkrRsExOo1HeMsWHvPgN6Q+MCuH1DTPBQ/Iw== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: e667784c-9811-4039-217e-08d7e11da346 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Apr 2020 09:16:10.3879 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 6ym7HTJKcYgbwPiarTvai2YgS1YjaFYlSKNcXMBdzWzdrMJ9TVN/QgVwnExy27l5ksbS487cpzAjhk9PDY9cHDKtqjIkSBw4Q4mk0gcRIw0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4452 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH 1/2] test/crypto: add capability check 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Pablo, > -----Original Message----- > From: dev On Behalf Of Pablo de Lara > Sent: Tuesday, 14 April, 2020 12:23 > To: Doherty, Declan ; akhil.goyal@nxp.com; > Zhang, Roy Fan ; thomas@monjalon.net > Cc: dev@dpdk.org; De Lara Guarch, Pablo > Subject: [dpdk-dev] [PATCH 1/2] test/crypto: add capability check >=20 > Check if test case is supported by the crypto device, including algorithm= and > some of its parameter, such as key length, IV length, etc, using the > capabilities API. > If it is not supported, test case is skipped. >=20 > Signed-off-by: Pablo de Lara > --- > app/test/test_cryptodev_blockcipher.c | 49 > +++++++++++++++++++++++++++++++++++ > 1 file changed, 49 insertions(+) >=20 > diff --git a/app/test/test_cryptodev_blockcipher.c > b/app/test/test_cryptodev_blockcipher.c > index 2ff7fc9..b0e53ee 100644 > --- a/app/test/test_cryptodev_blockcipher.c > +++ b/app/test/test_cryptodev_blockcipher.c > @@ -21,6 +21,47 @@ > #include "test_cryptodev_hash_test_vectors.h" >=20 > static int > +verify_algo_support(const struct blockcipher_test_case *t, > + const uint8_t dev_id, const uint32_t digest_len) { > + int ret; > + const struct blockcipher_test_data *tdata =3D t->test_data; > + struct rte_cryptodev_sym_capability_idx cap_idx; > + const struct rte_cryptodev_symmetric_capability *capability; > + > + if (t->op_mask & BLOCKCIPHER_TEST_OP_CIPHER) { > + cap_idx.type =3D RTE_CRYPTO_SYM_XFORM_CIPHER; > + cap_idx.algo.cipher =3D tdata->crypto_algo; > + capability =3D rte_cryptodev_sym_capability_get(dev_id, > &cap_idx); > + if (capability =3D=3D NULL) > + return -1; > + > + ret =3D rte_cryptodev_sym_capability_check_cipher(capability, > + tdata- > >cipher_key.len, > + tdata->iv.len); > + if (ret !=3D 0) > + return -1; > + } > + > + if (t->op_mask & BLOCKCIPHER_TEST_OP_AUTH) { > + cap_idx.type =3D RTE_CRYPTO_SYM_XFORM_AUTH; > + cap_idx.algo.auth =3D tdata->auth_algo; > + capability =3D rte_cryptodev_sym_capability_get(dev_id, > &cap_idx); > + if (capability =3D=3D NULL) > + return -1; > + > + ret =3D rte_cryptodev_sym_capability_check_auth(capability, > + tdata->auth_key.len, > + digest_len, > + 0); > + if (ret !=3D 0) > + return -1; > + } > + > + return 0; > +} > + > +static int > test_blockcipher_one_case(const struct blockcipher_test_case *t, > struct rte_mempool *mbuf_pool, > struct rte_mempool *op_mpool, > @@ -112,6 +153,14 @@ test_blockcipher_one_case(const struct > blockcipher_test_case *t, > nb_segs =3D 3; > } >=20 > + /* Check if PMD is capable of performing that test */ > + if (verify_algo_support(t, dev_id, digest_len) < 0) { > + RTE_LOG(DEBUG, USER1, > + "Device is not capable of performing this algorithm." > + "Test Skipped.\n"); [Adam] Maybe add a space after "algorithm." So it's not stuck with the rest= of the string. Or - probably even better - write the whole string in one line. It'll pass = the git check (if it's the long text followed by the ')' and ';' characters= only). Such long text is easier to find when debugging. Adam