]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net/mlx5: Use first online CPU instead of hard coded CPU
authorShay Drory <shayd@nvidia.com>
Tue, 26 Oct 2021 05:25:19 +0000 (08:25 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 23 Dec 2021 04:38:46 +0000 (20:38 -0800)
Hard coded CPU (0 in our case) might be offline. Hence, use the first
online CPU instead.

Fixes: 67b8f99e536b ("net/mlx5: Enable single IRQ for PCI Function")
Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c

index 830444f927d456deff102c57dc26332bfc124696..0e84c005d160ceafe716c23cf8ed4a978973556e 100644 (file)
@@ -398,7 +398,7 @@ irq_pool_request_vector(struct mlx5_irq_pool *pool, int vecidx,
        cpumask_copy(irq->mask, affinity);
        if (!irq_pool_is_sf_pool(pool) && !pool->xa_num_irqs.max &&
            cpumask_empty(irq->mask))
-               cpumask_set_cpu(0, irq->mask);
+               cpumask_set_cpu(cpumask_first(cpu_online_mask), irq->mask);
        irq_set_affinity_hint(irq->irqn, irq->mask);
 unlock:
        mutex_unlock(&pool->lock);