From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ayuj Verma Subject: [PATCH v3 3/4] app/test: check for key type ff in asym unit test Date: Thu, 28 Mar 2019 10:28:40 +0000 Message-ID: <1553768834-19072-4-git-send-email-ayverma@marvell.com> References: <1553768834-19072-1-git-send-email-ayverma@marvell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: "arkadiuszx.kusztal@intel.com" , "Shally Verma" , Sunila Sahu , "Kanaka Durga Kotamarthy" , Arvind Desai , "dev@dpdk.org" , Ayuj Verma To: "akhil.goyal@nxp.com" Return-path: Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 773091B146 for ; Thu, 28 Mar 2019 11:28:44 +0100 (CET) In-Reply-To: <1553768834-19072-1-git-send-email-ayverma@marvell.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Ayuj Verma Signed-off-by: Shally Verma --- app/test/test_cryptodev_asym.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.= c index a779e8f..539eda1 100644 --- a/app/test/test_cryptodev_asym.c +++ b/app/test/test_cryptodev_asym.c @@ -49,6 +49,7 @@ struct crypto_unittest_params { struct rte_mempool *op_mpool =3D ts_params->op_mpool; struct rte_mempool *sess_mpool =3D ts_params->session_mpool; uint8_t dev_id =3D ts_params->valid_devs[0]; + struct rte_cryptodev_info dev_info; 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; @@ -56,6 +57,18 @@ struct crypto_unittest_params { uint8_t output_buf[TEST_DATA_SIZE] =3D {0}; uint8_t input_buf[TEST_DATA_SIZE] =3D {0}; =20 + /* test case supports op with exponent key only, + * Check in PMD feature flag for RSA exponent key type support. + */ + rte_cryptodev_info_get(dev_id, &dev_info); + if (!(dev_info.feature_flags & + RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_EXP)) { + RTE_LOG(INFO, USER1, + "Device doesn't support sign op with " + "exponent key type. Test Skipped\n"); + return TEST_SKIPPED; + } + sess =3D rte_cryptodev_asym_session_create(sess_mpool); =20 if (!sess) { @@ -183,12 +196,25 @@ struct crypto_unittest_params { struct rte_mempool *op_mpool =3D ts_params->op_mpool; struct rte_mempool *sess_mpool =3D ts_params->session_mpool; uint8_t dev_id =3D ts_params->valid_devs[0]; + struct rte_cryptodev_info dev_info; 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; int status =3D TEST_SUCCESS; uint8_t input_buf[TEST_DATA_SIZE] =3D {0}; =20 + /* test case supports op with exponent key only, + * Check in PMD feature flag for RSA exponent key type support. + */ + rte_cryptodev_info_get(dev_id, &dev_info); + if (!(dev_info.feature_flags & + RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_EXP)) { + RTE_LOG(INFO, USER1, + "Device doesn't support sign op with " + "exponent key type. Test Skipped\n"); + return TEST_SKIPPED; + } + sess =3D rte_cryptodev_asym_session_create(sess_mpool); =20 if (!sess) { --=20 1.8.3.1