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 76EE8A0588; Thu, 16 Apr 2020 13:15:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DFABF1DA22; Thu, 16 Apr 2020 13:15:47 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 6D89D1D65E for ; Thu, 16 Apr 2020 13:15:46 +0200 (CEST) IronPort-SDR: ekoCKNts3SApaixLfsfkC7v5KnQXQEB9UflOFffVYfLQMjTGIVKb4/jSIwj3t2/GBXxL3Lk1j1 w7QApSWSA74Q== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2020 04:15:45 -0700 IronPort-SDR: KNtDS/QIKfeSVl9JvMj+Et7NM2O0qK4Z3RD5u1yYq30KddaQABx3NI2mQTH4rU4l47KyuvAcrQ k3Ej2MJouYpg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,390,1580803200"; d="scan'208";a="400636368" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga004.jf.intel.com with ESMTP; 16 Apr 2020 04:15:45 -0700 Received: from fmsmsx151.amr.corp.intel.com (10.18.125.4) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 16 Apr 2020 04:15:44 -0700 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by FMSMSX151.amr.corp.intel.com (10.18.125.4) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 16 Apr 2020 04:15:38 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.176) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 16 Apr 2020 04:15:38 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XUDi2GtXGqmsqSsSc02UatSlXyaHi1IaVj+yMw8N30uUmpx1+G1dUfmbqIYwwACAqNlhcDCWMX1igEwS899Rpw2uUytdwYSoMFFqaERtKgEahdhw4okKzmR/qhYvOEXCSaBNJbxJA/94YQi/ziFs5scSLxTMeUoQ1e8R8Q1fIXdfL4i0edhN+z3v+798WUPAiniIScLQW9PNWK7ytWydOUOzZsGK5+4x1Q9/IEUnHXW6DSRatJzqPaN2/cQycpZ9ol/6XCv27mJBdWp8JvSqZ1+xtO33vEP0mYh6cTK7FCXscI2SiTB7yT4XJE6WH1UUH6DttGyzq1fNa6AIbClGLA== 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=FrUSTUsp2awzfHHMJWQDovf5DM2IDp96WFxmkuB1Hrs=; b=VSlLSVwyjrM7bVWQCbIve0TYSfPlT3RH1byoakPtXybUhvQyqcBIyscEhYMA347ptos021bVnPZ2jwrrWQ9vqlkJKzbxYzRS2IkOrUeQCYpVrCbx4wYVb4I8QE5LKHbUQHA65JG2NM0rCRG8IWUJbazXmukD3nPpg7B7UxGrD0rzneOvXKrDwN7eAR0q7ZQUTUenxRKfrcWi6Lhmd3MFRQVWcqboWckqfKcqk1MuGLsM6AP3VJydMTNSw2wHfwZYyELIC/PCva54wQ23L+ZA7FCJxek7ZuVLHpd+LYcuLXR4OUaEV7kLYlvx6rMH8z/Dp9bL6t6Dms8mH2dhIFVEsw== 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=FrUSTUsp2awzfHHMJWQDovf5DM2IDp96WFxmkuB1Hrs=; b=DKxl1LY4ZgwIp6E0LXZ74P61Um78rjfb4blrrO8XBQ32i3TNtuIAaoqcGv/BT97jW7UXBk3If9OLm53ziD4C/c744NF8ABa3AV10AzVnaCsyiRG/TV1MHK8y5sTcYzRlFZAq95jrRgyHZH+ek5vQni0m98bwwSj0hIMv8YDo4ZA= Received: from SN6PR11MB3101.namprd11.prod.outlook.com (2603:10b6:805:d8::23) by SN6PR11MB3278.namprd11.prod.outlook.com (2603:10b6:805:ba::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.16; Thu, 16 Apr 2020 11:15:34 +0000 Received: from SN6PR11MB3101.namprd11.prod.outlook.com ([fe80::7d0f:735a:8d8b:1d40]) by SN6PR11MB3101.namprd11.prod.outlook.com ([fe80::7d0f:735a:8d8b:1d40%7]) with mapi id 15.20.2900.028; Thu, 16 Apr 2020 11:15:34 +0000 From: "De Lara Guarch, Pablo" To: "Doherty, Declan" CC: "dev@dpdk.org" , "akhil.goyal@nxp.com" Thread-Topic: [PATCH v3 1/2] test/crypto: add capability check Thread-Index: AQHWEoP1pv1v/rbEykaSJ0ybh/h9sah7m1iQ Date: Thu, 16 Apr 2020 11:15:34 +0000 Message-ID: References: <1586860539-209075-1-git-send-email-pablo.de.lara.guarch@intel.com> <1586886056-221547-1-git-send-email-pablo.de.lara.guarch@intel.com> <1586886056-221547-2-git-send-email-pablo.de.lara.guarch@intel.com> In-Reply-To: <1586886056-221547-2-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-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.2.0.6 authentication-results: spf=none (sender IP is ) smtp.mailfrom=pablo.de.lara.guarch@intel.com; x-originating-ip: [109.255.188.24] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d086c913-33cd-4d62-22e4-08d7e1f77bd0 x-ms-traffictypediagnostic: SN6PR11MB3278: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4303; x-forefront-prvs: 0375972289 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB3101.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10019020)(346002)(366004)(396003)(136003)(376002)(39860400002)(8936002)(33656002)(81156014)(86362001)(52536014)(2906002)(316002)(6636002)(8676002)(5660300002)(478600001)(54906003)(71200400001)(64756008)(6506007)(4326008)(6862004)(7696005)(76116006)(66556008)(186003)(9686003)(26005)(66476007)(55236004)(55016002)(66446008)(53546011)(66946007); DIR:OUT; SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: giLAgkXhbkbvERjlFWcmQRbo2HM5XYSg+IjligasWxUCISBBEqgvl4wkyy/OQsGvciDX+Pb6bt0S8Ick2ZgDB6npiroUBt1VGjuR8OKb9v7GicKy4Fk7Cgypj+7JelHXn2szjXJS5XJCi/mn6svNfMHg0smAUvrde5dF9kIl+po0Ig3j65fqyApMBnEW5/NeaNqYiP3NlYhad8a5CNbiyK76UWHhchbR1VHzj7h4vrIQwTzTv3LruRzY5otdSq1cRLt69T/KZRtz1dW4h50a4hLcNaYRvuawE6jFH8iS4wkL0fHJXfdKzwlcxCipUjo/HT+TYCZe/k092v8u8K5nksctxO0QCe77JGy0nOIgQy3RRw4+UxptbCp/aYcGVI7B9QqbQCTU1sgtmxDqaGixuS0/GX/yQ8noX8iM0H6bMrtBtWveek2PfKpJ14INXorB x-ms-exchange-antispam-messagedata: HFaJay6lTnBoan6jJgNJT494uGGcPSHWqGSKJAAZ+1cqwyAP9kWklUFuQkhR2vov44GKLIMAXO9AMnq8hFmjumpTsRscJFoqNbBp+4vJuw59CW6UQCDsuJBt0qO0rjFdeugdyUa5NG6cxor/JXsxQw== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: d086c913-33cd-4d62-22e4-08d7e1f77bd0 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Apr 2020 11:15:34.4585 (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: lZiYSlu5JQOdp9VHK/HgQmaGYp4iGqJ36Lj6fTr0OZtW38lzmBPGL2gFSSkyw/bwGRsFoDoeRukdH0gYW7qekkuH0dV5ch34uFZSFelFsbw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3278 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3 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, > -----Original Message----- > From: De Lara Guarch, Pablo > Sent: Tuesday, April 14, 2020 6:41 PM > To: Doherty, Declan > Cc: dev@dpdk.org; akhil.goyal@nxp.com; De Lara Guarch, Pablo > > Subject: [PATCH v3 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 capa= bilities > 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..3fb1274 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, > @@ -144,6 +185,14 @@ test_blockcipher_one_case(const struct > blockcipher_test_case *t, > goto error_exit; > } >=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 does not support this algorithm." > + "Test Skipped.\n"); > + return 0; I forgot to set the "test_msg" here, so I'll send another patchset. Thanks, Pablo