lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211015171730.5651f0f5@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date:   Fri, 15 Oct 2021 17:17:30 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Vladimir Oltean <olteanv@...il.com>
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 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).

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ