Skip to contentSkip to conversation

bus/pci: fix unknown NUMA node value on Windows

PATCH Applied Pallavi Kadam 3 participants 4 messages Sep 27, 2021 – Sep 30, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bus/pci: fix unknown NUMA node value on Windows

Based on the rte_eth_dev_socket_id() documentation, set the default numa_node to -1. When the API is unsuccessful, set numa_node to 0.
This change more correctly resembles the Linux code.

Fixes bf7cf1f947bd ("bus/pci: fix unknown NUMA node value on Windows")
---
 drivers/bus/pci/windows/pci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/bus/pci/windows/pci.c +2 -1
index 343ef6f33b..644c452c76 100644
@@ -237,6 +237,7 @@ get_device_resource_info(HDEVINFO dev_info,
 	}
 
 	/* Get NUMA node using DEVPKEY_Device_Numa_Node */
+	dev->device.numa_node = SOCKET_ID_ANY;
 	res = SetupDiGetDevicePropertyW(dev_info, dev_info_data,
 		&DEVPKEY_Device_Numa_Node, &property_type,
 		(BYTE *)&numa_node, sizeof(numa_node), NULL, 0);
@@ -244,7 +245,7 @@ get_device_resource_info(HDEVINFO dev_info,
 		DWORD error = GetLastError();
 		if (error == ERROR_NOT_FOUND) {
 			/* On older CPUs, NUMA is not bound to PCIe locality. */
-			dev->device.numa_node = SOCKET_ID_ANY;
+			dev->device.numa_node = 0;
 			return ERROR_SUCCESS;
 		}
 		RTE_LOG_WIN32_ERR("SetupDiGetDevicePropertyW"
Signature · 1 line
2.31.1.windows.1
Acked-by Ranjit Menon on v1 1/1
#1 lore raw
Quoted 27 lines · Pallavi Kadam

Based on the rte_eth_dev_socket_id() documentation, set the default numa_node to -1. When the API is unsuccessful, set numa_node to 0.
This change more correctly resembles the Linux code.

Fixes bf7cf1f947bd ("bus/pci: fix unknown NUMA node value on Windows")
---
  drivers/bus/pci/windows/pci.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/bus/pci/windows/pci.c +1 -0
index 343ef6f33b..644c452c76 100644
@@ -237,6 +237,7 @@ get_device_resource_info(HDEVINFO dev_info,
  	}
 
  	/* Get NUMA node using DEVPKEY_Device_Numa_Node */
+	dev->device.numa_node = SOCKET_ID_ANY;
  	res = SetupDiGetDevicePropertyW(dev_info, dev_info_data,
  		&DEVPKEY_Device_Numa_Node, &property_type,
  		(BYTE *)&numa_node, sizeof(numa_node), NULL, 0);

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

Quoted 8 lines
drivers/bus/pci/windows/pci.c +1 -1
@@ -244,7 +245,7 @@ get_device_resource_info(HDEVINFO dev_info,
  		DWORD error = GetLastError();
  		if (error == ERROR_NOT_FOUND) {
  			/* On older CPUs, NUMA is not bound to PCIe locality. */
-			dev->device.numa_node = SOCKET_ID_ANY;
+			dev->device.numa_node = 0;
  			return ERROR_SUCCESS;
  		}
  		RTE_LOG_WIN32_ERR("SetupDiGetDevicePropertyW"
Acked-by Ranjit Menon <[email protected] <mailto:[email protected]>>
Acked-by on v1 1/1
#2 lore raw
In reply to Pallavi Kadam

(Sending the ACK again since Outlook appeared to make the email address a smart link!)

Quoted 27 lines · Pallavi Kadam

Based on the rte_eth_dev_socket_id() documentation, set the default numa_node to -1. When the API is unsuccessful, set numa_node to 0.
This change more correctly resembles the Linux code.

Fixes bf7cf1f947bd ("bus/pci: fix unknown NUMA node value on Windows")
---
  drivers/bus/pci/windows/pci.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/bus/pci/windows/pci.c +1 -0
index 343ef6f33b..644c452c76 100644
@@ -237,6 +237,7 @@ get_device_resource_info(HDEVINFO dev_info,
  	}
 
  	/* Get NUMA node using DEVPKEY_Device_Numa_Node */
+	dev->device.numa_node = SOCKET_ID_ANY;
  	res = SetupDiGetDevicePropertyW(dev_info, dev_info_data,
  		&DEVPKEY_Device_Numa_Node, &property_type,
  		(BYTE *)&numa_node, sizeof(numa_node), NULL, 0);

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

Quoted 8 lines
drivers/bus/pci/windows/pci.c +1 -1
@@ -244,7 +245,7 @@ get_device_resource_info(HDEVINFO dev_info,
  		DWORD error = GetLastError();
  		if (error == ERROR_NOT_FOUND) {
  			/* On older CPUs, NUMA is not bound to PCIe locality. */
-			dev->device.numa_node = SOCKET_ID_ANY;
+			dev->device.numa_node = 0;
  			return ERROR_SUCCESS;
  		}
  		RTE_LOG_WIN32_ERR("SetupDiGetDevicePropertyW"
#3 lore raw

27/09/2021 20:34, Menon, Ranjit:

Quoted 6 lines · Pallavi Kadam
Quoted 5 lines

Based on the rte_eth_dev_socket_id() documentation, set the default numa_node to -1. When the API is unsuccessful, set numa_node to 0.
This change more correctly resembles the Linux code.

Quoted 7 lines
Quoted 5 lines
Fixes bf7cf1f947bd ("bus/pci: fix unknown NUMA node value on Windows")

Applied, thanks.