Loading
RDMA/hns: Fix concurrency issue between bond work and bond event
driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IAH10J ---------------------------------------------------------------------- Currently the complete process of a single RoCE bonding operation is: * check the constraints of RoCE bonding in the bond event * update the bond_grp information in the bond event * queue the delayed bond work * init/uninit slaves according to the bond information and bond state in the bond work This process works fine when there is only one single bonding operation. But when there is concurrency between bond work and bond event, some unexpected outcomes may occur. To fix the concurrency issues, the bond event just checks the constraints and queue the bond work now. The bond work checks the constraints of slaves again (as they may be changed between the bond work is queued and scheduled) and updates the information with a mutex. It is possible that after the bond work unlocks, new bond events occur and the information in bond_grp structure become outdated. In this case the bond work will finish the job with its outdated information and the bond event will queue a new work to update again. Fixes: 2004b3f9 ("RDMA/hns: Support RoCE bonding") Signed-off-by:Junxian Huang <huangjunxian6@hisilicon.com> Signed-off-by:
Xinghai Cen <cenxinghai@h-partners.com>