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]
Date: Tue, 2 Apr 2024 13:56:52 +0300
From: Vladimir Oltean <olteanv@...il.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: Florian Fainelli <f.fainelli@...il.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Russell King <linux@...linux.org.uk>,
	Gregory Clement <gregory.clement@...tlin.com>,
	netdev@...r.kernel.org
Subject: Re: [PATCH net-next v3 5/7] net: dsa: Add helpers to convert netdev
 to ds or port index

On Mon, Apr 01, 2024 at 08:35:50AM -0500, Andrew Lunn wrote:
> The LED helpers make use of a struct netdev. Add helpers a DSA driver
> can use to convert a netdev to a struct dsa_switch and the port index.
> 
> To do this, dsa_user_to_port() has to be made available out side of
> net/dev, to convert the inline function in net/dsa/user.h into a
> normal function, and export it.
> 
> Signed-off-by: Andrew Lunn <andrew@...n.ch>
> ---

I think the API we have today is sufficient: we have dsa_port_to_netdev(),
introduced at Vivien's request rather than exporting dsa_user_to_port().

Also, I believe that having a single API function which returns a single
struct dsa_port *, from which we force the caller to get the dp->ds and
dp->index, is better (cheaper) than requiring 2 API functions, one for
getting the ds and the other for the index.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ