Skip to content

Commit a5fdaa1

Browse files
shayshyiBrian Maly
authored andcommitted
net/mlx5: Fix indexing of mlx5_irq
After the cited patch, mlx5_irq xarray index can be different then mlx5_irq MSIX table index. Fix it by storing both mlx5_irq xarray index and MSIX table index. Fixes: 3354822 ("net/mlx5: Use dynamic msix vectors allocation") Signed-off-by: Shay Drory <[email protected]> Reviewed-by: Eli Cohen <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> Orabug: 35383105 (cherry picked from commit 1da438c) cherry-pick-repo=kernel/git/torvalds/linux.git Conflicts: drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c Small conflict in a context caused by already applied fix. Signed-off-by: Mikhael Goikhman <[email protected]> Signed-off-by: Qing Huang <[email protected]> Reviewed-by: Devesh Sharma <[email protected]> Signed-off-by: Brian Maly <[email protected]>
1 parent da1a6f3 commit a5fdaa1

File tree

1 file changed

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

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ struct mlx5_irq {
3232
struct mlx5_irq_pool *pool;
3333
int refcount;
3434
struct msi_map map;
35+
u32 pool_index;
3536
};
3637

3738
struct mlx5_irq_table {
@@ -152,7 +153,7 @@ static void irq_release(struct mlx5_irq *irq)
152153
{
153154
struct mlx5_irq_pool *pool = irq->pool;
154155

155-
xa_erase(&pool->irqs, irq->map.index);
156+
xa_erase(&pool->irqs, irq->pool_index);
156157
mlx5_system_free_irq(irq);
157158
free_cpumask_var(irq->mask);
158159
kfree(irq);
@@ -283,11 +284,11 @@ struct mlx5_irq *mlx5_irq_alloc(struct mlx5_irq_pool *pool, int i,
283284
}
284285
irq->pool = pool;
285286
irq->refcount = 1;
286-
irq->map.index = i;
287-
err = xa_err(xa_store(&pool->irqs, irq->map.index, irq, GFP_KERNEL));
287+
irq->pool_index = i;
288+
err = xa_err(xa_store(&pool->irqs, irq->pool_index, irq, GFP_KERNEL));
288289
if (err) {
289290
mlx5_core_err(dev, "Failed to alloc xa entry for irq(%u). err = %d\n",
290-
irq->map.index, err);
291+
irq->pool_index, err);
291292
goto err_xa;
292293
}
293294
return irq;

0 commit comments

Comments
 (0)