netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: linus.walleij@linaro.org, f.fainelli@gmail.com
Cc: netdev@vger.kernel.org, olteanv@gmail.com
Subject: Re: [PATCH 3/3] net: dsa: Add Vitesse VSC73xx DSA router driver
Date: Sun,  3 Mar 2019 14:08:39 +0200	[thread overview]
Message-ID: <20190303120839.17868-1-olteanv@gmail.com> (raw)
In-Reply-To: <3ad23735-38be-16ea-3bd0-c77eccc22f16@gmail.com>

On Sat, 30 Jun 2018 13:05:47, Linus Walleij wrote:
> On Thu, Jun 14, 2018 at 6:51 PM Florian Fainelli <f.fainelli@gmail.com> wrote:
> > On 06/14/2018 05:35 AM, Linus Walleij wrote:
>
> > > using DSA as a best fit so we can easily add VLAN support and maybe
> > > later also exploit the internal frame header to get more direct
> > > control over the switch.
> >
> > Yes having the internal frame header working would be really great,
> > DSA_TAG_PROTO_NONE is really difficult to use without knowing all the
> > DSA details which reminds that we should have the following action items:
> >
> > - document how DSA_TAG_PROTO_NONE behave differently with respect to
> > bridges/VLAN configuration and the DSA master device
> >
> > - possibly introduce DSA_TAG_PROTO_8021Q which would automatically
> > partition ports by allocating one VLAN ID per-port (e.g: from top to
> > bottom) that would effectively offer the same features/paradigms as what
> > a proper header would offer (Port separation, if nothing else) and it
> > could be made seemingly automatic from within DSA
>
> To me this makes a lot of sense. I haven't implemented VLAN yet
> for this switch chip, but for the Realtek RTL8366RB that I'm also
> working with, the vendor driver already does more or less exactly
> this by default. It would be great to have the kernel just put this
> in place so we have it under control.
>
> The RTL8366 chips does not even seem to have an internal
> frame format AFAICT, it seems they don't know what that is.
> So they will likely always have to use VLAN for this.

Hi Florian, Linus,

I am writing a DSA driver for a switch that doesn't support port separation
through switch tagging, and came across this discussion.
Would you mind to share some thoughts on how port separation with
DSA_TAG_PROTO_NONE would currently work? Thinking about the situations when
(a) ports are standalone
(b) ports are bridged with vlan_filtering=0
(c) ports are bridged with vlan_filtering=1
I am interested in trying to add generic support for DSA_TAG_PROTO_8021Q that
would also cover my hardware. However I do see some potential limitations, so
let me quickly describe what it can and cannot do:
* VLAN filtering cannot be disabled per se in hardware. The switch always
  internally appends the port-configured pvid to all untagged traffic. If
  traffic comes tagged, it enforces VLAN membership on the ingress port, and
  does not append any tag internally but keeps what already was in the frame.
  Each egress port can be either configured to send tagged or untagged frames.
* The switch has a programmable TPID by which it can be told what EtherType it
  should recognize and tag as 802.1Q. Thinking that VLAN filtering disabled can
  be emulated by configuring its TPID as 0x0 instead of 0x8100.
* It is able to recognize double-tagged frames (802.1ad) via a configurable
  TPID2, but it cannot actually be configured to push or pop VLAN headers if
  frames are already tagged on ingress. The only permitted action on frames
  detected as double-tagged is to optionally drop them.
* It cannot retag an ingress VLAN ID on ingress with another one on egress.
  Actually it can, but the feature is for debug purposes and it will actually
  create a frame clone with the new tag. I would like to avoid using this, as I
  would have to drop the original frame and it would look bad in port counters.

For my particular hardware, when vlan_filtering is disabled, this custom
802.1Q tag with a TPID of 0x0 can be used as a make-shift switch tag, given
that a unique pvid is applied to each user port, and the upstream port is
configured in trunk mode (tagged on the egress towards the master).
When vlan_filtering is enabled, obviously I cannot make use of the 0x0 TPID and
I have to restore the 802.1Q one. This means that switch tagging can no longer
work, and port separation has to rely on user configuration.

I did look at RTL8366 and saw that the TPID is not programmable. I'm wondering
whether a generic solution for DSA_TAG_PROTO_8021Q is indeed possible, and
looking for your advice on how it would look like.

Thank you,
-Vladimir


  parent reply	other threads:[~2019-03-03 12:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-14 12:35 [PATCH 0/3] DSA driver for Vitesse VSC73xx Linus Walleij
2018-06-14 12:35 ` [PATCH 1/3] net: dsa: Add DT bindings for Vitesse VSC73xx switches Linus Walleij
2018-06-14 16:09   ` Florian Fainelli
2018-06-14 16:09   ` Florian Fainelli
2018-06-17  7:40   ` Jiri Pirko
2018-06-14 12:35 ` [PATCH 2/3] net: phy: vitesse: Add support for VSC73xx Linus Walleij
2018-06-14 16:29   ` Florian Fainelli
2018-06-15 19:24     ` Woojung.Huh
2018-06-28 18:23       ` Linus Walleij
2018-06-14 12:35 ` [PATCH 3/3] net: dsa: Add Vitesse VSC73xx DSA router driver Linus Walleij
2018-06-14 16:51   ` Florian Fainelli
2018-06-30 11:05     ` Linus Walleij
2018-06-30 11:05     ` Linus Walleij
2019-03-03 12:08     ` Vladimir Oltean [this message]
2019-03-04  9:51       ` Linus Walleij
2019-03-04 12:14         ` Vladimir Oltean
2019-03-04 12:26           ` Linus Walleij
2019-03-04 13:53           ` Andrew Lunn
2019-03-04 14:10             ` 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=20190303120839.17868-1-olteanv@gmail.com \
    --to=olteanv@gmail.com \
    --cc=f.fainelli@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=netdev@vger.kernel.org \
    /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).