DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ankur Dwivedi <adwivedi@marvell.com>
To: <dev@dpdk.org>
Cc: <anoobj@marvell.com>, Ankur Dwivedi <adwivedi@marvell.com>
Subject: [dpdk-dev] [PATCH] app/test: handle -ENOTSUP from session init
Date: Mon, 4 May 2020 18:10:47 +0530	[thread overview]
Message-ID: <1588596047-14965-1-git-send-email-adwivedi@marvell.com> (raw)

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


             reply	other threads:[~2020-05-04 12:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-04 12:40 Ankur Dwivedi [this message]
2020-05-04 13:05 ` Anoob Joseph
2020-05-07 15:26 ` Ankur Dwivedi
2020-05-09 22:09   ` Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1588596047-14965-1-git-send-email-adwivedi@marvell.com \
    --to=adwivedi@marvell.com \
    --cc=anoobj@marvell.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).