diff mbox series

[v2] bus: clarify log for non-NUMA-aware devices

Message ID 20210616100712.829035-1-dkozlyuk@nvidia.com (mailing list archive)
State Superseded
Delegated to: David Marchand
Headers show
Series [v2] bus: clarify log for non-NUMA-aware devices | expand

Checks

Context Check Description
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Functional fail Functional Testing issues
ci/github-robot success github build: passed
ci/iol-testing fail Testing issues
ci/iol-abi-testing warning Testing issues
ci/intel-Testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch warning coding style issues

Commit Message

Dmitry Kozlyuk June 16, 2021, 10:07 a.m. UTC
PCI and vmbus drivers printed a warning
when NUMA node had beed reported as (-1) or not reported by OS:

    EAL:   Invalid NUMA socket, default to 0

This message and its level might confuse users, because configuration
is valid and nothing happens that requires attention or intervention.

Reduce level to INFO, reword the message, and suppress it when there is
only one NUMA node, bacause NUMA-awareness does not matter in this case.

Fixes: f0e0e86aa35d ("pci: move NUMA node check from scan to probe")
Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support")
Cc: stable@dpdk.org

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Reviewed-by: Xueming Li <xuemingl@nvidia.com>
---
v2: Add NUMA node count check (Stephen Hemminger).

 doc/guides/nics/ena.rst          | 2 +-
 drivers/bus/pci/pci_common.c     | 4 ++--
 drivers/bus/vmbus/vmbus_common.c | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

Comments

Andrew Rybchenko July 23, 2021, 8:07 p.m. UTC | #1
On 6/16/21 1:07 PM, Dmitry Kozlyuk wrote:
> PCI and vmbus drivers printed a warning
> when NUMA node had beed reported as (-1) or not reported by OS:
> 
>      EAL:   Invalid NUMA socket, default to 0
> 
> This message and its level might confuse users, because configuration
> is valid and nothing happens that requires attention or intervention.
> 
> Reduce level to INFO, reword the message, and suppress it when there is
> only one NUMA node, bacause NUMA-awareness does not matter in this case.
> 
> Fixes: f0e0e86aa35d ("pci: move NUMA node check from scan to probe")
> Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
> Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> Reviewed-by: Xueming Li <xuemingl@nvidia.com>
> ---
> v2: Add NUMA node count check (Stephen Hemminger).
> 
>   doc/guides/nics/ena.rst          | 2 +-
>   drivers/bus/pci/pci_common.c     | 4 ++--
>   drivers/bus/vmbus/vmbus_common.c | 4 ++--
>   3 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/doc/guides/nics/ena.rst b/doc/guides/nics/ena.rst
> index 0f1f63f722..694ce1da74 100644
> --- a/doc/guides/nics/ena.rst
> +++ b/doc/guides/nics/ena.rst
> @@ -234,7 +234,7 @@ Example output:
>   
>      [...]
>      EAL: PCI device 0000:00:06.0 on NUMA socket -1
> -   EAL:   Invalid NUMA socket, default to 0
> +   EAL:   Device is not NUMA-aware, defaulting socket to 0
>      EAL:   probe driver: 1d0f:ec20 net_ena
>   
>      Interactive-mode selected
> diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c
> index 35d7d092d1..0bb56d9b7f 100644
> --- a/drivers/bus/pci/pci_common.c
> +++ b/drivers/bus/pci/pci_common.c
> @@ -189,8 +189,8 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr,
>   		return 1;
>   	}
>   
> -	if (dev->device.numa_node < 0) {
> -		RTE_LOG(WARNING, EAL, "  Invalid NUMA socket, default to 0\n");
> +	if (rte_socket_count() > 1 && dev->device.numa_node < 0) {
> +		RTE_LOG(INFO, EAL, "  Device is not NUMA-aware, defaulting socket to 0\n");
>   		dev->device.numa_node = 0;

Is it intended side-effect of the patch that above assignment
is not done if node is negative and there is only one socket?

>   	}
>   
> diff --git a/drivers/bus/vmbus/vmbus_common.c b/drivers/bus/vmbus/vmbus_common.c
> index d25fd14ef5..5b654b0289 100644
> --- a/drivers/bus/vmbus/vmbus_common.c
> +++ b/drivers/bus/vmbus/vmbus_common.c
> @@ -111,8 +111,8 @@ vmbus_probe_one_driver(struct rte_vmbus_driver *dr,
>   	/* reference driver structure */
>   	dev->driver = dr;
>   
> -	if (dev->device.numa_node < 0) {
> -		VMBUS_LOG(WARNING, "  Invalid NUMA socket, default to 0");
> +	if (rte_socket_count() > 1 && dev->device.numa_node < 0) {
> +		VMBUS_LOG(INFO, "  Device is not NUMA-aware, defaulting socket to 0\n");
>   		dev->device.numa_node = 0;

Same question here.

>   	}
>   
>
Dmitry Kozlyuk July 27, 2021, 8:08 a.m. UTC | #2
> -----Original Message-----
> From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> Sent: 23 июля 2021 г. 23:07
> To: Dmitry Kozlyuk <dkozlyuk@nvidia.com>; dev@dpdk.org
> Cc: stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2] bus: clarify log for non-NUMA-aware devices
> 
> External email: Use caution opening links or attachments
> 
> 
> On 6/16/21 1:07 PM, Dmitry Kozlyuk wrote:
> > PCI and vmbus drivers printed a warning when NUMA node had beed
> > reported as (-1) or not reported by OS:
> >
> >      EAL:   Invalid NUMA socket, default to 0
> >
> > This message and its level might confuse users, because configuration
> > is valid and nothing happens that requires attention or intervention.
> >
> > Reduce level to INFO, reword the message, and suppress it when there
> > is only one NUMA node, bacause NUMA-awareness does not matter in this
> case.
> >
> > Fixes: f0e0e86aa35d ("pci: move NUMA node check from scan to probe")
> > Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
> > Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> > Reviewed-by: Xueming Li <xuemingl@nvidia.com>
> > ---
> > v2: Add NUMA node count check (Stephen Hemminger).
> >
> >   doc/guides/nics/ena.rst          | 2 +-
> >   drivers/bus/pci/pci_common.c     | 4 ++--
> >   drivers/bus/vmbus/vmbus_common.c | 4 ++--
> >   3 files changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/doc/guides/nics/ena.rst b/doc/guides/nics/ena.rst index
> > 0f1f63f722..694ce1da74 100644
> > --- a/doc/guides/nics/ena.rst
> > +++ b/doc/guides/nics/ena.rst
> > @@ -234,7 +234,7 @@ Example output:
> >
> >      [...]
> >      EAL: PCI device 0000:00:06.0 on NUMA socket -1
> > -   EAL:   Invalid NUMA socket, default to 0
> > +   EAL:   Device is not NUMA-aware, defaulting socket to 0
> >      EAL:   probe driver: 1d0f:ec20 net_ena
> >
> >      Interactive-mode selected
> > diff --git a/drivers/bus/pci/pci_common.c
> > b/drivers/bus/pci/pci_common.c index 35d7d092d1..0bb56d9b7f 100644
> > --- a/drivers/bus/pci/pci_common.c
> > +++ b/drivers/bus/pci/pci_common.c
> > @@ -189,8 +189,8 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr,
> >               return 1;
> >       }
> >
> > -     if (dev->device.numa_node < 0) {
> > -             RTE_LOG(WARNING, EAL, "  Invalid NUMA socket, default to 0\n");
> > +     if (rte_socket_count() > 1 && dev->device.numa_node < 0) {
> > +             RTE_LOG(INFO, EAL, "  Device is not NUMA-aware,
> > + defaulting socket to 0\n");
> >               dev->device.numa_node = 0;
> 
> Is it intended side-effect of the patch that above assignment is not done if node
> is negative and there is only one socket?

TBH, it was not intended, but after analyzing dev->device.numa_node usages,
I think this can be the right thing to do. Even if there is only one NUMA node,
its number may be different from 0, e. g. if we're running on a set of cores
that belong to another node. For safety we can change this patch to only affect logs,
then fix numa_node setting as a follow-up
(maybe set it to the real number of the only node).

> >       }
> >
> > diff --git a/drivers/bus/vmbus/vmbus_common.c
> > b/drivers/bus/vmbus/vmbus_common.c
> > index d25fd14ef5..5b654b0289 100644
> > --- a/drivers/bus/vmbus/vmbus_common.c
> > +++ b/drivers/bus/vmbus/vmbus_common.c
> > @@ -111,8 +111,8 @@ vmbus_probe_one_driver(struct rte_vmbus_driver
> *dr,
> >       /* reference driver structure */
> >       dev->driver = dr;
> >
> > -     if (dev->device.numa_node < 0) {
> > -             VMBUS_LOG(WARNING, "  Invalid NUMA socket, default to 0");
> > +     if (rte_socket_count() > 1 && dev->device.numa_node < 0) {
> > +             VMBUS_LOG(INFO, "  Device is not NUMA-aware, defaulting
> > + socket to 0\n");
> >               dev->device.numa_node = 0;
> 
> Same question here.
> 
> >       }
> >
> >
diff mbox series

Patch

diff --git a/doc/guides/nics/ena.rst b/doc/guides/nics/ena.rst
index 0f1f63f722..694ce1da74 100644
--- a/doc/guides/nics/ena.rst
+++ b/doc/guides/nics/ena.rst
@@ -234,7 +234,7 @@  Example output:
 
    [...]
    EAL: PCI device 0000:00:06.0 on NUMA socket -1
-   EAL:   Invalid NUMA socket, default to 0
+   EAL:   Device is not NUMA-aware, defaulting socket to 0
    EAL:   probe driver: 1d0f:ec20 net_ena
 
    Interactive-mode selected
diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c
index 35d7d092d1..0bb56d9b7f 100644
--- a/drivers/bus/pci/pci_common.c
+++ b/drivers/bus/pci/pci_common.c
@@ -189,8 +189,8 @@  rte_pci_probe_one_driver(struct rte_pci_driver *dr,
 		return 1;
 	}
 
-	if (dev->device.numa_node < 0) {
-		RTE_LOG(WARNING, EAL, "  Invalid NUMA socket, default to 0\n");
+	if (rte_socket_count() > 1 && dev->device.numa_node < 0) {
+		RTE_LOG(INFO, EAL, "  Device is not NUMA-aware, defaulting socket to 0\n");
 		dev->device.numa_node = 0;
 	}
 
diff --git a/drivers/bus/vmbus/vmbus_common.c b/drivers/bus/vmbus/vmbus_common.c
index d25fd14ef5..5b654b0289 100644
--- a/drivers/bus/vmbus/vmbus_common.c
+++ b/drivers/bus/vmbus/vmbus_common.c
@@ -111,8 +111,8 @@  vmbus_probe_one_driver(struct rte_vmbus_driver *dr,
 	/* reference driver structure */
 	dev->driver = dr;
 
-	if (dev->device.numa_node < 0) {
-		VMBUS_LOG(WARNING, "  Invalid NUMA socket, default to 0");
+	if (rte_socket_count() > 1 && dev->device.numa_node < 0) {
+		VMBUS_LOG(INFO, "  Device is not NUMA-aware, defaulting socket to 0\n");
 		dev->device.numa_node = 0;
 	}