]> git.ipfire.org Git - thirdparty/linux.git/commit
RDMA/mlx5: Fix state and counter desync on loopback enable failure
authorLi RongQing <lirongqing@baidu.com>
Mon, 1 Jun 2026 09:58:18 +0000 (05:58 -0400)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 5 Jun 2026 16:41:48 +0000 (13:41 -0300)
commit0d32eabccbe4b2f8d45be3192c5f3c76c8af703d
tree2ddb0424b4dd8970280f8a78696559e2c3f90025
parent309cacf953aa7e289ce50b3e7e4424c63103c333
RDMA/mlx5: Fix state and counter desync on loopback enable failure

In mlx5_ib_enable_lb(), dev->lb.enabled was unconditionally set
to true even if mlx5_nic_vport_update_local_lb() failed.

Fix this by only setting dev->lb.enabled on success. On failure,
roll back the reference counters and return the error.

Link: https://patch.msgid.link/r/20260601095818.2227-1-lirongqing@baidu.com
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/mlx5/main.c