summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHemant Agrawal <hemant.agrawal@nxp.com>2019-09-06 16:12:28 +0530
committerJerin Jacob <jerinj@marvell.com>2019-09-13 15:56:27 +0530
commit0e0cf78152445ad245c3957b5eaa1afaf74a8104 (patch)
tree504a7e9d6f9d6984877078330ca87a98fa47fce6
parent272236741258632b3c0177ec0cf09f4a50b737fb (diff)
downloaddpdk-next-eventdev-master.zip
dpdk-next-eventdev-master.tar.gz
dpdk-next-eventdev-master.tar.xz
test/event_crypto: add check for session init failureHEADmaster
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> Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
-rw-r--r--app/test/test_event_crypto_adapter.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
index 7365502..e7bf809 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;