From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7CD41A2EDB for ; Fri, 6 Sep 2019 12:44:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 85A5C1F167; Fri, 6 Sep 2019 12:44:23 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 4863C1C07B for ; Fri, 6 Sep 2019 12:44:22 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id C022F1A02B9; Fri, 6 Sep 2019 12:44:21 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 8B5DE1A0216; Fri, 6 Sep 2019 12:44:19 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 61F93402B4; Fri, 6 Sep 2019 18:44:16 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org Cc: jerinj@marvell.com, abhinandan.gujjar@intel.com, Hemant Agrawal Date: Fri, 6 Sep 2019 16:12:28 +0530 Message-Id: <20190906104228.15271-1-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH] test/event_crypto: add check for session init failure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Mismatch in algo or sec capability can cause session to fail. This patch handle it and return error timely. Signed-off-by: Hemant Agrawal --- 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