Commit 39c7fc1c authored by Yonglong Liu's avatar Yonglong Liu
Browse files

net: hns3: fix not call nic_call_event() problem when reset failed

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


CVE: NA

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

The variable reset_fail_cnt has moved into the struct rst_stats,
but in hclge_reset_end_it(), still using the old reset_fail_cnt,
so when reset fail, the reset_fail_cnt is always 0, and will not
call nic_call_event() to notify who cares about this event.

This patch use the correct variable rst_stats.reset_fail_cnt to
fix the problem.

Fixes: bc70c292 ("net: hns3: add some DFX info for reset issue")
Signed-off-by: default avatarYonglong Liu <liuyonglong@huawei.com>
parent 8a366b3d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -159,7 +159,7 @@ bool hclge_reset_end_it(struct hnae3_handle *handle, bool done)
			nic_call_event(netdev, HNAE3_RESET_DONE_CUSTOM);
	}

	if (hdev->reset_fail_cnt >= HCLGE_RESET_MAX_FAIL_CNT) {
	if (hdev->rst_stats.reset_fail_cnt >= HCLGE_RESET_MAX_FAIL_CNT) {
		dev_err(&hdev->pdev->dev, "IT Report Reset fail!\n");
		if (nic_event_call) {
			if (hdev->reset_type == HNAE3_FUNC_RESET)