diff mbox

IB/srp: Fix completion vector assignment algorithm

Message ID 20180212175025.18955-1-bart.vanassche@wdc.com (mailing list archive)
State Accepted
Delegated to: Jason Gunthorpe
Headers show

Commit Message

Bart Van Assche Feb. 12, 2018, 5:50 p.m. UTC
Ensure that cv_end is equal to ibdev->num_comp_vectors for the
NUMA node with the highest index. This patch improves spreading
of RDMA channels over completion vectors and thereby improves
performance, especially on systems with only a single NUMA node.
This patch drops support for the comp_vector login parameter by
ignoring the value of that parameter since I have not found a
good way to combine support for that parameter and automatic
spreading of RDMA channels over completion vectors.

Fixes: d92c0da71a35 ("IB/srp: Add multichannel support")
Reported-by: Alexander Schmid <alex@modula-shop-systems.de>
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Alexander Schmid <alex@modula-shop-systems.de>
Cc: stable@vger.kernel.org
---
 drivers/infiniband/ulp/srp/ib_srp.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Comments

Jason Gunthorpe Feb. 15, 2018, 10:39 p.m. UTC | #1
On Mon, Feb 12, 2018 at 09:50:25AM -0800, Bart Van Assche wrote:
> Ensure that cv_end is equal to ibdev->num_comp_vectors for the
> NUMA node with the highest index. This patch improves spreading
> of RDMA channels over completion vectors and thereby improves
> performance, especially on systems with only a single NUMA node.
> This patch drops support for the comp_vector login parameter by
> ignoring the value of that parameter since I have not found a
> good way to combine support for that parameter and automatic
> spreading of RDMA channels over completion vectors.
> 
> Fixes: d92c0da71a35 ("IB/srp: Add multichannel support")
> Reported-by: Alexander Schmid <alex@modula-shop-systems.de>
> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> Cc: Alexander Schmid <alex@modula-shop-systems.de>
> Cc: stable@vger.kernel.org
>  drivers/infiniband/ulp/srp/ib_srp.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)

Applied to for-next

Thanks,
Jason
--
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/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index b48843833d69..241c0e72dce3 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -3871,12 +3871,10 @@  static ssize_t srp_create_target(struct device *dev,
 				      num_online_nodes());
 		const int ch_end = ((node_idx + 1) * target->ch_count /
 				    num_online_nodes());
-		const int cv_start = (node_idx * ibdev->num_comp_vectors /
-				      num_online_nodes() + target->comp_vector)
-				     % ibdev->num_comp_vectors;
-		const int cv_end = ((node_idx + 1) * ibdev->num_comp_vectors /
-				    num_online_nodes() + target->comp_vector)
-				   % ibdev->num_comp_vectors;
+		const int cv_start = node_idx * ibdev->num_comp_vectors /
+				     num_online_nodes();
+		const int cv_end = (node_idx + 1) * ibdev->num_comp_vectors /
+				   num_online_nodes();
 		int cpu_idx = 0;
 
 		for_each_online_cpu(cpu) {