]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.18-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 18 Feb 2018 15:37:49 +0000 (16:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 18 Feb 2018 15:37:49 +0000 (16:37 +0100)
added patches:
ib-mlx4-fix-incorrectly-releasing-steerable-ud-qps-when-have-only-eth-ports.patch
series

queue-3.18/ib-mlx4-fix-incorrectly-releasing-steerable-ud-qps-when-have-only-eth-ports.patch [new file with mode: 0644]
queue-3.18/series [new file with mode: 0644]

diff --git a/queue-3.18/ib-mlx4-fix-incorrectly-releasing-steerable-ud-qps-when-have-only-eth-ports.patch b/queue-3.18/ib-mlx4-fix-incorrectly-releasing-steerable-ud-qps-when-have-only-eth-ports.patch
new file mode 100644 (file)
index 0000000..94ae106
--- /dev/null
@@ -0,0 +1,80 @@
+From 852f6927594d0d3e8632c889b2ab38cbc46476ad Mon Sep 17 00:00:00 2001
+From: Jack Morgenstein <jackm@dev.mellanox.co.il>
+Date: Fri, 12 Jan 2018 07:58:40 +0200
+Subject: IB/mlx4: Fix incorrectly releasing steerable UD QPs when have only ETH ports
+
+From: Jack Morgenstein <jackm@dev.mellanox.co.il>
+
+commit 852f6927594d0d3e8632c889b2ab38cbc46476ad upstream.
+
+Allocating steerable UD QPs depends on having at least one IB port,
+while releasing those QPs does not.
+
+As a result, when there are only ETH ports, the IB (RoCE) driver
+requests releasing a qp range whose base qp is zero, with
+qp count zero.
+
+When SR-IOV is enabled, and the VF driver is running on a VM over
+a hypervisor which treats such qp release calls as errors
+(rather than NOPs), we see lines in the VM message log like:
+
+ mlx4_core 0002:00:02.0: Failed to release qp range base:0 cnt:0
+
+Fix this by adding a check for a zero count in mlx4_release_qp_range()
+(which thus treats releasing 0 qps as a nop), and eliminating the
+check for device managed flow steering when releasing steerable UD QPs.
+(Freeing ib_uc_qpns_bitmap unconditionally is also OK, since it
+remains NULL when steerable UD QPs are not allocated).
+
+Fixes: 4196670be786 ("IB/mlx4: Don't allocate range of steerable UD QPs for Ethernet-only device")
+Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
+Signed-off-by: Leon Romanovsky <leon@kernel.org>
+Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/infiniband/hw/mlx4/main.c       |   13 +++++--------
+ drivers/net/ethernet/mellanox/mlx4/qp.c |    3 +++
+ 2 files changed, 8 insertions(+), 8 deletions(-)
+
+--- a/drivers/infiniband/hw/mlx4/main.c
++++ b/drivers/infiniband/hw/mlx4/main.c
+@@ -2348,9 +2348,8 @@ err_steer_free_bitmap:
+       kfree(ibdev->ib_uc_qpns_bitmap);
+ err_steer_qp_release:
+-      if (ibdev->steering_support == MLX4_STEERING_MODE_DEVICE_MANAGED)
+-              mlx4_qp_release_range(dev, ibdev->steer_qpn_base,
+-                                    ibdev->steer_qpn_count);
++      mlx4_qp_release_range(dev, ibdev->steer_qpn_base,
++                            ibdev->steer_qpn_count);
+ err_counter:
+       for (; i; --i)
+               if (ibdev->counters[i - 1] != -1)
+@@ -2452,11 +2451,9 @@ static void mlx4_ib_remove(struct mlx4_d
+               ibdev->iboe.nb.notifier_call = NULL;
+       }
+-      if (ibdev->steering_support == MLX4_STEERING_MODE_DEVICE_MANAGED) {
+-              mlx4_qp_release_range(dev, ibdev->steer_qpn_base,
+-                                    ibdev->steer_qpn_count);
+-              kfree(ibdev->ib_uc_qpns_bitmap);
+-      }
++      mlx4_qp_release_range(dev, ibdev->steer_qpn_base,
++                            ibdev->steer_qpn_count);
++      kfree(ibdev->ib_uc_qpns_bitmap);
+       if (ibdev->iboe.nb_inet.notifier_call) {
+               if (unregister_inetaddr_notifier(&ibdev->iboe.nb_inet))
+--- a/drivers/net/ethernet/mellanox/mlx4/qp.c
++++ b/drivers/net/ethernet/mellanox/mlx4/qp.c
+@@ -257,6 +257,9 @@ void mlx4_qp_release_range(struct mlx4_d
+       u64 in_param = 0;
+       int err;
++      if (!cnt)
++              return;
++
+       if (mlx4_is_mfunc(dev)) {
+               set_param_l(&in_param, base_qpn);
+               set_param_h(&in_param, cnt);
diff --git a/queue-3.18/series b/queue-3.18/series
new file mode 100644 (file)
index 0000000..5e90424
--- /dev/null
@@ -0,0 +1 @@
+ib-mlx4-fix-incorrectly-releasing-steerable-ud-qps-when-have-only-eth-ports.patch