ethernet: fec: use eth_hw_addr_gen()
authorJakub Kicinski <kuba@kernel.org>
Mon, 18 Oct 2021 21:10:05 +0000 (14:10 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Oct 2021 11:46:25 +0000 (12:46 +0100)
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.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fec_main.c

index 47a6fc7..bc418b9 100644 (file)
@@ -1768,11 +1768,8 @@ static int fec_get_mac(struct net_device *ndev)
                return 0;
        }
 
-       eth_hw_addr_set(ndev, iap);
-
        /* Adjust MAC if using macaddr */
-       if (iap == macaddr)
-                ndev->dev_addr[ETH_ALEN-1] = macaddr[ETH_ALEN-1] + fep->dev_id;
+       eth_hw_addr_gen(ndev, iap, iap == macaddr ? fep->dev_id : 0);
 
        return 0;
 }