diff options
author | Parav Pandit <parav@mellanox.com> | 2018-01-04 18:25:39 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-01-08 21:42:22 +0300 |
commit | a9e546e73ace1ebfb80dc9b55b46ace306f684cd (patch) | |
tree | eccd87fd8837f631b53d543ceb181cc8209097c1 /drivers/infiniband/hw/mlx5/main.c | |
parent | b3cbd6f080c90f64fa425589d20fe4506d96fb19 (diff) | |
download | linux-a9e546e73ace1ebfb80dc9b55b46ace306f684cd.tar.xz |
IB/mlx5: Change debugfs to have per port contents
When there are multiple ports for single IB(RoCE) device, support
debugfs entries to be available for each port.
Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Daniel Jurgens <danielj@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx5/main.c')
-rw-r--r-- | drivers/infiniband/hw/mlx5/main.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 59e26901d935..2ced365e8247 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -4254,6 +4254,8 @@ static void mlx5_ib_unbind_slave_port(struct mlx5_ib_dev *ibdev, int err; int i; + mlx5_ib_cleanup_cong_debugfs(ibdev, port_num); + spin_lock(&port->mp.mpi_lock); if (!mpi->ibdev) { spin_unlock(&port->mp.mpi_lock); @@ -4331,6 +4333,10 @@ static bool mlx5_ib_bind_slave_port(struct mlx5_ib_dev *ibdev, goto unbind; } + err = mlx5_ib_init_cong_debugfs(ibdev, port_num); + if (err) + goto unbind; + return true; unbind: @@ -4748,12 +4754,14 @@ static void mlx5_ib_stage_counters_cleanup(struct mlx5_ib_dev *dev) static int mlx5_ib_stage_cong_debugfs_init(struct mlx5_ib_dev *dev) { - return mlx5_ib_init_cong_debugfs(dev); + return mlx5_ib_init_cong_debugfs(dev, + mlx5_core_native_port_num(dev->mdev) - 1); } static void mlx5_ib_stage_cong_debugfs_cleanup(struct mlx5_ib_dev *dev) { - mlx5_ib_cleanup_cong_debugfs(dev); + mlx5_ib_cleanup_cong_debugfs(dev, + mlx5_core_native_port_num(dev->mdev) - 1); } static int mlx5_ib_stage_uar_init(struct mlx5_ib_dev *dev) |