Skip to content

Commit 0ab999d

Browse files
elic307iSaeed Mahameed
authored andcommitted
net/mlx5: Fix driver load with single msix vector
When a PCI device has just one msix vector available, we want to share this vector between async and completion events. Current code fails to do that assuming it will always have at least one dedicated vector for completion events. Fix this by detecting when the pool contains just a single vector. Fixes: 3354822 ("net/mlx5: Use dynamic msix vectors allocation") Signed-off-by: Eli Cohen <[email protected]> Reviewed-by: Shay Drory <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 62a522d commit 0ab999d

File tree

1 file changed

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

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,15 +565,21 @@ void mlx5_irqs_release_vectors(struct mlx5_irq **irqs, int nirqs)
565565
int mlx5_irqs_request_vectors(struct mlx5_core_dev *dev, u16 *cpus, int nirqs,
566566
struct mlx5_irq **irqs, struct cpu_rmap **rmap)
567567
{
568+
struct mlx5_irq_table *table = mlx5_irq_table_get(dev);
569+
struct mlx5_irq_pool *pool = table->pcif_pool;
568570
struct irq_affinity_desc af_desc;
569571
struct mlx5_irq *irq;
572+
int offset = 1;
570573
int i;
571574

575+
if (!pool->xa_num_irqs.max)
576+
offset = 0;
577+
572578
af_desc.is_managed = false;
573579
for (i = 0; i < nirqs; i++) {
574580
cpumask_clear(&af_desc.mask);
575581
cpumask_set_cpu(cpus[i], &af_desc.mask);
576-
irq = mlx5_irq_request(dev, i + 1, &af_desc, rmap);
582+
irq = mlx5_irq_request(dev, i + offset, &af_desc, rmap);
577583
if (IS_ERR(irq))
578584
break;
579585
irqs[i] = irq;

0 commit comments

Comments
 (0)