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 0639BA0350; Thu, 7 May 2020 17:26:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1BA021DAE4; Thu, 7 May 2020 17:26:46 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id EA4401DADE for ; Thu, 7 May 2020 17:26:44 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 047FPKnm008372; Thu, 7 May 2020 08:26:44 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0818; bh=TlVmdGX3A52kOEFh9vww6ds0mKNV2AFrSFO4bPqyWOc=; b=cau/sjK8uZW1hgcfX5iavPbaJMj3o9QahkXQMKJDosb+TOR21L4Hb5wmgbDW3G/yf1Lz VDRVJjEL47asouAPceoYpCI40jL4qerwGjpM0U294QItHNVKGeL89EBjJs9uhdvAQLde jJsP24q5XM1kVb0YHCO1QBTqoi3R4u6aaGepQDciNk5vijrTNeNyHJu+NBm2TdyEFByn 92LyIo2VN3OjHrtAJwbXtwBKaHwcStmklyzTI1LpSdaSjU8uBLdcA2sHln6IUoFALkDQ 4aGLc+YKJhOSlG65RPr0hzNJteFzFGL+PEr6V5g3p5WppHuv6WjM5aMaeeMPEyrNRdHP gQ== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 30urytxy0v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 07 May 2020 08:26:44 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 7 May 2020 08:26:41 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 7 May 2020 08:26:42 -0700 Received: from hyd1349.t110.caveonetworks.com (unknown [10.29.45.13]) by maili.marvell.com (Postfix) with ESMTP id EA97D3F7040; Thu, 7 May 2020 08:26:39 -0700 (PDT) From: Ankur Dwivedi To: CC: , , , , Ankur Dwivedi Date: Thu, 7 May 2020 20:56:10 +0530 Message-ID: <1588865170-965-1-git-send-email-adwivedi@marvell.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1588596047-14965-1-git-send-email-adwivedi@marvell.com> References: <1588596047-14965-1-git-send-email-adwivedi@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-07_09:2020-05-07, 2020-05-07 signatures=0 Subject: [dpdk-dev] [PATCH] app/test: handle -ENOTSUP from session init 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" The session init routine rte_cryptodev_sym_session_init(), could return -ENOTSUP when the requested algo combination is not supported by the PMD. This should be treated as unsupported features. For other return values like -EINVAL or -ENOMEM the test can be treated as failure. Signed-off-by: Ankur Dwivedi Acked-by: Anoob Joseph --- v2: * Updated test_msg to print UNSUPPORTED for the test case. app/test/test_cryptodev_blockcipher.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/test/test_cryptodev_blockcipher.c b/app/test/test_cryptodev_blockcipher.c index 473dad9..3ea1175 100644 --- a/app/test/test_cryptodev_blockcipher.c +++ b/app/test/test_cryptodev_blockcipher.c @@ -427,9 +427,13 @@ nb_iterates == 0) { sess = rte_cryptodev_sym_session_create(sess_mpool); - rte_cryptodev_sym_session_init(dev_id, sess, init_xform, - sess_priv_mpool); - if (!sess) { + status = rte_cryptodev_sym_session_init(dev_id, sess, + init_xform, sess_priv_mpool); + if (status == -ENOTSUP) { + snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "UNSUPPORTED"); + goto error_exit; + } + if (!sess || status < 0) { snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "line %u " "FAILED: %s", __LINE__, "Session creation failed"); -- 1.9.3