Re: [PATCH] usb: gadget: u_ether: use eth_hw_addr_set()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 19, 2021 at 10:21 AM Jakub Kicinski <kuba@xxxxxxxxxx> wrote:
>
> 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@xxxxxxxxxx>
> ---
> CC: balbi@xxxxxxxxxx
> CC: gregkh@xxxxxxxxxxxxxxxxxxx
> CC: lorenzo@xxxxxxxxxx
> CC: manish.narani@xxxxxxxxxx
> CC: maze@xxxxxxxxxx
> CC: linux-usb@xxxxxxxxxxxxxxx
> ---
>  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
>
Reviewed-by: Maciej Żenczykowski <maze@xxxxxxxxxx>




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux