All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, olteanv@gmail.com, andrew@lunn.ch,
	idosch@idosch.org, f.fainelli@gmail.com, snelson@pensando.io,
	Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next 4/6] ethernet: fec: use eth_hw_addr_gen()
Date: Mon, 18 Oct 2021 14:10:05 -0700	[thread overview]
Message-ID: <20211018211007.1185777-5-kuba@kernel.org> (raw)
In-Reply-To: <20211018211007.1185777-1-kuba@kernel.org>

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>
---
 drivers/net/ethernet/freescale/fec_main.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 47a6fc702ac7..bc418b910999 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -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;
 }
-- 
2.31.1


  parent reply	other threads:[~2021-10-18 21:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-18 21:10 [PATCH net-next 0/6] ethernet: add eth_hw_addr_gen() for switches Jakub Kicinski
2021-10-18 21:10 ` [PATCH net-next 1/6] ethernet: add a helper for assigning port addresses Jakub Kicinski
2021-10-18 21:37   ` Vladimir Oltean
2021-10-18 21:54   ` Shannon Nelson
2021-10-19  6:11   ` Ido Schimmel
2021-10-18 21:10 ` [PATCH net-next 2/6] ethernet: ocelot: use eth_hw_addr_gen() Jakub Kicinski
2021-10-18 21:33   ` Vladimir Oltean
2021-10-18 21:10 ` [PATCH net-next 3/6] ethernet: prestera: " Jakub Kicinski
2021-10-18 21:10 ` Jakub Kicinski [this message]
2021-10-18 23:19   ` [PATCH net-next 4/6] ethernet: fec: " Vladimir Oltean
2021-10-18 21:10 ` [PATCH net-next 5/6] ethernet: mlxsw: " Jakub Kicinski
2021-10-19  6:12   ` Ido Schimmel
2021-10-18 21:10 ` [PATCH net-next 6/6] ethernet: sparx5: " Jakub Kicinski
2021-10-19 11:50 ` [PATCH net-next 0/6] ethernet: add eth_hw_addr_gen() for switches patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211018211007.1185777-5-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=idosch@idosch.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=snelson@pensando.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.