From: Hemant Agrawal Date: Fri, 6 Sep 2019 10:42:28 +0000 (+0530) Subject: test/event_crypto: check session init failure X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=083a59695e14930a340be31766d50b1621dc7046;p=dpdk.git test/event_crypto: check session init failure Mismatch in algo or sec capability can cause session to fail. This patch handle it and return error timely. Signed-off-by: Hemant Agrawal Acked-by: Abhinandan Gujjar --- diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c index 73655020df..e7bf809783 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;