[PATCH v11 0/2] IB/mlx5: Fix loopback rollback and threshold accounting
From: Prathamesh Deshpande
Date: Tue Apr 14 2026 - 20:21:05 EST
This series fixes transport-domain rollback and inconsistent accounting
in the regular (non-MP) device paths.
Patch 1 fixes TD rollback on mlx5_ib_enable_lb() failure, makes the
success return path explicit, and initializes lb.mutex earlier.
Patch 2 corrects the loopback threshold logic to use a capability-aware
baseline rather than a hardcoded value and ensures that
user_td/qps counters are rolled back if the hardware command fails.
v11:
- Dropped the MP locking changes per review feedback
to keep the logic unchanged.
- Narrowed the scope of Patch 2/2 to focus solely on regular-path
threshold and accounting fixes.
v10:
- Initialize lb.mutex before multiport master init to avoid race.
- Use <= td_base in disable paths to handle idle/no-TD cases.
v9:
- Address race/state issues around force_enable and enabled.
- Fix TD leak on failure after successful allocation.
- Implement hardware-aware thresholds via mlx5_ib_lb_td_base() to
handle both TD-capable and no-TD hardware correctly.
- Serialize MP force-enable transitions under lb.mutex.
v8:
- Resubmitted as a fresh, independent thread per maintainer request.
- No functional changes since v7.
v7:
- Split the series into two patches to isolate the return-value/mutex
initialization fix from the refcounting logic.
- Moved force_enable check after increments/decrements to fix leaks.
- Updated hardware disable condition to a strict zero-check.
v1-v6:
- Initial combined versions.
- Added deallocation of tdn on failure.
- Moved mutex_init to stage_init_init to prevent crashes on non-ETH.
- Implemented atomic rollback in enable/disable paths.
Prathamesh Deshpande (2):
IB/mlx5: Fix transport-domain rollback and initialize lb mutex earlier
IB/mlx5: Fix loopback threshold/accounting in regular path
drivers/infiniband/hw/mlx5/main.c | 36 ++++++++++++++++++++++---------
1 file changed, 26 insertions(+), 10 deletions(-)
--
2.43.0