Skip to content

Commit

Permalink
net: sgi-xp: use eth_hw_addr_set()
Browse files Browse the repository at this point in the history
Commit 406f42f ("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 go through appropriate helpers.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jakub Kicinski authored and David S. Miller committed Oct 29, 2021
1 parent 704bc98 commit 40d5cb4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/misc/sgi-xp/xpnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ static const struct net_device_ops xpnet_netdev_ops = {
static int __init
xpnet_init(void)
{
u8 addr[ETH_ALEN];
int result;

if (!is_uv_system())
Expand Down Expand Up @@ -545,15 +546,17 @@ xpnet_init(void)
xpnet_device->min_mtu = XPNET_MIN_MTU;
xpnet_device->max_mtu = XPNET_MAX_MTU;

memset(addr, 0, sizeof(addr));
/*
* Multicast assumes the LSB of the first octet is set for multicast
* MAC addresses. We chose the first octet of the MAC to be unlikely
* to collide with any vendor's officially issued MAC.
*/
xpnet_device->dev_addr[0] = 0x02; /* locally administered, no OUI */
addr[0] = 0x02; /* locally administered, no OUI */

xpnet_device->dev_addr[XPNET_PARTID_OCTET + 1] = xp_partition_id;
xpnet_device->dev_addr[XPNET_PARTID_OCTET + 0] = (xp_partition_id >> 8);
addr[XPNET_PARTID_OCTET + 1] = xp_partition_id;
addr[XPNET_PARTID_OCTET + 0] = (xp_partition_id >> 8);
eth_hw_addr_set(xpnet_device, addr);

/*
* ether_setup() sets this to a multicast device. We are
Expand Down

0 comments on commit 40d5cb4

Please sign in to comment.