[v2,16/16] test/crypto: check if RAW API is supported

Message ID 20210628163434.77741-17-arkadiuszx.kusztal@intel.com (mailing list archive)
State Changes Requested, archived
Delegated to: akhil goyal
Headers
Series Add support for fourth generation of Intel QuickAssist Technology devices |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot success github build: passed
ci/Intel-compilation success Compilation OK
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-mellanox-Functional fail Functional Testing issues
ci/iol-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-intel-Performance fail Performance Testing issues

Commit Message

Arkadiusz Kusztal June 28, 2021, 4:34 p.m. UTC
  From: Adam Dybkowski <adamx.dybkowski@intel.com>

This patch adds checking if RAW API is supported at the start
of the test command "cryptodev_qat_raw_api_autotest".

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
---
 app/test/test_cryptodev.c | 34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)
  

Comments

Fan Zhang June 29, 2021, 12:24 p.m. UTC | #1
> -----Original Message-----
> From: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>
> Sent: Monday, June 28, 2021 5:35 PM
> To: dev@dpdk.org
> Cc: gakhil@marvell.com; Trahe, Fiona <fiona.trahe@intel.com>; Zhang, Roy
> Fan <roy.fan.zhang@intel.com>; Dybkowski, AdamX
> <adamx.dybkowski@intel.com>
> Subject: [PATCH v2 16/16] test/crypto: check if RAW API is supported
> 
> From: Adam Dybkowski <adamx.dybkowski@intel.com>

Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
  
Akhil Goyal July 16, 2021, 6:06 p.m. UTC | #2
> ----------------------------------------------------------------------
> From: Adam Dybkowski <adamx.dybkowski@intel.com>
> 
> This patch adds checking if RAW API is supported at the start
> of the test command "cryptodev_qat_raw_api_autotest".
> 
> Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
> ---
>  app/test/test_cryptodev.c | 34 +++++++++++++++++++++++++++++++++-
>  1 file changed, 33 insertions(+), 1 deletion(-)
> 

Rebase the patch for the latest changes in test_cryptodev.c

Skipped this patch from the patchset. All others applied
  
Dybkowski, AdamX July 19, 2021, 12:39 p.m. UTC | #3
Hi.

Rebased patch sent as http://patches.dpdk.org/project/dpdk/patch/20210719123718.15960-1-adamx.dybkowski@intel.com/
Please mark v2 [16/16] as superseded.
Thanks.

Adam Dybkowski

> -----Original Message-----
> From: Akhil Goyal <gakhil@marvell.com>
> Sent: Friday, 16 July, 2021 20:06
> To: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>; dev@dpdk.org
> Cc: Trahe, Fiona <fiona.trahe@intel.com>; Zhang, Roy Fan
> <roy.fan.zhang@intel.com>; Dybkowski, AdamX
> <adamx.dybkowski@intel.com>
> Subject: RE: [EXT] [PATCH v2 16/16] test/crypto: check if RAW API is
> supported
> 
> > ----------------------------------------------------------------------
> > From: Adam Dybkowski <adamx.dybkowski@intel.com>
> >
> > This patch adds checking if RAW API is supported at the start of the
> > test command "cryptodev_qat_raw_api_autotest".
> >
> > Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
> > ---
> >  app/test/test_cryptodev.c | 34
> +++++++++++++++++++++++++++++++++-
> >  1 file changed, 33 insertions(+), 1 deletion(-)
> >
> 
> Rebase the patch for the latest changes in test_cryptodev.c
> 
> Skipped this patch from the patchset. All others applied
  

Patch

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 39db52b17a..64b6cc0db7 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -14769,7 +14769,39 @@  test_cryptodev_bcmfs(void)
 static int
 test_cryptodev_qat_raw_api(void /*argv __rte_unused, int argc __rte_unused*/)
 {
-	int ret;
+	static const char *pmd_name = RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD);
+	struct rte_cryptodev_info dev_info;
+	uint8_t i, nb_devs, found = 0;
+	int driver_id, ret;
+
+	driver_id = rte_cryptodev_driver_id_get(pmd_name);
+	if (driver_id == -1) {
+		RTE_LOG(WARNING, USER1, "%s PMD must be loaded.\n", pmd_name);
+		return TEST_SKIPPED;
+	}
+
+	nb_devs = rte_cryptodev_count();
+	if (nb_devs < 1) {
+		RTE_LOG(WARNING, USER1, "No crypto devices found?\n");
+		return TEST_SKIPPED;
+	}
+
+	for (i = 0; i < nb_devs; i++) {
+		rte_cryptodev_info_get(i, &dev_info);
+		if (dev_info.driver_id == driver_id) {
+			if (!(dev_info.feature_flags &
+					RTE_CRYPTODEV_FF_SYM_RAW_DP)) {
+				RTE_LOG(INFO, USER1, "RAW API not supported\n");
+				return TEST_SKIPPED;
+			}
+			found = 1;
+			break;
+		}
+	}
+	if (!found) {
+		RTE_LOG(INFO, USER1, "RAW API not supported\n");
+		return TEST_SKIPPED;
+	}
 
 	global_api_test_type = CRYPTODEV_RAW_API_TEST;
 	ret = run_cryptodev_testsuite(RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD));