[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211015193848.779420-7-kuba@kernel.org>
Date: Fri, 15 Oct 2021 12:38:48 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: netdev@...r.kernel.org
Cc: olteanv@...il.com, andrew@...n.ch, idosch@...sch.org,
f.fainelli@...il.com, Jakub Kicinski <kuba@...nel.org>,
lars.povlsen@...rochip.com, Steen.Hegelund@...rochip.com,
UNGLinuxDriver@...rochip.com, bjarni.jonasson@...rochip.com,
linux-arm-kernel@...ts.infradead.org
Subject: [RFC net-next 6/6] ethernet: sparx5: use eth_hw_addr_set_port()
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@...nel.org>
---
CC: lars.povlsen@...rochip.com
CC: Steen.Hegelund@...rochip.com
CC: UNGLinuxDriver@...rochip.com
CC: bjarni.jonasson@...rochip.com
CC: linux-arm-kernel@...ts.infradead.org
---
drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c b/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c
index b21ebaa32d7e..d56822f6d09e 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c
@@ -200,7 +200,6 @@ struct net_device *sparx5_create_netdev(struct sparx5 *sparx5, u32 portno)
{
struct sparx5_port *spx5_port;
struct net_device *ndev;
- u64 val;
ndev = devm_alloc_etherdev(sparx5->dev, sizeof(struct sparx5_port));
if (!ndev)
@@ -216,8 +215,7 @@ struct net_device *sparx5_create_netdev(struct sparx5 *sparx5, u32 portno)
ndev->netdev_ops = &sparx5_port_netdev_ops;
ndev->ethtool_ops = &sparx5_ethtool_ops;
- val = ether_addr_to_u64(sparx5->base_mac) + portno + 1;
- u64_to_ether_addr(val, ndev->dev_addr);
+ eth_hw_addr_set_port(ndev, sparx5->base_mac, portno + 1);
return ndev;
}
--
2.31.1
Powered by blists - more mailing lists