diff options
author | Eran Ben Elisha <eranbe@mellanox.com> | 2016-11-10 04:31:00 -0500 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-12-13 13:29:46 -0500 |
commit | 1f22e454df2eb99ba6b7ace3f594f6805cdf5cbc (patch) | |
tree | 0089e250082ab4ba3426a937f33c14a4424251fb /drivers/infiniband/hw/mlx4 | |
parent | 6fa26208206c406fa529cd73f7ae6bf4181e270b (diff) |
IB/mlx4: When no DMFS for IPoIB, don't allow NET_IF QPs
According to the firmware spec, FLOW_STEERING_IB_UC_QP_RANGE command is
supported only if dmfs_ipoib bit is set.
If it isn't set we want to ensure allocating NET_IF QPs fail. We do so
by filling out the allocation bitmap. By thus, the NET_IF QPs allocating
function won't find any free QP and will fail.
Fixes: c1c98501121e ('IB/mlx4: Add support for steerable IB UD QPs')
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Daniel Jurgens <danielj@mellanox.com>
Reviewed-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx4')
-rw-r--r-- | drivers/infiniband/hw/mlx4/main.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index 4054a1bfabb5..4a67ffc1ddfb 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c | |||
@@ -2823,14 +2823,19 @@ static void *mlx4_ib_add(struct mlx4_dev *dev) | |||
2823 | goto err_steer_qp_release; | 2823 | goto err_steer_qp_release; |
2824 | } | 2824 | } |
2825 | 2825 | ||
2826 | bitmap_zero(ibdev->ib_uc_qpns_bitmap, ibdev->steer_qpn_count); | 2826 | if (dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_DMFS_IPOIB) { |
2827 | 2827 | bitmap_zero(ibdev->ib_uc_qpns_bitmap, | |
2828 | err = mlx4_FLOW_STEERING_IB_UC_QP_RANGE( | 2828 | ibdev->steer_qpn_count); |
2829 | dev, ibdev->steer_qpn_base, | 2829 | err = mlx4_FLOW_STEERING_IB_UC_QP_RANGE( |
2830 | ibdev->steer_qpn_base + | 2830 | dev, ibdev->steer_qpn_base, |
2831 | ibdev->steer_qpn_count - 1); | 2831 | ibdev->steer_qpn_base + |
2832 | if (err) | 2832 | ibdev->steer_qpn_count - 1); |
2833 | goto err_steer_free_bitmap; | 2833 | if (err) |
2834 | goto err_steer_free_bitmap; | ||
2835 | } else { | ||
2836 | bitmap_fill(ibdev->ib_uc_qpns_bitmap, | ||
2837 | ibdev->steer_qpn_count); | ||
2838 | } | ||
2834 | } | 2839 | } |
2835 | 2840 | ||
2836 | for (j = 1; j <= ibdev->dev->caps.num_ports; j++) | 2841 | for (j = 1; j <= ibdev->dev->caps.num_ports; j++) |