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, 27 Feb 2024 19:30:09 +0000
From: Simon Horman <horms@...nel.org>
To: Pawel Dembicki <paweldembicki@...il.com>
Cc: netdev@...r.kernel.org, linus.walleij@...aro.org,
	Andrew Lunn <andrew@...n.ch>,
	Florian Fainelli <f.fainelli@...il.com>,
	Vladimir Oltean <olteanv@...il.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Claudiu Manoil <claudiu.manoil@....com>,
	Alexandre Belloni <alexandre.belloni@...tlin.com>,
	UNGLinuxDriver@...rochip.com, Russell King <linux@...linux.org.uk>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v5 16/16] net: dsa: vsc73xx: start treating the
 BR_LEARNING flag

On Fri, Feb 23, 2024 at 10:00:46PM +0100, Pawel Dembicki wrote:
> This patch implements .port_pre_bridge_flags() and .port_bridge_flags(),
> which are required for properly treating the BR_LEARNING flag. Also,
> .port_stp_state_set() is tweaked and now disables learning for standalone
> ports.
> 
> Disabling learning for standalone ports is required to avoid situations
> where one port sees traffic originating from another, which could cause
> invalid operations.
> 
> Signed-off-by: Pawel Dembicki <paweldembicki@...il.com>

..

> +static int vsc73xx_port_bridge_flags(struct dsa_switch *ds, int port,
> +				     struct switchdev_brport_flags flags,
> +				     struct netlink_ext_ack *extack)
> +{
> +	if (flags.mask & BR_LEARNING) {
> +		struct vsc73xx *vsc = ds->priv;
> +		u32 val = flags.val & BR_LEARNING ? BIT(port) : 0;

Hi Pawel,

as it seems there will be a new revision anyway,
please consider arranging local variables in reverse xmas tree order -
longest line to shortest.

> +
> +		return vsc73xx_update_bits(vsc, VSC73XX_BLOCK_ANALYZER, 0,
> +					   VSC73XX_LEARNMASK, BIT(port), val);
> +	}
> +
> +	return 0;
> +}
> +
>  static int vsc73xx_port_bridge_join(struct dsa_switch *ds, int port,
>  				    struct dsa_bridge bridge,
>  				    bool *tx_fwd_offload,

..

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ