netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
	hkallweit1@gmail.com, nic_swsd@realtek.com
Subject: [PATCH net-next 05/12] ethernet: r8169: use eth_hw_addr_set()
Date: Mon, 18 Oct 2021 07:29:25 -0700	[thread overview]
Message-ID: <20211018142932.1000613-6-kuba@kernel.org> (raw)
In-Reply-To: <20211018142932.1000613-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.

Read the address into an array on the stack, then call
eth_hw_addr_set().

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: hkallweit1@gmail.com
CC: nic_swsd@realtek.com
---
 drivers/net/ethernet/realtek/r8169_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 0199914440ab..ee6c9c842012 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -5217,7 +5217,7 @@ static int rtl_get_ether_clk(struct rtl8169_private *tp)
 static void rtl_init_mac_address(struct rtl8169_private *tp)
 {
 	struct net_device *dev = tp->dev;
-	u8 *mac_addr = dev->dev_addr;
+	u8 mac_addr[ETH_ALEN];
 	int rc;
 
 	rc = eth_platform_get_mac_address(tp_to_dev(tp), mac_addr);
@@ -5235,6 +5235,7 @@ static void rtl_init_mac_address(struct rtl8169_private *tp)
 	eth_hw_addr_random(dev);
 	dev_warn(tp_to_dev(tp), "can't read MAC address, setting random one\n");
 done:
+	eth_hw_addr_set(dev, mac_addr);
 	rtl_rar_set(tp, mac_addr);
 }
 
-- 
2.31.1


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

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-18 14:29 [PATCH net-next 00/12] ethernet: manual netdev->dev_addr conversions (part 2) Jakub Kicinski
2021-10-18 14:29 ` [PATCH net-next 01/12] ethernet: mv643xx: use eth_hw_addr_set() Jakub Kicinski
2021-10-18 14:29 ` [PATCH net-next 02/12] ethernet: sky2/skge: " Jakub Kicinski
2021-10-18 17:01   ` Stephen Hemminger
2021-10-18 14:29 ` [PATCH net-next 03/12] ethernet: lpc: " Jakub Kicinski
2021-10-18 14:29 ` [PATCH net-next 04/12] ethernet: netxen: " Jakub Kicinski
2021-10-18 14:29 ` Jakub Kicinski [this message]
2021-10-18 14:29 ` [PATCH net-next 06/12] ethernet: renesas: " Jakub Kicinski
2021-10-18 14:29 ` [PATCH net-next 07/12] ethernet: rocker: " Jakub Kicinski
2021-10-18 14:29 ` [PATCH net-next 08/12] ethernet: sxgbe: " Jakub Kicinski
2021-10-18 14:29 ` [PATCH net-next 09/12] ethernet: sis190: " Jakub Kicinski
2021-10-18 14:29 ` [PATCH net-next 10/12] ethernet: sis900: " Jakub Kicinski
2021-10-18 14:29 ` [PATCH net-next 11/12] ethernet: smc91x: " Jakub Kicinski
2021-10-18 14:29 ` [PATCH net-next 12/12] ethernet: smsc: " Jakub Kicinski
2021-10-19 11:50 ` [PATCH net-next 00/12] ethernet: manual netdev->dev_addr conversions (part 2) 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=20211018142932.1000613-6-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).