devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Kurt Kanzenbach <kurt@linutronix.de>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	devicetree@vger.kernel.org,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Richard Cochran <richardcochran@gmail.com>,
	Kamil Alkhouri <kamil.alkhouri@hs-offenburg.de>,
	ilias.apalodimas@linaro.org
Subject: Re: [PATCH net-next v6 2/7] net: dsa: Add DSA driver for Hirschmann Hellcreek switches
Date: Tue, 6 Oct 2020 16:42:47 +0300	[thread overview]
Message-ID: <20201006134247.7uwchuo6s7lmyzeq@skbuf> (raw)
In-Reply-To: <87wo037ajr.fsf@kurt>

On Tue, Oct 06, 2020 at 03:23:36PM +0200, Kurt Kanzenbach wrote:
> On Tue Oct 06 2020, Vladimir Oltean wrote:
> Does this mean that tagged traffic is forwarded no matter what?

Precisely. The bridge VLAN table should be irrelevant to the acceptance
or forwarding decision of the packet if vlan_filtering is 0.

> That doesn't work with the current implementation, because the VLAN
> tags are interpreted by default. There's a global flag to put the
> switch in VLAN unaware mode. But it's global and not per bridge or
> port.

Oh, there is? Maybe you can use it then.

JUST FOR CONTEXT, for sja1105 and felix/ocelot, this is the mode that
they're operating in, when a bridge with vlan_filtering=0 is configured
as an upper.

In sja1105, I don't even have the VLAN awareness flag that you have. So
I need to change the VLAN TPID from 0x8100 to 0xdadb, and the switch
will think that VLAN-tagged frames aren't VLAN. So all frames are tagged
internally by the switch with the port-based VLAN ID and PCP, when in
vlan_filtering=0.
And because my knob is global and not per bridge either, I just set
ds->vlan_filtering_is_global = true and let DSA handle the rest.

As for ocelot/felix, those switches have 2 knobs:
- VLAN awareness: does the ingress port derive the classified VLAN from
  the packet's 802.1Q header? If yes, the VLAN ID and PCP are taken from
  the packet. If not, they are taken from the port-based default.
- VLAN ingress filtering: does the ingress port drop a VLAN-tagged frame
  if the classified VLAN is not installed in its ingress filter?

As you may guess, even for ocelot/felix, when we have a bridge with
vlan_filtering=0, we are still configuring it as:
VLAN awareness = disabled
VLAN ingress filtering = enabled

Because the classified VLAN is not derived from the packet, it will
always be equal to the pvid of the port, which is installed privately by
the driver. So no packet drops due to VLAN, regardless of VLAN ID.

> So you're saying private VLANs can be used but the user or the other
> kernel modules shouldn't be allowed to use them to simplify the
> implementation?  Makes sense to me.

Yes.
And because the user is more likely to install VLAN 2 and 3 than 4095
and 4094, maybe you could use private VLANs from the end of the range,
just to make this restriction less obvious (or maybe not at all).

> The egress port has to member to that VLAN.

Same as ocelot/felix. This is the reason why we make it VLAN-unaware.
There's no point in disabling just VLAN ingress filtering if the end
result is still going to be a drop, albeit due to a different reason (no
destinations).

  reply	other threads:[~2020-10-06 13:42 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-04 11:29 [PATCH net-next v6 0/7] Hirschmann Hellcreek DSA driver Kurt Kanzenbach
2020-10-04 11:29 ` [PATCH net-next v6 1/7] net: dsa: Add tag handling for Hirschmann Hellcreek switches Kurt Kanzenbach
2020-10-04 11:56   ` Vladimir Oltean
2020-10-05  6:14     ` Kurt Kanzenbach
2020-10-04 11:29 ` [PATCH net-next v6 2/7] net: dsa: Add DSA driver " Kurt Kanzenbach
2020-10-04 12:56   ` Vladimir Oltean
2020-10-06  6:09     ` Kurt Kanzenbach
2020-10-06  9:20       ` Vladimir Oltean
2020-10-06 10:13         ` Kurt Kanzenbach
2020-10-06 11:32           ` Vladimir Oltean
2020-10-06 12:37             ` Vladimir Oltean
2020-10-06 13:23             ` Kurt Kanzenbach
2020-10-06 13:42               ` Vladimir Oltean [this message]
2020-10-06 14:05                 ` Kurt Kanzenbach
2020-10-06 14:10                   ` Vladimir Oltean
2020-10-06 13:56               ` Vladimir Oltean
2020-10-06 14:13                 ` Kurt Kanzenbach
2020-10-11 12:29                 ` Kurt Kanzenbach
2020-10-11 15:30                   ` Vladimir Oltean
2020-10-12  5:37                     ` Kurt Kanzenbach
2020-10-16 12:11                       ` Kurt Kanzenbach
2020-10-16 15:43                         ` Vladimir Oltean
2020-10-16 16:56                           ` Florian Fainelli
2020-10-17 10:06                             ` Kurt Kanzenbach
2020-10-17 15:57                             ` Vladimir Oltean
2020-10-08 11:49           ` Vladimir Oltean
2020-10-09  5:58             ` Kurt Kanzenbach
2020-10-04 11:29 ` [PATCH net-next v6 3/7] net: dsa: hellcreek: Add PTP clock support Kurt Kanzenbach
2020-10-04 11:29 ` [PATCH net-next v6 4/7] net: dsa: hellcreek: Add support for hardware timestamping Kurt Kanzenbach
2020-10-04 14:30   ` Vladimir Oltean
2020-10-06  6:27     ` Kurt Kanzenbach
2020-10-06  7:28       ` Vladimir Oltean
2020-10-06 13:30         ` Kurt Kanzenbach
2020-10-06 13:32           ` Vladimir Oltean
2020-10-06 13:56             ` Kurt Kanzenbach
2020-10-06 14:01               ` Vladimir Oltean
2020-10-07 10:39                 ` Kurt Kanzenbach
2020-10-07 10:54                   ` Vladimir Oltean
2020-10-08  8:34                     ` Kurt Kanzenbach
2020-10-08  9:44                       ` Vladimir Oltean
2020-10-08 10:01                         ` Kurt Kanzenbach
2020-10-08 12:55                           ` Kamil Alkhouri
2020-10-08 15:09                             ` Vladimir Oltean
2020-10-12 12:53                               ` Kamil Alkhouri
2020-10-12 21:42                                 ` Richard Cochran
2020-10-14  9:57                                   ` Vladimir Oltean
2020-10-14 11:01                                     ` Richard Cochran
2020-10-14 11:37                                       ` Kurt Kanzenbach
2020-10-04 11:29 ` [PATCH net-next v6 5/7] net: dsa: hellcreek: Add PTP status LEDs Kurt Kanzenbach
2020-10-04 11:29 ` [PATCH net-next v6 6/7] dt-bindings: Add vendor prefix for Hirschmann Kurt Kanzenbach
2020-10-04 11:29 ` [PATCH net-next v6 7/7] dt-bindings: net: dsa: Add documentation for Hellcreek switches Kurt Kanzenbach

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=20201006134247.7uwchuo6s7lmyzeq@skbuf \
    --to=olteanv@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=bigeasy@linutronix.de \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=kamil.alkhouri@hs-offenburg.de \
    --cc=kuba@kernel.org \
    --cc=kurt@linutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --cc=robh+dt@kernel.org \
    --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).