diff mbox

mlx5: fix mlx5_get_vector_affinity to start from completion vector 0

Message ID 20180205142452.7630-1-sagi@grimberg.me (mailing list archive)
State Accepted
Headers show

Commit Message

Sagi Grimberg Feb. 5, 2018, 2:24 p.m. UTC
The consumers of this routine expects the affinity map of of vector
index relative to the first completion vector. The upper layers are
not aware of internal/private completion vectors that mlx5 allocates
for its own usage.

Hence, return the affinity map of vector index relative to the first
completion vector.

Fixes: 05e0cc84e00c ("net/mlx5: Fix get vector affinity helper function")
Reported-by: Logan Gunthorpe <logang@deltatee.com>
Tested-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
Cc: <stable@vger.kernel.org> # v4.15
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
---
 include/linux/mlx5/driver.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sagi Grimberg Feb. 5, 2018, 2:28 p.m. UTC | #1
Sorry, now my .gitaliases updated with Jason's correct email.


On 02/05/2018 04:24 PM, Sagi Grimberg wrote:
> The consumers of this routine expects the affinity map of of vector
> index relative to the first completion vector. The upper layers are
> not aware of internal/private completion vectors that mlx5 allocates
> for its own usage.
> 
> Hence, return the affinity map of vector index relative to the first
> completion vector.
> 
> Fixes: 05e0cc84e00c ("net/mlx5: Fix get vector affinity helper function")
> Reported-by: Logan Gunthorpe <logang@deltatee.com>
> Tested-by: Max Gurtovoy <maxg@mellanox.com>
> Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
> Cc: <stable@vger.kernel.org> # v4.15
> Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
> ---
>   include/linux/mlx5/driver.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
> index a0610427e168..b82c4ae92411 100644
> --- a/include/linux/mlx5/driver.h
> +++ b/include/linux/mlx5/driver.h
> @@ -1238,7 +1238,7 @@ mlx5_get_vector_affinity(struct mlx5_core_dev *dev, int vector)
>   	int eqn;
>   	int err;
>   
> -	err = mlx5_vector2eqn(dev, vector, &eqn, &irq);
> +	err = mlx5_vector2eqn(dev, MLX5_EQ_VEC_COMP_BASE + vector, &eqn, &irq);
>   	if (err)
>   		return NULL;
>   
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Doug Ledford Feb. 5, 2018, 3:23 p.m. UTC | #2
On Mon, 2018-02-05 at 16:28 +0200, Sagi Grimberg wrote:
> Sorry, now my .gitaliases updated with Jason's correct email.

Jason prefers jgg@ziepe.ca for his upstream work, so might need to
update again ;-)
Sagi Grimberg Feb. 5, 2018, 3:28 p.m. UTC | #3
>> Sorry, now my .gitaliases updated with Jason's correct email.
> 
> Jason prefers jgg@ziepe.ca for his upstream work, so might need to
> update again ;-)

Updated ;)
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Doug Ledford Feb. 5, 2018, 3:57 p.m. UTC | #4
On Mon, 2018-02-05 at 16:24 +0200, Sagi Grimberg wrote:
> The consumers of this routine expects the affinity map of of vector
> index relative to the first completion vector. The upper layers are
> not aware of internal/private completion vectors that mlx5 allocates
> for its own usage.
> 
> Hence, return the affinity map of vector index relative to the first
> completion vector.
> 
> Fixes: 05e0cc84e00c ("net/mlx5: Fix get vector affinity helper function")
> Reported-by: Logan Gunthorpe <logang@deltatee.com>
> Tested-by: Max Gurtovoy <maxg@mellanox.com>
> Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
> Cc: <stable@vger.kernel.org> # v4.15
> Signed-off-by: Sagi Grimberg <sagi@grimberg.me>

Thanks, applied.
Logan Gunthorpe Feb. 5, 2018, 5:16 p.m. UTC | #5
Thanks Sagi,

I can confirm this fixes our issue.

Nice Catch!

Logan

On 05/02/18 07:24 AM, Sagi Grimberg wrote:
> The consumers of this routine expects the affinity map of of vector
> index relative to the first completion vector. The upper layers are
> not aware of internal/private completion vectors that mlx5 allocates
> for its own usage.
> 
> Hence, return the affinity map of vector index relative to the first
> completion vector.
> 
> Fixes: 05e0cc84e00c ("net/mlx5: Fix get vector affinity helper function")
> Reported-by: Logan Gunthorpe <logang@deltatee.com>
> Tested-by: Max Gurtovoy <maxg@mellanox.com>
> Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
> Cc: <stable@vger.kernel.org> # v4.15
> Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
> ---
>   include/linux/mlx5/driver.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
> index a0610427e168..b82c4ae92411 100644
> --- a/include/linux/mlx5/driver.h
> +++ b/include/linux/mlx5/driver.h
> @@ -1238,7 +1238,7 @@ mlx5_get_vector_affinity(struct mlx5_core_dev *dev, int vector)
>   	int eqn;
>   	int err;
>   
> -	err = mlx5_vector2eqn(dev, vector, &eqn, &irq);
> +	err = mlx5_vector2eqn(dev, MLX5_EQ_VEC_COMP_BASE + vector, &eqn, &irq);
>   	if (err)
>   		return NULL;
>   
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index a0610427e168..b82c4ae92411 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -1238,7 +1238,7 @@  mlx5_get_vector_affinity(struct mlx5_core_dev *dev, int vector)
 	int eqn;
 	int err;
 
-	err = mlx5_vector2eqn(dev, vector, &eqn, &irq);
+	err = mlx5_vector2eqn(dev, MLX5_EQ_VEC_COMP_BASE + vector, &eqn, &irq);
 	if (err)
 		return NULL;