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 D9D5CA05D3 for ; Wed, 24 Apr 2019 21:28:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5F2961B55F; Wed, 24 Apr 2019 21:28:39 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id A84CC1B55F for ; Wed, 24 Apr 2019 21:28:37 +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 x3OJKVG2005076; Wed, 24 Apr 2019 12:28:37 -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=tyAHAQj5nqBHWp6c510rzT89mbver+vEnWBdt2Zb3Vs=; b=bmBmTeyTQNVt4a4giR4uiUUbXsNVYthGRXZBHzfVSp6M9a+BV+vRzoDCgRnuxs58xM8w IM2Q/nOgniPMVgDPUW6PIY8a8WqqgCZVeQERB1sS+gXMSH8Qbh8NlAadvltlzBkf6hAc op/SUu458Hnm9Upcvl8mhwJfXKfJwzVLvQD5su1CygDiPIf7d9bNDUrZJ3k3VVDZ9x8b oeGMc58ZLhoBO5THin4x/QIXTLJrYY8mh7o9ndqxaX4cZd3HwHQYHfT5ngNCHcwzVm0J K6AaT+mYRom5AGhqnSCuKh6XDY/RFJ5poTesJ0EokaYKnGqlEKvqnl9u+2zqVMaM4KRV Ww== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 2s2nnjj010-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 24 Apr 2019 12:28:37 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 24 Apr 2019 12:28:35 -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; Wed, 24 Apr 2019 12:28:36 -0700 Received: from localhost.marvell.com (unknown [10.28.10.76]) by maili.marvell.com (Postfix) with ESMTP id 88E813F703F; Wed, 24 Apr 2019 12:28:33 -0700 (PDT) From: Ayuj Verma To: , , CC: , , , , , Ayuj Verma Date: Thu, 25 Apr 2019 00:58:26 +0530 Message-ID: <1556134106-15245-2-git-send-email-ayverma@marvell.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1556134106-15245-1-git-send-email-ayverma@marvell.com> References: <1556134106-15245-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-04-24_12:, , signatures=0 Subject: [dpdk-dev] [PATCH v3] 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: <20190424192826.0D4UUP2QN9R4lyKvzEQCcBG2ALh8URlomhRMY6VnzMU@z> - 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