From: shenhao shenhao21@huawei.com
driver inclusion category: bugfix bugzilla: NA CVE: NA
---------------------------------------------------------
Currently, there is a 8s timewindow for PF to know VF being unalive. in this case, when host changes VF mac or VLAN configuration, PF may fail to send mailbox to VF. For VF will query these configuration from PF when reinitialization, so it needn't return error to stack.
Signed-off-by: Jian Shen shenjian15@huawei.com Signed-off-by: shenhao shenhao21@huawei.com Reviewed-by: Zhong Zhaohui zhongzhaohui@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 3f9ed71..c2ae05f 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -8054,11 +8054,17 @@ static int hclge_set_vf_mac(struct hnae3_handle *handle, int vf, }
ether_addr_copy(vport->vf_info.mac, mac_addr); + + /* there is a timewindow for PF to know VF unalive, it may + * cause send mailbox fail, but it doesn't matter, VF will + * query it when reinit. + */ if (test_bit(HCLGE_VPORT_STATE_ALIVE, &vport->state)) { dev_info(&hdev->pdev->dev, "MAC of VF %d has been set to %pM, and it will be reinitialized!\n", vf, mac_addr); - return hclge_inform_reset_assert_to_vf(vport); + (void)hclge_inform_reset_assert_to_vf(vport); + return 0; }
dev_info(&hdev->pdev->dev, "MAC of VF %d has been set to %pM\n", @@ -9186,11 +9192,15 @@ static int hclge_set_vf_vlan_filter(struct hnae3_handle *handle, int vfid, return ret; }
+ /* there is a timewindow for PF to know VF unalive, it may + * cause send mailbox fail, but it doesn't matter, VF will + * query it when reinit. + */ if (test_bit(HCLGE_VPORT_STATE_ALIVE, &vport->state)) - return hclge_push_vf_port_base_vlan_info(&hdev->vport[0], - vport->vport_id, - state, vlan, qos, - ntohs(proto)); + (void)hclge_push_vf_port_base_vlan_info(&hdev->vport[0], + vport->vport_id, + state, vlan, qos, + ntohs(proto));
return 0; }