Skip to content

Commit

Permalink
net/hns3: fix VF alive notification after config restore
Browse files Browse the repository at this point in the history
[ upstream commit 9c55208 ]

Currently in the VF reset scenario, the VF performs the set
alive operation before restoring the configuration completed,
which may cause the hardware to work in an abnormal state.

This patch fix this problem by set VF alive after restoring
the configuration is completed.

Fixes: a5475d6 ("net/hns3: support VF")

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
  • Loading branch information
Hongbo Zheng authored and steevenlee committed Jun 8, 2021
1 parent 6ed898b commit 8e72b7a
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions drivers/net/hns3/hns3_ethdev_vf.c
Expand Up @@ -1759,12 +1759,6 @@ hns3vf_init_hardware(struct hns3_adapter *hns)
goto err_init_hardware;
}

ret = hns3vf_set_alive(hw, true);
if (ret) {
PMD_INIT_LOG(ERR, "Failed to VF send alive to PF: %d", ret);
goto err_init_hardware;
}

return 0;

err_init_hardware:
Expand Down Expand Up @@ -1856,6 +1850,12 @@ hns3vf_init_vf(struct rte_eth_dev *eth_dev)

hns3_set_default_rss_args(hw);

ret = hns3vf_set_alive(hw, true);
if (ret) {
PMD_INIT_LOG(ERR, "Failed to VF send alive to PF: %d", ret);
goto err_set_tc_queue;
}

return 0;

err_set_tc_queue:
Expand Down Expand Up @@ -2559,6 +2559,13 @@ hns3vf_restore_conf(struct hns3_adapter *hns)
hns3_info(hw, "hns3vf dev restart successful!");
} else if (hw->adapter_state == HNS3_NIC_STOPPING)
hw->adapter_state = HNS3_NIC_CONFIGURED;

ret = hns3vf_set_alive(hw, true);
if (ret) {
hns3_err(hw, "failed to VF send alive to PF: %d", ret);
goto err_vlan_table;
}

return 0;

err_vlan_table:
Expand Down

0 comments on commit 8e72b7a

Please sign in to comment.