Skip to contentSkip to conversation

raw/ifpga: fix ifpga device name format

PATCH Applied Wei Huang 4 participants 4 messages Apr 22, 2021 – Apr 28, 2021

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore

Wei Huang

author
#0 lore raw

PATCH 1/1 raw/ifpga: fix ifpga device name format

The device name format used in ifpga_rawdev_create() was changed to "IFPGA:%02x:%02x.%x", but the format used in ifpga_rawdev_destroy() was left as "IFPGA:%x:%02x.%x", it should be changed synchronously.

Fixes 9c006c45d0c5 ("raw/ifpga: scan PCIe BDF device tree")
---
 drivers/raw/ifpga/ifpga_rawdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/raw/ifpga/ifpga_rawdev.c +1 -1
index d9a46ef915..f591a87b49 100644
@@ -1551,7 +1551,7 @@ ifpga_rawdev_destroy(struct rte_pci_device *pci_dev)
 	}
 
 	memset(name, 0, sizeof(name));
-	snprintf(name, RTE_RAWDEV_NAME_MAX_LEN, "IFPGA:%x:%02x.%x",
+	snprintf(name, RTE_RAWDEV_NAME_MAX_LEN, "IFPGA:%02x:%02x.%x",
 		pci_dev->addr.bus, pci_dev->addr.devid, pci_dev->addr.function);
 
 	IFPGA_RAWDEV_PMD_INFO("Closing %s on NUMA node %d",
Signature · 1 line
2.29.2
Acked-by on v1 1/1
#1 lore raw

Hi,

Quoted 36 lines

-----Original Message-----
From: Huang, Wei <[email protected]>
Sent: Thursday, April 22, 2021 16:27
To: [email protected]; Xu, Rosen <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: [email protected]; Zhang, Tianfei <[email protected]>; Yigit, Ferruh <[email protected]>; Huang, Wei <[email protected]>
Subject: [PATCH v1] raw/ifpga: fix ifpga device name format

The device name format used in ifpga_rawdev_create() was changed to "IFPGA:%02x:%02x.%x", but the format used in ifpga_rawdev_destroy() was left as "IFPGA:%x:%02x.%x", it should be changed synchronously.

Fixes 9c006c45d0c5 ("raw/ifpga: scan PCIe BDF device tree")
---
 drivers/raw/ifpga/ifpga_rawdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/raw/ifpga/ifpga_rawdev.c +1 -1
index d9a46ef915..f591a87b49 100644
@@ -1551,7 +1551,7 @@ ifpga_rawdev_destroy(struct rte_pci_device
 *pci_dev)
 	}
 
 	memset(name, 0, sizeof(name));
-	snprintf(name, RTE_RAWDEV_NAME_MAX_LEN,
 "IFPGA:%x:%02x.%x",
+	snprintf(name, RTE_RAWDEV_NAME_MAX_LEN,
 "IFPGA:%02x:%02x.%x",

pci_dev->addr.bus, pci_dev->addr.devid, pci_dev-

Quoted 5 lines
Quoted 1 line

addr.function);

IFPGA_RAWDEV_PMD_INFO("Closing %s on NUMA node %d",
--
2.29.2

Applied
#2 lore raw
Quoted 48 lines

-----Original Message-----
From: Xu, Rosen <[email protected]>
Sent: Thursday, April 22, 2021 7:13 PM
To: Huang, Wei <[email protected]>; [email protected]; Zhang, Qi Z <[email protected]>
Cc: [email protected]; Zhang, Tianfei <[email protected]>; Yigit, Ferruh <[email protected]>
Subject: RE: [PATCH v1] raw/ifpga: fix ifpga device name format

Hi,

Quoted 35 lines

-----Original Message-----
From: Huang, Wei <[email protected]>
Sent: Thursday, April 22, 2021 16:27
To: [email protected]; Xu, Rosen <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: [email protected]; Zhang, Tianfei <[email protected]>; Yigit, Ferruh <[email protected]>; Huang, Wei <[email protected]>
Subject: [PATCH v1] raw/ifpga: fix ifpga device name format

The device name format used in ifpga_rawdev_create() was changed to "IFPGA:%02x:%02x.%x", but the format used in ifpga_rawdev_destroy() was left as "IFPGA:%x:%02x.%x", it should be changed synchronously.

Fixes 9c006c45d0c5 ("raw/ifpga: scan PCIe BDF device tree")
---
 drivers/raw/ifpga/ifpga_rawdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/raw/ifpga/ifpga_rawdev.c +1 -1
index d9a46ef915..f591a87b49 100644
@@ -1551,7 +1551,7 @@ ifpga_rawdev_destroy(struct rte_pci_device
 *pci_dev)
 }
 
 memset(name, 0, sizeof(name));
-snprintf(name, RTE_RAWDEV_NAME_MAX_LEN, "IFPGA:%x:%02x.%x",
+snprintf(name, RTE_RAWDEV_NAME_MAX_LEN,
 "IFPGA:%02x:%02x.%x",
 pci_dev->addr.bus, pci_dev->addr.devid, pci_dev-
Quoted 7 lines
Quoted 5 lines
Quoted 1 line

addr.function);

IFPGA_RAWDEV_PMD_INFO("Closing %s on NUMA node %d",
--
2.29.2

Applied to dpdk-next-net-intel

Thanks
Qi

#3 lore raw
In reply to Wei Huang
Quoted 4 lines · Wei Huang

The device name format used in ifpga_rawdev_create() was changed to "IFPGA:%02x:%02x.%x", but the format used in ifpga_rawdev_destroy() was left as "IFPGA:%x:%02x.%x", it should be changed synchronously.

Hi Wei,

If the name is significant, why not convert the format into a macro and use it? This prevents further similar errors, also highlights that format should be exact same.

Quoted 22 lines
Fixes 9c006c45d0c5 ("raw/ifpga: scan PCIe BDF device tree")
---
 drivers/raw/ifpga/ifpga_rawdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/raw/ifpga/ifpga_rawdev.c +1 -1
index d9a46ef915..f591a87b49 100644
@@ -1551,7 +1551,7 @@ ifpga_rawdev_destroy(struct rte_pci_device *pci_dev)
 	}
 
 	memset(name, 0, sizeof(name));
-	snprintf(name, RTE_RAWDEV_NAME_MAX_LEN, "IFPGA:%x:%02x.%x",
+	snprintf(name, RTE_RAWDEV_NAME_MAX_LEN, "IFPGA:%02x:%02x.%x",
 		pci_dev->addr.bus, pci_dev->addr.devid, pci_dev->addr.function);
 
 	IFPGA_RAWDEV_PMD_INFO("Closing %s on NUMA node %d",