Skip to contentSkip to conversation

bus: clarify log for non-NUMA-aware devices

PATCH Superseded Dmitry Kozlyuk 4 participants 11 messages Jun 15, 2021 – Aug 4, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bus: clarify log for non-NUMA-aware devices

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 and reword the message.

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

---
Hi Xueming,
Please align logging in the pending bus/auxiliary patch.

 doc/guides/nics/ena.rst          | 2 +-
 drivers/bus/pci/pci_common.c     | 2 +-
 drivers/bus/vmbus/vmbus_common.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
doc/guides/nics/ena.rst +1 -1
index 0f1f63f722..694ce1da74 100644
@@ -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
drivers/bus/pci/pci_common.c +1 -1
index 35d7d092d1..bf06f81229 100644
@@ -190,7 +190,7 @@ 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");
+		RTE_LOG(INFO, EAL, "  Device is not NUMA-aware, defaulting socket to 0\n");
 		dev->device.numa_node = 0;
 	}
 
drivers/bus/vmbus/vmbus_common.c +1 -1
index d25fd14ef5..ef23af90ec 100644
@@ -112,7 +112,7 @@ 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");
+		VMBUS_LOG(INFO, "  Device is not NUMA-aware, defaulting socket to 0\n");
 		dev->device.numa_node = 0;
 	}
 
Signature · 1 line
2.18.2
#1 lore raw

drivers/bus/pci/pci_common.c rte_pci_probe_one_driver(struct rte_pci_driver *dr, · line 193

Quoted 10 lines · On Tue, 15 Jun 2021 13:51:55 +0300 Dmitry Kozlyuk <[email protected]> wrote:
drivers/bus/pci/pci_common.c +1 -1
index 35d7d092d1..bf06f81229 100644
@@ -190,7 +190,7 @@ 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");
+		RTE_LOG(INFO, EAL, "  Device is not NUMA-aware, defaulting socket to 0\n");

Also if RTE_MAX_NUMA_NODES is 1 then this message should be silenced. It would be normal in that case.

#2 lore raw

PATCH v2 1/1 bus: clarify log for non-NUMA-aware devices

In reply to Dmitry Kozlyuk

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")

---
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(-)
doc/guides/nics/ena.rst +1 -1
index 0f1f63f722..694ce1da74 100644
@@ -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
drivers/bus/pci/pci_common.c +2 -2
index 35d7d092d1..0bb56d9b7f 100644
@@ -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;
 	}
 
drivers/bus/vmbus/vmbus_common.c +2 -2
index d25fd14ef5..5b654b0289 100644
@@ -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;
 	}
 
Signature · 1 line
2.18.2
#3 lore raw
Quoted 44 lines · Dmitry Kozlyuk

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")

---
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(-)
doc/guides/nics/ena.rst +1 -1
index 0f1f63f722..694ce1da74 100644
@@ -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
drivers/bus/pci/pci_common.c +0 -0
index 35d7d092d1..0bb56d9b7f 100644

drivers/bus/pci/pci_common.c rte_pci_probe_one_driver(struct rte_pci_driver *dr, · line 194

Quoted 8 lines
drivers/bus/pci/pci_common.c +2 -2
@@ -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?

Quoted 7 lines
drivers/bus/pci/pci_common.c +0 -0
  	}
 
drivers/bus/vmbus/vmbus_common.c +0 -0
index d25fd14ef5..5b654b0289 100644

drivers/bus/vmbus/vmbus_common.c vmbus_probe_one_driver(struct rte_vmbus_driver *dr, · line 116

Quoted 8 lines
drivers/bus/vmbus/vmbus_common.c +2 -2
@@ -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.

Quoted 3 lines
drivers/bus/vmbus/vmbus_common.c +0 -0
  	}
 
#4 lore raw
Quoted 59 lines

-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: 23 июля 2021 г. 23:07
To: Dmitry Kozlyuk <[email protected]>; [email protected]
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v2] bus: clarify log for non-NUMA-aware devices

External email: Use caution opening links or attachments

Quoted 10 lines · Dmitry Kozlyuk

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.

Quoted 37 lines
Fixes f0e0e86aa35d ("pci: move NUMA node check from scan to probe")
Fixes 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support")

---
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(-)
doc/guides/nics/ena.rst index renamed from doc/guides/nics/ena.rst +0 -0

0f1f63f722..694ce1da74 100644

doc/guides/nics/ena.rst +1 -1
@@ -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
(quoted diff) +0 -0

b/drivers/bus/pci/pci_common.c index 35d7d092d1..0bb56d9b7f 100644

drivers/bus/pci/pci_common.c +0 -0
@@ -189,8 +189,8 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr,
              return 1;
      }
 
Quoted 9 lines

drivers/bus/pci/pci_common.c rte_pci_probe_one_driver(struct rte_pci_driver *dr, · line 194

Quoted 6 lines
drivers/bus/pci/pci_common.c +3 -2
-     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).

Quoted 24 lines

drivers/bus/vmbus/vmbus_common.c vmbus_probe_one_driver(struct rte_vmbus_driver

Quoted 8 lines
drivers/bus/pci/pci_common.c +0 -0
      }
drivers/bus/vmbus/vmbus_common.c +0 -0
index d25fd14ef5..5b654b0289 100644
@@ -111,8 +111,8 @@ vmbus_probe_one_driver(struct rte_vmbus_driver

*dr,

drivers/bus/vmbus/vmbus_common.c vmbus_probe_one_driver(struct rte_vmbus_driver *dr, · line 116

Quoted 9 lines
drivers/bus/vmbus/vmbus_common.c +3 -2
      /* 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.

Quoted 3 lines
drivers/bus/vmbus/vmbus_common.c +0 -0
      }
#5 lore raw

PATCH v3 1/1 bus: clarify log for non-NUMA-aware devices

In reply to Dmitry Kozlyuk

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, 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")
Fixes 1afce3086cf4 ("bus/auxiliary: introduce auxiliary bus")

---
v3: keep resetting device NUMA node to 0 (Andrew).

 doc/guides/nics/ena.rst                  | 2 +-
 drivers/bus/auxiliary/auxiliary_common.c | 3 ++-
 drivers/bus/pci/pci_common.c             | 3 ++-
 drivers/bus/vmbus/vmbus_common.c         | 3 ++-
 4 files changed, 7 insertions(+), 4 deletions(-)
doc/guides/nics/ena.rst +1 -1
index 63951098ea..c506fd5bd4 100644
@@ -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
drivers/bus/auxiliary/auxiliary_common.c +2 -1
index 89e653c54e..3891bab0e7 100644
@@ -106,7 +106,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;
 	}
 
drivers/bus/pci/pci_common.c +2 -1
index 35d7d092d1..b09e42c489 100644
@@ -190,7 +190,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;
 	}
 
drivers/bus/vmbus/vmbus_common.c +2 -1
index d25fd14ef5..2fdf2c7092 100644
@@ -112,7 +112,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;
 	}
 
Signature · 1 line
2.25.1
#6 lore raw

PATCH v4 1/1 bus: clarify log for non-NUMA-aware devices

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")

---
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(-)
doc/guides/nics/ena.rst +1 -1
index 63951098ea..c506fd5bd4 100644
@@ -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
drivers/bus/auxiliary/auxiliary_common.c +3 -1
index 89e653c54e..1d5af8e126 100644
@@ -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;
 	}
 
drivers/bus/pci/pci_common.c +3 -1
index 35d7d092d1..bafcddf96e 100644
@@ -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;
 	}
 
drivers/bus/vmbus/vmbus_common.c +3 -1
index d25fd14ef5..2ec4d77398 100644
@@ -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;
 	}
 
Signature · 1 line
2.25.1
Acked-by on v4 1/1
#7 lore raw
Quoted 11 lines · Dmitry Kozlyuk

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.

Quoted 8 lines
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")
#8 lore raw
In reply to Dmitry Kozlyuk

29/07/2021 00:06, Dmitry Kozlyuk:

doc/guides/nics/ena.rst Example output: · line 250

Quoted 4 lines
    EAL: PCI device 0000:00:06.0 on NUMA socket -1
doc/guides/nics/ena.rst +1 -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.

[...]

drivers/bus/auxiliary/auxiliary_common.c rte_auxiliary_probe_one_driver(struct rte_auxiliary_driver *drv,

Quoted 3 lines
drivers/bus/auxiliary/auxiliary_common.c +2 -1
-		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.

#9 lore raw

PATCH v5 1/1 bus: clarify log for non-NUMA-aware devices

In reply to Dmitry Kozlyuk

PCI, vmbus, and auxiliary drivers printed a warning when NUMA node had been reported as (-1) or not reported by OS:

EAL: Invalid NUMA socket, default to 0

This message and its level might confuse users because the configuration is valid and nothing happens that requires attention or intervention. It was also printed without the device identification and with an indent (PCI only), which is confusing unless DEBUG logging is on to print the header message with the device name.

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. Also, remove the indent for PCI.

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")

---
The messages say "socket" and not "node", because this is current terminology in DPDK.

v5: Add device name, remove indent, fix typos (Thomas Monjalon)
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 | 5 ++++-
 drivers/bus/pci/pci_common.c             | 5 ++++-
 drivers/bus/vmbus/vmbus_common.c         | 5 ++++-
 4 files changed, 13 insertions(+), 4 deletions(-)
doc/guides/nics/ena.rst +1 -1
index 63951098ea..92b1858e7a 100644
@@ -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 0000:00:06.0 is not NUMA-aware, defaulting socket to 0
    EAL:   probe driver: 1d0f:ec20 net_ena
 
    Interactive-mode selected
drivers/bus/auxiliary/auxiliary_common.c +4 -1
index 89e653c54e..603b6fdc02 100644
@@ -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,9 @@ 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 %s is not NUMA-aware, defaulting socket to 0",
+					dev->name);
 		dev->device.numa_node = 0;
 	}
 
drivers/bus/pci/pci_common.c +4 -1
index 35d7d092d1..79a6fcffbd 100644
@@ -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,9 @@ 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 %s is not NUMA-aware, defaulting socket to 0\n",
+					dev->name);
 		dev->device.numa_node = 0;
 	}
 
drivers/bus/vmbus/vmbus_common.c +4 -1
index d25fd14ef5..519ca9c6fe 100644
@@ -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,9 @@ 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 %s is not NUMA-aware, defaulting socket to 0",
+					guid);
 		dev->device.numa_node = 0;
 	}
 
Signature · 1 line
2.25.1
#10 lore raw

04/08/2021 10:03, Dmitry Kozlyuk:

Quoted 20 lines

PCI, vmbus, and auxiliary drivers printed a warning when NUMA node had been reported as (-1) or not reported by OS:

EAL: Invalid NUMA socket, default to 0

This message and its level might confuse users because the configuration is valid and nothing happens that requires attention or intervention. It was also printed without the device identification and with an indent (PCI only), which is confusing unless DEBUG logging is on to print the header message with the device name.

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. Also, remove the indent for PCI.

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")
Quoted 7 lines

---
The messages say "socket" and not "node", because this is current terminology in DPDK.

Yes we need to fix this terminology in a separate patch.

Applied, thanks.