Commit c6230446 authored by Daniel Golle's avatar Daniel Golle Committed by Jakub Kicinski
Browse files

net: dsa: add tagging driver for MaxLinear GSW1xx switch family



Add support for a new DSA tagging protocol driver for the MaxLinear
GSW1xx switch family. The GSW1xx switches use a proprietary 8-byte
special tag inserted between the source MAC address and the EtherType
field to indicate the source and destination ports for frames
traversing the CPU port.

Implement the tag handling logic to insert the special tag on transmit
and parse it on receive.

Signed-off-by: default avatarDaniel Golle <daniel@makrotopia.org>
Reviewed-by: default avatarAlexander Sverdlin <alexander.sverdlin@siemens.com>
Tested-by: default avatarAlexander Sverdlin <alexander.sverdlin@siemens.com>
Link: https://patch.msgid.link/0e973ebfd9433c30c96f50670da9e9449a0d98f2.1762170107.git.daniel@makrotopia.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent e1bb4b36
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -14053,7 +14053,7 @@ F: tools/testing/selftests/landlock/
K:	landlock
K:	LANDLOCK
LANTIQ / INTEL Ethernet drivers
LANTIQ / MAXLINEAR / INTEL Ethernet DSA drivers
M:	Hauke Mehrtens <hauke@hauke-m.de>
L:	netdev@vger.kernel.org
S:	Maintained
@@ -14061,6 +14061,7 @@ F: Documentation/devicetree/bindings/net/dsa/lantiq,gswip.yaml
F:	drivers/net/dsa/lantiq/*
F:	drivers/net/ethernet/lantiq_xrx200.c
F:	net/dsa/tag_gswip.c
F:	net/dsa/tag_mxl-gsw1xx.c
LANTIQ MIPS ARCHITECTURE
M:	John Crispin <john@phrozen.org>
+2 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ struct tc_action;
#define DSA_TAG_PROTO_VSC73XX_8021Q_VALUE	28
#define DSA_TAG_PROTO_BRCM_LEGACY_FCS_VALUE	29
#define DSA_TAG_PROTO_YT921X_VALUE		30
#define DSA_TAG_PROTO_MXL_GSW1XX_VALUE		31

enum dsa_tag_protocol {
	DSA_TAG_PROTO_NONE		= DSA_TAG_PROTO_NONE_VALUE,
@@ -89,6 +90,7 @@ enum dsa_tag_protocol {
	DSA_TAG_PROTO_LAN937X		= DSA_TAG_PROTO_LAN937X_VALUE,
	DSA_TAG_PROTO_VSC73XX_8021Q	= DSA_TAG_PROTO_VSC73XX_8021Q_VALUE,
	DSA_TAG_PROTO_YT921X		= DSA_TAG_PROTO_YT921X_VALUE,
	DSA_TAG_PROTO_MXL_GSW1XX	= DSA_TAG_PROTO_MXL_GSW1XX_VALUE,
};

struct dsa_switch;
+1 −0
Original line number Diff line number Diff line
@@ -92,6 +92,7 @@
#define ETH_P_ETHERCAT	0x88A4		/* EtherCAT			*/
#define ETH_P_8021AD	0x88A8          /* 802.1ad Service VLAN		*/
#define ETH_P_802_EX1	0x88B5		/* 802.1 Local Experimental 1.  */
#define ETH_P_MXLGSW	0x88C3		/* MaxLinear GSW DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
#define ETH_P_PREAUTH	0x88C7		/* 802.11 Preauthentication */
#define ETH_P_TIPC	0x88CA		/* TIPC 			*/
#define ETH_P_LLDP	0x88CC		/* Link Layer Discovery Protocol */
+8 −0
Original line number Diff line number Diff line
@@ -104,6 +104,14 @@ config NET_DSA_TAG_MTK
	  Say Y or M if you want to enable support for tagging frames for
	  Mediatek switches.

config NET_DSA_TAG_MXL_GSW1XX
	tristate "Tag driver for MaxLinear GSW1xx switches"
	help
	  The GSW1xx family of switches supports an 8-byte special tag which
	  can be used on the CPU port of the switch.
	  Say Y or M if you want to enable support for tagging frames for
	  MaxLinear GSW1xx switches.

config NET_DSA_TAG_KSZ
	tristate "Tag driver for Microchip 8795/937x/9477/9893 families of switches"
	help
+1 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ obj-$(CONFIG_NET_DSA_TAG_HELLCREEK) += tag_hellcreek.o
obj-$(CONFIG_NET_DSA_TAG_KSZ) += tag_ksz.o
obj-$(CONFIG_NET_DSA_TAG_LAN9303) += tag_lan9303.o
obj-$(CONFIG_NET_DSA_TAG_MTK) += tag_mtk.o
obj-$(CONFIG_NET_DSA_TAG_MXL_GSW1XX) += tag_mxl-gsw1xx.o
obj-$(CONFIG_NET_DSA_TAG_NONE) += tag_none.o
obj-$(CONFIG_NET_DSA_TAG_OCELOT) += tag_ocelot.o
obj-$(CONFIG_NET_DSA_TAG_OCELOT_8021Q) += tag_ocelot_8021q.o
Loading