DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: dev@dpdk.org
Cc: jerinj@marvell.com, abhinandan.gujjar@intel.com,
	Hemant Agrawal <hemant.agrawal@nxp.com>
Subject: [dpdk-dev] [PATCH] test/event_crypto: add check for session init failure
Date: Fri,  6 Sep 2019 16:12:28 +0530	[thread overview]
Message-ID: <20190906104228.15271-1-hemant.agrawal@nxp.com> (raw)

Mismatch in algo or sec capability can cause session to fail.
This patch handle it and return error timely.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 app/test/test_event_crypto_adapter.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
index 73655020d..e7bf80978 100644
--- a/app/test/test_event_crypto_adapter.c
+++ b/app/test/test_event_crypto_adapter.c
@@ -199,8 +199,9 @@ test_op_forward_mode(uint8_t session_less)
 		TEST_ASSERT_NOT_NULL(sess, "Session creation failed\n");
 
 		/* Create Crypto session*/
-		rte_cryptodev_sym_session_init(TEST_CDEV_ID, sess,
+		ret = rte_cryptodev_sym_session_init(TEST_CDEV_ID, sess,
 				&cipher_xform, params.session_priv_mpool);
+		TEST_ASSERT_SUCCESS(ret, "Failed to init session\n");
 
 		ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
 							evdev, &cap);
@@ -398,8 +399,10 @@ test_op_new_mode(uint8_t session_less)
 			rte_cryptodev_sym_session_set_user_data(sess,
 						&m_data, sizeof(m_data));
 		}
-		rte_cryptodev_sym_session_init(TEST_CDEV_ID, sess,
+		ret = rte_cryptodev_sym_session_init(TEST_CDEV_ID, sess,
 				&cipher_xform, params.session_priv_mpool);
+		TEST_ASSERT_SUCCESS(ret, "Failed to init session\n");
+
 		rte_crypto_op_attach_sym_session(op, sess);
 	} else {
 		struct rte_crypto_sym_xform *first_xform;
-- 
2.17.1


             reply	other threads:[~2019-09-06 10:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-06 10:42 Hemant Agrawal [this message]
2019-09-12 15:08 ` Gujjar, Abhinandan S
2019-09-13 10:28   ` Jerin Jacob

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=20190906104228.15271-1-hemant.agrawal@nxp.com \
    --to=hemant.agrawal@nxp.com \
    --cc=abhinandan.gujjar@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    /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).