DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] bus/pci: fix numa node return value
@ 2021-09-22 21:19 Pallavi Kadam
  2021-09-23 15:44 ` Tal Shnaiderman
  2021-09-24  9:13 ` Varghese, Vipin
  0 siblings, 2 replies; 4+ messages in thread
From: Pallavi Kadam @ 2021-09-22 21:19 UTC (permalink / raw)
  To: dev
  Cc: stable, thomas, ranjit.menon, dmitry.kozliuk, talshn,
	Narcisa.Vasile, Vipin.Varghese, pallavi.kadam

On older CPUs, currently numa_node returns value only for socket 0.
Instead, application should be able to make correct decision and
also to keep consistent with the Linux code,
replace the return value to -1.

Fixes: ac7c98d04f2c ("bus/pci: ignore missing NUMA node on Windows")
Cc: talshn@nvidia.com
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 d39a7748b8..343ef6f33b 100644
--- a/drivers/bus/pci/windows/pci.c
+++ b/drivers/bus/pci/windows/pci.c
@@ -5,6 +5,7 @@
 #include <rte_errno.h>
 #include <rte_log.h>
 #include <rte_eal.h>
+#include <rte_memory.h>
 
 #include "private.h"
 #include "pci_netuio.h"
@@ -243,7 +244,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 = 0;
+			dev->device.numa_node = SOCKET_ID_ANY;
 			return ERROR_SUCCESS;
 		}
 		RTE_LOG_WIN32_ERR("SetupDiGetDevicePropertyW"
-- 
2.31.1.windows.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] bus/pci: fix numa node return value
  2021-09-22 21:19 [dpdk-dev] [PATCH] bus/pci: fix numa node return value Pallavi Kadam
@ 2021-09-23 15:44 ` Tal Shnaiderman
  2021-09-23 17:09   ` Thomas Monjalon
  2021-09-24  9:13 ` Varghese, Vipin
  1 sibling, 1 reply; 4+ messages in thread
From: Tal Shnaiderman @ 2021-09-23 15:44 UTC (permalink / raw)
  To: Pallavi Kadam, dev
  Cc: stable, NBU-Contact-Thomas Monjalon, ranjit.menon,
	dmitry.kozliuk, Narcisa.Vasile, Vipin.Varghese

> Subject: [PATCH] bus/pci: fix numa node return value
> 
> External email: Use caution opening links or attachments
> 
> 
> On older CPUs, currently numa_node returns value only for socket 0.
> Instead, application should be able to make correct decision and also to keep
> consistent with the Linux code, replace the return value to -1.
> 
> Fixes: ac7c98d04f2c ("bus/pci: ignore missing NUMA node on Windows")
> Cc: talshn@nvidia.com
> 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 d39a7748b8..343ef6f33b 100644
> --- a/drivers/bus/pci/windows/pci.c
> +++ b/drivers/bus/pci/windows/pci.c
> @@ -5,6 +5,7 @@
>  #include <rte_errno.h>
>  #include <rte_log.h>
>  #include <rte_eal.h>
> +#include <rte_memory.h>
> 
>  #include "private.h"
>  #include "pci_netuio.h"
> @@ -243,7 +244,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 = 0;
> +                       dev->device.numa_node = SOCKET_ID_ANY;
>                         return ERROR_SUCCESS;
>                 }
>                 RTE_LOG_WIN32_ERR("SetupDiGetDevicePropertyW"
> --
> 2.31.1.windows.1

You should add "on Windows" to the end of the patch name to clarity it's a Windows issue.

Aside from that LGTM.

Acked-by: Tal Shnaiderman <talshn@nvidia.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] bus/pci: fix numa node return value
  2021-09-23 15:44 ` Tal Shnaiderman
@ 2021-09-23 17:09   ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2021-09-23 17:09 UTC (permalink / raw)
  To: Pallavi Kadam
  Cc: dev, stable, ranjit.menon, dmitry.kozliuk, Narcisa.Vasile,
	Vipin.Varghese, Tal Shnaiderman

23/09/2021 17:44, Tal Shnaiderman:
> > Subject: [PATCH] bus/pci: fix numa node return value
> > 
> > On older CPUs, currently numa_node returns value only for socket 0.
> > Instead, application should be able to make correct decision and also to keep
> > consistent with the Linux code, replace the return value to -1.
> > 
> > Fixes: ac7c98d04f2c ("bus/pci: ignore missing NUMA node on Windows")
> > Cc: talshn@nvidia.com
> > Cc: stable@dpdk.org
> > 
> > Reported-by: Vipin Varghese <Vipin.Varghese@intel.com>
> > Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
> 
> Acked-by: Tal Shnaiderman <talshn@nvidia.com>

Applied, thanks



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] bus/pci: fix numa node return value
  2021-09-22 21:19 [dpdk-dev] [PATCH] bus/pci: fix numa node return value Pallavi Kadam
  2021-09-23 15:44 ` Tal Shnaiderman
@ 2021-09-24  9:13 ` Varghese, Vipin
  1 sibling, 0 replies; 4+ messages in thread
From: Varghese, Vipin @ 2021-09-24  9:13 UTC (permalink / raw)
  To: Kadam, Pallavi, dev
  Cc: stable, thomas, Menon, Ranjit, dmitry.kozliuk, talshn, Narcisa.Vasile

Hi Pallavi,

Assuming the intention is set SOCKET_ID_ANY for faulty cases, couple of observation. In Linux

```
        if (access(filename, F_OK) != -1) {
                if (eal_parse_sysfs_value(filename, &tmp) == 0)
                        dev->device.numa_node = tmp;
                else
                        dev->device.numa_node = -1;
        } else {
                dev->device.numa_node = 0;
        }
```

[snipped]
 
> @@ -243,7 +244,7 @@ get_device_resource_info(HDEVINFO dev_info,
>  		DWORD error = GetLastError();

Set the default value as ` dev->device.numa_node = SOCKET_ID_ANY;`

>  		if (error == ERROR_NOT_FOUND) {
>  			/* On older CPUs, NUMA is not bound to PCIe
> locality. */
> -			dev->device.numa_node = 0;
> +			dev->device.numa_node = SOCKET_ID_ANY;

If the API is unsuccessful for ` ERROR_NOT_FOUND ` then you can set it to  `0` (as recommened in documentation)

>  			return ERROR_SUCCESS;
>  		}
>  		RTE_LOG_WIN32_ERR("SetupDiGetDevicePropertyW"

Else if if it other errors it will ` SOCKET_ID_ANY`.
> --
> 2.31.1.windows.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-24  9:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-22 21:19 [dpdk-dev] [PATCH] bus/pci: fix numa node return value Pallavi Kadam
2021-09-23 15:44 ` Tal Shnaiderman
2021-09-23 17:09   ` Thomas Monjalon
2021-09-24  9:13 ` Varghese, Vipin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).