aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatan Barak <matanb@mellanox.com>2014-02-02 10:06:47 -0500
committerRoland Dreier <roland@purestorage.com>2014-02-13 12:00:18 -0500
commit4196670be786d529ab7f6c18f5077141ce1b787e (patch)
tree3b6f5a807429babfe64e9ef40a139228afa55ab0
parent38dbfb59d1175ef458d006556061adeaa8751b72 (diff)
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: c1c98501121e ("IB/mlx4: Add support for steerable IB UD QPs") Signed-off-by: Matan Barak <matanb@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
-rw-r--r--drivers/infiniband/hw/mlx4/main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index c2702f549f10..64ca4087fb52 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -1810,6 +1810,7 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
1810 int i, j; 1810 int i, j;
1811 int err; 1811 int err;
1812 struct mlx4_ib_iboe *iboe; 1812 struct mlx4_ib_iboe *iboe;
1813 int ib_num_ports = 0;
1813 1814
1814 pr_info_once("%s", mlx4_ib_version); 1815 pr_info_once("%s", mlx4_ib_version);
1815 1816
@@ -1985,10 +1986,14 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
1985 ibdev->counters[i] = -1; 1986 ibdev->counters[i] = -1;
1986 } 1987 }
1987 1988
1989 mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_IB)
1990 ib_num_ports++;
1991
1988 spin_lock_init(&ibdev->sm_lock); 1992 spin_lock_init(&ibdev->sm_lock);
1989 mutex_init(&ibdev->cap_mask_mutex); 1993 mutex_init(&ibdev->cap_mask_mutex);
1990 1994
1991 if (ibdev->steering_support == MLX4_STEERING_MODE_DEVICE_MANAGED) { 1995 if (ibdev->steering_support == MLX4_STEERING_MODE_DEVICE_MANAGED &&
1996 ib_num_ports) {
1992 ibdev->steer_qpn_count = MLX4_IB_UC_MAX_NUM_QPS; 1997 ibdev->steer_qpn_count = MLX4_IB_UC_MAX_NUM_QPS;
1993 err = mlx4_qp_reserve_range(dev, ibdev->steer_qpn_count, 1998 err = mlx4_qp_reserve_range(dev, ibdev->steer_qpn_count,
1994 MLX4_IB_UC_STEER_QPN_ALIGN, 1999 MLX4_IB_UC_STEER_QPN_ALIGN,