From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 57CC3A0C43; Tue, 10 Aug 2021 21:51:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D7FE6411D7; Tue, 10 Aug 2021 21:51:02 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 0A931411C5 for ; Tue, 10 Aug 2021 21:51:00 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 17AJoZQl008924; Tue, 10 Aug 2021 12:50:54 -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-transfer-encoding : content-type; s=pfpt0220; bh=uvO8sR6cP1T/dZr3vOCN8uZ0aI9hkhZ9Nozi35bFqKI=; b=khLEaySGHeIE/sLegXIfGDfgLTFGQtmIzUVbwp1URTp2voWYg8sMOuUuwjxfoC12c6o1 6lzG/XDzELissKoTcNHmoG1z5/nURCMvKsp7t9Uvkke8y/WfMzH1909uS4oGzkALsgpf b27UytbAvXq+DnuyNNv2kR6K8kFHT/ijG6nE440kPXwdNZaNkis++IH3E2Lpyfq7nDA+ NKdiM3NGakkXVpKlddFT6DHzXWOyjvGmfaVy3cAQA8kyFnxvZ2syu5tAGun2qDmyBNSJ SRhF1+OVJd4LxUhR4jsAtfpGpOJ7L37+9p9zDi7iuPZozcmE4Xhq/BKcWEL1kRaQ2bDW 9Q== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com with ESMTP id 3abfu2kx1v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 10 Aug 2021 12:50:54 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 10 Aug 2021 12:50:52 -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.18 via Frontend Transport; Tue, 10 Aug 2021 12:50:52 -0700 Received: from localhost.localdomain (unknown [10.28.36.185]) by maili.marvell.com (Postfix) with ESMTP id 9CCD45E6881; Tue, 10 Aug 2021 12:50:47 -0700 (PDT) From: Akhil Goyal To: CC: , , , , , , , , , , , , , , , , , Akhil Goyal Date: Wed, 11 Aug 2021 01:20:19 +0530 Message-ID: <20210810195020.1423013-4-gakhil@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210810195020.1423013-1-gakhil@marvell.com> References: <20210805200236.1180289-1-gakhil@marvell.com> <20210810195020.1423013-1-gakhil@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: uuVM2x29ZdoytjFOtPQwpn22Ksm0_fTV X-Proofpoint-GUID: uuVM2x29ZdoytjFOtPQwpn22Ksm0_fTV X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-08-10_08:2021-08-10, 2021-08-10 signatures=0 Subject: [dpdk-dev] [PATCH v2 3/4] examples/fips_validation: remove illegal usage of APIs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" Some of the cryptodev APIs are not allowed to be used by application directly. Hence removing the usage of 1. queue_pair_release: it is not required, as configure of queue pair release the previous queue pairs and the dev is not directly exposed to application, hence cannot use its ops from app. 2. rte_cryptodev_stop: it can be used directly without checking if the device is started or not. 3. rte_cryptodev_pmd_destroy: application should use rte_cryptodev_close instead. Signed-off-by: Akhil Goyal --- examples/fips_validation/fips_dev_self_test.c | 19 ++----------------- examples/fips_validation/main.c | 7 ++----- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/examples/fips_validation/fips_dev_self_test.c b/examples/fips_validation/fips_dev_self_test.c index 17e85973c0..b4eab05a98 100644 --- a/examples/fips_validation/fips_dev_self_test.c +++ b/examples/fips_validation/fips_dev_self_test.c @@ -3,7 +3,7 @@ */ #include -#include +#include #include "fips_dev_self_test.h" @@ -1523,12 +1523,6 @@ static void fips_dev_auto_test_uninit(uint8_t dev_id, struct fips_dev_auto_test_env *env) { - struct rte_cryptodev *dev = rte_cryptodev_pmd_get_dev(dev_id); - uint32_t i; - - if (!dev) - return; - if (env->mbuf) rte_pktmbuf_free(env->mbuf); if (env->op) @@ -1542,16 +1536,7 @@ fips_dev_auto_test_uninit(uint8_t dev_id, if (env->sess_priv_pool) rte_mempool_free(env->sess_priv_pool); - if (dev->data->dev_started) - rte_cryptodev_stop(dev_id); - - if (dev->data->nb_queue_pairs) { - for (i = 0; i < dev->data->nb_queue_pairs; i++) - (*dev->dev_ops->queue_pair_release)(dev, i); - dev->data->nb_queue_pairs = 0; - rte_free(dev->data->queue_pairs); - dev->data->queue_pairs = NULL; - } + rte_cryptodev_stop(dev_id); } static int diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c index e892078f0e..a8daad1f48 100644 --- a/examples/fips_validation/main.c +++ b/examples/fips_validation/main.c @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include #include @@ -73,10 +73,7 @@ cryptodev_fips_validate_app_int(void) if (env.self_test) { ret = fips_dev_self_test(env.dev_id, env.broken_test_config); if (ret < 0) { - struct rte_cryptodev *cryptodev = - rte_cryptodev_pmd_get_dev(env.dev_id); - - rte_cryptodev_pmd_destroy(cryptodev); + rte_cryptodev_close(env.dev_id); return ret; } -- 2.25.1