DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Xueming(Steven) Li" <xuemingl@nvidia.com>
To: NBU-Contact-Thomas Monjalon <thomas@monjalon.net>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: Matan Azrad <matan@nvidia.com>,
	Shahaf Shuler <shahafs@nvidia.com>,
	Slava Ovsiienko <viacheslavo@nvidia.com>,
	Gaetan Rivet <grive@u256.net>
Subject: Re: [dpdk-dev] [PATCH v2 1/2] pci: rename catch-all ID
Date: Tue, 6 Apr 2021 06:23:55 +0000	[thread overview]
Message-ID: <BY5PR12MB432424893283BBEB5E5A0E0EA1769@BY5PR12MB4324.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20210405091506.562830-2-thomas@monjalon.net>


>-----Original Message-----
>From: dev <dev-bounces@dpdk.org> On Behalf Of Thomas Monjalon
>Sent: Monday, April 5, 2021 5:15 PM
>To: dev@dpdk.org
>Cc: Matan Azrad <matan@nvidia.com>; Shahaf Shuler <shahafs@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>; Gaetan
>Rivet <grive@u256.net>
>Subject: [dpdk-dev] [PATCH v2 1/2] pci: rename catch-all ID
>
>The name of the constant PCI_ANY_ID was missing RTE_ prefix.
>It is renamed, and the old name becomes a deprecated alias.
>
>While renaming, the duplicate definitions in rte_bus_pci.h are removed to keep only those in rte_pci.h.
>Note: rte_pci.h is included in rte_bus_pci.h
>
>Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
>---
> drivers/bus/pci/pci_common.c          |  8 ++++----
> drivers/bus/pci/rte_bus_pci.h         | 12 ++++--------
> drivers/common/mlx5/mlx5_common_pci.c |  8 ++++----
> lib/librte_pci/rte_pci.h              | 12 +++++++-----
> 4 files changed, 19 insertions(+), 21 deletions(-)
>
>diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c index 9b8d769287..ee7f966358 100644
>--- a/drivers/bus/pci/pci_common.c
>+++ b/drivers/bus/pci/pci_common.c
>@@ -133,18 +133,18 @@ rte_pci_match(const struct rte_pci_driver *pci_drv,
> 	     id_table++) {
> 		/* check if device's identifiers match the driver's ones */
> 		if (id_table->vendor_id != pci_dev->id.vendor_id &&
>-				id_table->vendor_id != PCI_ANY_ID)
>+				id_table->vendor_id != RTE_PCI_ANY_ID)
> 			continue;
> 		if (id_table->device_id != pci_dev->id.device_id &&
>-				id_table->device_id != PCI_ANY_ID)
>+				id_table->device_id != RTE_PCI_ANY_ID)
> 			continue;
> 		if (id_table->subsystem_vendor_id !=
> 		    pci_dev->id.subsystem_vendor_id &&
>-		    id_table->subsystem_vendor_id != PCI_ANY_ID)
>+		    id_table->subsystem_vendor_id != RTE_PCI_ANY_ID)
> 			continue;
> 		if (id_table->subsystem_device_id !=
> 		    pci_dev->id.subsystem_device_id &&
>-		    id_table->subsystem_device_id != PCI_ANY_ID)
>+		    id_table->subsystem_device_id != RTE_PCI_ANY_ID)
> 			continue;
> 		if (id_table->class_id != pci_dev->id.class_id &&
> 				id_table->class_id != RTE_CLASS_ANY_ID) diff --git a/drivers/bus/pci/rte_bus_pci.h
>b/drivers/bus/pci/rte_bus_pci.h index 876abddefb..3a092bc6d5 100644
>--- a/drivers/bus/pci/rte_bus_pci.h
>+++ b/drivers/bus/pci/rte_bus_pci.h
>@@ -91,26 +91,22 @@ struct rte_pci_device {
>
> #define RTE_ETH_DEV_TO_PCI(eth_dev)	RTE_DEV_TO_PCI((eth_dev)->device)
>
>-/** Any PCI device identifier (vendor, device, ...) */ -#define PCI_ANY_ID (0xffff) -#define RTE_CLASS_ANY_ID (0xffffff)
>-
> #ifdef __cplusplus
> /** C++ macro used to help building up tables of device IDs */  #define RTE_PCI_DEVICE(vend, dev) \
> 	RTE_CLASS_ANY_ID,         \
> 	(vend),                   \
> 	(dev),                    \
>-	PCI_ANY_ID,               \
>-	PCI_ANY_ID
>+	RTE_PCI_ANY_ID,           \
>+	RTE_PCI_ANY_ID
> #else
> /** Macro used to help building up tables of device IDs */
> #define RTE_PCI_DEVICE(vend, dev)          \
> 	.class_id = RTE_CLASS_ANY_ID,      \
> 	.vendor_id = (vend),               \
> 	.device_id = (dev),                \
>-	.subsystem_vendor_id = PCI_ANY_ID, \
>-	.subsystem_device_id = PCI_ANY_ID
>+	.subsystem_vendor_id = RTE_PCI_ANY_ID, \
>+	.subsystem_device_id = RTE_PCI_ANY_ID
> #endif
>
> /**
>diff --git a/drivers/common/mlx5/mlx5_common_pci.c b/drivers/common/mlx5/mlx5_common_pci.c
>index a7f541a90c..9689ca86fc 100644
>--- a/drivers/common/mlx5/mlx5_common_pci.c
>+++ b/drivers/common/mlx5/mlx5_common_pci.c
>@@ -142,18 +142,18 @@ mlx5_bus_match(const struct mlx5_pci_driver *drv,
> 	     id_table++) {
> 		/* Check if device's ids match the class driver's ids. */
> 		if (id_table->vendor_id != pci_dev->id.vendor_id &&
>-		    id_table->vendor_id != PCI_ANY_ID)
>+		    id_table->vendor_id != RTE_PCI_ANY_ID)
> 			continue;
> 		if (id_table->device_id != pci_dev->id.device_id &&
>-		    id_table->device_id != PCI_ANY_ID)
>+		    id_table->device_id != RTE_PCI_ANY_ID)
> 			continue;
> 		if (id_table->subsystem_vendor_id !=
> 		    pci_dev->id.subsystem_vendor_id &&
>-		    id_table->subsystem_vendor_id != PCI_ANY_ID)
>+		    id_table->subsystem_vendor_id != RTE_PCI_ANY_ID)
> 			continue;
> 		if (id_table->subsystem_device_id !=
> 		    pci_dev->id.subsystem_device_id &&
>-		    id_table->subsystem_device_id != PCI_ANY_ID)
>+		    id_table->subsystem_device_id != RTE_PCI_ANY_ID)
> 			continue;
> 		if (id_table->class_id != pci_dev->id.class_id &&
> 		    id_table->class_id != RTE_CLASS_ANY_ID) diff --git a/lib/librte_pci/rte_pci.h b/lib/librte_pci/rte_pci.h index
>f89c7dbbea..a8f8e404a9 100644
>--- a/lib/librte_pci/rte_pci.h
>+++ b/lib/librte_pci/rte_pci.h
>@@ -78,10 +78,10 @@ extern "C" {
>  */
> struct rte_pci_id {
> 	uint32_t class_id;            /**< Class ID or RTE_CLASS_ANY_ID. */
>-	uint16_t vendor_id;           /**< Vendor ID or PCI_ANY_ID. */
>-	uint16_t device_id;           /**< Device ID or PCI_ANY_ID. */
>-	uint16_t subsystem_vendor_id; /**< Subsystem vendor ID or PCI_ANY_ID. */
>-	uint16_t subsystem_device_id; /**< Subsystem device ID or PCI_ANY_ID. */
>+	uint16_t vendor_id;           /**< Vendor ID or RTE_PCI_ANY_ID. */
>+	uint16_t device_id;           /**< Device ID or RTE_PCI_ANY_ID. */
>+	uint16_t subsystem_vendor_id; /**< Subsystem vendor ID or RTE_PCI_ANY_ID. */
>+	uint16_t subsystem_device_id; /**< Subsystem device ID or +RTE_PCI_ANY_ID. */

Line length exceeds 80 chars.

> };
>
> /**
>@@ -95,7 +95,9 @@ struct rte_pci_addr {
> };
>
> /** Any PCI device identifier (vendor, device, ...) */ -#define PCI_ANY_ID (0xffff)
>+#define RTE_PCI_ANY_ID (0xffff)
>+/** @deprecated Replaced with RTE_PCI_ANY_ID */ #define PCI_ANY_ID
>+RTE_DEPRECATED(PCI_ANY_ID) RTE_PCI_ANY_ID
> #define RTE_CLASS_ANY_ID (0xffffff)
>
> /**
>--
>2.31.1


  reply	other threads:[~2021-04-06  6:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-31 22:34 [dpdk-dev] [PATCH 0/2] pci: add rte prefix Thomas Monjalon
2021-03-31 22:34 ` [dpdk-dev] [PATCH 1/2] pci: rename catch-all ID Thomas Monjalon
2021-04-01  7:58   ` David Marchand
2021-04-01  8:15     ` Thomas Monjalon
2021-04-05 10:42   ` Parav Pandit
2021-03-31 22:34 ` [dpdk-dev] [PATCH 2/2] bus/pci: rename probe/remove operation types Thomas Monjalon
2021-04-05  9:15 ` [dpdk-dev] [PATCH v2 0/2] pci: add rte prefix Thomas Monjalon
2021-04-05  9:15   ` [dpdk-dev] [PATCH v2 1/2] pci: rename catch-all ID Thomas Monjalon
2021-04-06  6:23     ` Xueming(Steven) Li [this message]
2021-04-06  9:33       ` Thomas Monjalon
2021-04-05  9:15   ` [dpdk-dev] [PATCH v2 2/2] bus/pci: rename probe/remove operation types Thomas Monjalon
2021-04-06  6:32     ` Xueming(Steven) Li
2021-04-06  9:38       ` Thomas Monjalon
2021-04-06 10:51         ` Xueming(Steven) Li
2021-04-06  8:55   ` [dpdk-dev] [PATCH v2 0/2] pci: add rte prefix David Marchand
2021-04-06 10:28 ` [dpdk-dev] [PATCH v3 " Thomas Monjalon
2021-04-06 10:28   ` [dpdk-dev] [PATCH v3 1/2] pci: rename catch-all ID Thomas Monjalon
2021-04-06 10:28   ` [dpdk-dev] [PATCH v3 2/2] bus/pci: rename probe/remove operation types Thomas Monjalon
2021-04-06 13:04   ` [dpdk-dev] [PATCH v3 0/2] pci: add rte prefix Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BY5PR12MB432424893283BBEB5E5A0E0EA1769@BY5PR12MB4324.namprd12.prod.outlook.com \
    --to=xuemingl@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=grive@u256.net \
    --cc=matan@nvidia.com \
    --cc=shahafs@nvidia.com \
    --cc=thomas@monjalon.net \
    --cc=viacheslavo@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).