From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 655C546010; Tue, 7 Jan 2025 18:38:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4624540150; Tue, 7 Jan 2025 18:38:49 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 5EDE64014F for ; Tue, 7 Jan 2025 18:38:47 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 507HEfMu031544; Tue, 7 Jan 2025 09:38:46 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=pfpt0220; bh=oI+qugBGbK5524UTC7nSDzT FIAsfBFFcTpEDAbg7bDQ=; b=bHf9DwFY+tUI09CWxyFTABEH77jCbcbe501DG4c bBw0Z6UY9tPHv/0Z8LQ99kswDFNkLt7ao5lJI0Z/Xs+Pu0W03wKOT9cD3zi+YCXQ gquPpRdibXrk+hvnq2Qr94uZRrkzm6te0UzdvOzjDP4KQviZYgPnkl2b8ARPiIK+ /WuRW648rivqRqAfDg12vGMSqS7Dq9SI1ylGb2NYYnmUpZ9WqFtmFZd35Rx3YGIA PsW5qGI7LPP0T3/+Dq0lBDAX6jgdMcqhRkKlS6/DNLAzkyvV5FKNdYJTTd0sMBOT VLFtaUddNt5s+2MtRPc2Lk0FMDpC4An/nQsy12Kr1RruSyQ== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 4418gc81ra-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Jan 2025 09:38:46 -0800 (PST) Received: from DC6WP-EXCH02.marvell.com (10.76.176.209) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 7 Jan 2025 09:38:45 -0800 Received: from maili.marvell.com (10.69.176.80) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 7 Jan 2025 09:38:45 -0800 Received: from IN-lckQE5Rwctls.marvell.com (IN-lckQE5Rwctls.marvell.com [10.28.163.68]) by maili.marvell.com (Postfix) with ESMTP id B732F3F703F; Tue, 7 Jan 2025 09:38:36 -0800 (PST) From: Gowrishankar Muthukrishnan To: , Akhil Goyal , Maxime Coquelin , Chenbo Xia , Fan Zhang , Jay Zhou CC: , , Gowrishankar Muthukrishnan Subject: [PATCH] test/crypto: check for RSA capability Date: Tue, 7 Jan 2025 23:08:30 +0530 Message-ID: <20250107173833.1860-1-gmuthukrishn@marvell.com> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: o-VoHBSqz6XpXTuMEEtb7fWwu_Vkz9gh X-Proofpoint-GUID: o-VoHBSqz6XpXTuMEEtb7fWwu_Vkz9gh X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org In RSA crypto tests, check if it is supported by PMD before executing it. Signed-off-by: Gowrishankar Muthukrishnan --- app/test/test_cryptodev_asym.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c index e2f74702ad..364e81ecd9 100644 --- a/app/test/test_cryptodev_asym.c +++ b/app/test/test_cryptodev_asym.c @@ -234,11 +234,17 @@ test_rsa_sign_verify(void) { struct crypto_testsuite_params_asym *ts_params = &testsuite_params; struct rte_mempool *sess_mpool = ts_params->session_mpool; + struct rte_cryptodev_asym_capability_idx idx; uint8_t dev_id = ts_params->valid_devs[0]; void *sess = NULL; struct rte_cryptodev_info dev_info; int ret, status = TEST_SUCCESS; + /* Check RSA capability */ + idx.type = RTE_CRYPTO_ASYM_XFORM_RSA; + if (rte_cryptodev_asym_capability_get(dev_id, &idx) == NULL) + return -ENOTSUP; + /* Test case supports op with exponent key only, * Check in PMD feature flag for RSA exponent key type support. */ @@ -274,11 +280,17 @@ test_rsa_enc_dec(void) { struct crypto_testsuite_params_asym *ts_params = &testsuite_params; struct rte_mempool *sess_mpool = ts_params->session_mpool; + struct rte_cryptodev_asym_capability_idx idx; uint8_t dev_id = ts_params->valid_devs[0]; void *sess = NULL; struct rte_cryptodev_info dev_info; int ret, status = TEST_SUCCESS; + /* Check RSA capability */ + idx.type = RTE_CRYPTO_ASYM_XFORM_RSA; + if (rte_cryptodev_asym_capability_get(dev_id, &idx) == NULL) + return -ENOTSUP; + /* Test case supports op with exponent key only, * Check in PMD feature flag for RSA exponent key type support. */ @@ -314,11 +326,17 @@ test_rsa_sign_verify_crt(void) { struct crypto_testsuite_params_asym *ts_params = &testsuite_params; struct rte_mempool *sess_mpool = ts_params->session_mpool; + struct rte_cryptodev_asym_capability_idx idx; uint8_t dev_id = ts_params->valid_devs[0]; void *sess = NULL; struct rte_cryptodev_info dev_info; int ret, status = TEST_SUCCESS; + /* Check RSA capability */ + idx.type = RTE_CRYPTO_ASYM_XFORM_RSA; + if (rte_cryptodev_asym_capability_get(dev_id, &idx) == NULL) + return -ENOTSUP; + /* Test case supports op with quintuple format key only, * Check im PMD feature flag for RSA quintuple key type support. */ @@ -354,11 +372,17 @@ test_rsa_enc_dec_crt(void) { struct crypto_testsuite_params_asym *ts_params = &testsuite_params; struct rte_mempool *sess_mpool = ts_params->session_mpool; + struct rte_cryptodev_asym_capability_idx idx; uint8_t dev_id = ts_params->valid_devs[0]; void *sess = NULL; struct rte_cryptodev_info dev_info; int ret, status = TEST_SUCCESS; + /* Check RSA capability */ + idx.type = RTE_CRYPTO_ASYM_XFORM_RSA; + if (rte_cryptodev_asym_capability_get(dev_id, &idx) == NULL) + return -ENOTSUP; + /* Test case supports op with quintuple format key only, * Check in PMD feature flag for RSA quintuple key type support. */ -- 2.25.1