From: Junxian Huang huangjunxian6@hisilicon.com
driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I6Z4E9
---------------------------------------------------------------
In the slave list of bond_grp, the first slave is always the main_hr_dev, and the main_hr_dev is responsible for bonding netdev event handling. If the main_hr_dev is uninit too early, some CHANGELOWERSTATE events may be missed before the main_hr_dev is re-register, which may cause the HW is configured with an outdated slave state.
This patch reverses the order of uniniting slave hr_dev to ensure main_hr_dev is the last one being uninited.
Fixes: e62a20278f18 ("RDMA/hns: support RoCE bonding") Signed-off-by: Junxian Huang huangjunxian6@hisilicon.com --- drivers/infiniband/hw/hns/hns_roce_bond.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/hns/hns_roce_bond.c b/drivers/infiniband/hw/hns/hns_roce_bond.c index 212f691716e2..43c7266f0fb3 100644 --- a/drivers/infiniband/hw/hns/hns_roce_bond.c +++ b/drivers/infiniband/hw/hns/hns_roce_bond.c @@ -185,7 +185,7 @@ static void hns_roce_set_bond(struct hns_roce_bond_group *bond_grp) int ret; int i;
- for (i = 0; i < ROCE_BOND_FUNC_MAX; i++) { + for (i = ROCE_BOND_FUNC_MAX - 1; i >= 0; i--) { net_dev = bond_grp->bond_func_info[i].net_dev; if (net_dev) hns_roce_bond_uninit_client(bond_grp, i);