Skip to content

Commit 139e879

Browse files
321lipengdavem330
authored andcommitted
net: hns3: Fixes the initialization of MAC address in hardware
This patch fixes the initialization of MAC address, fetched from HNS3 firmware i.e. when it is not randomly generated, to the HNS3 hardware. Fixes: ca60906d2795 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC") Signed-off-by: Lipeng <lipeng321@huawei.com> Signed-off-by: Salil Mehta <salil.mehta@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 0305b44 commit 139e879

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2705,10 +2705,11 @@ static void hns3_init_mac_addr(struct net_device *netdev)
27052705
eth_hw_addr_random(netdev);
27062706
dev_warn(priv->dev, "using random MAC address %pM\n",
27072707
netdev->dev_addr);
2708-
/* Also copy this new MAC address into hdev */
2709-
if (h->ae_algo->ops->set_mac_addr)
2710-
h->ae_algo->ops->set_mac_addr(h, netdev->dev_addr);
27112708
}
2709+
2710+
if (h->ae_algo->ops->set_mac_addr)
2711+
h->ae_algo->ops->set_mac_addr(h, netdev->dev_addr);
2712+
27122713
}
27132714

27142715
static void hns3_nic_set_priv_ops(struct net_device *netdev)

0 commit comments

Comments
 (0)