DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/test: handle -ENOTSUP from session init
@ 2020-05-04 12:40 Ankur Dwivedi
  2020-05-04 13:05 ` Anoob Joseph
  2020-05-07 15:26 ` Ankur Dwivedi
  0 siblings, 2 replies; 4+ messages in thread
From: Ankur Dwivedi @ 2020-05-04 12:40 UTC (permalink / raw)
  To: dev; +Cc: anoobj, Ankur Dwivedi

The session init routine rte_cryptodev_sym_session_init(),
could return -ENOTSUP when the requested algo combination
is not supported by the PMD. This should be treated as
unsupported features. For other return values like -EINVAL
or -ENOMEM the test can be treated as failure.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
---
 app/test/test_cryptodev_blockcipher.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/app/test/test_cryptodev_blockcipher.c b/app/test/test_cryptodev_blockcipher.c
index 473dad9..5717194 100644
--- a/app/test/test_cryptodev_blockcipher.c
+++ b/app/test/test_cryptodev_blockcipher.c
@@ -427,9 +427,11 @@
 			nb_iterates == 0) {
 		sess = rte_cryptodev_sym_session_create(sess_mpool);
 
-		rte_cryptodev_sym_session_init(dev_id, sess, init_xform,
-				sess_priv_mpool);
-		if (!sess) {
+		status = rte_cryptodev_sym_session_init(dev_id, sess,
+				init_xform, sess_priv_mpool);
+		if (status == -ENOTSUP)
+			goto error_exit;
+		if (!sess || status < 0) {
 			snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "line %u "
 				"FAILED: %s", __LINE__,
 				"Session creation failed");
-- 
1.9.3


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

* Re: [dpdk-dev] [PATCH] app/test: handle -ENOTSUP from session init
  2020-05-04 12:40 [dpdk-dev] [PATCH] app/test: handle -ENOTSUP from session init Ankur Dwivedi
@ 2020-05-04 13:05 ` Anoob Joseph
  2020-05-07 15:26 ` Ankur Dwivedi
  1 sibling, 0 replies; 4+ messages in thread
From: Anoob Joseph @ 2020-05-04 13:05 UTC (permalink / raw)
  To: Ankur Dwivedi, dev; +Cc: Akhil Goyal, declan.doherty, De Lara Guarch, Pablo

> The session init routine rte_cryptodev_sym_session_init(), could return -
> ENOTSUP when the requested algo combination is not supported by the PMD.
> This should be treated as unsupported features. For other return values like -
> EINVAL or -ENOMEM the test can be treated as failure.
> 
> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>

Acked-by: Anoob Joseph <anoobj@marvell.com> 

> ---
>  app/test/test_cryptodev_blockcipher.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/app/test/test_cryptodev_blockcipher.c
> b/app/test/test_cryptodev_blockcipher.c
> index 473dad9..5717194 100644
> --- a/app/test/test_cryptodev_blockcipher.c
> +++ b/app/test/test_cryptodev_blockcipher.c
> @@ -427,9 +427,11 @@
>  			nb_iterates == 0) {
>  		sess = rte_cryptodev_sym_session_create(sess_mpool);
> 
> -		rte_cryptodev_sym_session_init(dev_id, sess, init_xform,
> -				sess_priv_mpool);
> -		if (!sess) {
> +		status = rte_cryptodev_sym_session_init(dev_id, sess,
> +				init_xform, sess_priv_mpool);
> +		if (status == -ENOTSUP)
> +			goto error_exit;
> +		if (!sess || status < 0) {
>  			snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "line
> %u "
>  				"FAILED: %s", __LINE__,
>  				"Session creation failed");
> --
> 1.9.3


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

* [dpdk-dev] [PATCH] app/test: handle -ENOTSUP from session init
  2020-05-04 12:40 [dpdk-dev] [PATCH] app/test: handle -ENOTSUP from session init Ankur Dwivedi
  2020-05-04 13:05 ` Anoob Joseph
@ 2020-05-07 15:26 ` Ankur Dwivedi
  2020-05-09 22:09   ` Akhil Goyal
  1 sibling, 1 reply; 4+ messages in thread
From: Ankur Dwivedi @ 2020-05-07 15:26 UTC (permalink / raw)
  To: dev
  Cc: declan.doherty, pablo.de.lara.guarch, akhil.goyal, anoobj, Ankur Dwivedi

The session init routine rte_cryptodev_sym_session_init(),
could return -ENOTSUP when the requested algo combination
is not supported by the PMD. This should be treated as
unsupported features. For other return values like -EINVAL
or -ENOMEM the test can be treated as failure.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>

Acked-by: Anoob Joseph <anoobj@marvell.com>
---
v2:
* Updated test_msg to print UNSUPPORTED for the test case.

 app/test/test_cryptodev_blockcipher.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/app/test/test_cryptodev_blockcipher.c b/app/test/test_cryptodev_blockcipher.c
index 473dad9..3ea1175 100644
--- a/app/test/test_cryptodev_blockcipher.c
+++ b/app/test/test_cryptodev_blockcipher.c
@@ -427,9 +427,13 @@
 			nb_iterates == 0) {
 		sess = rte_cryptodev_sym_session_create(sess_mpool);
 
-		rte_cryptodev_sym_session_init(dev_id, sess, init_xform,
-				sess_priv_mpool);
-		if (!sess) {
+		status = rte_cryptodev_sym_session_init(dev_id, sess,
+				init_xform, sess_priv_mpool);
+		if (status == -ENOTSUP) {
+			snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "UNSUPPORTED");
+			goto error_exit;
+		}
+		if (!sess || status < 0) {
 			snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "line %u "
 				"FAILED: %s", __LINE__,
 				"Session creation failed");
-- 
1.9.3


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

* Re: [dpdk-dev] [PATCH] app/test: handle -ENOTSUP from session init
  2020-05-07 15:26 ` Ankur Dwivedi
@ 2020-05-09 22:09   ` Akhil Goyal
  0 siblings, 0 replies; 4+ messages in thread
From: Akhil Goyal @ 2020-05-09 22:09 UTC (permalink / raw)
  To: Ankur Dwivedi, dev; +Cc: declan.doherty, pablo.de.lara.guarch, anoobj

> The session init routine rte_cryptodev_sym_session_init(),
> could return -ENOTSUP when the requested algo combination
> is not supported by the PMD. This should be treated as
> unsupported features. For other return values like -EINVAL
> or -ENOMEM the test can be treated as failure.
> 
> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
> 
> Acked-by: Anoob Joseph <anoobj@marvell.com>

Applied to dpdk-next-crypto

Thanks.

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

end of thread, other threads:[~2020-05-09 22:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-04 12:40 [dpdk-dev] [PATCH] app/test: handle -ENOTSUP from session init Ankur Dwivedi
2020-05-04 13:05 ` Anoob Joseph
2020-05-07 15:26 ` Ankur Dwivedi
2020-05-09 22:09   ` 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).