summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorMark Bloch <markb@mellanox.com>2018-01-01 13:07:02 +0200
committerJason Gunthorpe <jgg@mellanox.com>2018-01-03 17:26:59 -0700
commitc8b8992446a945c103ac74ebd5e05672d9b3c48a (patch)
tree97e8cd6144af30b68dbed3e44e37dcb3a057ce9f /drivers/infiniband
parent5e1e76125152c9e4a963188ff66e773086fb54d2 (diff)
downloadop-kernel-dev-c8b8992446a945c103ac74ebd5e05672d9b3c48a.zip
op-kernel-dev-c8b8992446a945c103ac74ebd5e05672d9b3c48a.tar.gz
IB/mlx5: Move loopback initialization to the corresponding stage
The loopback stage only initializes a lock, move it to be in the CAPS initialization phase and get rid loopback step completely. Signed-off-by: Mark Bloch <markb@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/mlx5/main.c16
-rw-r--r--drivers/infiniband/hw/mlx5/mlx5_ib.h1
2 files changed, 4 insertions, 13 deletions
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 1a409e7..b8952ff 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -4203,6 +4203,10 @@ static int mlx5_ib_stage_caps_init(struct mlx5_ib_dev *dev)
INIT_LIST_HEAD(&dev->qp_list);
spin_lock_init(&dev->reset_flow_resource_lock);
+ if ((MLX5_CAP_GEN(dev->mdev, port_type) == MLX5_CAP_PORT_TYPE_ETH) &&
+ MLX5_CAP_GEN(dev->mdev, disable_local_lb))
+ mutex_init(&dev->lb_mutex);
+
return 0;
}
@@ -4384,15 +4388,6 @@ static int mlx5_ib_stage_class_attr_init(struct mlx5_ib_dev *dev)
return 0;
}
-static int mlx5_ib_stage_loopback_init(struct mlx5_ib_dev *dev)
-{
- if ((MLX5_CAP_GEN(dev->mdev, port_type) == MLX5_CAP_PORT_TYPE_ETH) &&
- MLX5_CAP_GEN(dev->mdev, disable_local_lb))
- mutex_init(&dev->lb_mutex);
-
- return 0;
-}
-
static void __mlx5_ib_remove(struct mlx5_ib_dev *dev,
const struct mlx5_ib_profile *profile,
int stage)
@@ -4481,9 +4476,6 @@ static const struct mlx5_ib_profile pf_profile = {
STAGE_CREATE(MLX5_IB_STAGE_CLASS_ATTR,
mlx5_ib_stage_class_attr_init,
NULL),
- STAGE_CREATE(MLX5_IB_STAGE_LOOPBACK,
- mlx5_ib_stage_loopback_init,
- NULL),
};
static void *mlx5_ib_add(struct mlx5_core_dev *mdev)
diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h
index 0504ab3..768fa73 100644
--- a/drivers/infiniband/hw/mlx5/mlx5_ib.h
+++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h
@@ -729,7 +729,6 @@ enum mlx5_ib_stages {
MLX5_IB_STAGE_UMR_RESOURCES,
MLX5_IB_STAGE_DELAY_DROP,
MLX5_IB_STAGE_CLASS_ATTR,
- MLX5_IB_STAGE_LOOPBACK,
MLX5_IB_STAGE_MAX,
};
OpenPOWER on IntegriCloud