From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id D2C8AA0096 for ; Thu, 9 May 2019 13:23:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9008737B7; Thu, 9 May 2019 13:23:33 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id C593A4CC7 for ; Thu, 9 May 2019 13:23:31 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x49BFMgv004446; Thu, 9 May 2019 04:23:31 -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=JastM7g8N+yKk4Kvk5+lwkn2WVo06nupNPxdypj3tAs=; b=cN0UdJN25r0o8kNWOA8XFdUepfzkstJyB7QosqjkqvP5bggWpdohjZG46agQ4bbwV/ny xDNcbSugaM6LryA3yCsOMAVveK6i8s/Cwuv1D7Jz/6Is64wPN7rQNcjXPoeqH6EGr28B 1YNrEb03xSLTX9gVEFcuTxci2qV6UgKf2CRAxwnPjNRduS6xLu7xWaqmLGjnNXeZYJbS zLTy0aYAGcnl8NlZHnRcHbDXtiY/WRcj2uinj5XpwgMuhYYo56kglaQ0ioorxGu2bV31 nP01yYLKYwjEYeS9ocQyWVt9KNuDUeLtTrydd52ViBunwuouBVeH5teVMr3oKSaz+mEr xw== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 2scadra7ju-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 09 May 2019 04:23:31 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 9 May 2019 04:23:29 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Thu, 9 May 2019 04:23:29 -0700 Received: from localhost.marvell.com (unknown [10.28.10.76]) by maili.marvell.com (Postfix) with ESMTP id 5999A3F703F; Thu, 9 May 2019 04:23:27 -0700 (PDT) From: Ayuj Verma To: , , CC: , , , , , Ayuj Verma Date: Thu, 9 May 2019 16:53:21 +0530 Message-ID: <1557401001-27203-2-git-send-email-ayverma@marvell.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1557401001-27203-1-git-send-email-ayverma@marvell.com> References: <1557401001-27203-1-git-send-email-ayverma@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-09_02:, , signatures=0 Subject: [dpdk-dev] [PATCH v4] app/test: replace TEST_SKIPPED with -ENOTSUP 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" Message-ID: <20190509112321._2zHYn-Cm5qqGPJ9_6y6MNRC1cxnGKzzF_NXmu6qNx8@z> Currently some tests return TEST_SKIPPED/-1 when tests or params are not supported for particular PMD because of which tests adds to FAILED test counter in place of Skipped/Unsupported counter. Since unsupported test is not a failure case, replace return value TEST_SKIPPED/-1 with -ENOTSUP - Return -ENOTSUP for unsupported tests - add NULL check for rte_cryptodev_asym_capability_get() - Typo correction Signed-off-by: Ayuj Verma Signed-off-by: Shally Verma --- app/test/test_cryptodev_asym.c | 45 ++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c index d2efce9..fc92d3d 100644 --- a/app/test/test_cryptodev_asym.c +++ b/app/test/test_cryptodev_asym.c @@ -119,6 +119,18 @@ struct test_cases_array { int status = TEST_SUCCESS; + xform_tc.next = NULL; + xform_tc.xform_type = data_tc->modex.xform_type; + + cap_idx.type = xform_tc.xform_type; + capability = rte_cryptodev_asym_capability_get(dev_id, &cap_idx); + + if (capability == NULL) { + RTE_LOG(INFO, USER1, + "Device doesn't support MODEX. Test Skipped\n"); + return -ENOTSUP; + } + /* Generate crypto op data structure */ op = rte_crypto_op_alloc(ts_params->op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC); @@ -133,11 +145,6 @@ struct test_cases_array { } asym_op = op->asym; - xform_tc.next = NULL; - xform_tc.xform_type = data_tc->modex.xform_type; - - cap_idx.type = xform_tc.xform_type; - capability = rte_cryptodev_asym_capability_get(dev_id, &cap_idx); switch (xform_tc.xform_type) { case RTE_CRYPTO_ASYM_XFORM_MODEX: @@ -352,7 +359,7 @@ struct test_cases_array { RTE_LOG(INFO, USER1, "Device doesn't support sign op with " "exponent key type. Test Skipped\n"); - return TEST_SKIPPED; + return -ENOTSUP; } sess = rte_cryptodev_asym_session_create(sess_mpool); @@ -498,7 +505,7 @@ struct test_cases_array { RTE_LOG(INFO, USER1, "Device doesn't support sign op with " "exponent key type. Test Skipped\n"); - return TEST_SKIPPED; + return -ENOTSUP; } sess = rte_cryptodev_asym_session_create(sess_mpool); @@ -1260,7 +1267,7 @@ static inline void print_asym_capa( if (rte_cryptodev_asym_get_xform_enum( &modinv_xform.xform_type, "modinv") < 0) { RTE_LOG(ERR, USER1, - "Invalid ASYNC algorithm specified\n"); + "Invalid ASYM algorithm specified\n"); return -1; } @@ -1268,12 +1275,18 @@ static inline void print_asym_capa( capability = rte_cryptodev_asym_capability_get(dev_id, &cap_idx); + if (capability == NULL) { + RTE_LOG(INFO, USER1, + "Device doesn't support MOD INV. Test Skipped\n"); + return -ENOTSUP; + } + if (rte_cryptodev_asym_xform_capability_check_modlen( capability, modinv_xform.modinv.modulus.length)) { RTE_LOG(ERR, USER1, - "Invalid MODULOUS length specified\n"); - return -1; + "Invalid MODULUS length specified\n"); + return -ENOTSUP; } sess = rte_cryptodev_asym_session_create(sess_mpool); @@ -1379,7 +1392,7 @@ static inline void print_asym_capa( "modexp") < 0) { RTE_LOG(ERR, USER1, - "Invalid ASYNC algorithm specified\n"); + "Invalid ASYM algorithm specified\n"); return -1; } @@ -1387,11 +1400,17 @@ static inline void print_asym_capa( cap_idx.type = modex_xform.xform_type; capability = rte_cryptodev_asym_capability_get(dev_id, &cap_idx); + if (capability == NULL) { + RTE_LOG(INFO, USER1, + "Device doesn't support MOD EXP. Test Skipped\n"); + return -ENOTSUP; + } + if (rte_cryptodev_asym_xform_capability_check_modlen( capability, modex_xform.modex.modulus.length)) { RTE_LOG(ERR, USER1, - "Invalid MODULOUS length specified\n"); - return -1; + "Invalid MODULUS length specified\n"); + return -ENOTSUP; } /* generate crypto op data structure */ -- 1.8.3.1