Skip to contentSkip to conversation

mlx5: fix mlx5_get_vector_affinity to start from completion vector 0

PATCH New Sagi Grimberg 3 participants 6 messages Feb 5, 2018

Subsystems (4)
lore
Share & tools
lore

Sagi Grimberg

author maintainer
#0 lore raw

PATCH 1/1 mlx5: fix mlx5_get_vector_affinity to start from completion vector 0

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 at deltatee.com>
Tested-by Max Gurtovoy <maxg at mellanox.com>
Reviewed-by Max Gurtovoy <maxg at mellanox.com>
Cc <stable at vger.kernel.org> # v4.15
Signed-off-by Sagi Grimberg <sagi at grimberg.me>
---
 include/linux/mlx5/driver.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/mlx5/driver.h +1 -1
index a0610427e168..b82c4ae92411 100644
@@ -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;
 
Signature · 1 line
2.14.1
author maintainer
#1 lore raw

PATCH 1/1 mlx5: fix mlx5_get_vector_affinity to start from completion vector 0

Sorry, now my .gitaliases updated with Jason's correct email.

Quoted 32 lines · Sagi Grimberg

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 at deltatee.com>
Tested-by Max Gurtovoy <maxg at mellanox.com>
Reviewed-by Max Gurtovoy <maxg at mellanox.com>
Cc <stable at vger.kernel.org> # v4.15
Signed-off-by Sagi Grimberg <sagi at grimberg.me>
---
  include/linux/mlx5/driver.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/mlx5/driver.h +1 -1
index a0610427e168..b82c4ae92411 100644
@@ -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;
 
#2 lore raw

PATCH 1/1 mlx5: fix mlx5_get_vector_affinity to start from completion vector 0

Quoted 1 line · Sagi Grimberg

Sorry, now my .gitaliases updated with Jason's correct email.

Jason prefers jgg at ziepe.ca for his upstream work, so might need to update again ;-)

Signature · 10 lines
Doug Ledford <dledford at redhat.com>
    GPG KeyID: B826A3330E572FDD
    Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-nvme/attachments/20180205/b3e1d858/attachment.sig>
author maintainer
#3 lore raw

PATCH 1/1 mlx5: fix mlx5_get_vector_affinity to start from completion vector 0

Quoted 4 lines
Quoted 1 line

Sorry, now my .gitaliases updated with Jason's correct email.

Jason prefers jgg at ziepe.ca for his upstream work, so might need to update again ;-)

Updated ;)

Applied
#4 lore raw

PATCH 1/1 mlx5: fix mlx5_get_vector_affinity to start from completion vector 0

In reply to Sagi Grimberg
Quoted 8 lines · Sagi Grimberg

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.

Quoted 6 lines
Fixes 05e0cc84e00c ("net/mlx5: Fix get vector affinity helper function")
Reported-by Logan Gunthorpe <logang at deltatee.com>
Tested-by Max Gurtovoy <maxg at mellanox.com>
Reviewed-by Max Gurtovoy <maxg at mellanox.com>
Cc <stable at vger.kernel.org> # v4.15
Signed-off-by Sagi Grimberg <sagi at grimberg.me>

Thanks, applied.

Signature · 10 lines
Doug Ledford <dledford at redhat.com>
    GPG KeyID: B826A3330E572FDD
    Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-nvme/attachments/20180205/45771bfc/attachment.sig>
#5 lore raw

PATCH 1/1 mlx5: fix mlx5_get_vector_affinity to start from completion vector 0

In reply to Sagi Grimberg

Thanks Sagi,

I can confirm this fixes our issue.

Nice Catch!

Logan

Quoted 32 lines · Sagi Grimberg

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 at deltatee.com>
Tested-by Max Gurtovoy <maxg at mellanox.com>
Reviewed-by Max Gurtovoy <maxg at mellanox.com>
Cc <stable at vger.kernel.org> # v4.15
Signed-off-by Sagi Grimberg <sagi at grimberg.me>
---
  include/linux/mlx5/driver.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/mlx5/driver.h +1 -1
index a0610427e168..b82c4ae92411 100644
@@ -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;