Skip to content

Commit 1da438c

Browse files
shayshyiSaeed Mahameed
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]>
1 parent ef8c063 commit 1da438c

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 {
@@ -132,7 +133,7 @@ static void irq_release(struct mlx5_irq *irq)
132133
struct cpu_rmap *rmap;
133134
#endif
134135

135-
xa_erase(&pool->irqs, irq->map.index);
136+
xa_erase(&pool->irqs, irq->pool_index);
136137
/* free_irq requires that affinity_hint and rmap will be cleared before
137138
* calling it. To satisfy this requirement, we call
138139
* irq_cpu_rmap_remove() to remove the notifier
@@ -276,11 +277,11 @@ struct mlx5_irq *mlx5_irq_alloc(struct mlx5_irq_pool *pool, int i,
276277
}
277278
irq->pool = pool;
278279
irq->refcount = 1;
279-
irq->map.index = i;
280-
err = xa_err(xa_store(&pool->irqs, irq->map.index, irq, GFP_KERNEL));
280+
irq->pool_index = i;
281+
err = xa_err(xa_store(&pool->irqs, irq->pool_index, irq, GFP_KERNEL));
281282
if (err) {
282283
mlx5_core_err(dev, "Failed to alloc xa entry for irq(%u). err = %d\n",
283-
irq->map.index, err);
284+
irq->pool_index, err);
284285
goto err_xa;
285286
}
286287
return irq;

0 commit comments

Comments
 (0)