Thread (11 messages) 11 messages, 4 authors, 2021-08-04

Re: [dpdk-dev] [PATCH v2] bus: clarify log for non-NUMA-aware devices

From: Dmitry Kozlyuk <hidden>
Date: 2021-07-27 08:08:07

-----Original Message-----
From: Andrew Rybchenko <redacted>
Sent: 23 июля 2021 г. 23:07
To: Dmitry Kozlyuk <redacted>; 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:
quoted
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
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 <redacted>
Reviewed-by: Viacheslav Ovsiienko <redacted>
Reviewed-by: Xueming Li <redacted>
---
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).
quoted
      }
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,
quoted
      /* 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
      }
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help