All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Tobias Waldekranz <tobias@waldekranz.com>
Cc: Vladimir Oltean <olteanv@gmail.com>,
	davem@davemloft.net, kuba@kernel.org, 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: Thu, 18 Mar 2021 02:50:41 +0100	[thread overview]
Message-ID: <YFKx8faByAd2cUiH@lunn.ch> (raw)
In-Reply-To: <87pmzynib9.fsf@waldekranz.com>

On Wed, Mar 17, 2021 at 12:14:18PM +0100, Tobias Waldekranz wrote:
> On Tue, Mar 16, 2021 at 11:39, Vladimir Oltean <olteanv@gmail.com> wrote:
> > On Mon, Mar 15, 2021 at 10:14:00PM +0100, Tobias Waldekranz wrote:
> >> These switches have two modes of classifying broadcast:
> >> 
> >> 1. Broadcast is multicast.
> >> 2. Broadcast is its own unique thing that is always flooded
> >>    everywhere.
> >> 
> >> This driver uses the first option, making sure to load the broadcast
> >> address into all active databases. Because of this, we can support
> >> per-port broadcast flooding by (1) making sure to only set the subset
> >> of ports that have it enabled whenever joining a new bridge or VLAN,
> >> and (2) by updating all active databases whenever the setting is
> >> changed on a port.
> >> 
> >> Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
> >> ---
> >>  drivers/net/dsa/mv88e6xxx/chip.c | 68 +++++++++++++++++++++++++++++++-
> >>  1 file changed, 67 insertions(+), 1 deletion(-)
> >> 
> >> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
> >> index 48e65f22641e..e6987c501fb7 100644
> >> --- a/drivers/net/dsa/mv88e6xxx/chip.c
> >> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
> >> @@ -1950,6 +1950,18 @@ static int mv88e6xxx_broadcast_setup(struct mv88e6xxx_chip *chip, u16 vid)
> >>  	int err;
> >>  
> >>  	for (port = 0; port < mv88e6xxx_num_ports(chip); port++) {
> >> +		struct dsa_port *dp = dsa_to_port(chip->ds, port);
> >> +
> >> +		if (dsa_is_unused_port(chip->ds, port))
> >> +			continue;
> >> +
> >> +		if (dsa_is_user_port(chip->ds, port) && dp->bridge_dev &&
> >> +		    !br_port_flag_is_set(dp->slave, BR_BCAST_FLOOD))
> >
> > What if dp->slave is not the bridge port, but a LAG? br_port_flag_is_set
> > will return false.
> 
> 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?

Hi Tobias

What i'm mostly against is dynamic memory allocation. If you can
allocate the space for this vector during probe, i have no problems
with that.

     Andrew

      parent reply	other threads:[~2021-03-18  1:51 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
2021-03-18  1:50       ` Andrew Lunn [this message]

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=YFKx8faByAd2cUiH@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --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.