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: <463679C4547B6274+20250814015244.GA1031326@nic-Precision-5820-Tower>
Date: Thu, 14 Aug 2025 09:52:44 +0800
From: Yibo Dong <dong100@...se.com>
To: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
Cc: andrew+netdev@...n.ch, davem@...emloft.net, edumazet@...gle.com,
	kuba@...nel.org, pabeni@...hat.com, horms@...nel.org,
	corbet@....net, gur.stavi@...wei.com, maddy@...ux.ibm.com,
	mpe@...erman.id.au, danishanwar@...com, lee@...ger.us,
	gongfan1@...wei.com, lorenzo@...nel.org, geert+renesas@...der.be,
	Parthiban.Veerasooran@...rochip.com, lukas.bulwahn@...hat.com,
	alexanderduyck@...com, richardcochran@...il.com,
	netdev@...r.kernel.org, linux-doc@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 5/5] net: rnpgbe: Add register_netdev

On Wed, Aug 13, 2025 at 01:50:34PM +0100, Vadim Fedorenko wrote:
> On 13/08/2025 10:04, Yibo Dong wrote:
> > On Tue, Aug 12, 2025 at 04:32:00PM +0100, Vadim Fedorenko wrote:
> > > On 12/08/2025 10:39, Dong Yibo wrote:
> > > > Initialize get mac from hw, register the netdev.
> > > > 
> > > > Signed-off-by: Dong Yibo <dong100@...se.com>
> > > > ---
> > > >    drivers/net/ethernet/mucse/rnpgbe/rnpgbe.h    | 22 ++++++
> > > >    .../net/ethernet/mucse/rnpgbe/rnpgbe_chip.c   | 73 ++++++++++++++++++
> > > >    drivers/net/ethernet/mucse/rnpgbe/rnpgbe_hw.h |  1 +
> > > >    .../net/ethernet/mucse/rnpgbe/rnpgbe_main.c   | 76 +++++++++++++++++++
> > > >    4 files changed, 172 insertions(+)
> > > > 
> > > > diff --git a/drivers/net/ethernet/mucse/rnpgbe/rnpgbe.h b/drivers/net/ethernet/mucse/rnpgbe/rnpgbe.h
> > > > index 6cb14b79cbfe..644b8c85c29d 100644
> > > > --- a/drivers/net/ethernet/mucse/rnpgbe/rnpgbe.h
> > > > +++ b/drivers/net/ethernet/mucse/rnpgbe/rnpgbe.h
> > > > @@ -6,6 +6,7 @@
> > > >    #include <linux/types.h>
> > > >    #include <linux/mutex.h>
> > > > +#include <linux/netdevice.h>
> > > >    extern const struct rnpgbe_info rnpgbe_n500_info;
> > > >    extern const struct rnpgbe_info rnpgbe_n210_info;
> > > > @@ -86,6 +87,18 @@ struct mucse_mbx_info {
> > > >    	u32 fw2pf_mbox_vec;
> > > >    };
> > > > +struct mucse_hw_operations {
> > > > +	int (*init_hw)(struct mucse_hw *hw);
> > > > +	int (*reset_hw)(struct mucse_hw *hw);
> > > > +	void (*start_hw)(struct mucse_hw *hw);
> > > > +	void (*init_rx_addrs)(struct mucse_hw *hw);
> > > > +	void (*driver_status)(struct mucse_hw *hw, bool enable, int mode);
> > > > +};
> > > > +
> > > > +enum {
> > > > +	mucse_driver_insmod,
> > > > +};
> > > > +
> > > >    struct mucse_hw {
> > > >    	void *back;
> > > >    	u8 pfvfnum;
> > > > @@ -96,12 +109,18 @@ struct mucse_hw {
> > > >    	u32 axi_mhz;
> > > >    	u32 bd_uid;
> > > >    	enum rnpgbe_hw_type hw_type;
> > > > +	const struct mucse_hw_operations *ops;
> > > >    	struct mucse_dma_info dma;
> > > >    	struct mucse_eth_info eth;
> > > >    	struct mucse_mac_info mac;
> > > >    	struct mucse_mbx_info mbx;
> > > > +	u32 flags;
> > > > +#define M_FLAGS_INIT_MAC_ADDRESS BIT(0)
> > > >    	u32 driver_version;
> > > >    	u16 usecstocount;
> > > > +	int lane;
> > > > +	u8 addr[ETH_ALEN];
> > > > +	u8 perm_addr[ETH_ALEN];
> > > 
> > > why do you need both addresses if you have this info already in netdev?
> > > 
> > 
> > 'perm_addr' is address from firmware (fixed, can't be changed by user).
> > 'addr' is the current netdev address (It is Initialized the same with
> > 'perm_addr', but can be changed by user)
> > Maybe I should add 'addr' in the patch which support ndo_set_mac_address?
> 
> But why do you need 'addr' at all? Current netdev address can be
> retrieved from netdev, why do you need to store it within driver's
> structure?
> 
> 

Ok, I will remove addr and use netdev->dev_addr if driver use it.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ