From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 7E3A91B427 for ; Wed, 6 Feb 2019 12:16:46 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x16BEniS006061; Wed, 6 Feb 2019 03:16:45 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=MZfgY418b/bBiPw+KYMMRJuzswyoKPs/MZW44nIcZVs=; b=hfs3JuHaJSgyQ4G6IwA5e6eptQRjkTSi7nNuuUb9uc6xOyP7rtCJOQYsDYwf+UFeV8k1 swusjch9YXyoWJJ2qnaZtRIvzHR0ll/DGIu6to6kYDhnMrnEK+2jwikk49a23FMmobPw lms/qxU/F2PQ8rwCO+LOEiPPzKNIpajYUp8YAkLJVWpBr1yh9JA4VZvdVQTy/qpxEAr6 zh2pVj86XjEyWeKUU+9YUYf/Lk5CklL/Z/FxRKp6+Oryc2dFACrBlwkcRD/Tl369WfYg F+4ARDBfnM5rf6s67tpL9RjTo7FMQtNXpBO9ZqhVLjLcdKVEKljYAFowA1hd6/SrqkLM Ew== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2qfc2aup06-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 06 Feb 2019 03:16:45 -0800 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 6 Feb 2019 03:16:44 -0800 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (104.47.46.57) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Wed, 6 Feb 2019 03:16:44 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MZfgY418b/bBiPw+KYMMRJuzswyoKPs/MZW44nIcZVs=; b=eaoq15PkmOXnteFv6YqASP85j7AkKrdPNqfU5iSOC2kWoFpu897VAgLmz0Bdd3o44g8ooOxNMCSbHNSJd19JA4Mk+PsiA4NFEc8MIFMTYR6wxXJ5FbeDoIDONEGsI1t5Cdett/b88QWSL6OYCfIO7rQoj9596v4vLrn2X2KcFD8= Received: from DM6PR18MB2908.namprd18.prod.outlook.com (20.179.50.12) by DM6PR18MB2378.namprd18.prod.outlook.com (20.179.71.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.19; Wed, 6 Feb 2019 11:16:42 +0000 Received: from DM6PR18MB2908.namprd18.prod.outlook.com ([fe80::d176:5cef:c5d7:b9ae]) by DM6PR18MB2908.namprd18.prod.outlook.com ([fe80::d176:5cef:c5d7:b9ae%5]) with mapi id 15.20.1601.016; Wed, 6 Feb 2019 11:16:42 +0000 From: Ayuj Verma To: "pablo.de.lara.guarch@intel.com" CC: "fiona.trahe@intel.com" , "dev@dpdk.org" , Shally Verma , Sunila Sahu , Kanaka Durga Kotamarthy , Arvind Desai , Ayuj Verma Thread-Topic: [PATCH 3/3] test/crypto: check for rsa capa for op-type Thread-Index: AQHUvg1wd5JBRiSagEix4TvHq8jnwQ== Date: Wed, 6 Feb 2019 11:16:42 +0000 Message-ID: <20190206111405.30860-4-ayverma@marvell.com> References: <20190206111405.30860-1-ayverma@marvell.com> In-Reply-To: <20190206111405.30860-1-ayverma@marvell.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BMXPR01CA0030.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:c::16) To DM6PR18MB2908.namprd18.prod.outlook.com (2603:10b6:5:168::12) x-mailer: git-send-email 2.20.0 x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [111.93.218.67] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM6PR18MB2378; 20:nMwcpnXxZszZ0bOuTIIcOPgmN7Ko1fU9X22VV6XA4Nhf63oepEw7x3NoMdnMtGvhhPj/yWE9z3RHKX9//h1B+yWTwgSLzD7TAl/GjUtDFUM1z0PpblM6/xSG5FAYBnMZiLRN55V+hm1gZFOhLFS2Bk8eN3YGSSLuVo165lvwy6Y= x-ms-office365-filtering-correlation-id: 3a69c7e4-b54f-4ac4-e10f-08d68c249293 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020); SRVR:DM6PR18MB2378; x-ms-traffictypediagnostic: DM6PR18MB2378: x-microsoft-antispam-prvs: x-forefront-prvs: 0940A19703 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(39860400002)(396003)(136003)(366004)(189003)(199004)(4326008)(106356001)(97736004)(81166006)(81156014)(105586002)(14444005)(8676002)(14454004)(53936002)(1076003)(316002)(102836004)(76176011)(186003)(478600001)(2906002)(66066001)(25786009)(50226002)(68736007)(486006)(8936002)(78486014)(2501003)(26005)(5640700003)(86362001)(99286004)(6486002)(52116002)(6512007)(54906003)(6436002)(2616005)(446003)(2351001)(476003)(6506007)(6916009)(386003)(7736002)(71190400001)(71200400001)(305945005)(256004)(107886003)(3846002)(6116002)(36756003)(11346002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR18MB2378; H:DM6PR18MB2908.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: rNA444bGf77pgvJJedKWiYSwYoxclOZfyhxaA/cUaCG7nDJeLLOJBC47yidf9RgrPeVqFv6nBZ01QI/a3USxBaFYUjTSL8e0O5uHTHmyOqv01r5hQ09wpizCwCzLCzNJvqI2y2PphdaHWzSHwZW7bX1PTNXpUSZRHWdqfnoPbmK5ZhTBa/f93/cKILcfavD1FLpJkx4I7KIjc7yGWBddeDYv0aSIl+dL1yGZpfNf7vsi6H2O/PXGfnC/d+Bnr/BqpMWZxRxgELksukom+PYdsaR5Pv4di8aJkNXQJ6655BznU1G/TKIcB6VIvCfxdfgERkyTaoW5cFJ2Aw9kUa7A155Hv5GQweCvGKo83wBUxo3W7IVrOkmqbh5lecf3czKTvSKDyv/zBOliUijBrDQ0z5YKjGXgKhlhrwIFbiV8alo= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 3a69c7e4-b54f-4ac4-e10f-08d68c249293 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Feb 2019 11:16:39.9020 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR18MB2378 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-02-06_07:, , signatures=0 X-Proofpoint-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902060090 Subject: [dpdk-dev] [PATCH 3/3] test/crypto: check for rsa capa for op-type 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: Wed, 06 Feb 2019 11:16:46 -0000 Add a rsa xform capability check in test functions, to check for supported sign and decrypt op_types Signed-off-by: Ayuj Verma Signed-off-by: Shally Verma --- test/test/test_cryptodev_asym.c | 47 +++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/test/test/test_cryptodev_asym.c b/test/test/test_cryptodev_asy= m.c index 0f6fc5767..ae1c76db7 100644 --- a/test/test/test_cryptodev_asym.c +++ b/test/test/test_cryptodev_asym.c @@ -52,10 +52,33 @@ test_rsa_sign_verify(void) struct rte_crypto_asym_op *asym_op =3D NULL; struct rte_crypto_op *op =3D NULL, *result_op =3D NULL; struct rte_cryptodev_asym_session *sess =3D NULL; + struct rte_cryptodev_asym_capability_idx cap_idx; + const struct rte_cryptodev_asymmetric_xform_capability *capability; int status =3D TEST_SUCCESS; uint8_t output_buf[TEST_DATA_SIZE] =3D {0}; uint8_t input_buf[TEST_DATA_SIZE] =3D {0}; =20 + /* check for RSA capability */ + cap_idx.type =3D RTE_CRYPTO_ASYM_XFORM_RSA; + capability =3D rte_cryptodev_asym_capability_get(dev_id, &cap_idx); + + if (!capability) { + RTE_LOG(ERR, USER1, + "RSA xform not supported\n"); + return TEST_SKIPPED; + } + + /* test case supports non-crt sign op only, + * so check for it in capability + */ + if (!rte_cryptodev_asym_xform_capability_check_optype( + capability, RTE_CRYPTO_ASYM_OP_SIGN)) { + RTE_LOG(ERR, USER1, + "non-crt mode RTE_CRYPTO_ASYM_OP_SIGN " + "not supported\n"); + return TEST_SKIPPED; + } + sess =3D rte_cryptodev_asym_session_create(sess_mpool); =20 if (!sess) { @@ -186,9 +209,33 @@ test_rsa_enc_dec(void) struct rte_crypto_asym_op *asym_op =3D NULL; struct rte_crypto_op *op =3D NULL, *result_op =3D NULL; struct rte_cryptodev_asym_session *sess =3D NULL; + struct rte_cryptodev_asym_capability_idx cap_idx; + const struct rte_cryptodev_asymmetric_xform_capability *capability; int status =3D TEST_SUCCESS; uint8_t input_buf[TEST_DATA_SIZE] =3D {0}; =20 + /* check for RSA capability */ + cap_idx.type =3D RTE_CRYPTO_ASYM_XFORM_RSA; + capability =3D rte_cryptodev_asym_capability_get(dev_id, &cap_idx); + + if (!capability) { + RTE_LOG(ERR, USER1, + "RSA xform not supported\n"); + return TEST_SKIPPED; + } + + /* test case supports non-crt decrypt op only, + * so check for it in capability + */ + if (!rte_cryptodev_asym_xform_capability_check_optype( + capability, RTE_CRYPTO_ASYM_OP_DECRYPT)) { + RTE_LOG(ERR, USER1, + "non-crt mode RTE_CRYPTO_ASYM_OP_DECRYPT " + "not supported\n"); + return TEST_SKIPPED; + } + + sess =3D rte_cryptodev_asym_session_create(sess_mpool); =20 if (!sess) { --=20 2.20.0