patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH v5 1/4] bus/pci: fix registration of PCI device
       [not found] ` <20250206000838.23428-1-shperetz@nvidia.com>
@ 2025-02-06  0:08   ` Shani Peretz
  2025-02-06 11:22     ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Shani Peretz @ 2025-02-06  0:08 UTC (permalink / raw)
  To: dev; +Cc: stephen, Shani Peretz, stable, Chenbo Xia, Nipun Gupta, Gaetan Rivet

When registering a new PCI device, the device->name field stored
the user-provided string from devargs (e.g., "08:00.0" or "0000:08:00.0").
This approach led to inconsistencies when registering new devices.

This patch fix this issue by saving the parsed PCI in device->name,
so when a new PCI device is registering the name displayed in the device
list will be the parsed version.

Fixes: 23eaa9059ec2 ("bus/pci: use given name as generic name")

Cc: stable@dpdk.org
Signed-off-by: Shani Peretz <shperetz@nvidia.com>
---
 drivers/bus/pci/pci_common.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c
index 1173f0887c..70faae4e44 100644
--- a/drivers/bus/pci/pci_common.c
+++ b/drivers/bus/pci/pci_common.c
@@ -99,21 +99,11 @@ pci_common_set(struct rte_pci_device *dev)
 	/* Each device has its internal, canonical name set. */
 	rte_pci_device_name(&dev->addr,
 			dev->name, sizeof(dev->name));
+	dev->device.name = dev->name;
+
 	devargs = pci_devargs_lookup(&dev->addr);
 	dev->device.devargs = devargs;
 
-	/* When using a blocklist, only blocked devices will have
-	 * an rte_devargs. Allowed devices won't have one.
-	 */
-	if (devargs != NULL)
-		/* If an rte_devargs exists, the generic rte_device uses the
-		 * given name as its name.
-		 */
-		dev->device.name = dev->device.devargs->name;
-	else
-		/* Otherwise, it uses the internal, canonical form. */
-		dev->device.name = dev->name;
-
 	if (dev->bus_info != NULL ||
 			asprintf(&dev->bus_info, "vendor_id=%"PRIx16", device_id=%"PRIx16,
 				dev->id.vendor_id, dev->id.device_id) != -1)
-- 
2.34.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v5 1/4] bus/pci: fix registration of PCI device
  2025-02-06  0:08   ` [PATCH v5 1/4] bus/pci: fix registration of PCI device Shani Peretz
@ 2025-02-06 11:22     ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2025-02-06 11:22 UTC (permalink / raw)
  To: Shani Peretz
  Cc: dev, stephen, stable, Chenbo Xia, Nipun Gupta, Gaetan Rivet,
	Shani Peretz

06/02/2025 01:08, Shani Peretz:
> When registering a new PCI device, the device->name field stored
> the user-provided string from devargs (e.g., "08:00.0" or "0000:08:00.0").
> This approach led to inconsistencies when registering new devices.
> 
> This patch fix this issue by saving the parsed PCI in device->name,
> so when a new PCI device is registering the name displayed in the device
> list will be the parsed version.
> 
> Fixes: 23eaa9059ec2 ("bus/pci: use given name as generic name")
> 
> Cc: stable@dpdk.org
> Signed-off-by: Shani Peretz <shperetz@nvidia.com>

It's way simpler.
Acked-by: Thomas Monjalon <thomas@monjalon.net>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-02-06 11:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20250129085416.226718-1-shperetz@nvidia.com>
     [not found] ` <20250206000838.23428-1-shperetz@nvidia.com>
2025-02-06  0:08   ` [PATCH v5 1/4] bus/pci: fix registration of PCI device Shani Peretz
2025-02-06 11:22     ` Thomas Monjalon

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).