Skip to content

Commit

Permalink
net: hns3: fix for mishandle of asserting VF reset fail
Browse files Browse the repository at this point in the history
When asserts VF reset fail, flag HCLGEVF_STATE_CMD_DISABLE
and handshake status should not set, otherwise the retry will
fail. So adds a check for asserting VF reset and returns
directly when fails.

Fixes: ef5f8e5 ("net: hns3: stop handling command queue while resetting VF")
Signed-off-by: Huazhong Tan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Huazhong Tan authored and davem330 committed Jul 6, 2020
1 parent bb3d866 commit cddd564
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1793,6 +1793,11 @@ static int hclgevf_reset_prepare_wait(struct hclgevf_dev *hdev)
if (hdev->reset_type == HNAE3_VF_FUNC_RESET) {
hclgevf_build_send_msg(&send_msg, HCLGE_MBX_RESET, 0);
ret = hclgevf_send_mbx_msg(hdev, &send_msg, true, NULL, 0);
if (ret) {
dev_err(&hdev->pdev->dev,
"failed to assert VF reset, ret = %d\n", ret);
return ret;
}
hdev->rst_stats.vf_func_rst_cnt++;
}

Expand Down

0 comments on commit cddd564

Please sign in to comment.