]> exis.tech > repos - linux.git/commit
net: dsa: netc: add VLAN filter table and egress treatment management
authorWei Fang <wei.fang@nxp.com>
Thu, 11 Jun 2026 02:14:56 +0000 (10:14 +0800)
committerJakub Kicinski <kuba@kernel.org>
Mon, 15 Jun 2026 21:32:06 +0000 (14:32 -0700)
commit84b4a3b30abd226ec528985d7c3cb63a3376d098
treeb0975033b63817e30b7dce3ea738a43132e5c627
parent8469b17310d1814b8e7d6fe2b4cc77a05a9da4f1
net: dsa: netc: add VLAN filter table and egress treatment management

Implement the DSA .port_vlan_add and .port_vlan_del operations to enable
VLAN-aware bridge offloading on the NETC switch.

VLAN membership is maintained in the VLAN Filter Table (VFT). Adding the
first port to a VLAN creates a new VFT entry with hardware MAC learning
and flood-on-miss forwarding; subsequent ports update the existing
entry's membership bitmap. Removing the last port deletes the entry.

Egress tagging is handled through the Egress Treatment Table (ETT). Each
VLAN is allocated a group of ETT entries, one per available port. Ports
are assigned a sequential ett_offset during initialisation, used to
address each port's entry within the group. Untagged ports configure the
ETT to strip the outer VLAN tag; tagged ports pass frames through
unmodified. Each ETT group is optionally paired with an Egress Counter
Table (ECT) group for per-port frame counting, allocated on a best-effort
basis. When the egress rule of an ETT entry changes, the counter of the
corresponding ECT entry will be recounted to track the number of frames
that match the new egress rule.

A software shadow list serialised by vft_lock tracks active VLAN state
across both port membership and egress tagging. VID 0 is used for single
port mode and is ignored by both callbacks.

Signed-off-by: Wei Fang <wei.fang@nxp.com>
Link: https://patch.msgid.link/20260611021458.2629145-8-wei.fang@oss.nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/netc/netc_main.c
drivers/net/dsa/netc/netc_switch.h
include/linux/fsl/ntmp.h