Commit 7c83a7c5 authored by Vladimir Oltean's avatar Vladimir Oltean Committed by Jakub Kicinski
Browse files

net: dsa: add a second tagger for Ocelot switches based on tag_8021q



There are use cases for which the existing tagger, based on the NPI
(Node Processor Interface) functionality, is insufficient.

Namely:
- Frames injected through the NPI port bypass the frame analyzer, so no
  source address learning is performed, no TSN stream classification,
  etc.
- Flow control is not functional over an NPI port (PAUSE frames are
  encapsulated in the same Extraction Frame Header as all other frames)
- There can be at most one NPI port configured for an Ocelot switch. But
  in NXP LS1028A and T1040 there are two Ethernet CPU ports. The non-NPI
  port is currently either disabled, or operated as a plain user port
  (albeit an internally-facing one). Having the ability to configure the
  two CPU ports symmetrically could pave the way for e.g. creating a LAG
  between them, to increase bandwidth seamlessly for the system.

So there is a desire to have an alternative to the NPI mode. This change
keeps the default tagger for the Seville and Felix switches as "ocelot",
but it can be changed via the following device attribute:

echo ocelot-8021q > /sys/class/<dsa-master>/dsa/tagging

Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent adb3dccf
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -12859,6 +12859,7 @@ F: drivers/net/dsa/ocelot/*
F:	drivers/net/ethernet/mscc/
F:	include/soc/mscc/ocelot*
F:	net/dsa/tag_ocelot.c
F:	net/dsa/tag_ocelot_8021q.c
F:	tools/testing/selftests/drivers/net/ocelot/*
OCXL (Open Coherent Accelerator Processor Interface OpenCAPI) DRIVER
+2 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ config NET_DSA_MSCC_FELIX
	depends on NET_VENDOR_FREESCALE
	depends on HAS_IOMEM
	select MSCC_OCELOT_SWITCH_LIB
	select NET_DSA_TAG_OCELOT_8021Q
	select NET_DSA_TAG_OCELOT
	select FSL_ENETC_MDIO
	select PCS_LYNX
@@ -19,6 +20,7 @@ config NET_DSA_MSCC_SEVILLE
	depends on NET_VENDOR_MICROSEMI
	depends on HAS_IOMEM
	select MSCC_OCELOT_SWITCH_LIB
	select NET_DSA_TAG_OCELOT_8021Q
	select NET_DSA_TAG_OCELOT
	select PCS_LYNX
	help
+2 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ struct phylink_link_state;
#define DSA_TAG_PROTO_RTL4_A_VALUE		17
#define DSA_TAG_PROTO_HELLCREEK_VALUE		18
#define DSA_TAG_PROTO_XRS700X_VALUE		19
#define DSA_TAG_PROTO_OCELOT_8021Q_VALUE	20

enum dsa_tag_protocol {
	DSA_TAG_PROTO_NONE		= DSA_TAG_PROTO_NONE_VALUE,
@@ -69,6 +70,7 @@ enum dsa_tag_protocol {
	DSA_TAG_PROTO_RTL4_A		= DSA_TAG_PROTO_RTL4_A_VALUE,
	DSA_TAG_PROTO_HELLCREEK		= DSA_TAG_PROTO_HELLCREEK_VALUE,
	DSA_TAG_PROTO_XRS700X		= DSA_TAG_PROTO_XRS700X_VALUE,
	DSA_TAG_PROTO_OCELOT_8021Q	= DSA_TAG_PROTO_OCELOT_8021Q_VALUE,
};

struct packet_type;
+18 −3
Original line number Diff line number Diff line
@@ -105,11 +105,26 @@ config NET_DSA_TAG_RTL4_A
	  the Realtek RTL8366RB.

config NET_DSA_TAG_OCELOT
	tristate "Tag driver for Ocelot family of switches"
	tristate "Tag driver for Ocelot family of switches, using NPI port"
	select PACKING
	help
	  Say Y or M if you want to enable support for tagging frames for the
	  Ocelot switches (VSC7511, VSC7512, VSC7513, VSC7514, VSC9959).
	  Say Y or M if you want to enable NPI tagging for the Ocelot switches
	  (VSC7511, VSC7512, VSC7513, VSC7514, VSC9953, VSC9959). In this mode,
	  the frames over the Ethernet CPU port are prepended with a
	  hardware-defined injection/extraction frame header.  Flow control
	  (PAUSE frames) over the CPU port is not supported when operating in
	  this mode.

config NET_DSA_TAG_OCELOT_8021Q
	tristate "Tag driver for Ocelot family of switches, using VLAN"
	select NET_DSA_TAG_8021Q
	help
	  Say Y or M if you want to enable support for tagging frames with a
	  custom VLAN-based header. Frames that require timestamping, such as
	  PTP, are not delivered over Ethernet but over register-based MMIO.
	  Flow control over the CPU port is functional in this mode. When using
	  this mode, less TCAM resources (VCAP IS1, IS2, ES0) are available for
	  use with tc-flower.

config NET_DSA_TAG_QCA
	tristate "Tag driver for Qualcomm Atheros QCA8K switches"
+1 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ obj-$(CONFIG_NET_DSA_TAG_RTL4_A) += tag_rtl4_a.o
obj-$(CONFIG_NET_DSA_TAG_LAN9303) += tag_lan9303.o
obj-$(CONFIG_NET_DSA_TAG_MTK) += tag_mtk.o
obj-$(CONFIG_NET_DSA_TAG_OCELOT) += tag_ocelot.o
obj-$(CONFIG_NET_DSA_TAG_OCELOT_8021Q) += tag_ocelot_8021q.o
obj-$(CONFIG_NET_DSA_TAG_QCA) += tag_qca.o
obj-$(CONFIG_NET_DSA_TAG_SJA1105) += tag_sja1105.o
obj-$(CONFIG_NET_DSA_TAG_TRAILER) += tag_trailer.o
Loading