app/crypto-perf: return ENOTSUP for unsupported cases

Message ID 20230731035221.932405-1-gakhil@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series app/crypto-perf: return ENOTSUP for unsupported cases |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch-unit-testing success Testing PASS
ci/iol-unit-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-testing success Testing PASS

Commit Message

Akhil Goyal July 31, 2023, 3:52 a.m. UTC
  dpdk-test-crypto-perf application returns failure for all
the cases which are not supported by the device.

This patch captures rte_errno to check if the case run is
supported or not, if not supported, the application would
now return ENOTSUP which can be used in automation to
identify between failed and unsupported cases.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
---
 app/test-crypto-perf/main.c | 7 +++++++
 1 file changed, 7 insertions(+)
  

Comments

Hemant Agrawal July 31, 2023, 5:10 a.m. UTC | #1
> -----Original Message-----
> From: Akhil Goyal <gakhil@marvell.com>
> 
> dpdk-test-crypto-perf application returns failure for all the cases which are
> not supported by the device.
> 
> This patch captures rte_errno to check if the case run is supported or not, if
> not supported, the application would now return ENOTSUP which can be
> used in automation to identify between failed and unsupported cases.
> 
> Signed-off-by: Akhil Goyal <gakhil@marvell.com>
> ---
>  app/test-crypto-perf/main.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c index
> bc1f0f9659..6a2e5762a3 100644
> --- a/app/test-crypto-perf/main.c
> +++ b/app/test-crypto-perf/main.c
> @@ -9,6 +9,7 @@
>  #include <rte_malloc.h>
>  #include <rte_random.h>
>  #include <rte_eal.h>
> +#include <rte_errno.h>
>  #include <rte_cryptodev.h>
>  #ifdef RTE_CRYPTO_SCHEDULER
>  #include <rte_cryptodev_scheduler.h>
> @@ -560,6 +561,7 @@ main(int argc, char **argv)
> 
>  	int ret;
>  	uint32_t lcore_id;
> +	bool cap_unsupported = false;
> 
>  	/* Initialise DPDK EAL */
>  	ret = rte_eal_init(argc, argv);
> @@ -600,6 +602,7 @@ main(int argc, char **argv)
>  	if (ret) {
>  		RTE_LOG(ERR, USER1, "Crypto device type does not support
> "
>  				"capabilities requested\n");
> +		cap_unsupported = true;
>  		goto err;
>  	}
> 
> @@ -819,6 +822,10 @@ main(int argc, char **argv)
>  	rte_free(opts.imix_buffer_sizes);
>  	free_test_vector(t_vec, &opts);
> 
> +	if (rte_errno == ENOTSUP || cap_unsupported) {
> +		RTE_LOG(ERR, USER1, "Unsupported case: errno: %u\n",
> rte_errno);
> +		return -ENOTSUP;
> +	}
>  	printf("\n");
>  	return EXIT_FAILURE;
>  }
> --
> 2.25.1
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
  
Akhil Goyal Sept. 6, 2023, 8:26 a.m. UTC | #2
> > -----Original Message-----
> > From: Akhil Goyal <gakhil@marvell.com>
> >
> > dpdk-test-crypto-perf application returns failure for all the cases which are
> > not supported by the device.
> >
> > This patch captures rte_errno to check if the case run is supported or not, if
> > not supported, the application would now return ENOTSUP which can be
> > used in automation to identify between failed and unsupported cases.
> >
> > Signed-off-by: Akhil Goyal <gakhil@marvell.com>
> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Applied to dpdk-next-crypto
  

Patch

diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c
index bc1f0f9659..6a2e5762a3 100644
--- a/app/test-crypto-perf/main.c
+++ b/app/test-crypto-perf/main.c
@@ -9,6 +9,7 @@ 
 #include <rte_malloc.h>
 #include <rte_random.h>
 #include <rte_eal.h>
+#include <rte_errno.h>
 #include <rte_cryptodev.h>
 #ifdef RTE_CRYPTO_SCHEDULER
 #include <rte_cryptodev_scheduler.h>
@@ -560,6 +561,7 @@  main(int argc, char **argv)
 
 	int ret;
 	uint32_t lcore_id;
+	bool cap_unsupported = false;
 
 	/* Initialise DPDK EAL */
 	ret = rte_eal_init(argc, argv);
@@ -600,6 +602,7 @@  main(int argc, char **argv)
 	if (ret) {
 		RTE_LOG(ERR, USER1, "Crypto device type does not support "
 				"capabilities requested\n");
+		cap_unsupported = true;
 		goto err;
 	}
 
@@ -819,6 +822,10 @@  main(int argc, char **argv)
 	rte_free(opts.imix_buffer_sizes);
 	free_test_vector(t_vec, &opts);
 
+	if (rte_errno == ENOTSUP || cap_unsupported) {
+		RTE_LOG(ERR, USER1, "Unsupported case: errno: %u\n", rte_errno);
+		return -ENOTSUP;
+	}
 	printf("\n");
 	return EXIT_FAILURE;
 }