Skip to contentSkip to conversation

pci/windows: do not fail on missing NUMA node for PCIe

PATCH In review Tal Shnaiderman 5 participants 5 messages Dec 13, 2020 – Jan 5, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pci/windows: do not fail on missing NUMA node for PCIe

On older processors, NUMA isn't bound to PCIe locality. those cases return ERROR_NOT_FOUND in response to the SetupDiGetDevicePropertyW call with DEVPKEY_Device_Numa_Node attribute.

This error fails the probe process for the PCIe device. this commit will ignore such failure and will set the numa_node to 0.

Fixes b762221ac24f ("bus/pci: support Windows with bifurcated drivers")
---
 drivers/bus/pci/windows/pci.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/bus/pci/windows/pci.c +9 -0
index 33a5fb1d83..62bac4b8ec 100644
@@ -234,6 +234,15 @@ get_device_resource_info(HDEVINFO dev_info,
 		&DEVPKEY_Device_Numa_Node, &property_type,
 		(BYTE *)&numa_node, sizeof(numa_node), NULL, 0);
 	if (!res) {
+		DWORD error = GetLastError();
+		if (error == ERROR_NOT_FOUND) {
+			/* On older CPUs, NUMA isn't bound to PCIe locality
+			 * We do not want to fail the probing process
+			 * Setting 0 for numa_node and returnng ERROR_SUCCESS.
+			 */
+			dev->device.numa_node = 0;
+			return ERROR_SUCCESS;
+		}
 		RTE_LOG_WIN32_ERR("SetupDiGetDevicePropertyW"
 			"(DEVPKEY_Device_Numa_Node)");
 		return -1;
Signature · 1 line
2.16.1.windows.4
Tested-by on v1 1/1
#1 lore raw
Quoted 41 lines

Subject: [PATCH] pci/windows: do not fail on missing NUMA node for PCIe

On older processors, NUMA isn't bound to PCIe locality. those cases return ERROR_NOT_FOUND in response to the SetupDiGetDevicePropertyW call with DEVPKEY_Device_Numa_Node attribute.

This error fails the probe process for the PCIe device. this commit will ignore such failure and will set the numa_node to 0.

Fixes b762221ac24f ("bus/pci: support Windows with bifurcated drivers")
---
 drivers/bus/pci/windows/pci.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/bus/pci/windows/pci.c +5 -0
index 33a5fb1d83..62bac4b8ec 100644
@@ -234,6 +234,15 @@ get_device_resource_info(HDEVINFO dev_info,
 		&DEVPKEY_Device_Numa_Node, &property_type,
 		(BYTE *)&numa_node, sizeof(numa_node), NULL, 0);
 	if (!res) {
+		DWORD error = GetLastError();
+		if (error == ERROR_NOT_FOUND) {
+			/* On older CPUs, NUMA isn't bound to PCIe locality
+			 * We do not want to fail the probing process
+			 * Setting 0 for numa_node and returnng

ERROR_SUCCESS.

drivers/bus/pci/windows/pci.c +4 -1
+			 */
+			dev->device.numa_node = 0;
+			return ERROR_SUCCESS;
+		}
 		RTE_LOG_WIN32_ERR("SetupDiGetDevicePropertyW"
 			"(DEVPKEY_Device_Numa_Node)");
 		return -1;
--
Quoted 1 line

2.16.1.windows.4

Acked-by on v1 1/1
#2 lore raw
In reply to Tal Shnaiderman
Quoted 9 lines · Tal Shnaiderman

On older processors, NUMA isn't bound to PCIe locality. those cases return ERROR_NOT_FOUND in response to the SetupDiGetDevicePropertyW call with DEVPKEY_Device_Numa_Node attribute.

This error fails the probe process for the PCIe device. this commit will ignore such failure and will set the numa_node to 0.

Quoted 5 lines
Fixes b762221ac24f ("bus/pci: support Windows with bifurcated drivers")
Acked-by on v1 1/1
#3 lore raw
In reply to Tal Shnaiderman
Quoted 9 lines · Tal Shnaiderman

On older processors, NUMA isn't bound to PCIe locality. those cases return ERROR_NOT_FOUND in response to the SetupDiGetDevicePropertyW call with DEVPKEY_Device_Numa_Node attribute.

This error fails the probe process for the PCIe device. this commit will ignore such failure and will set the numa_node to 0.

Quoted 8 lines
Fixes b762221ac24f ("bus/pci: support Windows with bifurcated drivers")
---
  drivers/bus/pci/windows/pci.c | 9 +++++++++
  1 file changed, 9 insertions(+)
#4 lore raw
In reply to Tal Shnaiderman

13/12/2020 15:16, Tal Shnaiderman:

Quoted 18 lines

On older processors, NUMA isn't bound to PCIe locality. those cases return ERROR_NOT_FOUND in response to the SetupDiGetDevicePropertyW call with DEVPKEY_Device_Numa_Node attribute.

This error fails the probe process for the PCIe device. this commit will ignore such failure and will set the numa_node to 0.

Fixes b762221ac24f ("bus/pci: support Windows with bifurcated drivers")

---

drivers/bus/pci/windows/pci.c get_device_resource_info(HDEVINFO dev_info, · line 242

Quoted 9 lines
drivers/bus/pci/windows/pci.c +6 -0
@@ -234,6 +234,15 @@ get_device_resource_info(HDEVINFO dev_info,
 		&DEVPKEY_Device_Numa_Node, &property_type,
 		(BYTE *)&numa_node, sizeof(numa_node), NULL, 0);
 	if (!res) {
+		DWORD error = GetLastError();
+		if (error == ERROR_NOT_FOUND) {
+			/* On older CPUs, NUMA isn't bound to PCIe locality
+			 * We do not want to fail the probing process
+			 * Setting 0 for numa_node and returnng ERROR_SUCCESS.
+			 */

The last 2 lines of comment are rephrasing the 2 lines of code below, so it can be removed.

drivers/bus/pci/windows/pci.c get_device_resource_info(HDEVINFO dev_info, · line 245

Quoted 3 lines
drivers/bus/pci/windows/pci.c +3 -0
+			dev->device.numa_node = 0;
+			return ERROR_SUCCESS;
+		}

Applied with smaller comment, thanks.