Commit b927e306 authored by Junxian Huang's avatar Junxian Huang Committed by Jeiwei Li
Browse files

RDMA/hns: Fix the concurrency error between bond and reset.

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I87LSW



--------------------------------------------------------------------------

In the concurrency process between setting bond and reset, when the
reset process is finished, the driver detects that bond resource has
already been allocated, thus entering the bond recover process, where
the bond state is set to HNS_ROCE_BOND_IS_BONDED. But at this point
the set bond process hasn't been executed yet(i.e. slaves haven't been
uninited). This wrong bond state leads to the abnormal reset result
that 2 slaves are both registered as bond device.

Thus delete the bond state setting in bond recover process. Besides,
to fix other potential concurrency errors between bond and reset,
some improvements are also added:

1. For the situation that reset occurs before bond work, add a reset
check at the beginning of bond work. If there is an ongoing reset
process, re-queue the bond work until the reset is finished.

2. For the situation that reset occurs during bond work, add reset
checks to bond init/uninit process, treating this situation as an
abnormal case.

Fixes: b0f80ad2 ("RDMA/hns: Support reset recovery for RoCE bonding")
Signed-off-by: default avatarJunxian Huang <huangjunxian6@hisilicon.com>
parent 172129db
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment