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

Message ID 20210728220618.1048721-1-dkozlyuk@nvidia.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series [v4] bus: clarify log for non-NUMA-aware devices |

Checks

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

Commit Message

Dmitry Kozlyuk July 28, 2021, 10:06 p.m. UTC
  PCI, vmbus, and auxiliary 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, because 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")
Fixes: 1afce3086cf4 ("bus/auxiliary: introduce auxiliary bus")
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>
---
v4: Fix build errors and a typo (CI).
v3: Keep resetting device NUMA node to 0 (Andrew Rybchenko).
v2: Add NUMA node count check (Stephen Hemminger).

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

Comments

Andrew Rybchenko July 29, 2021, 7:45 a.m. UTC | #1
On 7/29/21 1:06 AM, Dmitry Kozlyuk wrote:
> PCI, vmbus, and auxiliary 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, because 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")
> Fixes: 1afce3086cf4 ("bus/auxiliary: introduce auxiliary bus")
> 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>

Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
  
Thomas Monjalon July 30, 2021, 4:18 p.m. UTC | #2
29/07/2021 00:06, Dmitry Kozlyuk:
>     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

The indentation in logs are wrong because they are not all
at the same log level.
If you run at a non-debug-level, you lose the first line,
so the indent becomes meaningless and confusing.

[...]
> -		AUXILIARY_LOG(INFO, "Device is not NUMA-aware, defaulting NUMA node to 0");
> +		if (rte_socket_count() > 1)
> +			AUXILIARY_LOG(INFO, "  Device is not NUMA-aware, defaulting socket to
 0");

Instead of adding an indent, I would prefer we print the device name.
And we should remove log indents in other bus drivers.
  

Patch

diff --git a/doc/guides/nics/ena.rst b/doc/guides/nics/ena.rst
index 63951098ea..c506fd5bd4 100644
--- a/doc/guides/nics/ena.rst
+++ b/doc/guides/nics/ena.rst
@@ -246,7 +246,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/auxiliary/auxiliary_common.c b/drivers/bus/auxiliary/auxiliary_common.c
index 89e653c54e..1d5af8e126 100644
--- a/drivers/bus/auxiliary/auxiliary_common.c
+++ b/drivers/bus/auxiliary/auxiliary_common.c
@@ -17,6 +17,7 @@ 
 #include <rte_memory.h>
 #include <rte_eal.h>
 #include <rte_eal_paging.h>
+#include <rte_lcore.h>
 #include <rte_string_fns.h>
 #include <rte_common.h>
 #include <rte_devargs.h>
@@ -106,7 +107,8 @@  rte_auxiliary_probe_one_driver(struct rte_auxiliary_driver *drv,
 	}
 
 	if (dev->device.numa_node < 0) {
-		AUXILIARY_LOG(INFO, "Device is not NUMA-aware, defaulting NUMA node to 0");
+		if (rte_socket_count() > 1)
+			AUXILIARY_LOG(INFO, "  Device is not NUMA-aware, defaulting socket to 0");
 		dev->device.numa_node = 0;
 	}
 
diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c
index 35d7d092d1..bafcddf96e 100644
--- a/drivers/bus/pci/pci_common.c
+++ b/drivers/bus/pci/pci_common.c
@@ -16,6 +16,7 @@ 
 #include <rte_bus.h>
 #include <rte_pci.h>
 #include <rte_bus_pci.h>
+#include <rte_lcore.h>
 #include <rte_per_lcore.h>
 #include <rte_memory.h>
 #include <rte_eal.h>
@@ -190,7 +191,8 @@  rte_pci_probe_one_driver(struct rte_pci_driver *dr,
 	}
 
 	if (dev->device.numa_node < 0) {
-		RTE_LOG(WARNING, EAL, "  Invalid NUMA socket, default to 0\n");
+		if (rte_socket_count() > 1)
+			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..2ec4d77398 100644
--- a/drivers/bus/vmbus/vmbus_common.c
+++ b/drivers/bus/vmbus/vmbus_common.c
@@ -15,6 +15,7 @@ 
 #include <rte_eal.h>
 #include <rte_tailq.h>
 #include <rte_devargs.h>
+#include <rte_lcore.h>
 #include <rte_malloc.h>
 #include <rte_errno.h>
 #include <rte_memory.h>
@@ -112,7 +113,8 @@  vmbus_probe_one_driver(struct rte_vmbus_driver *dr,
 	dev->driver = dr;
 
 	if (dev->device.numa_node < 0) {
-		VMBUS_LOG(WARNING, "  Invalid NUMA socket, default to 0");
+		if (rte_socket_count() > 1)
+			VMBUS_LOG(INFO, "  Device is not NUMA-aware, defaulting socket to 0");
 		dev->device.numa_node = 0;
 	}