Commit 298b0e0c authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

ethernet: rocker: use eth_hw_addr_set()

Commit 406f42fa ("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: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0b08956c
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment