All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Weiss <thnkslprpt@gmail.com>
To: netdev@vger.kernel.org
Cc: linux-hyperv@vger.kernel.org, haiyangz@microsoft.com,
	wei.liu@kernel.org, decui@microsoft.com, andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, Avi Weiss <thnkslprpt@gmail.com>
Subject: [PATCH net] net: mana: Handle CPU-less NUMA nodes when assigning IRQ affinity
Date: Wed,  2 Dec 2026 05:06:00 +0200	[thread overview]
Message-ID: <20261202030600.416477-1-thnkslprpt@gmail.com> (raw)

mana_irq_setup_numa_aware() uses the device NUMA node as the starting
point for for_each_numa_hop_mask(). The scheduler only builds hop
masks for nodes containing CPUs. If the device is associated with
a memory-only node, the first mask is NULL, so the loop assigns no
IRQ affinities and the function still returns success.

For such a node, use numa_nearest_node() to select the closest node
with CPUs before iterating the hop masks. Leave CPU-bearing nodes,
NUMA_NO_NODE, and invalid node values on their existing paths.

Fixes: 8afefc361209 ("net: mana: Assigning IRQ affinity on HT cores")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
---
 drivers/net/ethernet/microsoft/mana/gdma_pci.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/microsoft/mana/gdma_pci.c b/drivers/net/ethernet/microsoft/mana/gdma_pci.c
index edfadfd89829..887e5db6d461 100644
--- a/drivers/net/ethernet/microsoft/mana/gdma_pci.c
+++ b/drivers/net/ethernet/microsoft/mana/gdma_pci.c
@@ -8,6 +8,7 @@
 #include <linux/list.h>
 #include <linux/module.h>
 #include <linux/msi.h>
+#include <linux/numa.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/topology.h>
@@ -308,6 +309,12 @@ static int mana_irq_setup_numa_aware(unsigned int *irqs, unsigned int len,
 	if (!alloc_cpumask_var(&cpus, GFP_KERNEL))
 		return -ENOMEM;
 
+#ifdef CONFIG_NUMA
+	if (node >= 0 && node < MAX_NUMNODES && node_online(node) &&
+	    !node_state(node, N_CPU))
+		node = numa_nearest_node(node, N_CPU);
+#endif
+
 	rcu_read_lock();
 	for_each_numa_hop_mask(next, node) {
 		weight = cpumask_weight_andnot(next, prev);
-- 
2.53.0


             reply	other threads:[~2026-12-02  3:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02  3:06 Avi Weiss [this message]
2026-12-02  3:09 ` [PATCH net] net: mana: Handle CPU-less NUMA nodes when assigning IRQ affinity netdev-bot+sinfo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261202030600.416477-1-thnkslprpt@gmail.com \
    --to=thnkslprpt@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=decui@microsoft.com \
    --cc=edumazet@kernel.org \
    --cc=haiyangz@microsoft.com \
    --cc=kuba@kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=wei.liu@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.