From patchwork Wed Mar 31 22:34:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 90244 X-Patchwork-Delegate: thomas@monjalon.net 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 B5615A034F; Thu, 1 Apr 2021 00:34:42 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 98BA3140F1F; Thu, 1 Apr 2021 00:34:42 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by mails.dpdk.org (Postfix) with ESMTP id 6C577140F1F for ; Thu, 1 Apr 2021 00:34:41 +0200 (CEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 20D655C00C3; Wed, 31 Mar 2021 18:34:40 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 31 Mar 2021 18:34:40 -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=Iaxyqi5T6VwSV yNdQTsaBdPIAu35OGkhMJdAPBFj6xM=; b=NYNIkxNHu4W63FNfF1k8Aw3qx/RtM eWOjgng4Vr21bwnb5KnI5+ZVb3DIgYrvAe5qmMoXVmC7Aak8Nj3/ZIuRAdJICnXp GjG5hXOF4pKA6t3kSjjrrU7MvRh11l0kWaE/2N92+SQUiILEmF/z9CUbGfcWF7EQ dxPB9RYw4Qo0PqwNDIb6fgCu7lFYxjCHHJjCCDPOshCkZjrknBUTuvlqLEf30Mlu PC222woJ3utw4Mr2bsdwo3imrzCL7P94148jk33ujpDi+yLkowwxYJKqhecMijQ9 Yn0OMIKNSFHh+M9HSlbJSuDTqdELXoZffWWdgq5fWuYTeijFVIiXKRMLg== 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=Iaxyqi5T6VwSVyNdQTsaBdPIAu35OGkhMJdAPBFj6xM=; b=Pcu/+0L2 K3eZ9/qCsPW7e4m6D3JFQpzekQVuU30YnSIhSD+c+3nOwS4u5Pi7eG7dEjQGIdMk ERX+fWIQAZnH315ry9CHm19jmloB7YHomDYDLeQHhlb8NxwK9Y3WIlU+F8BB+okW NXu7MzFlRe8kkNNuF3VAM/I+TP4n5aUjgjxuWKOvkAf2MvWFcPBF9ltLSEBjK0cs +QH/Y0VOJ88fCSBcW6/YoWtRGQbXrATlN4x+ehEPnen23Qha9UdPm+uBaFx06zpi lg6FysE8aDUJmdK5i7gJ2iL+lFRLdq5S/nsGsLVW1C1WuKxMHDG7Tr1vcMghpJGE H2FAJPPHI/bufA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudeifedgtdelucetufdoteggodetrfdotf 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 9D6C21080069; Wed, 31 Mar 2021 18:34:39 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: Gaetan Rivet Date: Thu, 1 Apr 2021 00:34:22 +0200 Message-Id: <20210331223423.2089467-2-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210331223423.2089467-1-thomas@monjalon.net> References: <20210331223423.2089467-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 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 Reviewed-by: Parav Pandit --- drivers/bus/pci/pci_common.c | 8 ++++---- drivers/bus/pci/rte_bus_pci.h | 12 ++++-------- lib/librte_pci/rte_pci.h | 12 +++++++----- 3 files changed, 15 insertions(+), 17 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/lib/librte_pci/rte_pci.h b/lib/librte_pci/rte_pci.h index f89c7dbbea..ed3196a368 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_PCI_ANY_ID #define RTE_CLASS_ANY_ID (0xffffff) /** From patchwork Wed Mar 31 22:34:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 90245 X-Patchwork-Delegate: thomas@monjalon.net 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 F0144A034F; Thu, 1 Apr 2021 00:34:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DD4BA140F30; Thu, 1 Apr 2021 00:34:48 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by mails.dpdk.org (Postfix) with ESMTP id DE0C1140F2A for ; Thu, 1 Apr 2021 00:34:46 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 919595C00D6; Wed, 31 Mar 2021 18:34:46 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 31 Mar 2021 18:34:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=4Cf+cVV9RT9rU Scs/Mm40o5TVodnQcFY9S1gEbSo2I8=; b=DphVEu42ZLQOXjAZahur05kbO5qQ6 6FpheauJ9UNnpYjgTCCBC8HUwTj/g3FzdHvIU1+zS4TfBmjPDd5ipihDeMMEJoPl OlN1H4L8xw3rsv9xSwZ7wz6g7Enil8wW4OOd3IZdgkx+PR+zdcqmsAnYO728cvlR 17UbUvbeHOGn3dPd0TDTzzENG1A1iM8a9aCAnCunORFKLwX99SvaHb3jx6uk6FAl br2PFNQW4TjPBPLV/CvlvkaIE/183mq4RT+dmU+Tuw397MwDpwSNyxTdZBljRTFP UEC281Qp/naCWHeSIE7e5Wft0LHJHzWx80srKQYeZnEYjFt/fWtc6VaQg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=4Cf+cVV9RT9rUScs/Mm40o5TVodnQcFY9S1gEbSo2I8=; b=VqfYPvVR MSVX4gP8tVHQhTwZwlgtrq8uELYLNQlWVrxosKgtmZn7mowpNFzz+W/Wj3V0xZ2X sMJrzDrIrrayR5u5vp/Cs9S6dn60pt4Tj+TOSu/Fgwc0IRXjGjow29bq5/7taqnT +mymXS7V73hGpi9T8dgY1o65VmQL+EfyMM7GLnJ8+etuHvwaNkSQTGjyj/OjpFJw kMLmno7mh0rZODlvbIaBLWlytePSd7Wd3PAE09Gx18FTbu2As2inqpUVB29pO0Ho Fv1nOKj/G8F6coCCQ5lpVkf8FJI/0bki9iwO26pyhvOVeknqUyuDO/S/E0f2INer gSqwp4Agws9/GQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudeifedguddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepvfhhohhmrghsucfoohhnjhgrlhhonhcuoehthhhomhgrshes mhhonhhjrghlohhnrdhnvghtqeenucggtffrrghtthgvrhhnpedvhefgiedvjeegtdevhe efhfetleefgfeivefgffevfeejgedtgfeutdehtdegveenucfkphepjeejrddufeegrddv tdefrddukeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth 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 2FF8D1080054 for ; Wed, 31 Mar 2021 18:34:46 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Date: Thu, 1 Apr 2021 00:34:23 +0200 Message-Id: <20210331223423.2089467-3-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210331223423.2089467-1-thomas@monjalon.net> References: <20210331223423.2089467-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 2/2] bus/pci: rename probe/remove operation types 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 names of the prototypes pci_probe_t and pci_remove_t are missing a prefix rte_. These function types are simply renamed. No compatibility break is expected for the applications because it is considered as an internal name in the driver interface. Signed-off-by: Thomas Monjalon --- drivers/bus/pci/rte_bus_pci.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/bus/pci/rte_bus_pci.h b/drivers/bus/pci/rte_bus_pci.h index 3a092bc6d5..64886b4731 100644 --- a/drivers/bus/pci/rte_bus_pci.h +++ b/drivers/bus/pci/rte_bus_pci.h @@ -112,12 +112,12 @@ struct rte_pci_device { /** * Initialisation function for the driver called during PCI probing. */ -typedef int (pci_probe_t)(struct rte_pci_driver *, struct rte_pci_device *); +typedef int (rte_pci_probe_t)(struct rte_pci_driver *, struct rte_pci_device *); /** * Uninitialisation function for the driver called during hotplugging. */ -typedef int (pci_remove_t)(struct rte_pci_device *); +typedef int (rte_pci_remove_t)(struct rte_pci_device *); /** * Driver-specific DMA mapping. After a successful call the device @@ -164,8 +164,8 @@ struct rte_pci_driver { TAILQ_ENTRY(rte_pci_driver) next; /**< Next in list. */ struct rte_driver driver; /**< Inherit core driver. */ struct rte_pci_bus *bus; /**< PCI bus reference. */ - pci_probe_t *probe; /**< Device Probe function. */ - pci_remove_t *remove; /**< Device Remove function. */ + rte_pci_probe_t *probe; /**< Device probe function. */ + rte_pci_remove_t *remove; /**< Device remove function. */ pci_dma_map_t *dma_map; /**< device dma map function. */ pci_dma_unmap_t *dma_unmap; /**< device dma unmap function. */ const struct rte_pci_id *id_table; /**< ID table, NULL terminated. */