| #
05b5ee61 |
| 11-Jun-2026 |
Wei Fang <wei.fang@nxp.com> |
net: dsa: netc: implement dynamic FDB entry ageing
The NETC switch does not age out dynamic FDB entries automatically. Without software management, stale entries persist after topology changes and c
net: dsa: netc: implement dynamic FDB entry ageing
The NETC switch does not age out dynamic FDB entries automatically. Without software management, stale entries persist after topology changes and cause incorrect forwarding.
Add a delayed work that periodically removes entries that have not been refreshed within the specified cycles. The effective ageing time is:
ageing_time = fdbt_ageing_delay * 100
Default values are 3s interval and 100 cycles (300s total), matching the IEEE 802.1Q default ageing time. The work starts when the first port joins a bridge (tracked via br_cnt) and is cancelled when the last port leaves. All FDB operations are serialized under fdbt_lock.
Implement .set_ageing_time() to allow the bridge layer to reconfigure ageing parameters on demand.
Signed-off-by: Wei Fang <wei.fang@nxp.com> Link: https://patch.msgid.link/20260611021458.2629145-10-wei.fang@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| #
751aa5a5 |
| 11-Jun-2026 |
Wei Fang <wei.fang@nxp.com> |
net: dsa: netc: add bridge mode support
Wire up the port_bridge_join, port_bridge_leave and port_vlan_filtering DSA callbacks to support both VLAN-unaware and VLAN-aware bridge modes.
For VLAN-unaw
net: dsa: netc: add bridge mode support
Wire up the port_bridge_join, port_bridge_leave and port_vlan_filtering DSA callbacks to support both VLAN-unaware and VLAN-aware bridge modes.
For VLAN-unaware bridges, each bridge instance is assigned a dedicated internal PVID via NETC_VLAN_UNAWARE_PVID(bridge.num), counting down from VID 4095. A VFT entry is created for this PVID with hardware MAC learning and flood-on-miss forwarding enabled. The CPU port is included as a VFT member so frames can reach the host. The reserved VID range is blocked in port_vlan_add to prevent user-space conflicts.
Only one VLAN-aware bridge is supported at a time; this constraint is enforced in port_bridge_join and port_vlan_filtering. The per-port PVID is tracked in software and written to the BPDVR register whenever VLAN filtering is active.
When a port leaves the bridge, its dynamic FDB entries are flushed right away in port_bridge_leave(), without waiting for the ageing cycle. When a link down event occurs on a port, netc_mac_link_down() will also clear the port's dynamic FDB entries via netc_port_remove_dynamic_entries(). Non-bridge ports have no dynamic FDB entries, so this call is always safe. Additionally, .port_fast_age() callback is added to flush the dynamic FDB entries associated to a port.
Host flood rules are removed from the ingress port filter table when a port joins a bridge to avoid bypassing FDB lookup and MAC learning.
Signed-off-by: Wei Fang <wei.fang@nxp.com> Link: https://patch.msgid.link/20260611021458.2629145-9-wei.fang@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| #
84b4a3b3 |
| 11-Jun-2026 |
Wei Fang <wei.fang@nxp.com> |
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
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>
show more ...
|
| #
beb0e54f |
| 18-May-2026 |
Wei Fang <wei.fang@nxp.com> |
net: dsa: netc: add support for ethtool private statistics
Implement the ethtool private statistics interface to expose additional port-level and MAC-level counters that are not covered by the stand
net: dsa: netc: add support for ethtool private statistics
Implement the ethtool private statistics interface to expose additional port-level and MAC-level counters that are not covered by the standard IEEE 802.3 statistics. The pMAC counters are only reported when the port supports Frame Preemption (802.1Qbu/802.3br).
Note that although rtnl_link_stats64 provides some standard statistics such as rx octets, rx frame errors, rx dropped packets, and tx packets, these are overall port statistics. The NETC switch supports preemption on each port, and each port has two MACs (eMAC and pMAC). The driver private statistics are used to obtain statistics for each MAC, allowing users to perform analysis and debugging.
Signed-off-by: Wei Fang <wei.fang@nxp.com> Link: https://patch.msgid.link/20260518082506.1318236-16-wei.fang@nxp.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
show more ...
|
| #
25049d8b |
| 18-May-2026 |
Wei Fang <wei.fang@nxp.com> |
net: dsa: netc: add support for the standardized counters
Each user port of the NETC switch supports 802.3 basic and mandatory managed objects statistic counters and IETF Management Information Data
net: dsa: netc: add support for the standardized counters
Each user port of the NETC switch supports 802.3 basic and mandatory managed objects statistic counters and IETF Management Information Database (MIB) package (RFC2665) and Remote Network Monitoring (RMON) counters. And all of these counters are 64-bit registers. In addition, some user ports support preemption, so these ports have two MACs, MAC 0 is the express MAC (eMAC), MAC 1 is the preemptible MAC (pMAC). So for ports that support preemption, the statistics are the sum of the pMAC and eMAC statistics.
Note that the current switch driver does not support preemption, all frames are sent and received via the eMAC by default. The statistics read from the pMAC should be zero.
Signed-off-by: Wei Fang <wei.fang@nxp.com> Link: https://patch.msgid.link/20260518082506.1318236-15-wei.fang@nxp.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
show more ...
|
| #
a5ccb7f5 |
| 18-May-2026 |
Wei Fang <wei.fang@nxp.com> |
net: dsa: netc: initialize buffer pool table and implement flow-control
The buffer pool is a quantity of memory available for buffering a group of flows (e.g. frames having the same priority, frames
net: dsa: netc: initialize buffer pool table and implement flow-control
The buffer pool is a quantity of memory available for buffering a group of flows (e.g. frames having the same priority, frames received from the same port), while waiting to be transmitted on a port. The buffer pool tracks internal memory consumption with upper bound limits and optionally a non-shared portion when associated with a shared buffer pool. Currently the shared buffer pool is not supported, it will be added in the future.
For i.MX94, the switch has 4 ports and 8 buffer pools, so each port is allocated two buffer pools. For frames with priorities of 0 to 3, they will be mapped to the first buffer pool; For frames with priorities of 4 to 7, they will be mapped to the second buffer pool. Each buffer pool has a flow control on threshold and a flow control off threshold. By setting these threshold, add the flow control support to each port.
Signed-off-by: Wei Fang <wei.fang@nxp.com> Link: https://patch.msgid.link/20260518082506.1318236-14-wei.fang@nxp.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
show more ...
|
| #
46d64076 |
| 18-May-2026 |
Wei Fang <wei.fang@nxp.com> |
net: dsa: netc: add FDB, STP, MTU, port setup and host flooding support
Expand the NETC switch driver with several foundational features: - FDB and MDB management - STP state handling - MTU configur
net: dsa: netc: add FDB, STP, MTU, port setup and host flooding support
Expand the NETC switch driver with several foundational features: - FDB and MDB management - STP state handling - MTU configuration - Port setup/teardown - Host flooding support
At this stage, the driver operates only in standalone port mode. Each port uses VLAN 0 as its PVID, meaning ingress frames are internally assigned VID 0 regardless of whether they arrive tagged or untagged. Note that this does not inject a VLAN 0 header into the frame, the VID is used purely for subsequent VLAN processing within the switch.
Signed-off-by: Wei Fang <wei.fang@nxp.com> Link: https://patch.msgid.link/20260518082506.1318236-13-wei.fang@nxp.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
show more ...
|
| #
bbe97e34 |
| 18-May-2026 |
Wei Fang <wei.fang@nxp.com> |
net: dsa: netc: add phylink MAC operations
Different versions of NETC switches have different numbers of ports and MAC capabilities. Add .phylink_get_caps() to struct netc_switch_info, allowing each
net: dsa: netc: add phylink MAC operations
Different versions of NETC switches have different numbers of ports and MAC capabilities. Add .phylink_get_caps() to struct netc_switch_info, allowing each NETC switch version to implement its own callback for obtaining MAC capabilities.
Implement the phylink_mac_ops callbacks: .mac_config(), .mac_link_up(), and .mac_link_down(). Note that flow-control configuration is not yet supported in .mac_link_up(), but will be implemented in a subsequent patch.
Signed-off-by: Wei Fang <wei.fang@nxp.com> Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Link: https://patch.msgid.link/20260518082506.1318236-12-wei.fang@nxp.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
show more ...
|
| #
187fbae0 |
| 18-May-2026 |
Wei Fang <wei.fang@nxp.com> |
net: dsa: netc: introduce NXP NETC switch driver for i.MX94
For i.MX94 series, the NETC IP provides full 802.1Q Ethernet switch functionality, advanced QoS with 8 traffic classes, and a full range o
net: dsa: netc: introduce NXP NETC switch driver for i.MX94
For i.MX94 series, the NETC IP provides full 802.1Q Ethernet switch functionality, advanced QoS with 8 traffic classes, and a full range of TSN standards capabilities. The switch has 3 user ports and 1 CPU port, the CPU port is connected to an internal ENETC. Since the switch and the internal ENETC are fully integrated within the NETC IP, no back-to-back MAC connection is required. Instead, a light-weight "pseudo MAC" is used between the switch and the ENETC. This translates to lower power (less logic and memory) and lower delay (as there is no serialization delay across this link).
Introduce the initial NETC switch driver with basic probe and remove functionality. More features will be added in subsequent patches.
Signed-off-by: Wei Fang <wei.fang@nxp.com> Link: https://patch.msgid.link/20260518082506.1318236-11-wei.fang@nxp.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
show more ...
|