]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.4.45/ib-mlx4-when-no-dmfs-for-ipoib-don-t-allow-net_if-qps.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.4.45 / ib-mlx4-when-no-dmfs-for-ipoib-don-t-allow-net_if-qps.patch
CommitLineData
f68557eb
GKH
1From 1f22e454df2eb99ba6b7ace3f594f6805cdf5cbc Mon Sep 17 00:00:00 2001
2From: Eran Ben Elisha <eranbe@mellanox.com>
3Date: Thu, 10 Nov 2016 11:31:00 +0200
4Subject: IB/mlx4: When no DMFS for IPoIB, don't allow NET_IF QPs
5
6From: Eran Ben Elisha <eranbe@mellanox.com>
7
8commit 1f22e454df2eb99ba6b7ace3f594f6805cdf5cbc upstream.
9
10According to the firmware spec, FLOW_STEERING_IB_UC_QP_RANGE command is
11supported only if dmfs_ipoib bit is set.
12
13If it isn't set we want to ensure allocating NET_IF QPs fail. We do so
14by filling out the allocation bitmap. By thus, the NET_IF QPs allocating
15function won't find any free QP and will fail.
16
17Fixes: c1c98501121e ('IB/mlx4: Add support for steerable IB UD QPs')
18Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
19Signed-off-by: Daniel Jurgens <danielj@mellanox.com>
20Reviewed-by: Mark Bloch <markb@mellanox.com>
21Signed-off-by: Leon Romanovsky <leon@kernel.org>
22Signed-off-by: Doug Ledford <dledford@redhat.com>
23Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24
25---
26 drivers/infiniband/hw/mlx4/main.c | 21 +++++++++++++--------
27 1 file changed, 13 insertions(+), 8 deletions(-)
28
29--- a/drivers/infiniband/hw/mlx4/main.c
30+++ b/drivers/infiniband/hw/mlx4/main.c
31@@ -2403,14 +2403,19 @@ static void *mlx4_ib_add(struct mlx4_dev
32 goto err_steer_qp_release;
33 }
34
35- bitmap_zero(ibdev->ib_uc_qpns_bitmap, ibdev->steer_qpn_count);
36-
37- err = mlx4_FLOW_STEERING_IB_UC_QP_RANGE(
38- dev, ibdev->steer_qpn_base,
39- ibdev->steer_qpn_base +
40- ibdev->steer_qpn_count - 1);
41- if (err)
42- goto err_steer_free_bitmap;
43+ if (dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_DMFS_IPOIB) {
44+ bitmap_zero(ibdev->ib_uc_qpns_bitmap,
45+ ibdev->steer_qpn_count);
46+ err = mlx4_FLOW_STEERING_IB_UC_QP_RANGE(
47+ dev, ibdev->steer_qpn_base,
48+ ibdev->steer_qpn_base +
49+ ibdev->steer_qpn_count - 1);
50+ if (err)
51+ goto err_steer_free_bitmap;
52+ } else {
53+ bitmap_fill(ibdev->ib_uc_qpns_bitmap,
54+ ibdev->steer_qpn_count);
55+ }
56 }
57
58 for (j = 1; j <= ibdev->dev->caps.num_ports; j++)