Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1735075
| From | Salil Mehta <salil.mehta@huawei.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH V2 net 4/7] net: hns3: Fixes the initialization of MAC address in hardware |
| Date | 2017-09-19 18:20 +0200 |
| Message-ID | <urtpE-7FJ-43@gated-at.bofh.it> (permalink) |
| References | <urtpD-7FJ-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Lipeng <lipeng321@huawei.com>
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>
---
drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c
index 1c3e294..4d68d6e 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c
@@ -2705,10 +2705,11 @@ static void hns3_init_mac_addr(struct net_device *netdev)
eth_hw_addr_random(netdev);
dev_warn(priv->dev, "using random MAC address %pM\n",
netdev->dev_addr);
- /* Also copy this new MAC address into hdev */
- if (h->ae_algo->ops->set_mac_addr)
- h->ae_algo->ops->set_mac_addr(h, netdev->dev_addr);
}
+
+ if (h->ae_algo->ops->set_mac_addr)
+ h->ae_algo->ops->set_mac_addr(h, netdev->dev_addr);
+
}
static void hns3_nic_set_priv_ops(struct net_device *netdev)
--
2.7.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH V2 net 0/7] Bug fixes for the HNS3 Ethernet Driver for Hip08 SoC Salil Mehta <salil.mehta@huawei.com> - 2017-09-19 18:20 +0200 [PATCH V2 net 4/7] net: hns3: Fixes the initialization of MAC address in hardware Salil Mehta <salil.mehta@huawei.com> - 2017-09-19 18:20 +0200 [PATCH V2 net 3/7] net: hns3: Fixes ring-to-vector map-and-unmap command Salil Mehta <salil.mehta@huawei.com> - 2017-09-19 18:20 +0200 [PATCH V2 net 1/7] net: hns3: Fixes initialization of phy address from firmware Salil Mehta <salil.mehta@huawei.com> - 2017-09-19 18:30 +0200 Re: [PATCH V2 net 0/7] Bug fixes for the HNS3 Ethernet Driver for Hip08 SoC David Miller <davem@davemloft.net> - 2017-09-20 01:10 +0200
csiph-web