From: Guojia Liao liaoguojia@huawei.com
driver inclusion category: bugfix bugzilla: NA CVE: NA
When PF set VF mac address, we need to sync the mac address to netdev. But we just forgot this point after optimize the code at patch "refine mac address configure for VF".
This patch fix it.
Fixes: c074500eb002 ("net: hns3: refine mac address configure for VF")
Signed-off-by: Guojia Liao liaoguojia@huawei.com Reviewed-by: Peng Li lipeng321@huawei.com Reviewed-by: Zhong Zhaohui zhongzhaohui@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 3 +++ drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index ae7a3d1..6cde7a6 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -4453,6 +4453,9 @@ static int hns3_reset_notify_init_enet(struct hnae3_handle *handle) goto err_init_irq_fail; }
+ if (!hns3_is_phys_func(handle->pdev)) + hns3_init_mac_addr(netdev); + ret = hns3_client_start(handle); if (ret) { dev_err(priv->dev, "hns3_client_start fail! ret=%d\n", ret); diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c index c61e3c1..ea41414 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -1264,7 +1264,7 @@ static int hclgevf_set_mac_addr(struct hnae3_handle *handle, void *p, hclgevf_build_send_msg(&send_msg, HCLGE_MBX_SET_UNICAST, 0); send_msg.subcode = HCLGE_MBX_MAC_VLAN_UC_MODIFY; ether_addr_copy(send_msg.data, new_mac_addr); - if (is_first) + if (is_first && !hdev->has_pf_mac) eth_zero_addr(&send_msg.data[ETH_ALEN]); else ether_addr_copy(&send_msg.data[ETH_ALEN], old_mac_addr);