Netdev List
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Vladimir Oltean <olteanv@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org
Cc: Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Richard Cochran <richardcochran@gmail.com>,
	Claudiu Manoil <claudiu.manoil@nxp.com>,
	Alexandru Marginean <alexandru.marginean@nxp.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Xiaoliang Yang <xiaoliang.yang_1@nxp.com>,
	Hongbo Wang <hongbo.wang@nxp.com>,
	Vladimir Oltean <vladimir.oltean@nxp.com>,
	Po Liu <po.liu@nxp.com>, Yangbo Lu <yangbo.lu@nxp.com>,
	Maxim Kochetkov <fido_max@inbox.ru>,
	Eldar Gasanov <eldargasanov2@gmail.com>,
	Andrey L <al@b4comtech.com>,
	Tobias Waldekranz <tobias@waldekranz.com>,
	UNGLinuxDriver@microchip.com
Subject: Re: [PATCH v5 net-next 10/10] net: dsa: felix: perform switch setup for tag_8021q
Date: Wed, 20 Jan 2021 20:10:07 -0800	[thread overview]
Message-ID: <bad1e172-a7b7-b578-91c6-afa34cfbfb61@gmail.com> (raw)
In-Reply-To: <20210121023616.1696021-11-olteanv@gmail.com>



On 1/20/2021 6:36 PM, Vladimir Oltean wrote:
> From: Vladimir Oltean <vladimir.oltean@nxp.com>
> 
> Unlike sja1105, the only other user of the software-defined tag_8021q.c
> tagger format, the implementation we choose for the Felix DSA switch
> driver preserves full functionality under a vlan_filtering bridge
> (i.e. IP termination works through the DSA user ports under all
> circumstances).
> 
> The tag_8021q protocol just wants:
> - Identifying the ingress switch port based on the RX VLAN ID, as seen
>   by the CPU. We achieve this by using the TCAM engines (which are also
>   used for tc-flower offload) to push the RX VLAN as a second, outer
>   tag, on egress towards the CPU port.
> - Steering traffic injected into the switch from the network stack
>   towards the correct front port based on the TX VLAN, and consuming
>   (popping) that header on the switch's egress.
> 
> A tc-flower pseudocode of the static configuration done by the driver
> would look like this:
> 
> $ tc qdisc add dev <cpu-port> clsact
> $ for eth in swp0 swp1 swp2 swp3; do \
> 	tc filter add dev <cpu-port> egress flower indev ${eth} \
> 		action vlan push id <rxvlan> protocol 802.1ad; \
> 	tc filter add dev <cpu-port> ingress protocol 802.1Q flower
> 		vlan_id <txvlan> action vlan pop \
> 		action mirred egress redirect dev ${eth}; \
> done
> 
> but of course since DSA does not register network interfaces for the CPU
> port, this configuration would be impossible for the user to do. Also,
> due to the same reason, it is impossible for the user to inadvertently
> delete these rules using tc. These rules do not collide in any way with
> tc-flower, they just consume some TCAM space, which is something we can
> live with.
> 
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

Quite an interesting read.
-- 
Florian

      reply	other threads:[~2021-01-21  4:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-21  2:36 [PATCH v5 net-next 00/10] tag_8021q for Ocelot switches Vladimir Oltean
2021-01-21  2:36 ` [PATCH v5 net-next 01/10] net: dsa: tag_8021q: add helpers to deduce whether a VLAN ID is RX or TX VLAN Vladimir Oltean
2021-01-21  2:36 ` [PATCH v5 net-next 02/10] net: mscc: ocelot: export VCAP structures to include/soc/mscc Vladimir Oltean
2021-01-21  2:36 ` [PATCH v5 net-next 03/10] net: mscc: ocelot: store a namespaced VCAP filter ID Vladimir Oltean
2021-01-21  2:36 ` [PATCH v5 net-next 04/10] net: mscc: ocelot: reapply bridge forwarding mask on bonding join/leave Vladimir Oltean
2021-01-21  3:40   ` Florian Fainelli
2021-01-21  2:36 ` [PATCH v5 net-next 05/10] net: mscc: ocelot: don't use NPI tag prefix for the CPU port module Vladimir Oltean
2021-01-21  3:41   ` Florian Fainelli
2021-01-21  2:36 ` [PATCH v5 net-next 06/10] net: dsa: document the existing switch tree notifiers and add a new one Vladimir Oltean
2021-01-21  3:43   ` Florian Fainelli
2021-01-21  2:36 ` [PATCH v5 net-next 07/10] net: dsa: allow changing the tag protocol via the "tagging" device attribute Vladimir Oltean
2021-01-21  3:53   ` Florian Fainelli
2021-01-21 12:23     ` Vladimir Oltean
2021-01-21  2:36 ` [PATCH v5 net-next 08/10] net: dsa: felix: convert to the new .{set,del}_tag_protocol DSA API Vladimir Oltean
2021-01-21  4:02   ` Florian Fainelli
2021-01-21  2:36 ` [PATCH v5 net-next 09/10] net: dsa: add a second tagger for Ocelot switches based on tag_8021q Vladimir Oltean
2021-01-21  4:05   ` Florian Fainelli
2021-01-21  2:36 ` [PATCH v5 net-next 10/10] net: dsa: felix: perform switch setup for tag_8021q Vladimir Oltean
2021-01-21  4:10   ` Florian Fainelli [this message]

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=bad1e172-a7b7-b578-91c6-afa34cfbfb61@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=al@b4comtech.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alexandru.marginean@nxp.com \
    --cc=andrew@lunn.ch \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=eldargasanov2@gmail.com \
    --cc=fido_max@inbox.ru \
    --cc=hongbo.wang@nxp.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=po.liu@nxp.com \
    --cc=richardcochran@gmail.com \
    --cc=tobias@waldekranz.com \
    --cc=vivien.didelot@gmail.com \
    --cc=vladimir.oltean@nxp.com \
    --cc=xiaoliang.yang_1@nxp.com \
    --cc=yangbo.lu@nxp.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