Skip to content

ramips: mt7620: fix jumbo frame mode - #24242

Merged
openwrt-bot merged 1 commit into
openwrt:mainfrom
dormancygrace:agent/ramips-mt7620-fix-jumbo-mode
Jul 17, 2026
Merged

openwrt-bot merged 1 commit into
openwrt:mainfrom
dormancygrace:agent/ramips-mt7620-fix-jumbo-mode

Conversation

@dormancygrace

@dormancygrace dormancygrace commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

What changed

Select MAX_RX_PKT_LEN value 3 for jumbo mode and correct the field
description.

Why

The affected MT7620 jumbo-frame setup was added by the
ramips: ethernet: ralink: mt7620 enable jumbo frames commit
in OpenWrt PR #23933. That PR adds support for external DSA switches,
while this register programming applies to the MT7620 internal switch.

Value 2 selects a 1552-byte receive limit, while value 3 selects jumbo
mode. The current code therefore advertises an MTU up to 2048 but the
internal switch drops larger frames. The encoding matches the upstream
MT7530 definitions.

Validation

Tested on a ZBT-WE826 with an MT7620:

  • Existing value 2 produced GMACCR=0x00003f0a; IPv4 packets with a
    total length of 1534 bytes passed, while 1535 bytes were dropped.
  • Changing only the field to value 3 produced GMACCR=0x00003f0b;
    1792-byte and 1800-byte DF IPv4 packets passed with no loss.
  • A firmware containing this change booted with GMACCR=0x00003f0b
    and repeated the 1792/1800-byte tests successfully.
  • With the MikroTik peer configured for an MTU of 2028, 100 DF IPv4
    echo requests at that limit completed without loss:
root@router:~# ip link set dev eth0 mtu 2048
root@router:~# ip link set dev eth0.2 mtu 2028
root@router:~# ip addr add 192.168.1.2/30 dev eth0.2
root@router:~# ping -I 192.168.1.2 -M do -c 100 -i 0.05 -W 1 -s 2000 192.168.1.1
PING 192.168.1.1 (192.168.1.1) from 192.168.1.2 : 2000(2028) bytes of data.

--- 192.168.1.1 ping statistics ---
100 packets transmitted, 100 received, 0% packet loss, time 4984ms
rtt min/avg/max/mdev = 0.860/0.898/1.040/0.027 ms
  • scripts/checkpatch.pl: 0 errors, 0 warnings.

@github-actions github-actions Bot added kernel pull request/issue with Linux kernel related changes target/ramips pull request/issue for ramips target labels Jul 15, 2026
@namiltd

namiltd commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Tested successfully on Mercusys AC12G v1 - 8M (similar to TP-Link Archer C5 v4) in DSA mode.

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 new commit. The core fix is correct: the MT7530 encoding the commit relies on defines value 0x3 as jumbo and 0x2 as the 1552-byte limit, and gsw_mt7620.c consumes GMACCR_MAX_RX_PKT_LEN_JUMBO directly so the value change takes effect. The Fixes: d083212e1105 tag resolves to the correct mainline commit. One nit inline on the field-description comment.


Generated by Claude Code

@dormancygrace
dormancygrace force-pushed the agent/ramips-mt7620-fix-jumbo-mode branch from 1d90fe9 to bd76a78 Compare July 16, 2026 06:16
@dormancygrace
dormancygrace force-pushed the agent/ramips-mt7620-fix-jumbo-mode branch from bd76a78 to 8bcc901 Compare July 16, 2026 07:21

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 updated commit; no new issues found. The only change since the last review is the reformatting of the MAX_RX_PKT_LEN field-description comment into per-value kernel style, which resolves both prior review threads (value-0 1518/1522 provenance and the layout suggestion). No functional change.


Generated by Claude Code

MAX_RX_PKT_LEN value 2 selects 1552-byte frames, not jumbo mode.
Select value 3 so the configured 2 KiB frames are actually accepted by
the switch.

Tested on a ZBT-WE826 (MT7620). With value 2, 1534-byte IPv4
packets pass while 1535-byte packets are dropped. With value 3,
1792-byte and 1800-byte DF IPv4 packets pass.

Fixes: d083212 ("ramips: ethernet: ralink: mt7620 enable jumbo frames")
Signed-off-by: Gleb Pesin <[email protected]>
Link: openwrt#24242
Signed-off-by: Jonas Jelonek <[email protected]>
@jonasjelonek
jonasjelonek force-pushed the agent/ramips-mt7620-fix-jumbo-mode branch from 8bcc901 to 4c85dfa Compare July 17, 2026 07:26
@openwrt-bot
openwrt-bot merged commit 4c85dfa into openwrt:main Jul 17, 2026
1 check passed
@jonasjelonek

Copy link
Copy Markdown
Member

Thanks! Rebased on top of main and merged!

Lienol pushed a commit to Lienol/openwrt that referenced this pull request Jul 30, 2026
MAX_RX_PKT_LEN value 2 selects 1552-byte frames, not jumbo mode.
Select value 3 so the configured 2 KiB frames are actually accepted by
the switch.

Tested on a ZBT-WE826 (MT7620). With value 2, 1534-byte IPv4
packets pass while 1535-byte packets are dropped. With value 3,
1792-byte and 1800-byte DF IPv4 packets pass.

Fixes: d083212e1105 ("ramips: ethernet: ralink: mt7620 enable jumbo frames")
Signed-off-by: Gleb Pesin <[email protected]>
Link: openwrt/openwrt#24242
Signed-off-by: Jonas Jelonek <[email protected]>
dormancygrace added a commit to dormancygrace/openwrt that referenced this pull request Jul 30, 2026
Add a DSA driver for the seven-port switch integrated in MT7620. Keep the
existing swconfig path for device trees without a DSA ports node.

Use RXD4 source-port and TXD4 forced-port metadata with the Ralink DSA
tagger. Implement bridge isolation and STP, VLAN filtering, FDB and MDB
offload, ageing, flood controls, phylink, MTU limits, and software-extended
hardware MIB counters.

Register DSA through a bound child of the frame-engine device. This gives the
managed conduit device link the correct lifetime across driver unbind and
reprobe while the switch registers remain owned by the existing GSW platform
device.

Also make MDIO and frame-engine teardown safe for deferred probes and runtime
reprobes, and reset a still-busy frame engine before freeing its DMA rings.

Tested on an MT7620N rev 2 eco 6 with 100BASE-T traffic, VLAN-aware hardware
bridging, 2026-byte MTU, FDB/MDB offload, repeated warm reboots, and driver
unbind/rebind.

Link: https://lists.infradead.org/pipermail/openwrt-devel/2021-December/037379.html
Link: openwrt#23933
Link: openwrt#24242
Signed-off-by: Gleb Pesin <[email protected]>
dormancygrace added a commit to dormancygrace/openwrt that referenced this pull request Jul 30, 2026
Add a DSA driver for the seven-port switch integrated in MT7620. Keep the
existing swconfig path for device trees without a DSA ports node.

Use RXD4 source-port and TXD4 forced-port metadata with the Ralink DSA
tagger. Implement bridge isolation and STP, VLAN filtering, FDB and MDB
offload, ageing, flood controls, phylink, MTU limits, and software-extended
hardware MIB counters.

Register DSA through a bound child of the frame-engine device. This gives the
managed conduit device link the correct lifetime across driver unbind and
reprobe while the switch registers remain owned by the existing GSW platform
device.

Also make MDIO and frame-engine teardown safe for deferred probes and runtime
reprobes, and reset a still-busy frame engine before freeing its DMA rings.

Tested on an MT7620N rev 2 eco 6 with 100BASE-T traffic, VLAN-aware hardware
bridging, 2026-byte MTU, FDB/MDB offload, repeated warm reboots, and driver
unbind/rebind.

Link: https://lists.infradead.org/pipermail/openwrt-devel/2021-December/037379.html
Link: openwrt#23933
Link: openwrt#24242
Signed-off-by: Gleb Pesin <[email protected]>
dormancygrace added a commit to dormancygrace/openwrt that referenced this pull request Jul 30, 2026
Add a DSA driver for the seven-port switch integrated in MT7620. Keep the existing swconfig path for device trees without a DSA ports node.

Use RXD4 source-port and TXD4 forced-port metadata with the Ralink DSA tagger. Implement bridge isolation and STP, VLAN filtering, FDB and MDB offload, ageing, flood controls, phylink, MTU limits, and software-extended hardware MIB counters.

Register DSA through a bound child of the frame-engine device. This gives the managed conduit device link the correct lifetime across driver unbind and reprobe while the switch registers remain owned by the existing GSW platform device.

Package the driver and tagger as kmod-dsa-mt7620 for per-device opt-in. This keeps DSA and switchdev out of swconfig-only MT7620 images and prevents installing the DSA package together with swconfig.

Also make MDIO and frame-engine teardown safe for deferred probes and runtime reprobes, and reset a still-busy frame engine before freeing its DMA rings.

Tested on an MT7620N rev 2 eco 6 with 100BASE-T traffic, VLAN-aware hardware bridging, 2026-byte MTU, FDB/MDB offload, repeated warm reboots, and driver unbind/rebind. The modular driver, tagger, package contents, DSA image composition, and swconfig-only kernel configuration were also verified.

Link: https://lists.infradead.org/pipermail/openwrt-devel/2021-December/037379.html

Link: openwrt#23933

Link: openwrt#24242

Signed-off-by: Gleb Pesin <[email protected]>
dormancygrace added a commit to dormancygrace/openwrt that referenced this pull request Jul 30, 2026
Add a DSA driver for the seven-port switch integrated in MT7620. Keep
the existing swconfig path for device trees without a DSA ports node.

Use RXD4 source-port and TXD4 forced-port metadata with the Ralink DSA
tagger. Implement bridge isolation and STP, VLAN filtering, FDB and MDB
offload, ageing, flood controls, phylink, MTU limits, and
software-extended hardware MIB counters.

Register DSA through a bound child of the frame-engine device. This
gives the managed conduit device link the correct lifetime across driver
unbind and reprobe while the switch registers remain owned by the existing
GSW platform device.

Package the driver and tagger as kmod-dsa-mt7620 for per-device opt-in.
This keeps DSA and switchdev out of swconfig-only MT7620 images and
prevents installing the DSA package together with swconfig.

Also make MDIO and frame-engine teardown safe for deferred probes and
runtime reprobes, and reset a still-busy frame engine before freeing its
DMA rings.

Tested on an MT7620N rev 2 eco 6 with 100BASE-T traffic, VLAN-aware
hardware bridging, 2026-byte MTU, FDB/MDB offload, repeated warm reboots,
and driver unbind/rebind. The modular driver, tagger, package contents,
DSA image composition, and swconfig-only kernel configuration were also
verified.

Link: https://lists.infradead.org/pipermail/openwrt-devel/2021-December/037379.html
Link: openwrt#23933
Link: openwrt#24242
Signed-off-by: Gleb Pesin <[email protected]>
dormancygrace added a commit to dormancygrace/openwrt that referenced this pull request Jul 30, 2026
Add a DSA driver for the seven-port switch integrated in MT7620. Keep
the existing swconfig path for device trees without a DSA ports node.

Use RXD4 source-port and TXD4 forced-port metadata with the Ralink DSA
tagger. Implement bridge isolation and STP, VLAN filtering, FDB and MDB
offload, ageing, flood controls, phylink, MTU limits, and
software-extended hardware MIB counters.

Register DSA through a bound child of the frame-engine device. This
gives the managed conduit device link the correct lifetime across driver
unbind and reprobe while the switch registers remain owned by the existing
GSW platform device.

Package the driver and tagger as kmod-dsa-mt7620 for per-device opt-in.
This keeps DSA and switchdev out of swconfig-only MT7620 images and
prevents installing the DSA package together with swconfig.

Also make MDIO and frame-engine teardown safe for deferred probes and
runtime reprobes, and reset a still-busy frame engine before freeing its
DMA rings.

Tested on an MT7620N rev 2 eco 6 with 100BASE-T traffic, VLAN-aware
hardware bridging, 2026-byte MTU, FDB/MDB offload, repeated warm reboots,
and driver unbind/rebind. The modular driver, tagger, package contents,
DSA image composition, and swconfig-only kernel configuration were also
verified.

Link: https://lists.infradead.org/pipermail/openwrt-devel/2021-December/037379.html
Link: openwrt#23933
Link: openwrt#24242
Signed-off-by: Gleb Pesin <[email protected]>
dormancygrace added a commit to dormancygrace/openwrt that referenced this pull request Jul 30, 2026
Add a DSA driver for the seven-port switch integrated in MT7620. Keep
the existing swconfig path for device trees without a DSA ports node.

Use RXD4 source-port and TXD4 forced-port metadata with the Ralink DSA
tagger. Implement bridge isolation and STP, VLAN filtering, FDB and MDB
offload, ageing, flood controls, phylink, MTU limits, and
software-extended hardware MIB counters.

Register DSA through a bound child of the frame-engine device. This
gives the managed conduit device link the correct lifetime across driver
unbind and reprobe while the switch registers remain owned by the existing
GSW platform device.

Package the driver and tagger as kmod-dsa-mt7620 for per-device opt-in.
This keeps DSA and switchdev out of swconfig-only MT7620 images and
prevents installing the DSA package together with swconfig.

Also make MDIO and frame-engine teardown safe for deferred probes and
runtime reprobes, and reset a still-busy frame engine before freeing its
DMA rings.

Tested on an MT7620N rev 2 eco 6 with 100BASE-T traffic, VLAN-aware
hardware bridging, 2026-byte MTU, FDB/MDB offload, repeated warm reboots,
and driver unbind/rebind. The modular driver, tagger, package contents,
DSA image composition, and swconfig-only kernel configuration were also
verified.

Link: https://lists.infradead.org/pipermail/openwrt-devel/2021-December/037379.html
Link: openwrt#23933
Link: openwrt#24242
Signed-off-by: Gleb Pesin <[email protected]>
dormancygrace added a commit to dormancygrace/openwrt that referenced this pull request Jul 31, 2026
Add a DSA driver for the seven-port switch integrated in MT7620. Keep
the existing swconfig path for device trees without a DSA ports node.

Use RXD4 source-port and TXD4 forced-port metadata with the Ralink DSA
tagger. Implement bridge isolation and STP, VLAN filtering, FDB and MDB
offload, ageing, flood controls, phylink, MTU limits, and
software-extended hardware MIB counters.

Register DSA through a bound child of the frame-engine device. This
gives the managed conduit device link the correct lifetime across driver
unbind and reprobe while the switch registers remain owned by the existing
GSW platform device.

Package the driver and tagger as kmod-dsa-mt7620 for per-device opt-in.
This keeps DSA and switchdev out of swconfig-only MT7620 images and
prevents installing the DSA package together with swconfig.

Also make MDIO and frame-engine teardown safe for deferred probes and
runtime reprobes, and reset a still-busy frame engine before freeing its
DMA rings.

Tested on an MT7620N rev 2 eco 6 with 100BASE-T traffic, VLAN-aware
hardware bridging, 2026-byte MTU, FDB/MDB offload, repeated warm reboots,
and driver unbind/rebind. The modular driver, tagger, package contents,
DSA image composition, and swconfig-only kernel configuration were also
verified.

Link: https://lists.infradead.org/pipermail/openwrt-devel/2021-December/037379.html
Link: openwrt#23933
Link: openwrt#24242
Signed-off-by: Gleb Pesin <[email protected]>
dormancygrace added a commit to dormancygrace/openwrt that referenced this pull request Jul 31, 2026
Add a DSA driver for the seven-port switch integrated in MT7620. Keep
the existing swconfig path for device trees without a DSA ports node.

Use RXD4 source-port and TXD4 forced-port metadata with the Ralink DSA
tagger. Implement bridge isolation and STP, VLAN filtering, FDB and MDB
offload, ageing, flood controls, phylink, MTU limits, and
software-extended hardware MIB counters.

Register DSA through a bound child of the frame-engine device. This
gives the managed conduit device link the correct lifetime across driver
unbind and reprobe while the switch registers remain owned by the existing
GSW platform device.

Package the driver and tagger as kmod-dsa-mt7620 for per-device opt-in.
This keeps DSA and switchdev out of swconfig-only MT7620 images and
prevents installing the DSA package together with swconfig.

Also make MDIO and frame-engine teardown safe for deferred probes and
runtime reprobes, and reset a still-busy frame engine before freeing its
DMA rings.

Tested on an MT7620N rev 2 eco 6 with 100BASE-T traffic, VLAN-aware
hardware bridging, 2026-byte MTU, FDB/MDB offload, repeated warm reboots,
and driver unbind/rebind. The modular driver, tagger, package contents,
DSA image composition, and swconfig-only kernel configuration were also
verified.

Link: https://lists.infradead.org/pipermail/openwrt-devel/2021-December/037379.html
Link: openwrt#23933
Link: openwrt#24242
Signed-off-by: Gleb Pesin <[email protected]>
dormancygrace added a commit to dormancygrace/openwrt that referenced this pull request Jul 31, 2026
Add a DSA driver for the seven-port switch integrated in MT7620. Keep
the existing swconfig path for device trees without a DSA ports node.

Use RXD4 source-port and TXD4 forced-port metadata with the Ralink DSA
tagger. Implement bridge isolation and STP, VLAN filtering, FDB and MDB
offload, ageing, flood controls, phylink, MTU limits, and
software-extended hardware MIB counters.

Register DSA through a bound child of the frame-engine device. This
gives the managed conduit device link the correct lifetime across driver
unbind and reprobe while the switch registers remain owned by the existing
GSW platform device.

Package the driver and tagger as kmod-dsa-mt7620 for per-device opt-in.
This keeps DSA and switchdev out of swconfig-only MT7620 images and
prevents installing the DSA package together with swconfig.

Also make MDIO and frame-engine teardown safe for deferred probes and
runtime reprobes, and reset a still-busy frame engine before freeing its
DMA rings.

Tested on an MT7620N rev 2 eco 6 with 100BASE-T traffic, VLAN-aware
hardware bridging, 2026-byte MTU, FDB/MDB offload, repeated warm reboots,
and driver unbind/rebind. The modular driver, tagger, package contents,
DSA image composition, and swconfig-only kernel configuration were also
verified.

Link: https://lists.infradead.org/pipermail/openwrt-devel/2021-December/037379.html
Link: openwrt#23933
Link: openwrt#24242
Signed-off-by: Gleb Pesin <[email protected]>
dormancygrace added a commit to dormancygrace/openwrt that referenced this pull request Jul 31, 2026
Add a DSA driver for the seven-port switch integrated in MT7620. Keep
the existing swconfig path for device trees without a DSA ports node.

Use RXD4 source-port and TXD4 forced-port metadata with the Ralink DSA
tagger. Implement bridge isolation and STP, VLAN filtering, FDB and MDB
offload, ageing, flood controls, phylink, MTU limits, and
software-extended hardware MIB counters.

Correct the shared switch MIB enable register and enable all seven port
counters. The old address was inside port 0 counter space, so this also
fixes legacy swconfig initialization.

Register DSA through a bound child of the frame-engine device. This gives
the managed conduit device link the correct lifetime across driver unbind
and reprobe while the switch registers remain owned by the existing GSW
platform device.

Package the driver and tagger as kmod-dsa-mt7620 for per-device opt-in.
This keeps DSA and switchdev out of swconfig-only MT7620 images and
prevents installing the DSA package together with swconfig.

Also make MDIO and frame-engine teardown safe for deferred probes and
runtime reprobes, and reset a still-busy frame engine before freeing its
DMA rings. Resolve FE and ESW resets by name so recovery can reset FE
alone, and warn if a switch node provides neither named reset.

The netdev is devm-managed, so leave NAPI deletion to free_netdev after
unregister instead of deleting NAPI from fe_remove while the netdev is
still registered.

Tested on an MT7620N rev 2 eco 6 with 100BASE-T traffic, VLAN-aware
hardware bridging, 2026-byte MTU, FDB/MDB offload, repeated warm reboots,
and driver unbind/rebind. The modular driver, tagger, package contents,
DSA image composition, and swconfig-only kernel configuration were also
verified.

Link: https://lists.infradead.org/pipermail/openwrt-devel/2021-December/037379.html
Link: openwrt#23933
Link: openwrt#24242
Signed-off-by: Gleb Pesin <[email protected]>
dormancygrace added a commit to dormancygrace/openwrt that referenced this pull request Jul 31, 2026
Add a DSA driver for the seven-port switch integrated in MT7620. Keep
the existing swconfig path for device trees without a DSA ports node.

Use RXD4 source-port and TXD4 forced-port metadata with the Ralink DSA
tagger. Implement bridge isolation and STP, VLAN filtering, FDB and MDB
offload, ageing, flood controls, phylink, MTU limits, and
software-extended hardware MIB counters.

Correct the shared switch MIB enable register and enable all seven port
counters. The old address was inside port 0 counter space, so this also
fixes legacy swconfig initialization.

Register DSA through a bound child of the frame-engine device. This gives
the managed conduit device link the correct lifetime across driver unbind
and reprobe while the switch registers remain owned by the existing GSW
platform device.

Package the driver and tagger as kmod-dsa-mt7620 for per-device opt-in.
This keeps DSA and switchdev out of swconfig-only MT7620 images and
prevents installing the DSA package together with swconfig.

Also make MDIO and frame-engine teardown safe for deferred probes and
runtime reprobes, and reset a still-busy frame engine before freeing its
DMA rings. Resolve FE and ESW resets by name so recovery can reset FE
alone, and warn if a switch node provides neither named reset.

The netdev is devm-managed, so leave NAPI deletion to free_netdev after
unregister instead of deleting NAPI from fe_remove while the netdev is
still registered.

Tested on an MT7620N rev 2 eco 6 with 100BASE-T traffic, VLAN-aware
hardware bridging, 2026-byte MTU, FDB/MDB offload, repeated warm reboots,
and driver unbind/rebind. The modular driver, tagger, package contents,
DSA image composition, and swconfig-only kernel configuration were also
verified.

Link: https://lists.infradead.org/pipermail/openwrt-devel/2021-December/037379.html
Link: openwrt#23933
Link: openwrt#24242
Signed-off-by: Gleb Pesin <[email protected]>
dormancygrace added a commit to dormancygrace/openwrt that referenced this pull request Jul 31, 2026
Add a DSA driver for the seven-port switch integrated in MT7620. Keep
the existing swconfig path for device trees without a DSA ports node.

Use RXD4 source-port and TXD4 forced-port metadata with the Ralink DSA
tagger. Implement bridge isolation and STP, VLAN filtering, FDB and MDB
offload, ageing, flood controls, phylink, MTU limits, and
software-extended hardware MIB counters.

Correct the shared switch MIB enable register and enable all seven port
counters. The old address was inside port 0 counter space, so this also
fixes legacy swconfig initialization.

Register DSA through a bound child of the frame-engine device. This gives
the managed conduit device link the correct lifetime across driver unbind
and reprobe while the switch registers remain owned by the existing GSW
platform device.

Package the driver and tagger as kmod-dsa-mt7620 for per-device opt-in.
This keeps DSA and switchdev out of swconfig-only MT7620 images and
prevents installing the DSA package together with swconfig.

Also make MDIO and frame-engine teardown safe for deferred probes and
runtime reprobes, and reset a still-busy frame engine before freeing its
DMA rings. Resolve FE and ESW resets by name so recovery can reset FE
alone, and warn if a switch node provides neither named reset.

The netdev is devm-managed, so leave NAPI deletion to free_netdev after
unregister instead of deleting NAPI from fe_remove while the netdev is
still registered.

Tested on an MT7620N rev 2 eco 6 with 100BASE-T traffic, VLAN-aware
hardware bridging, 2026-byte MTU, FDB/MDB offload, repeated warm reboots,
and driver unbind/rebind. The modular driver, tagger, package contents,
DSA image composition, and swconfig-only kernel configuration were also
verified.

Link: https://lists.infradead.org/pipermail/openwrt-devel/2021-December/037379.html
Link: openwrt#23933
Link: openwrt#24242
Signed-off-by: Gleb Pesin <[email protected]>
dormancygrace added a commit to dormancygrace/openwrt that referenced this pull request Jul 31, 2026
Add a DSA driver for the seven-port switch integrated in MT7620. Keep
the existing swconfig path for device trees without a DSA ports node.

Use RXD4 source-port and TXD4 forced-port metadata with the Ralink DSA
tagger. Implement bridge isolation and STP, VLAN filtering, FDB and MDB
offload, ageing, flood controls, phylink, MTU limits, and
software-extended hardware MIB counters.

Correct the shared switch MIB enable register and enable all seven port
counters. The old address was inside port 0 counter space, so this also
fixes legacy swconfig initialization.

Register DSA through a bound child of the frame-engine device. This gives
the managed conduit device link the correct lifetime across driver unbind
and reprobe while the switch registers remain owned by the existing GSW
platform device.

Package the driver and tagger as kmod-dsa-mt7620 for per-device opt-in.
This keeps DSA and switchdev out of swconfig-only MT7620 images and
prevents installing the DSA package together with swconfig.

Also make MDIO and frame-engine teardown safe for deferred probes and
runtime reprobes, and reset a still-busy frame engine before freeing its
DMA rings. Resolve FE and ESW resets by name so recovery can reset FE
alone, and warn if a switch node provides neither named reset.

The netdev is devm-managed, so leave NAPI deletion to free_netdev after
unregister instead of deleting NAPI from fe_remove while the netdev is
still registered.

Tested on an MT7620N rev 2 eco 6 with 100BASE-T traffic, VLAN-aware
hardware bridging, 2026-byte MTU, FDB/MDB offload, repeated warm reboots,
and driver unbind/rebind. The modular driver, tagger, package contents,
DSA image composition, and swconfig-only kernel configuration were also
verified.

Link: https://lists.infradead.org/pipermail/openwrt-devel/2021-December/037379.html
Link: openwrt#23933
Link: openwrt#24242
Signed-off-by: Gleb Pesin <[email protected]>
dormancygrace added a commit to dormancygrace/openwrt that referenced this pull request Aug 1, 2026
Add a DSA driver for the seven-port switch integrated in MT7620. Keep
the existing swconfig path for device trees without a DSA ports node.

Use RXD4 source-port and TXD4 forced-port metadata with the Ralink DSA
tagger. The programming guide places TXD4 FP_BMAP at bits 27:20; use
that layout instead of the stale unused bits 26:19 definition.

Implement bridge isolation and STP, VLAN filtering, FDB and MDB offload,
ageing, flood controls, phylink, MTU limits, and software-extended
hardware MIB counters. DSA invokes port_stp_state_set() before updating
its cached state, so pass the pending callback state as an override when
recalculating port matrices instead of leaving hardware one transition
behind.

Correct the shared switch MIB enable register and enable all seven port
counters. The old address was inside port 0 counter space, so this also
fixes legacy swconfig initialization.

Register DSA through a bound child of the frame-engine device. This gives
the managed conduit device link the correct lifetime across driver unbind
and reprobe while the switch registers remain owned by the existing GSW
platform device.

Package the driver and tagger as kmod-dsa-mt7620 for per-device opt-in.
This keeps DSA and switchdev out of swconfig-only MT7620 images and
prevents installing the DSA package together with swconfig.

Also make MDIO and frame-engine teardown safe for deferred probes and
runtime reprobes. Replace the legacy MDIO busy loop and -1 return with
readl_poll_timeout_atomic() and its real error, and reset a still-busy
frame engine before freeing DMA rings. Resolve FE and ESW resets by name
so recovery can reset FE alone, and warn if a switch node provides
neither named reset.

The netdev is devm-managed, so leave NAPI deletion to free_netdev after
unregister instead of deleting NAPI from fe_remove while the netdev is
still registered.

Tested on an MT7620N rev 2 eco 6 with 100BASE-T traffic, VLAN-aware
hardware bridging, 2026-byte MTU, FDB/MDB offload, pending STP state,
repeated warm reboots, and driver unbind/rebind. The modular driver,
tagger, package contents, DSA image composition, and swconfig-only kernel
configuration were also verified. An independent TP-Link Archer C5 v4
test found no regression with an external RTL8367S DSA switch using the
RTL8_4t tagger.

Link: https://lists.infradead.org/pipermail/openwrt-devel/2021-December/037379.html
Link: openwrt#23933
Link: openwrt#24242
Signed-off-by: Gleb Pesin <[email protected]>
dormancygrace added a commit to dormancygrace/openwrt that referenced this pull request Aug 5, 2026
Add a DSA driver for the seven-port switch integrated in MT7620. Keep
the existing swconfig path for device trees without a DSA ports node.

Use RXD4 source-port and TXD4 forced-port metadata with the Ralink DSA
tagger. The programming guide places TXD4 FP_BMAP at bits 27:20; use
that layout instead of the stale unused bits 26:19 definition.

Implement bridge isolation and STP, VLAN filtering, FDB and MDB offload,
ageing, flood controls, phylink, MTU limits, and software-extended
hardware MIB counters. DSA invokes port_stp_state_set() before updating
its cached state, so pass the pending callback state as an override when
recalculating port matrices instead of leaving hardware one transition
behind.

Correct the shared switch MIB enable register and enable all seven port
counters. The old address was inside port 0 counter space, so this also
fixes legacy swconfig initialization.

Register DSA through a bound child of the frame-engine device. This gives
the managed conduit device link the correct lifetime across driver unbind
and reprobe while the switch registers remain owned by the existing GSW
platform device.

Package the driver and tagger as kmod-dsa-mt7620 for per-device opt-in.
This keeps DSA and switchdev out of swconfig-only MT7620 images and
prevents installing the DSA package together with swconfig.

Also make MDIO and frame-engine teardown safe for deferred probes and
runtime reprobes. Replace the legacy MDIO busy loop and -1 return with
readl_poll_timeout_atomic() and its real error, and reset a still-busy
frame engine before freeing DMA rings. Resolve FE and ESW resets by name
so recovery can reset FE alone, and warn if a switch node provides
neither named reset.

The netdev is devm-managed, so leave NAPI deletion to free_netdev after
unregister instead of deleting NAPI from fe_remove while the netdev is
still registered.

Tested on an MT7620N rev 2 eco 6 with 100BASE-T traffic, VLAN-aware
hardware bridging, 2026-byte MTU, FDB/MDB offload, pending STP state,
repeated warm reboots, and driver unbind/rebind. The modular driver,
tagger, package contents, DSA image composition, and swconfig-only kernel
configuration were also verified. An independent TP-Link Archer C5 v4
test found no regression with an external RTL8367S DSA switch using the
RTL8_4t tagger.

Link: https://lists.infradead.org/pipermail/openwrt-devel/2021-December/037379.html
Link: openwrt#23933
Link: openwrt#24242
Signed-off-by: Gleb Pesin <[email protected]>
dormancygrace added a commit to dormancygrace/openwrt that referenced this pull request Aug 5, 2026
Add a DSA driver for the seven-port switch integrated in MT7620. Keep
the existing swconfig path for device trees without a DSA ports node.

Use RXD4 source-port and TXD4 forced-port metadata with the Ralink DSA
tagger. The programming guide places TXD4 FP_BMAP at bits 27:20; use
that layout instead of the stale unused bits 26:19 definition.

Implement bridge isolation and STP, VLAN filtering, FDB and MDB offload,
ageing, flood controls, phylink, MTU limits, and software-extended
hardware MIB counters. DSA invokes port_stp_state_set() before updating
its cached state, so pass the pending callback state as an override when
recalculating port matrices instead of leaving hardware one transition
behind.

Correct the shared switch MIB enable register and enable all seven port
counters. The old address was inside port 0 counter space, so this also
fixes legacy swconfig initialization.

Register DSA through a bound child of the frame-engine device. This gives
the managed conduit device link the correct lifetime across driver unbind
and reprobe while the switch registers remain owned by the existing GSW
platform device.

Package the driver and tagger as kmod-dsa-mt7620 for per-device opt-in.
This keeps DSA and switchdev out of swconfig-only MT7620 images and
prevents installing the DSA package together with swconfig.

Also make MDIO and frame-engine teardown safe for deferred probes and
runtime reprobes. Replace the legacy MDIO busy loop and -1 return with
readl_poll_timeout_atomic() and its real error, and reset a still-busy
frame engine before freeing DMA rings. Resolve FE and ESW resets by name
so recovery can reset FE alone, and warn if a switch node provides
neither named reset.

The netdev is devm-managed, so leave NAPI deletion to free_netdev after
unregister instead of deleting NAPI from fe_remove while the netdev is
still registered.

Tested on an MT7620N rev 2 eco 6 with 100BASE-T traffic, VLAN-aware
hardware bridging, 2026-byte MTU, FDB/MDB offload, pending STP state,
repeated warm reboots, and driver unbind/rebind. The modular driver,
tagger, package contents, DSA image composition, and swconfig-only kernel
configuration were also verified. An independent TP-Link Archer C5 v4
test found no regression with an external RTL8367S DSA switch using the
RTL8_4t tagger.

Link: https://lists.infradead.org/pipermail/openwrt-devel/2021-December/037379.html
Link: openwrt#23933
Link: openwrt#24242
Signed-off-by: Gleb Pesin <[email protected]>
dormancygrace added a commit to dormancygrace/openwrt that referenced this pull request Aug 5, 2026
Add a DSA driver for the seven-port switch integrated in MT7620. Keep
the existing swconfig path for device trees without a DSA ports node.

Use RXD4 source-port and TXD4 forced-port metadata with the Ralink DSA
tagger. The programming guide places TXD4 FP_BMAP at bits 27:20; use
that layout instead of the stale unused bits 26:19 definition.

Implement bridge isolation and STP, VLAN filtering, FDB and MDB offload,
ageing, flood controls, phylink, MTU limits, and software-extended
hardware MIB counters. DSA invokes port_stp_state_set() before updating
its cached state, so pass the pending callback state as an override when
recalculating port matrices instead of leaving hardware one transition
behind.

Correct the shared switch MIB enable register and enable all seven port
counters. The old address was inside port 0 counter space, so this also
fixes legacy swconfig initialization.

Register DSA through a bound child of the frame-engine device. This gives
the managed conduit device link the correct lifetime across driver unbind
and reprobe while the switch registers remain owned by the existing GSW
platform device.

Package the driver and tagger as kmod-dsa-mt7620 for per-device opt-in.
This keeps DSA and switchdev out of swconfig-only MT7620 images and
prevents installing the DSA package together with swconfig.

Also make MDIO and frame-engine teardown safe for deferred probes and
runtime reprobes. Replace the legacy MDIO busy loop and -1 return with
readl_poll_timeout_atomic() and its real error, and reset a still-busy
frame engine before freeing DMA rings. Resolve FE and ESW resets by name
so recovery can reset FE alone, and warn if a switch node provides
neither named reset.

The netdev is devm-managed, so leave NAPI deletion to free_netdev after
unregister instead of deleting NAPI from fe_remove while the netdev is
still registered.

Tested on an MT7620N rev 2 eco 6 with 100BASE-T traffic, VLAN-aware
hardware bridging, 2026-byte MTU, FDB/MDB offload, pending STP state,
repeated warm reboots, and driver unbind/rebind. The modular driver,
tagger, package contents, DSA image composition, and swconfig-only kernel
configuration were also verified. An independent TP-Link Archer C5 v4
test found no regression with an external RTL8367S DSA switch using the
RTL8_4t tagger.

Link: https://lists.infradead.org/pipermail/openwrt-devel/2021-December/037379.html
Link: openwrt#23933
Link: openwrt#24242
Signed-off-by: Gleb Pesin <[email protected]>
dormancygrace added a commit to dormancygrace/openwrt that referenced this pull request Aug 7, 2026
Add a DSA driver for the seven-port switch integrated in MT7620. Keep
the existing swconfig path for device trees without a DSA ports node.

Use RXD4 source-port and TXD4 forced-port metadata with the Ralink DSA
tagger. The programming guide places TXD4 FP_BMAP at bits 27:20; use
that layout instead of the stale unused bits 26:19 definition.

Implement bridge isolation and STP, VLAN filtering, FDB and MDB offload,
ageing, flood controls, phylink, MTU limits, and software-extended
hardware MIB counters. DSA invokes port_stp_state_set() before updating
its cached state, so pass the pending callback state as an override when
recalculating port matrices instead of leaving hardware one transition
behind.

Correct the shared switch MIB enable register and enable all seven port
counters. The old address was inside port 0 counter space, so this also
fixes legacy swconfig initialization.

Register DSA through a bound child of the frame-engine device. This gives
the managed conduit device link the correct lifetime across driver unbind
and reprobe while the switch registers remain owned by the existing GSW
platform device.

Package the driver and tagger as kmod-dsa-mt7620 for per-device opt-in.
This keeps DSA and switchdev out of swconfig-only MT7620 images and
prevents installing the DSA package together with swconfig.

Also make MDIO and frame-engine teardown safe for deferred probes and
runtime reprobes. Replace the legacy MDIO busy loop and -1 return with
readl_poll_timeout_atomic() and its real error, and reset a still-busy
frame engine before freeing DMA rings. Resolve FE and ESW resets by name
so recovery can reset FE alone, and warn if a switch node provides
neither named reset.

The netdev is devm-managed, so leave NAPI deletion to free_netdev after
unregister instead of deleting NAPI from fe_remove while the netdev is
still registered.

Tested on an MT7620N rev 2 eco 6 with 100BASE-T traffic, VLAN-aware
hardware bridging, 2026-byte MTU, FDB/MDB offload, pending STP state,
repeated warm reboots, and driver unbind/rebind. The modular driver,
tagger, package contents, DSA image composition, and swconfig-only kernel
configuration were also verified. An independent TP-Link Archer C5 v4
test found no regression with an external RTL8367S DSA switch using the
RTL8_4t tagger.

Link: https://lists.infradead.org/pipermail/openwrt-devel/2021-December/037379.html
Link: openwrt#23933
Link: openwrt#24242
Signed-off-by: Gleb Pesin <[email protected]>
dormancygrace added a commit to dormancygrace/openwrt that referenced this pull request Aug 8, 2026
Add a DSA driver for the seven-port switch integrated in MT7620. Keep
the existing swconfig path for device trees without a DSA ports node.

Use RXD4 source-port and TXD4 forced-port metadata with the Ralink DSA
tagger. The programming guide places TXD4 FP_BMAP at bits 27:20; use
that layout instead of the stale unused bits 26:19 definition.

Implement bridge isolation and STP, VLAN filtering, FDB and MDB offload,
ageing, flood controls, phylink, MTU limits, and software-extended
hardware MIB counters. DSA invokes port_stp_state_set() before updating
its cached state, so pass the pending callback state as an override when
recalculating port matrices instead of leaving hardware one transition
behind.

Correct the shared switch MIB enable register and enable all seven port
counters. The old address was inside port 0 counter space, so this also
fixes legacy swconfig initialization.

Register DSA through a bound child of the frame-engine device. This gives
the managed conduit device link the correct lifetime across driver unbind
and reprobe while the switch registers remain owned by the existing GSW
platform device.

Package the driver and tagger as kmod-dsa-mt7620 for per-device opt-in.
This keeps DSA and switchdev out of swconfig-only MT7620 images and
prevents installing the DSA package together with swconfig.

Also make MDIO and frame-engine teardown safe for deferred probes and
runtime reprobes. Replace the legacy MDIO busy loop and -1 return with
readl_poll_timeout_atomic() and its real error, and reset a still-busy
frame engine before freeing DMA rings. Resolve FE and ESW resets by name
so recovery can reset FE alone, and warn if a switch node provides
neither named reset.

The netdev is devm-managed, so leave NAPI deletion to free_netdev after
unregister instead of deleting NAPI from fe_remove while the netdev is
still registered.

Tested on an MT7620N rev 2 eco 6 with 100BASE-T traffic, VLAN-aware
hardware bridging, 2026-byte MTU, FDB/MDB offload, pending STP state,
repeated warm reboots, and driver unbind/rebind. The modular driver,
tagger, package contents, DSA image composition, and swconfig-only kernel
configuration were also verified. An independent TP-Link Archer C5 v4
test found no regression with an external RTL8367S DSA switch using the
RTL8_4t tagger.

Link: https://lists.infradead.org/pipermail/openwrt-devel/2021-December/037379.html
Link: openwrt#23933
Link: openwrt#24242
Signed-off-by: Gleb Pesin <[email protected]>
dormancygrace added a commit to dormancygrace/openwrt that referenced this pull request Aug 8, 2026
Add a DSA driver for the seven-port switch integrated in MT7620. Keep
the existing swconfig path for device trees without a DSA ports node.

Use RXD4 source-port and TXD4 forced-port metadata with the Ralink DSA
tagger. The programming guide places TXD4 FP_BMAP at bits 27:20; use
that layout instead of the stale unused bits 26:19 definition.

Implement bridge isolation and STP, VLAN filtering, FDB and MDB offload,
ageing, flood controls, phylink, MTU limits, and software-extended
hardware MIB counters. DSA invokes port_stp_state_set() before updating
its cached state, so pass the pending callback state as an override when
recalculating port matrices instead of leaving hardware one transition
behind.

Correct the shared switch MIB enable register and enable all seven port
counters. The old address was inside port 0 counter space, so this also
fixes legacy swconfig initialization.

Register DSA through a bound child of the frame-engine device. This gives
the managed conduit device link the correct lifetime across driver unbind
and reprobe while the switch registers remain owned by the existing GSW
platform device.

Package the driver and tagger as kmod-dsa-mt7620 for per-device opt-in.
This keeps DSA and switchdev out of swconfig-only MT7620 images and
prevents installing the DSA package together with swconfig.

Also make MDIO and frame-engine teardown safe for deferred probes and
runtime reprobes. Replace the legacy MDIO busy loop and -1 return with
readl_poll_timeout_atomic() and its real error, and reset a still-busy
frame engine before freeing DMA rings. Resolve FE and ESW resets by name
so recovery can reset FE alone, and warn if a switch node provides
neither named reset.

The netdev is devm-managed, so leave NAPI deletion to free_netdev after
unregister instead of deleting NAPI from fe_remove while the netdev is
still registered.

Tested on an MT7620N rev 2 eco 6 with 100BASE-T traffic, VLAN-aware
hardware bridging, 2026-byte MTU, FDB/MDB offload, pending STP state,
repeated warm reboots, and driver unbind/rebind. The modular driver,
tagger, package contents, DSA image composition, and swconfig-only kernel
configuration were also verified. An independent TP-Link Archer C5 v4
test found no regression with an external RTL8367S DSA switch using the
RTL8_4t tagger.

Link: https://lists.infradead.org/pipermail/openwrt-devel/2021-December/037379.html
Link: openwrt#23933
Link: openwrt#24242
Signed-off-by: Gleb Pesin <[email protected]>
dormancygrace added a commit to dormancygrace/openwrt that referenced this pull request Aug 9, 2026
Add a DSA driver for the seven-port switch integrated in MT7620. Keep
the existing swconfig path for device trees without a DSA ports node.

Use RXD4 source-port and TXD4 forced-port metadata with the Ralink DSA
tagger. The programming guide places TXD4 FP_BMAP at bits 27:20; use
that layout instead of the stale unused bits 26:19 definition.

Implement bridge isolation and STP, VLAN filtering, FDB and MDB offload,
ageing, flood controls, phylink, MTU limits, and software-extended
hardware MIB counters. DSA invokes port_stp_state_set() before updating
its cached state, so pass the pending callback state as an override when
recalculating port matrices instead of leaving hardware one transition
behind.

Correct the shared switch MIB enable register and enable all seven port
counters. The old address was inside port 0 counter space, so this also
fixes legacy swconfig initialization.

Register DSA through a bound child of the frame-engine device. This gives
the managed conduit device link the correct lifetime across driver unbind
and reprobe while the switch registers remain owned by the existing GSW
platform device.

Package the driver and tagger as kmod-dsa-mt7620 for per-device opt-in.
This keeps DSA and switchdev out of swconfig-only MT7620 images and
prevents installing the DSA package together with swconfig.

Also make MDIO and frame-engine teardown safe for deferred probes and
runtime reprobes. Replace the legacy MDIO busy loop and -1 return with
readl_poll_timeout_atomic() and its real error, and reset a still-busy
frame engine before freeing DMA rings. Resolve FE and ESW resets by name
so recovery can reset FE alone, and warn if a switch node provides
neither named reset.

The netdev is devm-managed, so leave NAPI deletion to free_netdev after
unregister instead of deleting NAPI from fe_remove while the netdev is
still registered.

Tested on an MT7620N rev 2 eco 6 with 100BASE-T traffic, VLAN-aware
hardware bridging, 2026-byte MTU, FDB/MDB offload, pending STP state,
repeated warm reboots, and driver unbind/rebind. The modular driver,
tagger, package contents, DSA image composition, and swconfig-only kernel
configuration were also verified. An independent TP-Link Archer C5 v4
test found no regression with an external RTL8367S DSA switch using the
RTL8_4t tagger.

Link: https://lists.infradead.org/pipermail/openwrt-devel/2021-December/037379.html
Link: openwrt#23933
Link: openwrt#24242
Signed-off-by: Gleb Pesin <[email protected]>
dormancygrace added a commit to dormancygrace/openwrt that referenced this pull request Aug 14, 2026
Add a DSA driver for the seven-port switch integrated in MT7620. Keep
the existing swconfig path for device trees without a DSA ports node.

Use RXD4 source-port and TXD4 forced-port metadata with the Ralink DSA
tagger. The programming guide places TXD4 FP_BMAP at bits 27:20; use
that layout instead of the stale unused bits 26:19 definition.

Implement bridge isolation and STP, VLAN filtering, FDB and MDB offload,
ageing, flood controls, phylink, MTU limits, and software-extended
hardware MIB counters. DSA invokes port_stp_state_set() before updating
its cached state, so pass the pending callback state as an override when
recalculating port matrices instead of leaving hardware one transition
behind.

Correct the shared switch MIB enable register and enable all seven port
counters. The old address was inside port 0 counter space, so this also
fixes legacy swconfig initialization.

Register DSA through a bound child of the frame-engine device. This gives
the managed conduit device link the correct lifetime across driver unbind
and reprobe while the switch registers remain owned by the existing GSW
platform device.

Package the driver and tagger as kmod-dsa-mt7620 for per-device opt-in.
This keeps DSA and switchdev out of swconfig-only MT7620 images and
prevents installing the DSA package together with swconfig.

Also make MDIO and frame-engine teardown safe for deferred probes and
runtime reprobes. Replace the legacy MDIO busy loop and -1 return with
readl_poll_timeout_atomic() and its real error, and reset a still-busy
frame engine before freeing DMA rings. Resolve FE and ESW resets by name
so recovery can reset FE alone, and warn if a switch node provides
neither named reset.

The netdev is devm-managed, so leave NAPI deletion to free_netdev after
unregister instead of deleting NAPI from fe_remove while the netdev is
still registered.

Tested on an MT7620N rev 2 eco 6 with 100BASE-T traffic, VLAN-aware
hardware bridging, 2026-byte MTU, FDB/MDB offload, pending STP state,
repeated warm reboots, and driver unbind/rebind. The modular driver,
tagger, package contents, DSA image composition, and swconfig-only kernel
configuration were also verified. An independent TP-Link Archer C5 v4
test found no regression with an external RTL8367S DSA switch using the
RTL8_4t tagger.

Link: https://lists.infradead.org/pipermail/openwrt-devel/2021-December/037379.html
Link: openwrt#23933
Link: openwrt#24242
Signed-off-by: Gleb Pesin <[email protected]>
dormancygrace added a commit to dormancygrace/openwrt that referenced this pull request Aug 14, 2026
Add a DSA driver for the seven-port switch integrated in MT7620. Keep
the existing swconfig path for device trees without a DSA ports node.

Use RXD4 source-port and TXD4 forced-port metadata with the Ralink DSA
tagger. The programming guide places TXD4 FP_BMAP at bits 27:20; use
that layout instead of the stale unused bits 26:19 definition.

Implement bridge isolation and STP, VLAN filtering, FDB and MDB offload,
ageing, flood controls, phylink, MTU limits, and software-extended
hardware MIB counters. DSA invokes port_stp_state_set() before updating
its cached state, so pass the pending callback state as an override when
recalculating port matrices instead of leaving hardware one transition
behind.

Correct the shared switch MIB enable register and enable all seven port
counters. The old address was inside port 0 counter space, so this also
fixes legacy swconfig initialization.

Register DSA through a bound child of the frame-engine device. This gives
the managed conduit device link the correct lifetime across driver unbind
and reprobe while the switch registers remain owned by the existing GSW
platform device.

Package the driver and tagger as kmod-dsa-mt7620 for per-device opt-in.
This keeps DSA and switchdev out of swconfig-only MT7620 images and
prevents installing the DSA package together with swconfig.

Also make MDIO and frame-engine teardown safe for deferred probes and
runtime reprobes. Replace the legacy MDIO busy loop and -1 return with
readl_poll_timeout_atomic() and its real error, and reset a still-busy
frame engine before freeing DMA rings. Resolve FE and ESW resets by name
so recovery can reset FE alone, and warn if a switch node provides
neither named reset.

The FE-only reset is a stop-path fallback when DMA fails to quiesce
before its rings are freed. It does not recover network blocks left stale
across a system restart; that separate condition is handled by the reset
change linked below.

The netdev is devm-managed, so leave NAPI deletion to free_netdev after
unregister instead of deleting NAPI from fe_remove while the netdev is
still registered.

Tested on an MT7620N rev 2 eco 6 with 100BASE-T traffic, VLAN-aware
hardware bridging, 2026-byte MTU, FDB/MDB offload, pending STP state, and
driver unbind/rebind. The modular driver, tagger, package contents, DSA
image composition, and swconfig-only kernel configuration were also
verified. An independent TP-Link Archer C5 v4 test found no regression
with an external RTL8367S DSA switch using the RTL8_4t tagger.

Warm-reboot recovery was tested with the separate reset change applied
and is not claimed by this DSA commit alone.

Link: https://lists.infradead.org/pipermail/openwrt-devel/2021-December/037379.html

Link: openwrt#23933

Link: openwrt#24242

Link: openwrt#24724

Signed-off-by: Gleb Pesin <[email protected]>
dormancygrace added a commit to dormancygrace/openwrt that referenced this pull request Aug 15, 2026
Add a DSA driver for the seven-port switch integrated in MT7620. Keep
the existing swconfig path for device trees without a DSA ports node.

Use RXD4 source-port and TXD4 forced-port metadata with the Ralink DSA
tagger. The programming guide places TXD4 FP_BMAP at bits 27:20; use
that layout instead of the stale unused bits 26:19 definition.

Implement bridge isolation and STP, VLAN filtering, FDB and MDB offload,
ageing, flood controls, phylink, MTU limits, and software-extended
hardware MIB counters. DSA invokes port_stp_state_set() before updating
its cached state, so pass the pending callback state as an override when
recalculating port matrices instead of leaving hardware one transition
behind.

Correct the shared switch MIB enable register and enable all seven port
counters. The old address was inside port 0 counter space, so this also
fixes legacy swconfig initialization.

Register DSA through a bound child of the frame-engine device. This gives
the managed conduit device link the correct lifetime across driver unbind
and reprobe while the switch registers remain owned by the existing GSW
platform device.

Package the driver and tagger as kmod-dsa-mt7620 for per-device opt-in.
This keeps DSA and switchdev out of swconfig-only MT7620 images and
prevents installing the DSA package together with swconfig.

Also make MDIO and frame-engine teardown safe for deferred probes and
runtime reprobes. Replace the legacy MDIO busy loop and -1 return with
readl_poll_timeout_atomic() and its real error, and reset a still-busy
frame engine before freeing DMA rings. Resolve FE and ESW resets by name
so recovery can reset FE alone, and warn if a switch node provides
neither named reset.

The FE-only reset is a stop-path fallback when DMA fails to quiesce
before its rings are freed. It does not recover network blocks left stale
across a system restart; that separate condition is handled by the reset
change linked below.

The netdev is devm-managed, so leave NAPI deletion to free_netdev after
unregister instead of deleting NAPI from fe_remove while the netdev is
still registered.

Tested on an MT7620N rev 2 eco 6 with 100BASE-T traffic, VLAN-aware
hardware bridging, 2026-byte MTU, FDB/MDB offload, pending STP state, and
driver unbind/rebind. The modular driver, tagger, package contents, DSA
image composition, and swconfig-only kernel configuration were also
verified.

An independent TP-Link Archer C5 v4 test exercised an external RTL8367S
DSA switch using the RTL8_4t tagger as a regression check on the shared
dsa_tag_protocol enum. It found no collision or external-switch
regression; it does not validate the MT7620 integrated-switch path.

Warm-reboot recovery was tested with the separate reset change from
openwrt#24724 applied and is not claimed by this DSA commit.

Link: openwrt#24242
Link: openwrt#24724
Signed-off-by: Gleb Pesin <[email protected]>
dormancygrace added a commit to dormancygrace/openwrt that referenced this pull request Aug 18, 2026
Add a DSA driver for the seven-port switch integrated in MT7620. Keep
the existing swconfig path for device trees without a DSA ports node.

Use RXD4 source-port and TXD4 forced-port metadata with the Ralink DSA
tagger. The programming guide places TXD4 FP_BMAP at bits 27:20; use
that layout instead of the stale unused bits 26:19 definition.

Implement bridge isolation and STP, VLAN filtering, FDB and MDB offload,
ageing, flood controls, phylink, MTU limits, and software-extended
hardware MIB counters. DSA invokes port_stp_state_set() before updating
its cached state, so pass the pending callback state as an override when
recalculating port matrices instead of leaving hardware one transition
behind.

Correct the shared switch MIB enable register and enable all seven port
counters. The old address was inside port 0 counter space, so this also
fixes legacy swconfig initialization.

Register DSA through a bound child of the frame-engine device. This gives
the managed conduit device link the correct lifetime across driver unbind
and reprobe while the switch registers remain owned by the existing GSW
platform device.

Package the driver and tagger as kmod-dsa-mt7620 for per-device opt-in.
This keeps DSA and switchdev out of swconfig-only MT7620 images and
prevents installing the DSA package together with swconfig.

Also make MDIO and frame-engine teardown safe for deferred probes and
runtime reprobes. Replace the legacy MDIO busy loop and -1 return with
readl_poll_timeout_atomic() and its real error, and reset a still-busy
frame engine before freeing DMA rings. Resolve FE and ESW resets by name
so recovery can reset FE alone, and warn if a switch node provides
neither named reset.

The FE-only reset is a stop-path fallback when DMA fails to quiesce
before its rings are freed. It does not recover network blocks left stale
across a system restart; that separate condition is handled by the reset
change linked below.

The netdev is devm-managed, so leave NAPI deletion to free_netdev after
unregister instead of deleting NAPI from fe_remove while the netdev is
still registered.

Tested on an MT7620N rev 2 eco 6 with 100BASE-T traffic, VLAN-aware
hardware bridging, 2026-byte MTU, FDB/MDB offload, pending STP state, and
driver unbind/rebind. The modular driver, tagger, package contents, DSA
image composition, and swconfig-only kernel configuration were also
verified.

An independent TP-Link Archer C5 v4 test exercised an external RTL8367S
DSA switch using the RTL8_4t tagger as a regression check on the shared
dsa_tag_protocol enum. It found no collision or external-switch
regression; it does not validate the MT7620 integrated-switch path.

Warm-reboot recovery was tested with the separate reset change from
openwrt#24724 applied and is not claimed by this DSA commit.

Link: openwrt#24242
Link: openwrt#24724
Signed-off-by: Gleb Pesin <[email protected]>
Vladdrako pushed a commit to Vladdrako/openwrt that referenced this pull request Aug 22, 2026
MAX_RX_PKT_LEN value 2 selects 1552-byte frames, not jumbo mode.
Select value 3 so the configured 2 KiB frames are actually accepted by
the switch.

Tested on a ZBT-WE826 (MT7620). With value 2, 1534-byte IPv4
packets pass while 1535-byte packets are dropped. With value 3,
1792-byte and 1800-byte DF IPv4 packets pass.

Fixes: d083212 ("ramips: ethernet: ralink: mt7620 enable jumbo frames")
Signed-off-by: Gleb Pesin <[email protected]>
Link: openwrt#24242
Signed-off-by: Jonas Jelonek <[email protected]>
Quarx2k pushed a commit to Quarx2k/OpenWRT-BE7000 that referenced this pull request Sep 22, 2026
MAX_RX_PKT_LEN value 2 selects 1552-byte frames, not jumbo mode.
Select value 3 so the configured 2 KiB frames are actually accepted by
the switch.

Tested on a ZBT-WE826 (MT7620). With value 2, 1534-byte IPv4
packets pass while 1535-byte packets are dropped. With value 3,
1792-byte and 1800-byte DF IPv4 packets pass.

Fixes: bb0d9ca ("ramips: ethernet: ralink: mt7620 enable jumbo frames")
Signed-off-by: Gleb Pesin <[email protected]>
Link: openwrt/openwrt#24242
Signed-off-by: Jonas Jelonek <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kernel pull request/issue with Linux kernel related changes target/ramips pull request/issue for ramips target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants