Commit 6082d9c9 authored by Israel Rukshin's avatar Israel Rukshin Committed by Saeed Mahameed

net/mlx5: Fix mlx5_get_vector_affinity function

Adding the vector offset when calling to mlx5_vector2eqn() is wrong.
This is because mlx5_vector2eqn() checks if EQ index is equal to vector number
and the fact that the internal completion vectors that mlx5 allocates
don't get an EQ index.

The second problem here is that using effective_affinity_mask gives the same
CPU for different vectors.
This leads to unmapped queues when calling it from blk_mq_rdma_map_queues().
This doesn't happen when using affinity_hint mask.

Fixes: 2572cf57 ("mlx5: fix mlx5_get_vector_affinity to start from completion vector 0")
Fixes: 05e0cc84 ("net/mlx5: Fix get vector affinity helper function")
Signed-off-by: default avatarIsrael Rukshin <israelr@mellanox.com>
Reviewed-by: default avatarMax Gurtovoy <maxg@mellanox.com>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
parent 35f80acb
...@@ -4757,7 +4757,7 @@ mlx5_ib_get_vector_affinity(struct ib_device *ibdev, int comp_vector) ...@@ -4757,7 +4757,7 @@ mlx5_ib_get_vector_affinity(struct ib_device *ibdev, int comp_vector)
{ {
struct mlx5_ib_dev *dev = to_mdev(ibdev); struct mlx5_ib_dev *dev = to_mdev(ibdev);
return mlx5_get_vector_affinity(dev->mdev, comp_vector); return mlx5_get_vector_affinity_hint(dev->mdev, comp_vector);
} }
/* The mlx5_ib_multiport_mutex should be held when calling this function */ /* The mlx5_ib_multiport_mutex should be held when calling this function */
......
...@@ -1284,25 +1284,19 @@ enum { ...@@ -1284,25 +1284,19 @@ enum {
}; };
static inline const struct cpumask * static inline const struct cpumask *
mlx5_get_vector_affinity(struct mlx5_core_dev *dev, int vector) mlx5_get_vector_affinity_hint(struct mlx5_core_dev *dev, int vector)
{ {
const struct cpumask *mask;
struct irq_desc *desc; struct irq_desc *desc;
unsigned int irq; unsigned int irq;
int eqn; int eqn;
int err; int err;
err = mlx5_vector2eqn(dev, MLX5_EQ_VEC_COMP_BASE + vector, &eqn, &irq); err = mlx5_vector2eqn(dev, vector, &eqn, &irq);
if (err) if (err)
return NULL; return NULL;
desc = irq_to_desc(irq); desc = irq_to_desc(irq);
#ifdef CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK return desc->affinity_hint;
mask = irq_data_get_effective_affinity_mask(&desc->irq_data);
#else
mask = desc->irq_common_data.affinity;
#endif
return mask;
} }
#endif /* MLX5_DRIVER_H */ #endif /* MLX5_DRIVER_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment