]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
net/mlx5: Fix setting of irq->map.index for static IRQ case
authorNiklas Schnelle <schnelle@linux.ibm.com>
Wed, 31 May 2023 08:48:56 +0000 (10:48 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 1 Jun 2023 03:08:36 +0000 (20:08 -0700)
commit8764bd0fa5d402c51b136f6aeaba20fc16961ba1
tree4fb19a9d3f1bb0397657d0a15fd0d561b55e9049
parent1c4c769cdf682c63d3b10cb241f4a96ebad2f215
net/mlx5: Fix setting of irq->map.index for static IRQ case

When dynamic IRQ allocation is not supported all IRQs are allocated up
front in mlx5_irq_table_create() instead of dynamically as part of
mlx5_irq_alloc(). In the latter dynamic case irq->map.index is set
via the mapping returned by pci_msix_alloc_irq_at(). In the static case
and prior to commit 1da438c0ae02 ("net/mlx5: Fix indexing of mlx5_irq")
irq->map.index was set in mlx5_irq_alloc() twice once initially to 0 and
then to the requested index before storing in the xarray. After this
commit it is only set to 0 which breaks all other IRQ mappings.

Fix this by setting irq->map.index to the requested index together with
irq->map.virq and improve the related comment to make it clearer which
cases it deals with.

Cc: Chuck Lever III <chuck.lever@oracle.com>
Tested-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Reviewed-by: Eli Cohen <elic@nvidia.com>
Fixes: 1da438c0ae02 ("net/mlx5: Fix indexing of mlx5_irq")
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Tested-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c