When creating a CQ, the CPU id is used for the vector value.
This would fail in-case the CPU id was higher than the maximum
vector value.
Fixes: 297cccebdc5a ("net/mlx5: DR, Expose an internal API to issue RDMA operations")
Signed-off-by: Alex Vesker <valex@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Reviewed-by: Erez Shitrit <erezsh@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
        unsigned int irqn;
        void *cqc, *in;
        __be64 *pas;
+       int vector;
        u32 i;
 
        cq = kzalloc(sizeof(*cq), GFP_KERNEL);
        if (!in)
                goto err_cqwq;
 
-       err = mlx5_vector2eqn(mdev, smp_processor_id(), &eqn, &irqn);
+       vector = smp_processor_id() % mlx5_comp_vectors_count(mdev);
+       err = mlx5_vector2eqn(mdev, vector, &eqn, &irqn);
        if (err) {
                kvfree(in);
                goto err_cqwq;