Batch of mlx5_ib fixes
Subsystems (2)
cover Batch of mlx5_ib fixes
The batch of different mlx5_ib fixes from Patrisious.
Patrisious Haddad (3):
RDMA/mlx5: Fix HW counters query for non-representor devices RDMA/mlx5: Fix CC counters query for MPV RDMA/mlx5: Fix vport loopback for MPV device
drivers/infiniband/hw/mlx5/counters.c | 4 ++-- drivers/infiniband/hw/mlx5/main.c | 33 +++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-)
Signature · 1 line
2.49.0
PATCH 1/3 RDMA/mlx5: Fix HW counters query for non-representor devices
From: Patrisious Haddad <[email protected]>
To get the device HW counters, a non-representor switchdev device should use the mlx5_ib_query_q_counters() function and query all of the available counters. While a representor device in switchdev mode should use the mlx5_ib_query_q_counters_vport() function and query only the Q_Counters without the PPCNT counters and congestion control counters, since they aren't relevant for a representor device.
Currently a non-representor switchdev device skips querying the PPCNT counters and congestion control counters, leaving them unupdated. Fix that by properly querying those counters for non-representor devices.
--- drivers/infiniband/hw/mlx5/counters.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/counters.c +1 -1
@@ -398,7 +398,7 @@ static int do_get_hw_stats(struct ib_device *ibdev,return ret;/* We don't expose device counters over Vports */ -if (is_mdev_switchdev_mode (dev->mdev) && port_num !=0 ) +if (is_mdev_switchdev_mode (dev->mdev) && dev->is_rep && port_num !=0 ) goto done;if (MLX5_CAP_PCAM_FEATURE (dev->mdev, rx_icrc_encapsulated_counter)) {
Signature · 1 line
2.49.0
PATCH 2/3 RDMA/mlx5: Fix CC counters query for MPV
In reply to Leon RomanovskyFrom: Patrisious Haddad <[email protected]>
In case, CC counters are querying for the second port use the correct core device for the query instead of always using the master core device.
--- drivers/infiniband/hw/mlx5/counters.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/counters.c +1 -1
@@ -418,7 +418,7 @@ static int do_get_hw_stats(struct ib_device *ibdev,*/ goto done; } - ret = mlx5_lag_query_cong_counters(dev->mdev, + ret = mlx5_lag_query_cong_counters(mdev, stats->value + cnts->num_q_counters, cnts->num_cong_counters,
Signature · 1 line
2.49.0
PATCH 3/3 RDMA/mlx5: Fix vport loopback for MPV device
In reply to Leon RomanovskyFrom: Patrisious Haddad <[email protected]>
Always enable vport loopback for both MPV devices on driver start.
Previously in some cases related to MPV RoCE, packets weren't correctly executing loopback check at vport in FW, since it was disabled. Due to complexity of identifying such cases for MPV always enable vport loopback for both GVMIs when binding the slave to the master port.
--- drivers/infiniband/hw/mlx5/main.c | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+)
drivers/infiniband/hw/mlx5/main.c +33 -0
@@ -1791,6 +1791,33 @@ static void deallocate_uars(struct mlx5_ib_dev *dev, context->devx_uid); } +static int mlx5_ib_enable_lb_mp (struct mlx5_core_dev *master, +struct mlx5_core_dev *slave) +{ +int err; + + err =mlx5_nic_vport_update_local_lb (master, true); +if (err) +return err; + + err =mlx5_nic_vport_update_local_lb (slave, true); +if (err) + goto out; + +return 0 ; + +out: +mlx5_nic_vport_update_local_lb (master, false); +return err; +} + +static void mlx5_ib_disable_lb_mp (struct mlx5_core_dev *master, +struct mlx5_core_dev *slave) +{ +mlx5_nic_vport_update_local_lb (slave, false); +mlx5_nic_vport_update_local_lb (master, false); +} +int mlx5_ib_enable_lb (struct mlx5_ib_dev *dev,bool td,bool qp) {int err =0 ;
@@ -3495,6 +3522,8 @@ static void mlx5_ib_unbind_slave_port(struct mlx5_ib_dev *ibdev,lockdep_assert_held (&mlx5_ib_multiport_mutex); +mlx5_ib_disable_lb_mp (ibdev->mdev, mpi->mdev); +mlx5_core_mp_event_replay (ibdev->mdev,MLX5_DRIVER_EVENT_AFFILIATION_REMOVED ,NULL );
@@ -3590,6 +3619,10 @@ static bool mlx5_ib_bind_slave_port(struct mlx5_ib_dev *ibdev,MLX5_DRIVER_EVENT_AFFILIATION_DONE , &key); + err =mlx5_ib_enable_lb_mp (ibdev->mdev, mpi->mdev); +if (err) + goto unbind; +return true; unbind:
Signature · 1 line
2.49.0
Leon Romanovsky
AppliedQuoted 8 lines · Leon Romanovsky
The batch of different
mlx5_ibfixes from Patrisious.Patrisious Haddad (3):
RDMA/mlx5: Fix HW counters query for non-representor devices RDMA/mlx5: Fix CC counters query for MPV RDMA/mlx5: Fix vport loopback for MPV device[...]
Applied, thanks!
[1/3] RDMA/mlx5: Fix HW counters query for non-representor devices
https://git.kernel.org/rdma/rdma/c/3cc1dbfddf88dc [2/3] RDMA/mlx5: Fix CC counters query for MPV https://git.kernel.org/rdma/rdma/c/acd245b1e33fc4 [3/3] RDMA/mlx5: Fix vport loopback for MPV device https://git.kernel.org/rdma/rdma/c/a9a9e68954f29b
Best regards,
Signature · 1 line
Leon Romanovsky <[email protected]>