net: dsa: Optional VLAN-based port separation for switches without tagging
This patch provides generic DSA code for using VLAN (802.1Q) tags for the same purpose as a dedicated switch tag for injection/extraction. It is based on the discussions and interest that has been so far expressed in https://www.spinics.net/lists/netdev/msg556125.html. Unlike all other DSA-supported tagging protocols, CONFIG_NET_DSA_TAG_8021Q does not offer a complete solution for drivers (nor can it). Instead, it provides generic code that driver can opt into calling: - dsa_8021q_xmit: Inserts a VLAN header with the specified contents. Can be called from another tagging protocol's xmit function. Currently the LAN9303 driver is inserting headers that are simply 802.1Q with custom fields, so this is an opportunity for code reuse. - dsa_8021q_rcv: Retrieves the TPID and TCI from a VLAN-tagged skb. Removing the VLAN header is left as a decision for the caller to make. - dsa_port_setup_8021q_tagging: For each user port, instal...
Showing
- include/linux/dsa/8021q.h 76 additions, 0 deletionsinclude/linux/dsa/8021q.h
- include/net/dsa.h 2 additions, 0 deletionsinclude/net/dsa.h
- net/dsa/Kconfig 11 additions, 0 deletionsnet/dsa/Kconfig
- net/dsa/Makefile 1 addition, 0 deletionsnet/dsa/Makefile
- net/dsa/tag_8021q.c 222 additions, 0 deletionsnet/dsa/tag_8021q.c
include/linux/dsa/8021q.h
0 → 100644
net/dsa/tag_8021q.c
0 → 100644
Please register or sign in to comment