From patchwork Tue Sep 7 19:22:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akhil Goyal X-Patchwork-Id: 98227 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C5115A0C47; Tue, 7 Sep 2021 21:23:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2F16441121; Tue, 7 Sep 2021 21:23:23 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id A159041139 for ; Tue, 7 Sep 2021 21:23:21 +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 187HZW1i016077; Tue, 7 Sep 2021 12:23:12 -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=GUcGRfZIzvNxbnk/I3foFYzDbRnA+hurQCeeYKIhxyesovJVBCkypBxi5REzBpUQUT3D GJnGBh4Raoi9zN+DfD/VeEcmPxuqZ/LXp55nUT0AlhNt/4IY0OJKayyv3LxsmU0ZSwdH IjhMuHIZSzTqqrtIwced2uO2jwUpordkR9KWpy7LPn/LCrI5bfTyI1ScOos/9EhCPgQt /fHBsZJP7OrkF7i91M3RFAuI1irLzznnJW7VCk+neGlWqt3ole/jhyRWpiN3cgEkSW6W Z3bSwNpR+GS8oZJVzc1BM52c3N2ouT1GX9Q1VV+glQ44hgbSo1MUOkWu6qquoLSbBF3A 1Q== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com with ESMTP id 3axcm7rc30-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 07 Sep 2021 12:23:12 -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:23:11 -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:23:11 -0700 Received: from localhost.localdomain (unknown [10.28.36.185]) by maili.marvell.com (Postfix) with ESMTP id 1266D3F7094; Tue, 7 Sep 2021 12:23:05 -0700 (PDT) From: Akhil Goyal To: CC: , , , , , , , , , , , , , , , , , Akhil Goyal Date: Wed, 8 Sep 2021 00:52:45 +0530 Message-ID: <20210907192246.3010653-4-gakhil@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210907192246.3010653-1-gakhil@marvell.com> References: <20210907190020.2968234-1-gakhil@marvell.com> <20210907192246.3010653-1-gakhil@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: QGfgDC7esjwKgX5xSofidJT7kKzGIXcj X-Proofpoint-ORIG-GUID: QGfgDC7esjwKgX5xSofidJT7kKzGIXcj 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 v4 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; }