diff mbox series

bus/pci: fix unknown NUMA node value on Windows

Message ID 20210927184322.1455-1-pallavi.kadam@intel.com (mailing list archive)
State Accepted
Delegated to: Thomas Monjalon
Headers show
Series bus/pci: fix unknown NUMA node value on Windows | expand

Checks

Context Check Description
ci/iol-testing warning apply patch failure
ci/github-robot: build success github build: passed
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Kadam, Pallavi Sept. 27, 2021, 6:43 p.m. UTC
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")
Cc: stable@dpdk.org

Reported-by: Vipin Varghese <vipin.varghese@intel.com>
Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
---
 drivers/bus/pci/windows/pci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Menon, Ranjit Sept. 27, 2021, 6:29 p.m. UTC | #1
On 9/27/2021 11:43 AM, Pallavi Kadam wrote:
> 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")
> Cc: stable@dpdk.org
>
> Reported-by: Vipin Varghese <vipin.varghese@intel.com>
> Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
> ---
>   drivers/bus/pci/windows/pci.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c
> index 343ef6f33b..644c452c76 100644
> --- a/drivers/bus/pci/windows/pci.c
> +++ b/drivers/bus/pci/windows/pci.c
> @@ -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"


Acked-by: Ranjit Menon <ranjit.menon@intel.com 
<mailto:ranjit.menon@intel.com>>
Menon, Ranjit Sept. 27, 2021, 6:34 p.m. UTC | #2
(Sending the ACK again since Outlook appeared to make the email address 
a smart link!)

On 9/27/2021 11:43 AM, Pallavi Kadam wrote:
> 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")
> Cc: stable@dpdk.org
>
> Reported-by: Vipin Varghese <vipin.varghese@intel.com>
> Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
> ---
>   drivers/bus/pci/windows/pci.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c
> index 343ef6f33b..644c452c76 100644
> --- a/drivers/bus/pci/windows/pci.c
> +++ b/drivers/bus/pci/windows/pci.c
> @@ -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"

Acked-by: Ranjit Menon <ranjit.menon@intel.com>
Thomas Monjalon Sept. 30, 2021, 4:22 p.m. UTC | #3
27/09/2021 20:34, Menon, Ranjit:
> On 9/27/2021 11:43 AM, Pallavi Kadam wrote:
> > 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")
> > Cc: stable@dpdk.org
> >
> > Reported-by: Vipin Varghese <vipin.varghese@intel.com>
> > Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
> 
> Acked-by: Ranjit Menon <ranjit.menon@intel.com>

Applied, thanks.
diff mbox series

Patch

diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c
index 343ef6f33b..644c452c76 100644
--- a/drivers/bus/pci/windows/pci.c
+++ b/drivers/bus/pci/windows/pci.c
@@ -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"