From: Florian Fainelli <f.fainelli@gmail.com>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: davem@davemloft.net, vivien.didelot@gmail.com, andrew@lunn.ch,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next 4/4] net: dsa: set configure_vlan_while_not_filtering to true by default
Date: Fri, 11 Sep 2020 12:48:37 -0700 [thread overview]
Message-ID: <7cbe45bd-efb0-ec3e-cc37-4d3154e91fd5@gmail.com> (raw)
In-Reply-To: <ac73600d-6c1d-83a3-9b49-19f853ba0226@gmail.com>
On 9/11/2020 12:39 PM, Florian Fainelli wrote:
>
>
> On 9/11/2020 11:35 AM, Vladimir Oltean wrote:
>> On Fri, Sep 11, 2020 at 11:23:28AM -0700, Florian Fainelli wrote:
>>> On 9/11/2020 8:43 AM, Vladimir Oltean wrote:
>>>>> The slightly confusing part is that a vlan_filtering=1 bridge
>>>>> accepts the
>>>>> default_pvid either tagged or untagged whereas a vlan_filtering=0
>>>>> bridge
>>>>> does not, except for DHCP for instance. I would have to add a br0.1
>>>>> 802.1Q
>>>>> upper to take care of the default_pvid being egress tagged on the
>>>>> CPU port.
>>>>>
>>>>> We could solve this in the DSA receive path, or the Broadcom tag
>>>>> receive
>>>>> path as you say since that is dependent on the tagging format and
>>>>> switch
>>>>> properties.
>>>>>
>>>>> With Broadcom tags enabled now, all is well since we can differentiate
>>>>> traffic from different source ports using that 4 bytes tag.
>>>>>
>>>>> Where this broke was when using a 802.1Q separation because all
>>>>> frames that
>>>>> egressed the CPU were egress tagged and it was no longer possible to
>>>>> differentiate whether they came from the LAN group in VID 1 or the
>>>>> WAN group
>>>>> in VID 2. But all of this should be a thing of the past now, ok,
>>>>> all is
>>>>> clear again now.
>>>>
>>>> Or we could do this, what do you think?
>>>
>>> Yes, this would be working, and I just tested it with the following
>>> delta on
>>> top of my b53 patch:
>>>
>>> diff --git a/drivers/net/dsa/b53/b53_common.c
>>> b/drivers/net/dsa/b53/b53_common.c
>>> index 46ac8875f870..73507cff3bc4 100644
>>> --- a/drivers/net/dsa/b53/b53_common.c
>>> +++ b/drivers/net/dsa/b53/b53_common.c
>>> @@ -1427,7 +1427,7 @@ void b53_vlan_add(struct dsa_switch *ds, int port,
>>> untagged = true;
>>>
>>> vl->members |= BIT(port);
>>> - if (untagged)
>>> + if (untagged && !dsa_is_cpu_port(ds, port))
>>> vl->untag |= BIT(port);
>>> else
>>> vl->untag &= ~BIT(port);
>>> @@ -1465,7 +1465,7 @@ int b53_vlan_del(struct dsa_switch *ds, int port,
>>> if (pvid == vid)
>>> pvid = b53_default_pvid(dev);
>>>
>>> - if (untagged)
>>> + if (untagged && !dsa_is_cpu_port(ds, port))
>>> vl->untag &= ~(BIT(port));
>>>
>>> b53_set_vlan_entry(dev, vid, vl);
>>>
>>> and it works, thanks!
>>>
>>
>> I'm conflicted. So you prefer having the CPU port as egress-tagged?
>
> I do, because I realized that some of the switches we support are still
> configured in DSA_TAG_NONE mode because the CPU port they chose is not
> Broadcom tag capable and there is an user out there who cares a lot
> about that case not to "break".
>
>>
>> Also, I think I'll also experiment with a version of this patch that is
>> local to the DSA RX path. The bridge people may not like it, and as far
>> as I understand, only DSA has this situation where pvid-tagged traffic
>> may end up with a vlan tag on ingress.
>
> OK so something along the lines of: port is bridged, and bridge has
> vlan_filtering=0 and switch does egress tagging and VID is bridge's
> default_pvid then pop the tag?
>
> Should this be a helper function that is utilized by the relevant tagger
> drivers or do you want this in dsa_switch_rcv()?
The two drivers that appear to be untagging the CPU port unconditionally
are b53 and kzs9477.
--
Florian
next prev parent reply other threads:[~2020-09-11 19:48 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-07 18:29 [PATCH net-next 0/4] Some VLAN handling cleanup in DSA Vladimir Oltean
2020-09-07 18:29 ` [PATCH net-next 1/4] net: dsa: tag_8021q: include missing refcount.h Vladimir Oltean
2020-09-08 4:07 ` Florian Fainelli
2020-09-07 18:29 ` [PATCH net-next 2/4] net: dsa: tag_8021q: add a context structure Vladimir Oltean
2020-09-07 18:29 ` [PATCH net-next 3/4] Revert "net: dsa: Add more convenient functions for installing port VLANs" Vladimir Oltean
2020-09-07 18:29 ` [PATCH net-next 4/4] net: dsa: set configure_vlan_while_not_filtering to true by default Vladimir Oltean
2020-09-08 4:07 ` Florian Fainelli
2020-09-08 10:33 ` Vladimir Oltean
2020-09-08 22:28 ` Florian Fainelli
2020-09-09 0:02 ` Florian Fainelli
2020-09-09 16:31 ` Vladimir Oltean
2020-09-09 17:22 ` Florian Fainelli
2020-09-09 17:53 ` Vladimir Oltean
2020-09-09 18:34 ` Florian Fainelli
2020-09-10 21:58 ` Florian Fainelli
2020-09-11 0:03 ` Vladimir Oltean
2020-09-11 3:09 ` Florian Fainelli
2020-09-11 15:43 ` Vladimir Oltean
2020-09-11 18:23 ` Florian Fainelli
2020-09-11 18:35 ` Vladimir Oltean
2020-09-11 19:39 ` Florian Fainelli
2020-09-11 19:48 ` Florian Fainelli [this message]
2020-09-11 22:30 ` Vladimir Oltean
2020-09-08 10:14 ` Kurt Kanzenbach
2020-09-08 10:29 ` Vladimir Oltean
2020-10-02 8:06 ` Kurt Kanzenbach
2020-10-02 8:15 ` Vladimir Oltean
2020-10-03 7:52 ` Vladimir Oltean
2020-10-03 9:45 ` Kurt Kanzenbach
2020-10-04 10:56 ` Vladimir Oltean
2020-10-05 12:34 ` Vladimir Oltean
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=7cbe45bd-efb0-ec3e-cc37-4d3154e91fd5@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).