From: Jakub Kicinski <kuba@kernel.org>
To: balbi@kernel.org, gregkh@linuxfoundation.org
Cc: Jakub Kicinski <kuba@kernel.org>,
lorenzo@google.com, manish.narani@xilinx.com, maze@google.com,
linux-usb@vger.kernel.org
Subject: [PATCH] usb: gadget: u_ether: use eth_hw_addr_set()
Date: Tue, 19 Oct 2021 10:21:24 -0700 [thread overview]
Message-ID: <20211019172124.1413620-1-kuba@kernel.org> (raw)
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>
---
CC: balbi@kernel.org
CC: gregkh@linuxfoundation.org
CC: lorenzo@google.com
CC: manish.narani@xilinx.com
CC: maze@google.com
CC: linux-usb@vger.kernel.org
---
drivers/usb/gadget/function/u_ether.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c
index 85a3f6d4b5af..e0ad5aed6ac9 100644
--- a/drivers/usb/gadget/function/u_ether.c
+++ b/drivers/usb/gadget/function/u_ether.c
@@ -754,6 +754,7 @@ struct eth_dev *gether_setup_name(struct usb_gadget *g,
struct eth_dev *dev;
struct net_device *net;
int status;
+ u8 addr[ETH_ALEN];
net = alloc_etherdev(sizeof *dev);
if (!net)
@@ -773,9 +774,10 @@ struct eth_dev *gether_setup_name(struct usb_gadget *g,
dev->qmult = qmult;
snprintf(net->name, sizeof(net->name), "%s%%d", netname);
- if (get_ether_addr(dev_addr, net->dev_addr))
+ if (get_ether_addr(dev_addr, addr))
dev_warn(&g->dev,
"using random %s ethernet address\n", "self");
+ eth_hw_addr_set(net, addr);
if (get_ether_addr(host_addr, dev->host_mac))
dev_warn(&g->dev,
"using random %s ethernet address\n", "host");
--
2.31.1
next reply other threads:[~2021-10-19 17:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-19 17:21 Jakub Kicinski [this message]
2021-10-19 18:02 ` [PATCH] usb: gadget: u_ether: use eth_hw_addr_set() Maciej Żenczykowski
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=20211019172124.1413620-1-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-usb@vger.kernel.org \
--cc=lorenzo@google.com \
--cc=manish.narani@xilinx.com \
--cc=maze@google.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