bus/pci: fix unknown NUMA node value on Windows
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.
--- drivers/bus/pci/windows/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/bus/pci/windows/pci.c +2 -1
@@ -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
Quoted 27 lines · Pallavi Kadam
Based on the
rte_eth_dev_socket_id()documentation, set the defaultnuma_nodeto -1. When the API is unsuccessful, setnuma_nodeto 0.
This change more correctly resembles the Linux code.Fixes bf7cf1f947bd ("bus/pci: fix unknown NUMA node value on Windows")Reported-by Vipin Varghese <[email protected]>Signed-off-by Pallavi Kadam <[email protected]>--- drivers/bus/pci/windows/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/bus/pci/windows/pci.c +1
-0@@ -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"
(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 defaultnuma_nodeto -1. When the API is unsuccessful, setnuma_nodeto 0.
This change more correctly resembles the Linux code.Fixes bf7cf1f947bd ("bus/pci: fix unknown NUMA node value on Windows")Reported-by Vipin Varghese <[email protected]>Signed-off-by Pallavi Kadam <[email protected]>--- drivers/bus/pci/windows/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/bus/pci/windows/pci.c +1
-0@@ -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"
Thomas Monjalon
Applied27/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 defaultnuma_nodeto -1. When the API is unsuccessful, setnuma_nodeto 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")Reported-by Vipin Varghese <[email protected]>Signed-off-by Pallavi Kadam <[email protected]>Acked-by Ranjit Menon <[email protected]>
Applied, thanks.