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] [day] [month] [year] [list]
Date: Thu, 4 Apr 2024 12:03:36 -0700
From: Breno Leitao <leitao@...ian.org>
To: Alexander Lobakin <aleksander.lobakin@...el.com>
Cc: kuba@...nel.org, davem@...emloft.net, pabeni@...hat.com,
	edumazet@...gle.com, elder@...nel.org,
	linux-arm-kernel@...ts.infradead.org,
	linux-mediatek@...ts.infradead.org, nbd@....name,
	sean.wang@...iatek.com, Mark-MC.Lee@...iatek.com,
	lorenzo@...nel.org, taras.chornyi@...ision.eu,
	quic_jjohnson@...cinc.com, kvalo@...nel.org, leon@...nel.org,
	dennis.dalessandro@...nelisnetworks.com,
	linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
	bpf@...r.kernel.org, Jiri Pirko <jiri@...nulli.us>,
	Simon Horman <horms@...nel.org>,
	Daniel Borkmann <daniel@...earbox.net>,
	Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Subject: Re: [PATCH net-next v3 1/5] net: create a dummy net_device allocator

Hello Alexander,

On Thu, Apr 04, 2024 at 06:40:33PM +0200, Alexander Lobakin wrote:
> > @@ -11063,6 +11070,17 @@ void free_netdev(struct net_device *dev)
> >  }
> >  EXPORT_SYMBOL(free_netdev);
> >  
> > +/**
> > + * alloc_netdev_dummy - Allocate and initialize a dummy net device.
> > + * @sizeof_priv: size of private data to allocate space for
> > + */
> > +struct net_device *alloc_netdev_dummy(int sizeof_priv)
> 
> Repeating my question from the previous thread: I see that in your
> series you always pass 0 as @sizeof_priv, does it make sense to have
> this argument or we can just pass 0 here to alloc_netdev() unconditionally?
> Drivers that have &net_device embedded can't have any private data there
> anyway.

Sorry, I answered you this question in the previous thread, and gave you an
example why we need the @sizeof_priv.

	https://lore.kernel.org/all/ZgWrcvKyAzDvl%2Fjn@gmail.com/

I didn't see any reply from you, so, I suppose you were OK with it, but
maybe you missed it?!

Anyway, let me paste what I've sent there here, so, we can continue the
discussion in this thread, which might make the reviewing process here.

This is what I wrote in the thread/message above:

  We need to have this private size for cases where we need to get the
pointer to their private structure given the dummy device.  In the
embedded case you can use container_of(), but, with a pointer to
net_device, that is not the case anymore, and we should use the dummy private
data pointer back to the private data.

For instance, see the example of iwlwifi:
https://lore.kernel.org/all/20240307174843.1719130-1-leitao@debian.org/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ