]>
Commit | Line | Data |
---|---|---|
f68557eb GKH |
1 | From 1f22e454df2eb99ba6b7ace3f594f6805cdf5cbc Mon Sep 17 00:00:00 2001 |
2 | From: Eran Ben Elisha <eranbe@mellanox.com> | |
3 | Date: Thu, 10 Nov 2016 11:31:00 +0200 | |
4 | Subject: IB/mlx4: When no DMFS for IPoIB, don't allow NET_IF QPs | |
5 | ||
6 | From: Eran Ben Elisha <eranbe@mellanox.com> | |
7 | ||
8 | commit 1f22e454df2eb99ba6b7ace3f594f6805cdf5cbc upstream. | |
9 | ||
10 | According to the firmware spec, FLOW_STEERING_IB_UC_QP_RANGE command is | |
11 | supported only if dmfs_ipoib bit is set. | |
12 | ||
13 | If it isn't set we want to ensure allocating NET_IF QPs fail. We do so | |
14 | by filling out the allocation bitmap. By thus, the NET_IF QPs allocating | |
15 | function won't find any free QP and will fail. | |
16 | ||
17 | Fixes: c1c98501121e ('IB/mlx4: Add support for steerable IB UD QPs') | |
18 | Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com> | |
19 | Signed-off-by: Daniel Jurgens <danielj@mellanox.com> | |
20 | Reviewed-by: Mark Bloch <markb@mellanox.com> | |
21 | Signed-off-by: Leon Romanovsky <leon@kernel.org> | |
22 | Signed-off-by: Doug Ledford <dledford@redhat.com> | |
23 | Signed-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++) |