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 2A2C3A0C47; Tue, 7 Sep 2021 21:01:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 14DB241168; Tue, 7 Sep 2021 21:00:55 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 5F0DD4114F for ; Tue, 7 Sep 2021 21:00:53 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 187HZc5E016123; Tue, 7 Sep 2021 12:00:46 -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=+P+EzxuH8XXbuB312emvBQO7fJjoDRP5KNkOOdO3LB8=; b=V7uW7SJ08sogf2BzLgt1Ey1DqeAAdv0Ol4hPZvE2ahyrvvgElM7SR3tIgTnBvjboBQVV Dn4wdD0NbE+JdvpUxcp4RNMDWLBDFfpTrS7N1caOIz12GY7iCcI2xPM+fXQ4JV4Ctyf+ Jir5g7eNRMr4DIqeSiFSYsMf5jKoYBcjTKuLOmihfIla8ew4P+z5hGEdYoCaI8XKmUJU Y/dPshWq079nl2LvfuE7CLSX4pLvRkqMU76ANzHyEl4ieXs6G3f7oNpF+9wYDbQ008f7 /VAMdZzZhHaScqNjO+HZHFL+PRKBgx2+6cHk5/YxXYpUP9FJxahZTI2EJLeSWpLtUfnL jQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com with ESMTP id 3axcm7r9uf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 07 Sep 2021 12:00:46 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 7 Sep 2021 12:00:44 -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, 7 Sep 2021 12:00:45 -0700 Received: from localhost.localdomain (unknown [10.28.36.185]) by maili.marvell.com (Postfix) with ESMTP id 2ACF93F708F; Tue, 7 Sep 2021 12:00:39 -0700 (PDT) From: Akhil Goyal To: CC: , , , , , , , , , , , , , , , , , Akhil Goyal Date: Wed, 8 Sep 2021 00:30:19 +0530 Message-ID: <20210907190020.2968234-4-gakhil@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210907190020.2968234-1-gakhil@marvell.com> References: <20210810195020.1423013-1-gakhil@marvell.com> <20210907190020.2968234-1-gakhil@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: s7mmz3KFL9TtQ08DuG-f91XyNU_WD5ed X-Proofpoint-ORIG-GUID: s7mmz3KFL9TtQ08DuG-f91XyNU_WD5ed X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-09-07_07,2021-09-07_02,2020-04-07_01 Subject: [dpdk-dev] [PATCH v3 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 Acked-by: Matan Azrad --- 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