[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211016002716.j3v4pamavkvxodsv@skbuf>
Date: Sat, 16 Oct 2021 03:27:16 +0300
From: Vladimir Oltean <olteanv@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: netdev@...r.kernel.org, andrew@...n.ch, idosch@...sch.org,
f.fainelli@...il.com, vkochan@...vell.com, tchornyi@...vell.com
Subject: Re: [RFC net-next 3/6] ethernet: prestera: use eth_hw_addr_set_port()
On Fri, Oct 15, 2021 at 05:17:30PM -0700, Jakub Kicinski wrote:
> On Sat, 16 Oct 2021 02:51:30 +0300 Vladimir Oltean wrote:
> > > @@ -341,8 +342,8 @@ static int prestera_port_create(struct prestera_switch *sw, u32 id)
> > > /* firmware requires that port's MAC address consist of the first
> > > * 5 bytes of the base MAC address
> > > */
> > > - memcpy(dev->dev_addr, sw->base_mac, dev->addr_len - 1);
> > > - dev->dev_addr[dev->addr_len - 1] = port->fp_id;
> > > + memcpy(addr, sw->base_mac, dev->addr_len - 1);
> > > + eth_hw_addr_set_port(dev, addr, port->fp_id);
> >
> > Instead of having yet another temporary copy, can't we zero out
> > sw->base_mac[ETH_ALEN - 1] in prestera_switch_set_base_mac_addr()?
>
> Will do unless Marvel & friends tell us FW cares about the last byte
> (prestera_hw_switch_mac_set() send the whole thing).
You can always zero out the last byte after the call to
prestera_hw_switch_mac_set(), and then it shouldn't even matter.
Powered by blists - more mailing lists