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 564B9A0C57; Wed, 8 Sep 2021 17:16:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3DD2541136; Wed, 8 Sep 2021 17:16:50 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id A822C41102; Wed, 8 Sep 2021 17:16:48 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1889rFNf001132; Wed, 8 Sep 2021 08:16:37 -0700 Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2104.outbound.protection.outlook.com [104.47.70.104]) by mx0b-0016f401.pphosted.com with ESMTP id 3axtxc185k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Sep 2021 08:16:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hODmGNQ36vWNJyNNzFbFnVrwRJod8NAVrVZFP0E8Ovod3enBzuwVErVu1/Somy4LCravym2pm3uVW1E2FPGjgQwulA6oU8Bqp+uBqdVKaM8rBArWaGaJdg9PuOe5EtkIMH5Eoe4mh6p0f1rCEZ2+EAUXKRGcUlMXRjgDSJtl2xs2lVdnXMLsRNH34hHry751VyoykBo4QUMXMVOVwnuVRqQpdEPzR8YYfv5Fy39i1n307AD1fUQqdCZoqz++IMoZ9oKwLeok5mr5dIYwuJtj6vnKUpB6w+1hrsDtwE/QOPFo7eIbjtML+MqjMg3O11WTbnSKM9mxpeofkT4i2qAhAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=pod3GoAKsXehpmtH+wPH/XPaITqr8td9VuUXkv8Pt6w=; b=c46ICiH5tzDcR+5xJqPNnTDTGfpDT94q6+wLDqfN4AfZCyCaHsP4P8HpMJmGUMTcNVuhRlzamBf5LwAx23MXtp9Kz4uSGW/uGaPN+oOnuXiRI+o0HNZjxEjjYQUlXdCfupdmYM8Sfpo0X7arErTNpWngFxrQ6cKQ+0VO8UFdhRgb22O6y/z4V1bwh88RuRIxMreBMyjNGozu36GZm1S5L7dSbUUtZpvumwoULB3v3DJOsqKlGASfSeQ849OISNApq/hbLhU4zwov6rAmW0Ay24Hx8IbdURhIM1GPCKJNOoTaOaf2O4piFLTy2TVQWsraseB3xdAuaAF7og8n5x4n+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pod3GoAKsXehpmtH+wPH/XPaITqr8td9VuUXkv8Pt6w=; b=q6TCD6pEZT5M4Y7eS98tRQDqXe5OQr7vlyrJhVfSS+WNQVW/FAWNrZYZIqjdCPTdhRpaRuWfvGhPdTwAbUGrZa4Hv+/pE4+QIOC485kS0/Nle6fi2kDCm1J/R7c2cuuL9Ph2uifSV6cBXaU3OmuiitvTTTqHVxj8q6sjWOeB7cA= Received: from PH0PR18MB4491.namprd18.prod.outlook.com (2603:10b6:510:e6::13) by PH0PR18MB4557.namprd18.prod.outlook.com (2603:10b6:510:a6::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Wed, 8 Sep 2021 15:16:34 +0000 Received: from PH0PR18MB4491.namprd18.prod.outlook.com ([fe80::5511:79c8:c025:a250]) by PH0PR18MB4491.namprd18.prod.outlook.com ([fe80::5511:79c8:c025:a250%7]) with mapi id 15.20.4500.016; Wed, 8 Sep 2021 15:16:34 +0000 From: Akhil Goyal To: Akhil Goyal , "dev@dpdk.org" , Ray Kinsella , "techboard@dpdk.org" CC: Anoob Joseph , "radu.nicolau@intel.com" , "declan.doherty@intel.com" , "hemant.agrawal@nxp.com" , "matan@nvidia.com" , "konstantin.ananyev@intel.com" , "thomas@monjalon.net" , "roy.fan.zhang@intel.com" , "asomalap@amd.com" , "ruifeng.wang@arm.com" , "ajit.khaparde@broadcom.com" , "pablo.de.lara.guarch@intel.com" , "fiona.trahe@intel.com" , Ankur Dwivedi , Michael Shamis , Nagadheeraj Rottela , "jianjay.zhou@huawei.com" Thread-Topic: [PATCH v4 2/4] cryptodev: change valid dev API Thread-Index: AQHXpB3QE9diSqBWdUq5fzGkzZ2kaquaP5vA Date: Wed, 8 Sep 2021 15:16:34 +0000 Message-ID: References: <20210907190020.2968234-1-gakhil@marvell.com> <20210907192246.3010653-1-gakhil@marvell.com> <20210907192246.3010653-3-gakhil@marvell.com> In-Reply-To: <20210907192246.3010653-3-gakhil@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 260ee872-534d-459a-6bd4-08d972dba516 x-ms-traffictypediagnostic: PH0PR18MB4557: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4714; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 64xD/zsa0p1Z/DKPMl+ddLkzvAvGsxKTsK62Y0q8onRSJ3o2qx1zZSIDYz+LfcuCgt+CEtUvqU6JmdqTQTRB+ParNT/XSmqzDyQgXsnI9BOvkVcFBkklBcAcvGO4OAbOHnJJmnrx+AS1eG1kW+yqHhfJZ+Dn3N4UKHw++tNbqb6aTWkIFKehM2EXNlH9sunh2mi3I3pvd519c2/A8ihKEIWmTYKA6edF6zevmbbAMr7ez3gl+woVcbWpBINWruSszE6POLKRvo68wxcY9cOB5Baazgcfv9hd2XIokFPhAU3vK9IDP2wh3y7h3+VwT8ZBqqs6Ihcbs3+jIn/hQKeLz75Gcsev6qNWFc83Fw+pVIRHxueN1VJQZU+XNEFy/UBmrWqIFj/wae/jouLMik94uq6/GVqImCmGk/uJSfbzEYEsyq4JPwbpPR4s4wQVLEpGHhTfQIx7wAsOQt28ovAYP9vVNABUXTi+uh/Gg2+U/4Q+Hdc0pKhC/qfukniw9VqBWOAhrd/L3DQr3vgffZ3gJ9HboVo1hJSM1gWZr0RCtnqWHNxtxJbFajCZ2GF94VReryy7ug8ddW1qfqsNX6U9KbypKgqX10eNyoNh/v0GEo/iSanwctseLEKUpBqmFyp2CU+DrKdQBdKWjb9P7hPW3dHeg7USWqrmfHtRQKDl9aRPPGgJxQqbMQwurJDe47uUj7c7YDMA20pqngcJe19DsQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR18MB4491.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(6506007)(7696005)(38070700005)(66446008)(66476007)(4326008)(64756008)(2906002)(122000001)(508600001)(26005)(71200400001)(66556008)(5660300002)(83380400001)(76116006)(38100700002)(186003)(54906003)(110136005)(86362001)(55016002)(7416002)(52536014)(66946007)(9686003)(8936002)(316002)(8676002)(30864003)(33656002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?cBzDm2YMwddQyWCpafCvcfjAXPXvC2UKfWL1QzT/qvk/5qKU490jktWCvbIp?= =?us-ascii?Q?rhtczi/NWmI5cFv9fjE7DfK5y58H/Hma8YfrRNlWVDvHPnm3whSUNQ/48chI?= =?us-ascii?Q?+TCydG06P47ckIxXvUzyaDINGGPTnpFHT9tgdaHQSOL/pUwh1lG989nXGhWF?= =?us-ascii?Q?OGgYp93UPK4VWxphYwcYODxd9/5JXMA9p/OryZTrS6GTdHUovoZ7Ur7NhVQx?= =?us-ascii?Q?BpPNKuH0h5leLLw6HmyJs1vLyzAzuDn+nzDr+fbDAllRGaUKOio7YDQjoDPV?= =?us-ascii?Q?TSF3J6DBc/NnGtWgz6gG7wxwV/w4PNoC4nKA9MiBI27DVbpV//OnnX08iEED?= =?us-ascii?Q?YNNdN07jttmsxDSPIbapxLfOCdPad6/feDd1Tb35zItvGtSfEPEAUMBff/Ci?= =?us-ascii?Q?8mHnY7iL217xQlFnyYRVnyRvoWKh7OooroOfO3J5dkg4A9Vr43OuE0hnUQeI?= =?us-ascii?Q?YTj+CQmPInBAAXJHua0hd323wqIDbSMN2q2+THpcAl63J/PuhuaK/C4dm959?= =?us-ascii?Q?D8Lo4Xxs6TkAP9fzUoGm2NE/6quSpVxytjjulFaeyq23J1zeZJVBs7yUYXUe?= =?us-ascii?Q?OHWoKY/MtI2EyuXurYM6N52oY0F+rqcZUy64TXyqI8Q4kjH/oDKo7aok8vdY?= =?us-ascii?Q?PsAzRk2uJ42pCU0/t3urKdXpD5jzQfdFfqAeRutyCN5ylkBLl8qgHl7F4XEv?= =?us-ascii?Q?TEgpEOeJHBqp5vh2x8ZSzvCOmsGqVxesRAeTYMRkkNT9GLVeoZlZxCLHsgn0?= =?us-ascii?Q?GGWCA1Qa6cybYsYIvm0sPPN7FVAQ/Uohrm0LoVyhIoxIBztfZde0VWnigHQP?= =?us-ascii?Q?8w59ndQiZLGd5deXvqh/NaIcyc/uJQY8cqBW4jP0XZxLgjohIUk5qAJHvUYr?= =?us-ascii?Q?CBDPZkuH9rbfKSCOIhuKv1/doLVVAH/EM3Hbx4fNs8t4yBz3eAqH8uzLE1z0?= =?us-ascii?Q?F9yMZUMX/rZcOQd7Hm9vu+4jg0E52IxllI6uENzF6XINwHCelq29dfgfW6ql?= =?us-ascii?Q?nz/DJkh92+zu4FGYzSE3JP+CSij6n7m8qUmSwn1JM3/rKKu5pmC5reg9MdNx?= =?us-ascii?Q?pjiR5TKppRzu8U8qgIcfWvYJ1i9JRq9dkFfMwQ3CUbJ4/28ze6PDGPkUOOwD?= =?us-ascii?Q?lVrnPHcp+aCBVUNLgjp/LOnTJhldb6Wz/PSFhlBhZofItdAb2+kYYB1L0ed/?= =?us-ascii?Q?hJYKCv+iSFpWQClJwcdGT2aMzTsbuacgoUHINkmHE8FqtSHg+DSquDAiwN3r?= =?us-ascii?Q?1VQmsSmi9K7+FR0qxJ9TVE7yTUVskB7y3BRGi+W1rrQC+MPPO0+l6E/t7RmL?= =?us-ascii?Q?E1DkCd8i/IVHqh4d3/NUvlmJ?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR18MB4491.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 260ee872-534d-459a-6bd4-08d972dba516 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Sep 2021 15:16:34.1346 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: MMA/60J6QOmOqn0miq4zFzq99iN+p3fQe202dsI3szXJO6QAl702T1x+4oliapjEJ75MloCzKvK8PbIHXSxv4Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR18MB4557 X-Proofpoint-ORIG-GUID: EB5eghFvHPjKtPS3s210zhhaKmkiUb4M X-Proofpoint-GUID: EB5eghFvHPjKtPS3s210zhhaKmkiUb4M 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-08_06,2021-09-07_02,2020-04-07_01 Subject: Re: [dpdk-dev] [PATCH v4 2/4] cryptodev: change valid dev API 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" > Subject: [PATCH v4 2/4] cryptodev: change valid dev API >=20 > The API rte_cryptodev_pmd_is_valid_dev, can be used > by the application as well as PMD to check whether > the device is valid or not. Hence, _pmd is removed > from the API. > The applications and drivers which use this API are > also updated. >=20 > Signed-off-by: Akhil Goyal This patch is merged on dpdk-next-crypto. As discussed in DPDK techboard meeting, adding Ray and Techboard to take a better look so that changes(if any) can be made before merging to ma= in. > --- > doc/guides/rel_notes/release_21_11.rst | 4 ++ > .../net/softnic/rte_eth_softnic_cryptodev.c | 2 +- > examples/fips_validation/main.c | 2 +- > examples/ip_pipeline/cryptodev.c | 3 +- > lib/cryptodev/rte_cryptodev.c | 50 +++++++++---------- > lib/cryptodev/rte_cryptodev.h | 11 ++++ > lib/cryptodev/rte_cryptodev_pmd.h | 11 ---- > lib/cryptodev/version.map | 2 +- > lib/eventdev/rte_event_crypto_adapter.c | 4 +- > lib/eventdev/rte_eventdev.c | 2 +- > lib/pipeline/rte_table_action.c | 2 +- > 11 files changed, 48 insertions(+), 45 deletions(-) >=20 > diff --git a/doc/guides/rel_notes/release_21_11.rst > b/doc/guides/rel_notes/release_21_11.rst > index 411fa9530a..e7ad50ba09 100644 > --- a/doc/guides/rel_notes/release_21_11.rst > +++ b/doc/guides/rel_notes/release_21_11.rst > @@ -102,6 +102,10 @@ API Changes > Also, make sure to start the actual text at the margin. > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >=20 > +* cryptodev: The API rte_cryptodev_pmd_is_valid_dev is modified to > + rte_cryptodev_is_valid_dev as it can be used by the application as > + well as PMD to check whether the device is valid or not. > + >=20 > ABI Changes > ----------- > diff --git a/drivers/net/softnic/rte_eth_softnic_cryptodev.c > b/drivers/net/softnic/rte_eth_softnic_cryptodev.c > index a1a4ca5650..8e278801c5 100644 > --- a/drivers/net/softnic/rte_eth_softnic_cryptodev.c > +++ b/drivers/net/softnic/rte_eth_softnic_cryptodev.c > @@ -82,7 +82,7 @@ softnic_cryptodev_create(struct pmd_internals *p, >=20 > dev_id =3D (uint32_t)status; > } else { > - if (rte_cryptodev_pmd_is_valid_dev(params->dev_id) =3D=3D 0) > + if (rte_cryptodev_is_valid_dev(params->dev_id) =3D=3D 0) > return NULL; >=20 > dev_id =3D params->dev_id; > diff --git a/examples/fips_validation/main.c > b/examples/fips_validation/main.c > index c175fe6ac2..e892078f0e 100644 > --- a/examples/fips_validation/main.c > +++ b/examples/fips_validation/main.c > @@ -196,7 +196,7 @@ parse_cryptodev_id_arg(char *arg) > } >=20 >=20 > - if (!rte_cryptodev_pmd_is_valid_dev(cryptodev_id)) { > + if (!rte_cryptodev_is_valid_dev(cryptodev_id)) { > RTE_LOG(ERR, USER1, "Error %i: invalid cryptodev id %s\n", > cryptodev_id, arg); > return -1; > diff --git a/examples/ip_pipeline/cryptodev.c > b/examples/ip_pipeline/cryptodev.c > index b0d9f3d217..9997d97456 100644 > --- a/examples/ip_pipeline/cryptodev.c > +++ b/examples/ip_pipeline/cryptodev.c > @@ -6,7 +6,6 @@ > #include >=20 > #include > -#include > #include >=20 > #include "cryptodev.h" > @@ -74,7 +73,7 @@ cryptodev_create(const char *name, struct > cryptodev_params *params) >=20 > dev_id =3D (uint32_t)status; > } else { > - if (rte_cryptodev_pmd_is_valid_dev(params->dev_id) =3D=3D 0) > + if (rte_cryptodev_is_valid_dev(params->dev_id) =3D=3D 0) > return NULL; >=20 > dev_id =3D params->dev_id; > diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.= c > index 447aa9d519..37502b9b3c 100644 > --- a/lib/cryptodev/rte_cryptodev.c > +++ b/lib/cryptodev/rte_cryptodev.c > @@ -663,7 +663,7 @@ rte_cryptodev_is_valid_device_data(uint8_t dev_id) > } >=20 > unsigned int > -rte_cryptodev_pmd_is_valid_dev(uint8_t dev_id) > +rte_cryptodev_is_valid_dev(uint8_t dev_id) > { > struct rte_cryptodev *dev =3D NULL; >=20 > @@ -761,7 +761,7 @@ rte_cryptodev_socket_id(uint8_t dev_id) > { > struct rte_cryptodev *dev; >=20 > - if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) > + if (!rte_cryptodev_is_valid_dev(dev_id)) > return -1; >=20 > dev =3D rte_cryptodev_pmd_get_dev(dev_id); > @@ -1032,7 +1032,7 @@ rte_cryptodev_configure(uint8_t dev_id, struct > rte_cryptodev_config *config) > struct rte_cryptodev *dev; > int diag; >=20 > - if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) { > + if (!rte_cryptodev_is_valid_dev(dev_id)) { > CDEV_LOG_ERR("Invalid dev_id=3D%" PRIu8, dev_id); > return -EINVAL; > } > @@ -1080,7 +1080,7 @@ rte_cryptodev_start(uint8_t dev_id) >=20 > CDEV_LOG_DEBUG("Start dev_id=3D%" PRIu8, dev_id); >=20 > - if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) { > + if (!rte_cryptodev_is_valid_dev(dev_id)) { > CDEV_LOG_ERR("Invalid dev_id=3D%" PRIu8, dev_id); > return -EINVAL; > } > @@ -1110,7 +1110,7 @@ rte_cryptodev_stop(uint8_t dev_id) > { > struct rte_cryptodev *dev; >=20 > - if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) { > + if (!rte_cryptodev_is_valid_dev(dev_id)) { > CDEV_LOG_ERR("Invalid dev_id=3D%" PRIu8, dev_id); > return; > } > @@ -1136,7 +1136,7 @@ rte_cryptodev_close(uint8_t dev_id) > struct rte_cryptodev *dev; > int retval; >=20 > - if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) { > + if (!rte_cryptodev_is_valid_dev(dev_id)) { > CDEV_LOG_ERR("Invalid dev_id=3D%" PRIu8, dev_id); > return -1; > } > @@ -1176,7 +1176,7 @@ rte_cryptodev_get_qp_status(uint8_t dev_id, > uint16_t queue_pair_id) > { > struct rte_cryptodev *dev; >=20 > - if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) { > + if (!rte_cryptodev_is_valid_dev(dev_id)) { > CDEV_LOG_ERR("Invalid dev_id=3D%" PRIu8, dev_id); > return -EINVAL; > } > @@ -1207,7 +1207,7 @@ rte_cryptodev_queue_pair_setup(uint8_t dev_id, > uint16_t queue_pair_id, > { > struct rte_cryptodev *dev; >=20 > - if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) { > + if (!rte_cryptodev_is_valid_dev(dev_id)) { > CDEV_LOG_ERR("Invalid dev_id=3D%" PRIu8, dev_id); > return -EINVAL; > } > @@ -1283,7 +1283,7 @@ rte_cryptodev_add_enq_callback(uint8_t dev_id, > return NULL; > } >=20 > - if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) { > + if (!rte_cryptodev_is_valid_dev(dev_id)) { > CDEV_LOG_ERR("Invalid dev_id=3D%d", dev_id); > rte_errno =3D ENODEV; > return NULL; > @@ -1349,7 +1349,7 @@ rte_cryptodev_remove_enq_callback(uint8_t > dev_id, > return -EINVAL; > } >=20 > - if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) { > + if (!rte_cryptodev_is_valid_dev(dev_id)) { > CDEV_LOG_ERR("Invalid dev_id=3D%d", dev_id); > return -ENODEV; > } > @@ -1418,7 +1418,7 @@ rte_cryptodev_add_deq_callback(uint8_t dev_id, > return NULL; > } >=20 > - if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) { > + if (!rte_cryptodev_is_valid_dev(dev_id)) { > CDEV_LOG_ERR("Invalid dev_id=3D%d", dev_id); > rte_errno =3D ENODEV; > return NULL; > @@ -1484,7 +1484,7 @@ rte_cryptodev_remove_deq_callback(uint8_t > dev_id, > return -EINVAL; > } >=20 > - if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) { > + if (!rte_cryptodev_is_valid_dev(dev_id)) { > CDEV_LOG_ERR("Invalid dev_id=3D%d", dev_id); > return -ENODEV; > } > @@ -1542,7 +1542,7 @@ rte_cryptodev_stats_get(uint8_t dev_id, struct > rte_cryptodev_stats *stats) > { > struct rte_cryptodev *dev; >=20 > - if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) { > + if (!rte_cryptodev_is_valid_dev(dev_id)) { > CDEV_LOG_ERR("Invalid dev_id=3D%d", dev_id); > return -ENODEV; > } > @@ -1565,7 +1565,7 @@ rte_cryptodev_stats_reset(uint8_t dev_id) > { > struct rte_cryptodev *dev; >=20 > - if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) { > + if (!rte_cryptodev_is_valid_dev(dev_id)) { > CDEV_LOG_ERR("Invalid dev_id=3D%" PRIu8, dev_id); > return; > } > @@ -1581,7 +1581,7 @@ rte_cryptodev_info_get(uint8_t dev_id, struct > rte_cryptodev_info *dev_info) > { > struct rte_cryptodev *dev; >=20 > - if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) { > + if (!rte_cryptodev_is_valid_dev(dev_id)) { > CDEV_LOG_ERR("Invalid dev_id=3D%d", dev_id); > return; > } > @@ -1608,7 +1608,7 @@ rte_cryptodev_callback_register(uint8_t dev_id, > if (!cb_fn) > return -EINVAL; >=20 > - if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) { > + if (!rte_cryptodev_is_valid_dev(dev_id)) { > CDEV_LOG_ERR("Invalid dev_id=3D%" PRIu8, dev_id); > return -EINVAL; > } > @@ -1652,7 +1652,7 @@ rte_cryptodev_callback_unregister(uint8_t dev_id, > if (!cb_fn) > return -EINVAL; >=20 > - if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) { > + if (!rte_cryptodev_is_valid_dev(dev_id)) { > CDEV_LOG_ERR("Invalid dev_id=3D%" PRIu8, dev_id); > return -EINVAL; > } > @@ -1720,7 +1720,7 @@ rte_cryptodev_sym_session_init(uint8_t dev_id, > uint8_t index; > int ret; >=20 > - if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) { > + if (!rte_cryptodev_is_valid_dev(dev_id)) { > CDEV_LOG_ERR("Invalid dev_id=3D%" PRIu8, dev_id); > return -EINVAL; > } > @@ -1765,7 +1765,7 @@ rte_cryptodev_asym_session_init(uint8_t dev_id, > uint8_t index; > int ret; >=20 > - if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) { > + if (!rte_cryptodev_is_valid_dev(dev_id)) { > CDEV_LOG_ERR("Invalid dev_id=3D%" PRIu8, dev_id); > return -EINVAL; > } > @@ -1939,7 +1939,7 @@ rte_cryptodev_sym_session_clear(uint8_t dev_id, > struct rte_cryptodev *dev; > uint8_t driver_id; >=20 > - if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) { > + if (!rte_cryptodev_is_valid_dev(dev_id)) { > CDEV_LOG_ERR("Invalid dev_id=3D%" PRIu8, dev_id); > return -EINVAL; > } > @@ -1969,7 +1969,7 @@ rte_cryptodev_asym_session_clear(uint8_t dev_id, > { > struct rte_cryptodev *dev; >=20 > - if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) { > + if (!rte_cryptodev_is_valid_dev(dev_id)) { > CDEV_LOG_ERR("Invalid dev_id=3D%" PRIu8, dev_id); > return -EINVAL; > } > @@ -2079,7 +2079,7 @@ > rte_cryptodev_sym_get_private_session_size(uint8_t dev_id) > struct rte_cryptodev *dev; > unsigned int priv_sess_size; >=20 > - if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) > + if (!rte_cryptodev_is_valid_dev(dev_id)) > return 0; >=20 > dev =3D rte_cryptodev_pmd_get_dev(dev_id); > @@ -2099,7 +2099,7 @@ > rte_cryptodev_asym_get_private_session_size(uint8_t dev_id) > unsigned int header_size =3D sizeof(void *) * nb_drivers; > unsigned int priv_sess_size; >=20 > - if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) > + if (!rte_cryptodev_is_valid_dev(dev_id)) > return 0; >=20 > dev =3D rte_cryptodev_pmd_get_dev(dev_id); > @@ -2156,7 +2156,7 @@ rte_cryptodev_sym_cpu_crypto_process(uint8_t > dev_id, > { > struct rte_cryptodev *dev; >=20 > - if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) { > + if (!rte_cryptodev_is_valid_dev(dev_id)) { > sym_crypto_fill_status(vec, EINVAL); > return 0; > } > @@ -2179,7 +2179,7 @@ rte_cryptodev_get_raw_dp_ctx_size(uint8_t > dev_id) > int32_t size =3D sizeof(struct rte_crypto_raw_dp_ctx); > int32_t priv_size; >=20 > - if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) > + if (!rte_cryptodev_is_valid_dev(dev_id)) > return -EINVAL; >=20 > dev =3D rte_cryptodev_pmd_get_dev(dev_id); > diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.= h > index 11f4e6fdbf..bb01f0f195 100644 > --- a/lib/cryptodev/rte_cryptodev.h > +++ b/lib/cryptodev/rte_cryptodev.h > @@ -1368,6 +1368,17 @@ __rte_experimental > unsigned int > rte_cryptodev_asym_get_private_session_size(uint8_t dev_id); >=20 > +/** > + * Validate if the crypto device index is valid attached crypto device. > + * > + * @param dev_id Crypto device index. > + * > + * @return > + * - If the device index is valid (1) or not (0). > + */ > +unsigned int > +rte_cryptodev_is_valid_dev(uint8_t dev_id); > + > /** > * Provide driver identifier. > * > diff --git a/lib/cryptodev/rte_cryptodev_pmd.h > b/lib/cryptodev/rte_cryptodev_pmd.h > index 1274436870..dd2a4940a2 100644 > --- a/lib/cryptodev/rte_cryptodev_pmd.h > +++ b/lib/cryptodev/rte_cryptodev_pmd.h > @@ -94,17 +94,6 @@ rte_cryptodev_pmd_get_dev(uint8_t dev_id); > struct rte_cryptodev * > rte_cryptodev_pmd_get_named_dev(const char *name); >=20 > -/** > - * Validate if the crypto device index is valid attached crypto device. > - * > - * @param dev_id Crypto device index. > - * > - * @return > - * - If the device index is valid (1) or not (0). > - */ > -unsigned int > -rte_cryptodev_pmd_is_valid_dev(uint8_t dev_id); > - > /** > * The pool of rte_cryptodev structures. > */ > diff --git a/lib/cryptodev/version.map b/lib/cryptodev/version.map > index 979d823a7c..1a7f759c57 100644 > --- a/lib/cryptodev/version.map > +++ b/lib/cryptodev/version.map > @@ -25,6 +25,7 @@ DPDK_22 { > rte_cryptodev_get_feature_name; > rte_cryptodev_get_sec_ctx; > rte_cryptodev_info_get; > + rte_cryptodev_is_valid_dev; > rte_cryptodev_name_get; > rte_cryptodev_pmd_allocate; > rte_cryptodev_pmd_callback_process; > @@ -33,7 +34,6 @@ DPDK_22 { > rte_cryptodev_pmd_destroy; > rte_cryptodev_pmd_get_dev; > rte_cryptodev_pmd_get_named_dev; > - rte_cryptodev_pmd_is_valid_dev; > rte_cryptodev_pmd_parse_input_args; > rte_cryptodev_pmd_release_device; > rte_cryptodev_queue_pair_count; > diff --git a/lib/eventdev/rte_event_crypto_adapter.c > b/lib/eventdev/rte_event_crypto_adapter.c > index e1d38d383d..2d38389858 100644 > --- a/lib/eventdev/rte_event_crypto_adapter.c > +++ b/lib/eventdev/rte_event_crypto_adapter.c > @@ -781,7 +781,7 @@ rte_event_crypto_adapter_queue_pair_add(uint8_t > id, >=20 > EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); >=20 > - if (!rte_cryptodev_pmd_is_valid_dev(cdev_id)) { > + if (!rte_cryptodev_is_valid_dev(cdev_id)) { > RTE_EDEV_LOG_ERR("Invalid dev_id=3D%" PRIu8, cdev_id); > return -EINVAL; > } > @@ -898,7 +898,7 @@ rte_event_crypto_adapter_queue_pair_del(uint8_t > id, uint8_t cdev_id, >=20 > EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); >=20 > - if (!rte_cryptodev_pmd_is_valid_dev(cdev_id)) { > + if (!rte_cryptodev_is_valid_dev(cdev_id)) { > RTE_EDEV_LOG_ERR("Invalid dev_id=3D%" PRIu8, cdev_id); > return -EINVAL; > } > diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c > index 594dd5e759..cb0ed7b620 100644 > --- a/lib/eventdev/rte_eventdev.c > +++ b/lib/eventdev/rte_eventdev.c > @@ -165,7 +165,7 @@ rte_event_crypto_adapter_caps_get(uint8_t dev_id, > uint8_t cdev_id, > struct rte_cryptodev *cdev; >=20 > RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL); > - if (!rte_cryptodev_pmd_is_valid_dev(cdev_id)) > + if (!rte_cryptodev_is_valid_dev(cdev_id)) > return -EINVAL; >=20 > dev =3D &rte_eventdevs[dev_id]; > diff --git a/lib/pipeline/rte_table_action.c b/lib/pipeline/rte_table_act= ion.c > index 98f3438774..54721ed96a 100644 > --- a/lib/pipeline/rte_table_action.c > +++ b/lib/pipeline/rte_table_action.c > @@ -1732,7 +1732,7 @@ struct sym_crypto_data { > static int > sym_crypto_cfg_check(struct rte_table_action_sym_crypto_config *cfg) > { > - if (!rte_cryptodev_pmd_is_valid_dev(cfg->cryptodev_id)) > + if (!rte_cryptodev_is_valid_dev(cfg->cryptodev_id)) > return -EINVAL; > if (cfg->mp_create =3D=3D NULL || cfg->mp_init =3D=3D NULL) > return -EINVAL; > -- > 2.25.1