]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.16.4/ib-srp-fix-completion-vector-assignment-algorithm.patch
Fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 4.16.4 / ib-srp-fix-completion-vector-assignment-algorithm.patch
1 From 3a148896b24adf8688dc0c59af54531931677a40 Mon Sep 17 00:00:00 2001
2 From: Bart Van Assche <bart.vanassche@wdc.com>
3 Date: Mon, 12 Feb 2018 09:50:25 -0800
4 Subject: IB/srp: Fix completion vector assignment algorithm
5
6 From: Bart Van Assche <bart.vanassche@wdc.com>
7
8 commit 3a148896b24adf8688dc0c59af54531931677a40 upstream.
9
10 Ensure that cv_end is equal to ibdev->num_comp_vectors for the
11 NUMA node with the highest index. This patch improves spreading
12 of RDMA channels over completion vectors and thereby improves
13 performance, especially on systems with only a single NUMA node.
14 This patch drops support for the comp_vector login parameter by
15 ignoring the value of that parameter since I have not found a
16 good way to combine support for that parameter and automatic
17 spreading of RDMA channels over completion vectors.
18
19 Fixes: d92c0da71a35 ("IB/srp: Add multichannel support")
20 Reported-by: Alexander Schmid <alex@modula-shop-systems.de>
21 Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
22 Cc: Alexander Schmid <alex@modula-shop-systems.de>
23 Cc: stable@vger.kernel.org
24 Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
25 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
26
27 ---
28 drivers/infiniband/ulp/srp/ib_srp.c | 10 ++++------
29 1 file changed, 4 insertions(+), 6 deletions(-)
30
31 --- a/drivers/infiniband/ulp/srp/ib_srp.c
32 +++ b/drivers/infiniband/ulp/srp/ib_srp.c
33 @@ -3873,12 +3873,10 @@ static ssize_t srp_create_target(struct
34 num_online_nodes());
35 const int ch_end = ((node_idx + 1) * target->ch_count /
36 num_online_nodes());
37 - const int cv_start = (node_idx * ibdev->num_comp_vectors /
38 - num_online_nodes() + target->comp_vector)
39 - % ibdev->num_comp_vectors;
40 - const int cv_end = ((node_idx + 1) * ibdev->num_comp_vectors /
41 - num_online_nodes() + target->comp_vector)
42 - % ibdev->num_comp_vectors;
43 + const int cv_start = node_idx * ibdev->num_comp_vectors /
44 + num_online_nodes();
45 + const int cv_end = (node_idx + 1) * ibdev->num_comp_vectors /
46 + num_online_nodes();
47 int cpu_idx = 0;
48
49 for_each_online_cpu(cpu) {