All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Tobias Waldekranz <tobias@waldekranz.com>
Cc: davem@davemloft.net, kuba@kernel.org, andrew@lunn.ch,
	vivien.didelot@gmail.com, f.fainelli@gmail.com,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next 5/5] net: dsa: mv88e6xxx: Offload bridge broadcast flooding flag
Date: Wed, 17 Mar 2021 13:24:33 +0200	[thread overview]
Message-ID: <20210317112433.byk6gmkrlojz3jlk@skbuf> (raw)
In-Reply-To: <87pmzynib9.fsf@waldekranz.com>

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.

  reply	other threads:[~2021-03-17 11:25 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-15 21:13 [PATCH net-next 0/5] net: dsa: mv88e6xxx: Offload bridge port flags Tobias Waldekranz
2021-03-15 21:13 ` [PATCH net-next 1/5] net: dsa: mv88e6xxx: Provide generic VTU iterator Tobias Waldekranz
2021-03-16  8:42   ` Vladimir Oltean
2021-03-17  9:41     ` Tobias Waldekranz
2021-03-18  1:34   ` Andrew Lunn
2021-03-15 21:13 ` [PATCH net-next 2/5] net: dsa: mv88e6xxx: Remove some bureaucracy around querying the VTU Tobias Waldekranz
2021-03-16  9:17   ` Vladimir Oltean
2021-03-17  9:46     ` Tobias Waldekranz
2021-03-15 21:13 ` [PATCH net-next 3/5] net: dsa: mv88e6xxx: Flood all traffic classes on standalone ports Tobias Waldekranz
2021-03-16  9:19   ` Vladimir Oltean
2021-03-17 22:33   ` Florian Fainelli
2021-03-18  1:38   ` Andrew Lunn
2021-03-15 21:13 ` [PATCH net-next 4/5] net: dsa: mv88e6xxx: Offload bridge learning flag Tobias Waldekranz
2021-03-16  9:27   ` Vladimir Oltean
2021-03-17  9:57     ` Tobias Waldekranz
2021-03-17 14:12   ` Vladimir Oltean
2021-03-17 18:45     ` Tobias Waldekranz
2021-03-17 19:29       ` Vladimir Oltean
2021-03-17 22:32         ` Tobias Waldekranz
2021-03-15 21:14 ` [PATCH net-next 5/5] net: dsa: mv88e6xxx: Offload bridge broadcast flooding flag Tobias Waldekranz
2021-03-16  9:39   ` Vladimir Oltean
2021-03-17 11:14     ` Tobias Waldekranz
2021-03-17 11:24       ` Vladimir Oltean [this message]
2021-03-18  1:50       ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210317112433.byk6gmkrlojz3jlk@skbuf \
    --to=olteanv@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tobias@waldekranz.com \
    --cc=vivien.didelot@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.