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:   Wed, 17 Mar 2021 13:24:33 +0200
From:   Vladimir Oltean <olteanv@...il.com>
To:     Tobias Waldekranz <tobias@...dekranz.com>
Cc:     davem@...emloft.net, kuba@...nel.org, andrew@...n.ch,
        vivien.didelot@...il.com, f.fainelli@...il.com,
        netdev@...r.kernel.org
Subject: Re: [PATCH net-next 5/5] net: dsa: mv88e6xxx: Offload bridge
 broadcast flooding flag

On Wed, Mar 17, 2021 at 12:14:18PM +0100, Tobias Waldekranz wrote:
> Good point. I see two ways forward:
> 
> - My first idea was to cache a vector per switch that would act as the
>   template when creating a new entry. This avoids having the driver
>   layer knowing about stacked netdevs etc. But I think that Andrew is
>   generally opposed to caching?
> 
> - Add a new helper at the dsa layer that takes a dp and returns the
>   netdev that is attached to the bridge, if any:
> 
>   struct net_device *dsa_port_to_bridge_port(struct dsa_port *dp)
> 
> Any preference or other ideas?

I vote for dsa_port_to_bridge_port. We'll need it anyway for my software
bridging series with sandwiched net devices.

> > Speaking of, shouldn't mv88e6xxx_port_vlan_join also be called from
> > mv88e6xxx_port_bridge_join somehow, or are we waiting for the bridge
> > facility to replay VLANs added to the LAG when we emit the offload
> > notification for it?
> 
> I do not think so. VLANs are always added via the .port_vlan_add
> callback, no?

I got things mixed up in my head while thinking about it.
Yes, of course, the bridge pvid is added via .port_vlan_add as soon as
the port joins the bridge.
What I meant to say is that this sequence of events:

ip link add br0 type bridge
ip link add bond0 type bonding
ip link set bond0 master br0
ip link set lan0 master bond0

will cause lan0 to miss all sorts of information about the bridge port
switchdev objects, including the pvid. My patch series for
SWITCHDEV_BRPORT_OFFLOADED catches this case and asks for a replay.

> Potentially the bridge is of the non-filtering variety, so it could be
> that no VLANs are ever added.

That will not happen unless you set ds->configure_vlan_while_not_filtering = false,
which mv88e6xxx no longer does, so we're in the clear.

> Or do you mean (the most confusingly named feature Marvell LinkStreet
> devices) port-based VLANs? Those are setup on a bridge join via
> mv88e6xxx_port_vlan_map and mv88e6xxx_pvt_map.

Nope, I wasn't thinking about PVTs.

> >> +			/* Skip bridged user ports where broadcast
> >> +			 * flooding is disabled.
> >> +			 */
> >> +			continue;
> >> +
> >>  		err = mv88e6xxx_port_add_broadcast(chip, port, vid);
> >>  		if (err)
> >>  			return err;
> >> @@ -1958,6 +1970,51 @@ static int mv88e6xxx_broadcast_setup(struct mv88e6xxx_chip *chip, u16 vid)
> >>  	return 0;
> >>  }
> >>  
> >> +struct mv88e6xxx_port_broadcast_sync_ctx {
> >> +	int port;
> >> +	bool flood;
> >> +};
> >> +
> >> +static int
> >> +mv88e6xxx_port_broadcast_sync_vlan(struct mv88e6xxx_chip *chip,
> >> +				   const struct mv88e6xxx_vtu_entry *vlan,
> >> +				   void *_ctx)
> >> +{
> >> +	const char broadcast[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
> >
> > MAC addresses are usually defined as unsigned char[ETH_ALEN]. You can
> > also use eth_broadcast_addr(broadcast) for initialization.
> 
> I was going for uniformity with mv88e6xxx_port_add_broadcast. But I will
> add a clean-up commit that fixes the existing code first, and then adds
> this definition in the proper way.

Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ