public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, andrew@lunn.ch, idosch@idosch.org,
	f.fainelli@gmail.com, vkochan@marvell.com, tchornyi@marvell.com
Subject: Re: [RFC net-next 3/6] ethernet: prestera: use eth_hw_addr_set_port()
Date: Sat, 16 Oct 2021 03:27:16 +0300	[thread overview]
Message-ID: <20211016002716.j3v4pamavkvxodsv@skbuf> (raw)
In-Reply-To: <20211015171730.5651f0f5@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>

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.

  reply	other threads:[~2021-10-16  0:27 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-15 19:38 [RFC net-next 0/6] ethernet: add eth_hw_addr_set_port() Jakub Kicinski
2021-10-15 19:38 ` [RFC net-next 1/6] ethernet: add a helper for assigning port addresses Jakub Kicinski
2021-10-15 21:36   ` Shannon Nelson
2021-10-15 22:30     ` Jakub Kicinski
2021-10-15 22:50       ` Vladimir Oltean
2021-10-17 15:06   ` Ido Schimmel
2021-10-18 14:08     ` Jakub Kicinski
2021-10-15 19:38 ` [RFC net-next 2/6] ethernet: ocelot: use eth_hw_addr_set_port() Jakub Kicinski
2021-10-15 19:38 ` [RFC net-next 3/6] ethernet: prestera: " Jakub Kicinski
2021-10-15 23:51   ` Vladimir Oltean
2021-10-16  0:17     ` Jakub Kicinski
2021-10-16  0:27       ` Vladimir Oltean [this message]
2021-10-18 16:54     ` Taras Chornyi [C]
2021-10-18 17:01       ` Jakub Kicinski
2021-10-18 18:20         ` Taras Chornyi
2021-10-16 21:19   ` Shannon Nelson
2021-10-18 14:19     ` Jakub Kicinski
2021-10-18 16:26       ` Shannon Nelson
2021-10-18 17:33         ` Ido Schimmel
2021-10-18 17:54           ` Shannon Nelson
2021-10-18 19:15             ` Ido Schimmel
2021-10-15 19:38 ` [RFC net-next 4/6] ethernet: fec: " Jakub Kicinski
2021-10-15 19:38 ` [RFC net-next 5/6] ethernet: mlxsw: " Jakub Kicinski
2021-10-15 19:38 ` [RFC net-next 6/6] ethernet: sparx5: " Jakub Kicinski

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=20211016002716.j3v4pamavkvxodsv@skbuf \
    --to=olteanv@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=f.fainelli@gmail.com \
    --cc=idosch@idosch.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tchornyi@marvell.com \
    --cc=vkochan@marvell.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