diff options
author | Jakub Kicinski <kuba@kernel.org> | 2021-10-18 17:29:27 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-10-19 14:41:47 +0300 |
commit | 298b0e0c5fec65081e308a4aa2f16ec8a91070e1 (patch) | |
tree | 7477b18f347428bd00258cde051aebd06c462abd /drivers/net/ethernet/rocker | |
parent | 0b08956cd532786b7442338d700e6950e00b4a92 (diff) | |
download | linux-298b0e0c5fec65081e308a4aa2f16ec8a91070e1.tar.xz |
ethernet: rocker: use eth_hw_addr_set()
Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.
Read the address into an array on the stack, then call
eth_hw_addr_set().
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/rocker')
-rw-r--r-- | drivers/net/ethernet/rocker/rocker_main.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/ethernet/rocker/rocker_main.c b/drivers/net/ethernet/rocker/rocker_main.c index f28c0c36b606..ba4062881eed 100644 --- a/drivers/net/ethernet/rocker/rocker_main.c +++ b/drivers/net/ethernet/rocker/rocker_main.c @@ -2545,11 +2545,13 @@ static void rocker_port_dev_addr_init(struct rocker_port *rocker_port) { const struct rocker *rocker = rocker_port->rocker; const struct pci_dev *pdev = rocker->pdev; + u8 addr[ETH_ALEN]; int err; - err = rocker_cmd_get_port_settings_macaddr(rocker_port, - rocker_port->dev->dev_addr); - if (err) { + err = rocker_cmd_get_port_settings_macaddr(rocker_port, addr); + if (!err) { + eth_hw_addr_set(rocker_port->dev, addr); + } else { dev_warn(&pdev->dev, "failed to get mac address, using random\n"); eth_hw_addr_random(rocker_port->dev); } |