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 62011A0A02; Mon, 5 Apr 2021 11:15:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A7281140E15; Mon, 5 Apr 2021 11:15:16 +0200 (CEST) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by mails.dpdk.org (Postfix) with ESMTP id 8D780140DFD for ; Mon, 5 Apr 2021 11:15:14 +0200 (CEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 2B5695C00B2; Mon, 5 Apr 2021 05:15:14 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 05 Apr 2021 05:15:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=hA1wgvBxud6VJ POS//ARpFF1YcOMvrLGUxKrKEF4SeU=; b=xb55uU7qRlf7VorZs0zY9/L37w5OB g9AQ29A8n3Ddt2YXB5f2+1KXKl/bvj+goo+VDsNuvw8aXpXRA6nwdHSqY3HjE9a7 P1NB4iI2W6jvG+yEGxeePNmo0OcTC9ox4VXMfFQCrlx0TgPjum+e8Tao/TSSBiHS NsoOzTHZO1jIpuTTU1CwIG5F5VYunr6B4+NlCsJ5zAAPrczgcGYqQEV0FRwHrCpv 7hQzAOzcCyYrDyH3c2MnbvRh/ql3kbbcIOUhv0k/l+XkFZHhy1UBS4pIYdXo98gu 1l/ZsCOYnGMsQMETPg+rJtl267HHtjkNJUE1XgPSnj3o1TD1ShU4LbFbw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=hA1wgvBxud6VJPOS//ARpFF1YcOMvrLGUxKrKEF4SeU=; b=UAoOyazI EvDQr5oQSwYPio8dYtOAhyFyr3Ylt/nuGBkt5HzFhP9d7281xaCrP6Fm6CmYdq84 YfaNq8n/zqwstXcJs5t6l9dtzk+N93NdQiw32Ykm+nV1v78dWPbEFuFjnfH5p+07 1w18J5ybanhJJ2n785fmkLwiHzr9f1xGIqvemKq6lYhanVUsTFjloRaTGc8ZzcgW r7gTsKC1p3PjxUYSsQbnI/AEG0noWK34Vvf/XtUGUOQEQpQ1Mxn+t6tR16334O/O HWsMsY9Ieh4fep8AUPaWvE6EH8qhhQng00hEWaNhArf63N/PdvbX4fUHDKn1HDOM GjX24KkWCe3xPA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudejvddgudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id EA610240054; Mon, 5 Apr 2021 05:15:12 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko , Gaetan Rivet Date: Mon, 5 Apr 2021 11:15:04 +0200 Message-Id: <20210405091506.562830-2-thomas@monjalon.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210405091506.562830-1-thomas@monjalon.net> References: <20210331223423.2089467-1-thomas@monjalon.net> <20210405091506.562830-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 1/2] pci: rename catch-all ID 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" 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 --- 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. */ }; /** @@ -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