All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Tobias Waldekranz <tobias@waldekranz.com>
To: Vladimir Oltean <olteanv@gmail.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 4/5] net: dsa: mv88e6xxx: Offload bridge learning flag
Date: Wed, 17 Mar 2021 23:32:36 +0100	[thread overview]
Message-ID: <87h7l9o1h7.fsf@waldekranz.com> (raw)
In-Reply-To: <20210317192929.qviweve6acjzrjcq@skbuf>

On Wed, Mar 17, 2021 at 21:29, Vladimir Oltean <olteanv@gmail.com> wrote:
> On Wed, Mar 17, 2021 at 07:45:46PM +0100, Tobias Waldekranz wrote:
>> On Wed, Mar 17, 2021 at 16:12, Vladimir Oltean <olteanv@gmail.com> wrote:
>> > On Mon, Mar 15, 2021 at 10:13:59PM +0100, Tobias Waldekranz wrote:
>> >> +	if (flags.mask & BR_LEARNING) {
>> >> +		u16 pav = (flags.val & BR_LEARNING) ? (1 << port) : 0;
>> >> +
>> >> +		err = mv88e6xxx_port_set_assoc_vector(chip, port, pav);
>> >> +		if (err)
>> >> +			goto out;
>> >> +	}
>> >> +
>> >
>> > If flags.val & BR_LEARNING is off, could you please call
>> > mv88e6xxx_port_fast_age too? This ensures that existing ATU entries that
>> > were automatically learned are purged.
>> 
>> This opened up another can of worms.
>> 
>> It turns out that the hardware is incapable of fast aging a LAG.
>
> You sound pretty definitive about it, do you know why?

The big note saying "Entries associated with a LAG cannot be moved or
removed using these commands" was the first clue :)

This is pure speculation on my part.

In the first iterations of this family of devices (before it was bought
by Marvell), cross-chip LAGs where not supported. You would simply set
multiple bits in the PAV for all LAG members to associate stations with
the LAG. In that scenario you can fast-age a LAG by fast-aging each
individual port.

Later, cross-chip LAGs where added, and enough support was bolted on to
the ATU to support automatic learning, but not enough to support
fast-aging.

>> I can see two workarounds. Both are awful in their own special ways:
>> 
>> 1. Iterate over all entries of all FIDs in the ATU, removing all
>>    matching dynamic entries. This will accomplish the same thing, but it
>>    is a very expensive operation, and having that in the control path of
>>    STP does not feel quite right.
>
> When does it ever feel right? :)
>
> I think of it like a faster 'bridge fdb' command (since 'bridge fdb'
> traverses the ATU super inefficiently, it dumps the whole table for each
> port).
>
> On my system with 24 mv88e6xxx ports, 'time bridge fdb' takes around 34
> seconds. So that means a 'slow age' will take around 1.4 seconds for a
> single LAG.

Well, it also scales linearly with the number of active entries in the
ATU. Here are some times for "bridge fdb" on my system with a single
6390X:

Entries    Time
      1   0.17s
     10   0.48s
    100   3.20s
    200   6.24s
   1000  31.82s

(I used trafgen to generate broadcasts with random SAs)

Then you have to consider that you are not simply walking the ATU, you
also have to write back entries whenever you come across one attached to
the LAG you are fast-aging.

> On the other hand, on my system with 7 sja1105 ports, I have no choice
> but to do slow ageing - the hardware simply doesn't have the concept of
> 'fast ageing'. There, 'time bridge fdb' returns 1.781s, so I expect a
> slow age would take around 0.25 seconds. Of course I'm not happy about
> it, but I think I'll bite the bullet.
>
>> 2. Flushing all dynamic entries in the entire ATU. Fast, but obviously
>>    results in a period of lots of flooded packets.
>
> This one seems like an overreaction to me. Would that even solve the
> problem? Couly you destroy and re-create the trunk?

It would make sure that no entries lingered on the port in question,
absolutely. Unfortunately that would also be true for all other ports :)

Adding/removing a LAG in hardware has no connection to ATU entries
unfortunately.

>> Any opinion on which approach you think would hurt less? Or, even
>> better, if there is a third way that I have missed.
>> 
>> For this series I am leaning towards making mv88e6xxx_port_fast_age a
>> no-op for LAG ports. We could then come back to this problem when we add
>> other LAG-related FDB operations like static FDB entries. Acceptable?
>
> Yeah, I guess that's fair.

Great. I will try to put together a v2 tomorrow.

  reply	other threads:[~2021-03-17 22:33 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 [this message]
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

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=87h7l9o1h7.fsf@waldekranz.com \
    --to=tobias@waldekranz.com \
    --cc=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=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.