lkml.org 
[lkml]   [2024]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@gmail.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,

..

\
 
 \ /
  Last update: 2024-05-27 15:25    [W:0.096 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site