Commit 4196670b authored by Matan Barak's avatar Matan Barak Committed by Roland Dreier

IB/mlx4: Don't allocate range of steerable UD QPs for Ethernet-only device

When the device has only Ethernet ports, don't try to allocate range
of steerable UD QPs since they aren't needed.  This fixes an issue
where mlx4 VFs tried to allocate a range of UD steerable QPs, but
failed to do so.

Fixes: c1c98501 ("IB/mlx4: Add support for steerable IB UD QPs")
Signed-off-by: default avatarMatan Barak <matanb@mellanox.com>
Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 38dbfb59
...@@ -1810,6 +1810,7 @@ static void *mlx4_ib_add(struct mlx4_dev *dev) ...@@ -1810,6 +1810,7 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
int i, j; int i, j;
int err; int err;
struct mlx4_ib_iboe *iboe; struct mlx4_ib_iboe *iboe;
int ib_num_ports = 0;
pr_info_once("%s", mlx4_ib_version); pr_info_once("%s", mlx4_ib_version);
...@@ -1985,10 +1986,14 @@ static void *mlx4_ib_add(struct mlx4_dev *dev) ...@@ -1985,10 +1986,14 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
ibdev->counters[i] = -1; ibdev->counters[i] = -1;
} }
mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_IB)
ib_num_ports++;
spin_lock_init(&ibdev->sm_lock); spin_lock_init(&ibdev->sm_lock);
mutex_init(&ibdev->cap_mask_mutex); mutex_init(&ibdev->cap_mask_mutex);
if (ibdev->steering_support == MLX4_STEERING_MODE_DEVICE_MANAGED) { if (ibdev->steering_support == MLX4_STEERING_MODE_DEVICE_MANAGED &&
ib_num_ports) {
ibdev->steer_qpn_count = MLX4_IB_UC_MAX_NUM_QPS; ibdev->steer_qpn_count = MLX4_IB_UC_MAX_NUM_QPS;
err = mlx4_qp_reserve_range(dev, ibdev->steer_qpn_count, err = mlx4_qp_reserve_range(dev, ibdev->steer_qpn_count,
MLX4_IB_UC_STEER_QPN_ALIGN, MLX4_IB_UC_STEER_QPN_ALIGN,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment