DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] app/crypto-perf: return ENOTSUP for unsupported cases
@ 2023-07-31  3:52 Akhil Goyal
  2023-07-31  5:10 ` Hemant Agrawal
  0 siblings, 1 reply; 3+ messages in thread
From: Akhil Goyal @ 2023-07-31  3:52 UTC (permalink / raw)
  To: dev; +Cc: ciara.power, fanzhang.oss, anoobj, hemant.agrawal, Akhil Goyal

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] app/crypto-perf: return ENOTSUP for unsupported cases
  2023-07-31  3:52 [PATCH] app/crypto-perf: return ENOTSUP for unsupported cases Akhil Goyal
@ 2023-07-31  5:10 ` Hemant Agrawal
  2023-09-06  8:26   ` Akhil Goyal
  0 siblings, 1 reply; 3+ messages in thread
From: Hemant Agrawal @ 2023-07-31  5:10 UTC (permalink / raw)
  To: Akhil Goyal, dev; +Cc: ciara.power, fanzhang.oss, anoobj



> -----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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] app/crypto-perf: return ENOTSUP for unsupported cases
  2023-07-31  5:10 ` Hemant Agrawal
@ 2023-09-06  8:26   ` Akhil Goyal
  0 siblings, 0 replies; 3+ messages in thread
From: Akhil Goyal @ 2023-09-06  8:26 UTC (permalink / raw)
  To: Hemant Agrawal, dev; +Cc: ciara.power, fanzhang.oss, Anoob Joseph

> > -----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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-09-06  8:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-31  3:52 [PATCH] app/crypto-perf: return ENOTSUP for unsupported cases Akhil Goyal
2023-07-31  5:10 ` Hemant Agrawal
2023-09-06  8:26   ` Akhil Goyal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).