Commit 8d3ee0ae authored by Junxian Huang's avatar Junxian Huang Committed by ZhouJuan
Browse files

RDMA/hns: Fix the driver uninit order during bond setting

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: e62a2027 ("RDMA/hns: support RoCE bonding")
Signed-off-by: default avatarJunxian Huang <huangjunxian6@hisilicon.com>
parent bc80b728
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);