Skip to content

Commit 7451e9e

Browse files
Nitesh Narayan LalKAGA-KOKO
authored andcommitted
net/mlx5: Use irq_set_affinity_and_hint()
The driver uses irq_set_affinity_hint() to update the affinity_hint mask that is consumed by the userspace to distribute the interrupts and to apply the provided mask as the affinity for the mlx5 interrupts. However, irq_set_affinity_hint() applying the provided cpumask as an affinity for the interrupt is an undocumented side effect. To remove this side effect irq_set_affinity_hint() has been marked as deprecated and new interfaces have been introduced. Hence, replace the irq_set_affinity_hint() with the new interface irq_set_affinity_and_hint() where the provided mask needs to be applied as the affinity and affinity_hint pointer needs to be set and replace with irq_update_affinity_hint() where only affinity_hint needs to be updated. Signed-off-by: Nitesh Narayan Lal <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 2d1e72f commit 7451e9e

File tree

1 file changed

+4
-4
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+4
-4
lines changed

drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,11 @@ static void irq_release(struct mlx5_irq *irq)
143143
struct mlx5_irq_pool *pool = irq->pool;
144144

145145
xa_erase(&pool->irqs, irq->index);
146-
/* free_irq requires that affinity and rmap will be cleared
146+
/* free_irq requires that affinity_hint and rmap will be cleared
147147
* before calling it. This is why there is asymmetry with set_rmap
148148
* which should be called after alloc_irq but before request_irq.
149149
*/
150-
irq_set_affinity_hint(irq->irqn, NULL);
150+
irq_update_affinity_hint(irq->irqn, NULL);
151151
free_cpumask_var(irq->mask);
152152
free_irq(irq->irqn, &irq->nh);
153153
kfree(irq);
@@ -316,7 +316,7 @@ static struct mlx5_irq *irq_pool_create_irq(struct mlx5_irq_pool *pool,
316316
if (IS_ERR(irq))
317317
return irq;
318318
cpumask_copy(irq->mask, affinity);
319-
irq_set_affinity_hint(irq->irqn, irq->mask);
319+
irq_set_affinity_and_hint(irq->irqn, irq->mask);
320320
return irq;
321321
}
322322

@@ -399,7 +399,7 @@ irq_pool_request_vector(struct mlx5_irq_pool *pool, int vecidx,
399399
if (!irq_pool_is_sf_pool(pool) && !pool->xa_num_irqs.max &&
400400
cpumask_empty(irq->mask))
401401
cpumask_set_cpu(0, irq->mask);
402-
irq_set_affinity_hint(irq->irqn, irq->mask);
402+
irq_set_affinity_and_hint(irq->irqn, irq->mask);
403403
unlock:
404404
mutex_unlock(&pool->lock);
405405
return irq;

0 commit comments

Comments
 (0)