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 24D03A0563; Wed, 15 Apr 2020 11:23:14 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7DF7B1D5BC; Wed, 15 Apr 2020 11:23:13 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id BBEB21D58B for ; Wed, 15 Apr 2020 11:23:10 +0200 (CEST) IronPort-SDR: fnyo4tuh/eqJ0k+FD5EnlLYDhqfj3Ic0uCYEhlIs/WbTp0I40EEcZxq1EAqgH6ZNmyO1jwnTbE VRQ8EO6O0EZQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2020 02:23:09 -0700 IronPort-SDR: Grx7lxTWexOmCOG5ka07ZR7qKS5E1cumpsAXHQSfQmCI3dE89Je4srb2IYqGoAdHUKxCZTX5LO CXQDwPTC1zyQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,386,1580803200"; d="scan'208";a="288496393" Received: from orsmsx109.amr.corp.intel.com ([10.22.240.7]) by fmsmga002.fm.intel.com with ESMTP; 15 Apr 2020 02:23:09 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX109.amr.corp.intel.com (10.22.240.7) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 15 Apr 2020 02:23:09 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 15 Apr 2020 02:23:08 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by orsmsx609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Wed, 15 Apr 2020 02:23:08 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.175) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 15 Apr 2020 02:23:08 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aC32poZ0LLROG3T0GA13ctQXT8YbdGElYWYadCmvAw9KjM7jXRtf2byJ4Sz9ZxL0mJ+UDTOB7LmxcPHdlAgd8PM5k+3Rgkd+vtCDoBrZLX95PAHnXZ5mpVlIZw9Ju8z7CBMqOZAwCeowB0VTJYNGGFo6DN48uuKKa4+WYQW4OYOilF+VhTM2h8A18pg/mKUxIah+fLR4rt3YbHlb90o6HcBzob7d9OEAyu2iABgFwxwGN+5x/ezIk3mrDraiB7jl4RaTi3PRT1gJwEnv+PVpIjzYP2daFKO6QwAf/4Epl5NS30uUQfsrSbREDCtL1gtiHeWoduUAVYixBJ0+syIHMA== 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=v7TuIWN+BOaK4VGtkYU0ZNWWKmNTCFB6lzGmV+XxA6I=; b=FZ1Xg2bI6m2Ne49kRf7e4E2PSjFqcTlZS8iYrMOjnnI+Di9syNkUtKvrMwlN8kTTY1tLvnkHVkEwzXNk50Nb4jkV10YIodedbTh6hHpFcqGv/IbQvTI10w2pc7ISf+BRYkbawNJZUa996tlxGFcur87wA2RvUEzy6twDF7hA/4qVkLe4YcysWPidtUgv3sdM4TZfNGHBYsr+5QgU2/XQn67efXJ4ioBRTFcxFxU2/zcjIIofQ2buhkR5lCCUWQPKgWCDJPFs5dX6p8B3P+xiybm9TO5GjcbcpkQwNH5FjHplPjWda/62cTHdnlcflhuAGVIpuLYN6u89FItYl5dP7w== 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=v7TuIWN+BOaK4VGtkYU0ZNWWKmNTCFB6lzGmV+XxA6I=; b=PaxJ/2zRwpAnAJLSbK9q9X958Dqra2RnPY3hpAAqWyw9BkX+kNNa9ih8HdPOfBbYbmQkVbT58uRcBMwtdS71CR0t5Rat1tM2yKjX168n+8GkQxwln+UlG9LbgWoyrUI7fy2UhodhspvS2ZEY4eKh651Crufzcrk6o6jrWD3v9Sg= Received: from BY5PR11MB3910.namprd11.prod.outlook.com (2603:10b6:a03:185::13) by BY5PR11MB4088.namprd11.prod.outlook.com (2603:10b6:a03:185::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.17; Wed, 15 Apr 2020 09:23:06 +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:23:06 +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: AQHWEka4ICLTCSOLdkqs7e8OzhTPOah56dVA Date: Wed, 15 Apr 2020 09:23:06 +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: e8172748-67e5-4066-6b04-08d7e11e9b70 x-ms-traffictypediagnostic: BY5PR11MB4088: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4714; 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)(136003)(366004)(396003)(376002)(39860400002)(346002)(26005)(52536014)(6862004)(4326008)(55016002)(33656002)(9686003)(71200400001)(2906002)(5660300002)(66476007)(66556008)(186003)(66446008)(66946007)(478600001)(76116006)(6506007)(86362001)(81156014)(8936002)(53546011)(8676002)(6636002)(7696005)(64756008)(316002); DIR:OUT; SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: T5HNwunDY0X8Gegg3LNUktgxR29GrgLdc8J3q1rcy4xGCxqRVC4Y1DEOHHWgZ8EdpocSBllosnhWY9EZURstOD0+tAbYJ96IpTvBFukGdjAiyT/43/dYuvYqfaZ0kigRqsrR1GASRzzzSKgrnBA3tXIBVpc2xceyuqCbBdbuF3J+FpDBarXGLxRg6/2LxUbzYtCa0JMZgSRUDlfOP6Nc8/brY3KfPBpZ2ahoBQioiWx6XktLkHr1aPAoMuCmzcZ3qDiSmoBtURk4HT9kC+W7lK113gf+E6OLvt6JDzgNZXCZVPvAVF1z6JX0lLasTBV3/58ND7GwB9n1qiUBUeUGYdFHJPLpR3omCouPkgFH6EiLZZfKsCOsYRCyDsqJ+KkwJbS3ueG+JO7FY8nmV8PlWBx66vN2t6uE+UDvtxpkFYyYMENiWWJMi4K7VT8riCvx x-ms-exchange-antispam-messagedata: R8+KgmNny5VwuWQLpWBf2bbrDEpFTWhRySqKauwFA+xQGeHPPCQG5hsZcTSyMFIzZTIftZuHhvCrYeERBdu7AJCwUj0LwVJMYbtKL6kkl4/QdvGPJS8pm6HLZRF7z1PWpDNoLrWL4tUCVJWmNiQSrw== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: e8172748-67e5-4066-6b04-08d7e11e9b70 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Apr 2020 09:23:06.8539 (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: hCeJK9MaDhbcX6XzgIUQwV7qo6CUYkmUxNjOgh9Htbjw3QSgj3psxVQ++up3BtI/KTE1gVV7PnEmkw3Mp+AottBY9EKmLWwS7bVi7LRO+Ak= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4088 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" One more thing: > -----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"); Pablo, please explain why did you use RTE_LOG here? All strings in this sou= rce code file are shown using printf. This is the only place with RTE_LOG c= all now. Adam