Re: [PATCH v2 2/2] net/mlx5: Use effective affinity mask for IRQ selection
From: Shay Drori <hidden>
Date: 2026-06-05 06:25:49
Also in:
linux-rdma, lkml
On 04/06/2026 15:57, Fushuai Wang wrote:
External email: Use caution opening links or attachments From: Fushuai Wang <redacted> When an SF is created after a CPU has been taken offline, the IRQ pool may contain IRQs with affinity masks that include the offline CPU. Since only online CPUs should be considered for IRQ placement, cpumask_subset() check would fail because the iter_mask contains offline CPUs that are not present in req_mask, causing SF creation to fail.
can you please add the example/repro from the prev discussion? Sorry I wasn't clear I want it the commit message...
quoted hunk ↗ jump to hunk
Use irq_get_effective_affinity_mask() instead, which returns the IRQ's actual effective affinity that already excludes offline CPUs. Fixes: 061f5b23588a ("net/mlx5: SF, Use all available cpu for setting cpu affinity") Suggested-by: Shay Drory <redacted> Signed-off-by: Fushuai Wang <redacted> --- drivers/net/ethernet/mellanox/mlx5/core/irq_affinity.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)diff --git a/drivers/net/ethernet/mellanox/mlx5/core/irq_affinity.c b/drivers/net/ethernet/mellanox/mlx5/core/irq_affinity.c index 994fe83da4be..c5d784cbc8e4 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/irq_affinity.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/irq_affinity.c@@ -105,9 +105,12 @@ irq_pool_find_least_loaded(struct mlx5_irq_pool *pool, const struct cpumask *req lockdep_assert_held(&pool->lock); xa_for_each_range(&pool->irqs, index, iter, start, end) { - struct cpumask *iter_mask = mlx5_irq_get_affinity_mask(iter); + const struct cpumask *iter_mask; int iter_refcount = mlx5_irq_read_locked(iter);
can you please keep revers xmas tree here as well?
+ iter_mask = irq_get_effective_affinity_mask(mlx5_irq_get_irq(iter));
+ if (!iter_mask)
+ continue;
if (!cpumask_subset(iter_mask, req_mask))
/* skip IRQs with a mask which is not subset of req_mask */
continue;
--
2.36.1