From patchwork Fri Sep 6 10:42:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 173216 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp535526ilq; Fri, 6 Sep 2019 03:44:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3zcOiouRLdEm4Q+ATHrMviMkz23Azf49KDnoDWxjRQ/M8ycqxyBZX6x7gJyyOBWoSnwPS X-Received: by 2002:a17:907:2102:: with SMTP id qn2mr6820432ejb.266.1567766665085; Fri, 06 Sep 2019 03:44:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567766665; cv=none; d=google.com; s=arc-20160816; b=nzkXoqgOru5NgcDH25oMKGhRNaLK/DFo3/TrmEdhhWqI3toAJTD+OaSJcpmoWUZdk7 I3zhKwbrijSbC8eacsvU8vj/smoJFWUfxhR+71jbgo5q3ctVS/E5eRBhvmwphhbTVUc9 PS2HAMn1Ci7+EW7SMGHzGA4BQ+1JcwpV24ulvUCuVApm1VWbgDAU7DEJfJaaIh2xdaM5 JWc4lZVEENCKvR6NyOkhH8FCGC8sNBY3sT0k/HW9yMws6AQq3/yK9HcQ6YnTxRXdrsxl z5iYkAmlaCqO5lydU/eWZ3XbE9DaF355qXYvueRlCahzBmRIbi8+750DHZgEvHDXcJiq tV5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:date:cc:to :from; bh=8WIUU3Htfny16oZvXl/s5CXMk5JCMctNE2F8lPdK7co=; b=MNfmH2VLluazC1FWlhSYmaENn9AvgKHd7+W31Opcex37Xy6uVm8pm7bDqJyHYDn95U I6YlIImyA4jHGeteJJ//7Wnu9MIDZ5vxw9GYTReH5lTdveJK/yA3GTuRZzmVmM5f/l1g 685zdySNOH+wnTODrHHzC9Zfg6VD1mCgMwdg/pi1ACRs5EO/LdWxugfOyQv5apBGEiP0 p9OQj8O2C0vL9TNFrH3ZF9obD3cm0Ff4NtHkOq+z2z/vhA5etVw9AL65+y79hIpeCZQp AjMUt8rgBZYbUMj/3i71Qd9kHnLP2SfsXgq+29bUPjnHo1JhP5botMHqresmIdxw2mmc 9/GA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id b35si2893107edb.204.2019.09.06.03.44.24; Fri, 06 Sep 2019 03:44:25 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com 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(-) -- 2.17.1 Acked-by: abhinandan.gujjar@intel.com 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;