Re: B53 DSA switch problem on Banana Pi-R1 on Fedora 26
From: Florian Fainelli
Date: Wed May 23 2018 - 14:01:42 EST
On 05/23/2018 11:27 AM, Gerhard Wiesinger wrote:
> On 23.05.2018 19:55, Florian Fainelli wrote:
>> On 05/23/2018 10:35 AM, Gerhard Wiesinger wrote:
>>> On 23.05.2018 17:28, Florian Fainelli wrote:
>>>>> And in the future (time plan)?
>>>> If you don't care about multicast then you can use those patches:
>>>>
>>>> https://github.com/ffainelli/linux/commit/de055bf5f34e9806463ab2793e0852f5dfc380df
>>>>
>>>>
>>>>
>>>> and you have to change the part of drivers/net/dsa/b53/b53_common.c
>>>> that
>>>> returns DSA_TAG_PROTO_NONE for 53125:
>>>>
>>>>
>>>> diff --git a/drivers/net/dsa/b53/b53_common.c
>>>> b/drivers/net/dsa/b53/b53_common.c
>>>> index 9f561fe505cb..3c64f026a8ce 100644
>>>> --- a/drivers/net/dsa/b53/b53_common.c
>>>> +++ b/drivers/net/dsa/b53/b53_common.c
>>>> @@ -1557,7 +1557,7 @@ enum dsa_tag_protocol b53_get_tag_protocol(struct
>>>> dsa_switch *ds, int port)
>>>> ÂÂÂÂÂÂÂÂÂÂ * mode to be turned on which means we need to specifically
>>>> manage ARL
>>>> ÂÂÂÂÂÂÂÂÂÂ * misses on multicast addresses (TBD).
>>>> ÂÂÂÂÂÂÂÂÂÂ */
>>>> -ÂÂÂÂÂÂ if (is5325(dev) || is5365(dev) || is539x(dev) ||
>>>> is531x5(dev) ||
>>>> +ÂÂÂÂÂÂ if (is5325(dev) || is5365(dev) || is539x(dev) ||
>>>> ÂÂÂÂÂÂÂÂÂÂÂÂÂ !b53_can_enable_brcm_tags(ds, port))
>>>> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ return DSA_TAG_PROTO_NONE;
>>>>
>>>>
>>>> That would bring Broadcom tags to the 53125 switch and you would be
>>>> able
>>>> to use the configuration lines from Andrew in that case.
>>> What's the plan here regarding these 2 config option mode (how do you
>>> call them?)?
>> Broadcom tags is the underlying feature that provides per-port
>> information about the packets going in and out. Turning on Broadcom tags
>> requires turning on managed mode which means that the host now has to
>> manage how MAC addresses are programmed into the switch, it's not rocket
>> science, but I don't have a good test framework to automate the testing
>> of those changes yet. If you are willing to help in the testing, I can
>> certainly give you patches to try.
>
> Yes, patches are welcome.
I gave you the two things that would be required to have Broadcom tags
working already, feel free to givem them a try. Make sure your kernel
also has that patch:
8cad443eacf661796a740903a75cb8944c675b4e ("net: stmmac: Fix reception of
Broadcom switches tags")
>
>>> I mean, will this be a breaking change in the future where config has to
>>> be done in a different way then?
>> When Broadcom tags are enabled the switch gets usable the way Andrew
>> expressed it, the only difference that makes on your configuration if
>> you want e.g: VLAN 101 to be for port 1-4 and VLAN 102 to be for port 5,
>> is that you no longer create an eth0.101 and eth0.102, but you create
>> br0.101 and br0.102.
>
> I think documentation (dsa.txt) should provide more examples.
Fair enough.
>
>>
>>> Or will it be configurable via module parameters or /proc or /sys
>>> filesystem options?
>> We might be able to expose a sysfs attribute which shows the type of
>> tagging being enabled by a particular switch, that way scripts can
>> detect which variant: configuring the host controller or the bridge is
>> required. Would that be acceptable?
>
> Yes, acceptable for me. But what's the long term concept for DSA (and
> also other implementations)?
>
> - "old" mode variant, mode can only be read
>
> - "new" mode variant, mode can only be read
>
> - mode settable/configurable by the user, mode can be read
Having tags enabled is a "superior" mode of operation so it should
always be enabled when possible and working, using DSA_TAG_PROTO_NONE
creates unfortunate confusion because the switch becomes "dumb" so that
is not to be maintained in the future.
The plan is to bring Broadcom tags at some point into b53, for all
generation of the switches, that requires time that I do not have right
now, but which I will hopefully have at some point. There is not
necessarily a plan to avoid breaking user-space because, see below, this
is really niche hardware.
>
>
> In general:
>
> OK, thank you for your explainations.
>
>
> I think DSA (at least with b53) had secveral topics. implementation
> bugs, missing documentation, lack of distribution support (e.g.
> systemd), etc. which were not understood by the users.
Yes, that is entirely fair enough, the concepts are pretty simple, but
they are sometimes hard to communicate clearly.
>
> So everything which clarifies the topics for DSA in the future is welcome.
>
> BTW: systemd-networkd support for DSA #7478
>
> https://github.com/systemd/systemd/issues/7478
Well, you have to understand where this is coming from, people don't run
mainline distributions on the routers that typically have support for
DSA, they use Buildroot, Yocto, OpenWrt, whatever, and they know their
platform and that this platform requires Tender Love and Care to work as
they expect it to behave, because that's what embedded is all about.
--
Florian