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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7D45894046CE41CC+20251031014410.GA49419@nic-Precision-5820-Tower>
Date: Fri, 31 Oct 2025 09:44:10 +0800
From: Yibo Dong <dong100@...se.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
	horms@...nel.org, corbet@....net, andrew+netdev@...n.ch,
	danishanwar@...com, vadim.fedorenko@...ux.dev,
	geert+renesas@...der.be, mpe@...erman.id.au, lorenzo@...nel.org,
	lukas.bulwahn@...hat.com, netdev@...r.kernel.org,
	linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v16 5/5] net: rnpgbe: Add register_netdev

On Thu, Oct 30, 2025 at 08:16:40AM -0700, Jakub Kicinski wrote:
> On Thu, 30 Oct 2025 10:38:38 +0800 Yibo Dong wrote:
> > > >  #include <linux/types.h>
> > > >  #include <linux/mutex.h>
> > > > +#include <linux/netdevice.h>  
> > > 
> > > Why do you need to include netdevice.h here now?
> > > This patch doesn't add anything that'd need it to the header.
> > >   
> > 
> > It is for 'u8 perm_addr[ETH_ALEN];'
> > Maybe I should just "#include <linux/if_ether.h>" for this patch. 
> 
> I see, that's fine. Then again, I'm not sure why you store the perm
> addr in the struct in the first place. It's already stored in netdevice.
> 

I get 'mac_addr' from fw, and store it to hw->perm_addr 'before'
registe netdev (rnpgbe_get_permanent_mac in rnpgbe_chip.c).
You mean I can use a local variable to store mac_addr from fw,
and then use it to registe netdev?

Maybe like this?
int rnpgbe_get_permanent_mac(struct mucse_hw *hw, u8 *perm_addr)
...
	u8 perm_addr[ETH_ALEN]
...
	err = rnpgbe_get_permanent_mac(hw, perm_addr);
	if (!err) {
		eth_hw_addr_set(netdev, perm_addr);
	} else if (err == -EINVAL) {
		dev_warn(&pdev->dev, "Using random MAC\n");
		eth_hw_addr_random(netdev);
	} else if (err) {
		dev_err(&pdev->dev, "get perm_addr failed %d\n", err);
		goto err_powerdown;
	}
...

Thanks for you feedback.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ