Repository navigation
ramips: mt7620: add DSA support for integrated switch - #24493
Conversation
35e0a88 to
86e2ae6
Compare
|
Many routers disable the built-in switch in the MT7620 and use external switches via RGMII with speeds of 1000 Mbps. These chips, such as the RTL8367S, can be configured in swconfig mode, and after recent updates, in DSA mode. Therefore, your changes require thorough verification to ensure they won't "break" the operation of these routers. Changes made in target/linux/ramips/mt7620/config-6.18 will also apply to these routers. Look at #19397 |
86e2ae6 to
a831a68
Compare
|
Thanks for pointing this out. Unfortunately, none of the MT7620 devices available to me use an external RGMII switch such as the RTL8367S, so I cannot perform hardware testing of that topology. The MT7620 devices I currently have available are:
All of them use the integrated MT7620 switch. This PR deliberately does not migrate any individual board to DSA. The new DSA path is selected only when the integrated switch node contains an enabled Nevertheless, testing on a device with an external RGMII switch would be valuable. I would be happy to provide test images and investigate any regressions if someone with suitable hardware can help with testing. |
|
A safer approach would be to make MT7620 DSA support optional (module-based) instead of enabling it target-wide in target/linux/ramips/mt7620/config-6.18. Suggested direction:
Why this helps:
|
a831a68 to
c2c335c
Compare
c2c335c to
69bb9ae
Compare
|
Thanks, addressed in 31c7e7b.
I verified the modular kernel build ( The D-Link DT/profile migration used for testing remains local and is not included in this PR. The parent now also keeps its DSA platform child registered until the modular driver loads, allowing normal late module binding without deferring the built-in frame-engine driver. A clean kernel rebuild passed with this load-order fix. |
69bb9ae to
31c7e7b
Compare
|
mt7620_gsw_dsa_init()/mt7620_gsw_dsa_cleanup() currently live in gsw_mt7620.c, which is always compiled when CONFIG_NET_RALINK_GSW_MT7620=y, regardless of whether CONFIG_NET_DSA_MT7620 is enabled. Two issues:
Proposed change:
This keeps the call site in soc_mt7620.c linking cleanly when CONFIG_NET_DSA_MT7620=n, and also fixes the silent infinite EPROBE_DEFER case for free: a DTS requesting DSA on a kernel without the DSA driver built in will now fail probe with a clear -ENODEV instead of hanging forever.
Summary: move the DSA init/cleanup glue into gsw_mt7620_dsa.c and add -ENODEV inline stubs under |
31c7e7b to
c20e372
Compare
|
Thanks. The disabled-configuration part is now addressed in c20e372. The current implementation no longer checks This revision additionally:
I kept the child-device registration in the built-in GSW core intentionally. With the frame-engine driver built in and Both configurations were rebuilt: the modular DSA build passed, and a ZBT-WE826 swconfig-only build passed with |
|
One more small thing, purely cosmetic: mt7620_gsw_dsa_device_register()/_unregister() and gsw_interrupt_mt7620_dsa() are now fully wrapped in #if IS_ENABLED(CONFIG_NET_DSA_MT7620), so they're effectively dead code in a plain swconfig build anyway. Might as well move them out of gsw_mt7620.c into gsw_mt7620_dsa.c where the rest of the DSA logic already lives — right now someone reading gsw_mt7620.c to work on the legacy swconfig path has to scroll past DSA-only code that's guarded out for them, which is a bit noisy. The declarations/stubs in gsw_mt7620.h can stay exactly as-is, only the function bodies would move. No functional change, just easier to follow which file owns what. |
|
Those functions need to stay on the built-in side of the module boundary. The supported configuration is The code left in Moving the helpers would therefore require a larger redesign (for example a runtime callback-registration interface), not a cosmetic file move. I would prefer to keep the current split. |
51b6506 to
1306ef7
Compare
openwrt-ai
left a comment
There was a problem hiding this comment.
Reviewed all 5 commits (first review of this PR, against 1306ef7). Substantial, well-tested work — most of what follows is about commit-message/diff hygiene rather than the DSA design itself. Inline comments cover the details.
Commit checks
b11fe4d"generic: add Ralink DMA metadata DSA tagger" — the subject scopes the change togeneric:, but the diff also edits four target patches (target/linux/ipq40xx/patches-6.18/701-*,target/linux/qualcommax/patches-6.18/0950-*,target/linux/realtek/patches-6.18/700-*and721-*). Those are just hunk-offset refreshes forced by inserting intoinclude/net/dsa.h, but the body doesn't say so, and nothing explains why value33was chosen over the next free number. Worth a sentence in the message.- FWIW the formality bot's warning about missing
From:/Date:/Subject:headers ontarget/linux/realtek/patches-6.18/721-net-dsa-add-support-for-tag-rtl-otto.patchis pre-existing in that file; this commit only shifted its hunk offsets.
- FWIW the formality bot's warning about missing
1306ef7"ramips: mt7620: add DSA support for integrated switch" — the message enumerates the teardown/lifetime fixes carefully but omits three hunks that change existing, non-DSA behaviour: theGSW_REG_MIB_CNT_ENregister address and enable-mask change (0x4000/BIT(1)→0x4800/GENMASK(30, 24)), which affectsmt7620_mac_init()on every swconfig MT7620 board; the split ofpriv->resetsinto by-name"fe"/"esw"reset controls; and the removal ofnetif_napi_del()fromfe_remove(). The first of those in particular looks like an independent bug fix that would be better as its own commit.
Commits 22bdd16, fdb1075 and a2167b3 match their diffs.
Generated by Claude Code
|
Good catch. Addressed in cc89efc. The MIB worker now uses two polling rates instead of increasing the cost for every port:
This leaves scheduling margin before the CPU port's 16-bit packet counters wrap at minimum-sized gigabit line rate while increasing the steady-state work from 70 to 110 port samples per second, rather than polling all seven ports five times more often. The worker still runs only while at least one user port is enabled, and the final full-port snapshot on stop is preserved. I also removed the warm-reset discussion and the jumbo/reset PR links from the integrated-switch commit message. The FE-only stop-path reset remains described because that code is part of this diff, but the separate system-restart recovery claim is gone. Validation on the exact updated head:
|
8a1ff71 to
cc89efc
Compare
|
For |
|
Agreed, updated in 69c659d. The CPU port remains at 20 ms, while the complete port set is now sampled every tenth tick (200 ms). That reduces the steady-state cost from 110 to 80 port samples per second and still leaves more than a 2x margin before a 100BASE-T port's 16-bit packet counter wraps at minimum-frame line rate. The exact updated head passed |
cc89efc to
69c659d
Compare
|
In my opinion, the 761-net-dsa-add-ralink-metadata-tagger.patch patch could be placed in target/linux/ramips/patches-6.18 as it only applies to the mt7620 soc, i.e. ramips. |
69c659d to
f6fda3c
Compare
|
Agreed. Moved in
The relocated ramips patch series applies cleanly through |
openwrt-ai
left a comment
There was a problem hiding this comment.
Re-reviewed the delta since my last pass (3c01d63..f6fda3c). The series was restructured from five commits to two: the three MIPS workaround/reset commits moved out to #24723 and #24724, and the tagger moved from target/linux/generic/pending-6.18/761-net-dsa-add-ralink-metadata-tagger.patch into the ramips target, so the commit is now scoped ramips: mt7620: and the ipq40xx/qualcommax/realtek offset refreshes are gone (those four files are byte-identical to main again). On top of that, the MIB worker gained the two-rate CPU/all-ports polling. Three inline comments, all on the relocated patch file; nothing blocking.
Things I checked and found correct, for the record:
- The relocated patch body is byte-identical to the old generic
761-patch apart from the addedMODULE_AUTHORline and the correspondingly bumped hunk count. Nothing was lost in the move, and no stalegeneric/pending-6.18file is left behind. - Putting a
net/dsa/patch in a targetpatches-<ver>directory is established practice — realtek718-net-dsa-add-support-for-rtl838x-switch.patch/721-...tag-rtl-otto.patchand ipq40xx701-net-dsa-add-out-of-band-tagging-protocol.patchdo exactly this. - The two-rate MIB polling is sound.
mt7620_gsw_setup()still seeds every port withMT7620_DSA_ALL_PORTSbeforemib_initializedflips to true, so the user ports'mib_lastis always valid when the every-tenth-tick full sweep runs 200 ms later;MT7620_DSA_ALL_PORTSincludes bit 6, so the CPU port never sees a gap longer than one 20 ms tick.mib_port_intervalsis touched only from the single delayed work item and fromsetup(), so the unlocked++is not racy, and the partially-filledraw[][]entries are only ever read under the samefor_each_set_bit()mask. for_each_set_bit()overint portagainst anunsigned longmask does not reintroduce a signed-compare issue, and the remainingint/unsigned intcomparisons intag_ralink.c(port < ds->num_ports,port < data->num_ports) only warn underW=3—scripts/Makefile.extrawarnadds-Wno-sign-comparefor everything below that.- No tag-protocol value collision in a ramips build: generic
760-08-...claims up to 31, and the two other patches claiming 32 (OOB,RTL_OTTO) live in ipq40xx/qualcommax/realtek and never apply here.
Both commit messages match their diffs — the tagger commit adds only the patch file, and the driver commit's message covers every hunk including the MIB register fix, the by-name FE/ESW resets, the readl_poll_timeout_atomic() conversion and the netif_napi_del() removal — so no commit-checks section this round.
CI on f6fda3c has no failures: all 26 check runs are success or skipped, including Check Kernel patches (ramips, mt7620) and every ramips subtarget kernel build. The single cancelled entry is a superseded build-pr-profile run from the previous push. Nothing CI-grounded.
Generated by Claude Code
f6fda3c to
9d3cb05
Compare
openwrt-ai
left a comment
There was a problem hiding this comment.
Re-reviewed the delta since my last pass (3c01d63..9d3cb05). The series shrank from five commits to two: the entropy/long-calls/reset commits moved out to #24723 and #24724, so what remains is the tagger plus the integrated-switch driver. The tree delta against my last review is the tagger patch relocation, the split MIB polling rate, and two MODULE_AUTHOR lines. One nit inline, nothing blocking.
Things I checked in the delta and found correct:
- Tagger relocation is a net improvement over the old
generic/pending-6.18placement. Moving totarget/linux/ramips/patches-6.18/761-*letsDSA_TAG_PROTO_RALINK_VALUEdrop from 33 to 32, which is exactly what the three existing target-local taggers already do —ipq40xx/patches-6.18/701-*andqualcommax/patches-6.18/0950-*both defineDSA_TAG_PROTO_OOB_VALUE 32, andrealtek/patches-6.18/721-*definesDSA_TAG_PROTO_RTL_OTTO_VALUE 32. Since only one target's kernel is built at a time, there is no collision, and the enum entry now sits in numeric order at the end of the list, so the patch-header paragraph justifying the out-of-order insertion is correctly gone. The four ipq40xx/qualcommax/realtek patch files are byte-identical tomainagain, and the Kconfig/Makefile insertions stay alphabetical (betweenQCAandRTL4_A). - Polling the CPU port is not dead work. DSA has no user netdev for port 6, but
dsa_conduit_get_ethtool_stats()callsds->ops->get_ethtool_stats(ds, cpu_dp->index, ...)at conduit.c:89-97, somib_stats[6][*]really is reachable throughethtool -Son the conduit. The 20 ms rate therefore protects counters a user can actually observe. - The partial-port update is safe.
mt7620_gsw_mib_update()iterates the samefor_each_set_bit(port, &ports, …)in both the read loop and the accumulate loop, so noraw[port][]slot is consumed uninitialised. The single globalmib_initializedflag is not a partial-init hazard either, because the only call that flips it from false to true is theMT7620_DSA_ALL_PORTSsweep inmt7620_gsw_setup(), which runs before the worker is ever scheduled.mib_port_intervalsis touched only by the single worker plus that same setup path. -Wsign-compareis not a concern for theint port/unsigned int num_portscomparisons intag_ralink.c: 6.18 only enables it atW=3(Makefile.extrawarn:201, with-Wno-sign-comparein the default path).
The 200 ms full-port interval versus the 440 ms wrap was raised and settled in the thread (#24493 comments of 2026-08-18), so I'm not re-opening it.
Both commit messages match their diffs — commit 1 is now correctly scoped ramips: mt7620: for a patch that lives under target/linux/ramips/, and commit 2 documents the 20 ms / 200 ms split — so no commit-checks section this round.
CI on 9d3cb05 has no failures: all 25 check runs are success or skipped, including Check Kernel patches (ramips, mt7620) (which is what would have caught a bad relocation), all five ramips subtarget kernel builds, and the three FormalityCheck jobs. Nothing CI-grounded.
Generated by Claude Code
9d3cb05 to
3ec27fd
Compare
openwrt-ai
left a comment
There was a problem hiding this comment.
Re-reviewed the delta since my last pass (3c01d63..3ec27fd). The series was restructured from five commits to two: 333/334 moved to #24723 and 335 to #24724, exactly as agreed in the thread, and the tagger moved from generic/pending-6.18/ into target/linux/ramips/patches-6.18/. Restricted to the twelve files this PR owns, the tree delta is small and I found no new issues; one nit inline.
What I checked in the delta:
- Tagger relocation and value change. The patch content is unchanged apart from dropping the now-obsolete value-33 placement paragraph, renumbering to
32, and addingMODULE_AUTHOR. The twoinclude/net/dsa.hhunks are now in numeric order afterMXL862_8021Q(31) rather than spliced next toNONE, which is only possible because the patch no longer has to keep the end-of-list context free for the ipq40xx/qualcommax/realtek patches.Check Kernel patches (ramips, mt7620)and all five ramips subtarget kernel builds are green on this head, so the new offsets apply cleanly. The four previously-refreshed target patches are byte-identical tomainagain. - Split-out commits are not prerequisites.
334-mt7620-use-long-calls.patchonly adds-mlong-callstodrivers/spi/spi.oandnet/ipv6/udp.o; neither the DSA driver nor the tagger depends on it, and335is the system-restart reset, which the PR body explicitly disclaims. Nothing this diff needs went out with them. - Two-rate MIB polling.
mib_port_intervalsis au8reset to 0 insetup()and only touched from the single work item, so no wrap and no locking gap.for_each_set_bit(port, &ports, MT7620_DSA_NUM_PORTS)withMT7620_DSA_ALL_PORTS = GENMASK(6, 0)stays insideraw[GSW_NUM_PORTS=7].mib_initializedis only ever set from a full sweep (setup()seeds every port before the worker can run), so the CPU-only ticks can never publish a delta against an unseededmib_last.port_disable()still does the final full sync aftercancel_delayed_work_sync(); not resettingmib_port_intervalsthere only means the first sweep after a re-enable can arrive early, which is harmless. - The fast CPU-port poll has a consumer.
dsa_conduit_get_ethtool_stats()callsds->ops->get_ethtool_stats(ds, port, ...)for the CPU port at conduit.c:96-97 (v6.18.44), so port 6's counters are surfaced on the conduit netdev rather than being computed and discarded. - The 200 ms full-sweep interval and the ~2x margin against the 100BASE-T wrap were settled in the thread, so not re-raising.
CI on 3ec27fd has no failures — all 25 check runs are success or skipped, including FormalityCheck / Code Patches and the ramips mt7620/mt7621/mt76x8/rt305x/rt3883 kernel builds. Nothing CI-grounded.
Both commit messages match their diffs, so no commit-checks section this round.
Generated by Claude Code
3ec27fd to
d654368
Compare
openwrt-ai
left a comment
There was a problem hiding this comment.
Re-reviewed the delta since my last pass (3c01d63..d654368). The series was restructured from five commits to two: the entropy-jal, long-calls and warm-restart-reset commits were split into #24723/#24724, leaving just the tagger and the DSA driver here. Reviewed against the PR's own base (f6bc2a3), the net contribution is the same two-commit DSA change, now rebased onto current main. No new issues found; nothing inline.
The tagger moved from a generic:-scoped patch to the ramips-local target/linux/ramips/patches-6.18/761-net-dsa-add-ralink-metadata-tagger.patch, and its protocol value changed 33 → 32. That resolves the whole 32/33 thread cleanly, and I confirmed it:
- Value 32 is in-order (next free after
DSA_TAG_PROTO_MXL862_8021Q_VALUE= 31) and is the onlyDSA_TAG_PROTO_*_VALUEadded undertarget/linux/ramips/patches-6.18/. Because the patch is now ramips-local rather than generic, it cannot coexist with the ipq40xx/qualcommaxOOBor realtekRTL_OTTOpatches that also claim 32 — those apply only in their own mutually-exclusive targets — so no collision, unlike the earlier generic form that needed 33 to dodge them. tag_ralink.cfollows the standardMETADATA_HW_PORT_MUXpattern (per-portmetadata_dst,skb_dst_set_norefon xmit); theralink_tag_connecterror path unwinds withwhile (port--) dst_release(...)correctly, andralink_tag_rcvreturning NULL is safe sincedsa_switch_rcv()frees the skb and this path is diagnostic-only.- kmod packaging is consistent:
kmod-dsa-mt7620selectsCONFIG_NET_DSA_MT7620+CONFIG_NET_DSA_TAG_RALINK, shipsgsw_mt7620_dsa.ko+tag_ralink.ko, andCONFLICTS:=swconfig.
The MIB polling design described in the driver commit message is now realised in code — mib_work samples the CPU port every 20 ms and the full port set every tenth tick (200 ms) via mib_port_intervals. That is correct: the 1000BASE-T CPU port (44 ms wrap) is read at 20 ms and the 100BASE-T user ports (440 ms wrap) at 200 ms, so no counter double-wraps between samples; the worker is single-threaded so the interval counter needs no locking, and setup()/port_disable() still do a full-port sync to keep baselines correct.
Both commit messages match their diffs, so no commit-checks section this round. CI on d654368 has no failures — the ramips/mt7620 build, Check Kernel patches (ramips, mt7620), and all three FormalityCheck jobs are green; everything else is success or skipped. Nothing CI-grounded.
Generated by Claude Code
The MT7620 frame engine selects the egress switch port in TXD4 and reports the ingress source port in RXD4. Add a DSA tagger which exchanges the port through METADATA_HW_PORT_MUX instead of modifying packet data. This preserves the frame payload and leaves descriptor encoding to the conduit driver. Keep the kernel patch in the ramips target because the tagger is specific to the MT7620 frame engine. Signed-off-by: Gleb Pesin <[email protected]> Link: openwrt#24493 Signed-off-by: Jonas Jelonek <[email protected]>
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. Poll the 1000BASE-T CPU port counters every 20 ms and the remaining ports every 200 ms to leave scheduling margin before their 16-bit packet counters wrap at minimum-sized line-rate traffic. 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, 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. Signed-off-by: Gleb Pesin <[email protected]> Link: openwrt#24493 Signed-off-by: Jonas Jelonek <[email protected]>
d654368 to
d0f9d21
Compare
|
Thanks! Rebased on top of main and merged! |
The MT7620 frame engine selects the egress switch port in TXD4 and reports the ingress source port in RXD4. Add a DSA tagger which exchanges the port through METADATA_HW_PORT_MUX instead of modifying packet data. This preserves the frame payload and leaves descriptor encoding to the conduit driver. Keep the kernel patch in the ramips target because the tagger is specific to the MT7620 frame engine. Signed-off-by: Gleb Pesin <[email protected]> Link: openwrt#24493 Signed-off-by: Jonas Jelonek <[email protected]>
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. Poll the 1000BASE-T CPU port counters every 20 ms and the remaining ports every 200 ms to leave scheduling margin before their 16-bit packet counters wrap at minimum-sized line-rate traffic. 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, 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. Signed-off-by: Gleb Pesin <[email protected]> Link: openwrt#24493 Signed-off-by: Jonas Jelonek <[email protected]>
|
I've now got MT7620 DSA working on the DAP-1620 A2 with this PR and I'd appreciate some review before I try to turn this into a proper OpenWrt PR. Openwrt forum link: DAP-1620 A2 - MT7620 DSA test (#24493): external port 5 and RGMII delays |
|
Review and feedback appreciated: ramips: mt7620: add DSA support for RGMII1 that is based on this PR. |
Summary
Add common DSA support for the seven-port switch integrated in MT7620 while preserving the existing swconfig path for device trees without a
portsnode.This PR deliberately migrates no individual boards. A board opts into DSA by describing the switch ports in DT and including
kmod-dsa-mt7620inDEVICE_PACKAGES; existing MT7620 devices continue using swconfig without building DSA or switchdev support.The data path uses the frame engine's descriptor metadata rather than an in-frame tag: TXD4 carries the forced egress bitmap and RXD4 reports the ingress source port. A ramips-local Ralink metadata tagger exchanges that information through
METADATA_HW_PORT_MUX.Series
The DSA instance is owned by a bound child of the frame-engine device. This gives the managed conduit device link the correct lifetime across driver unbind/reprobe. The series also fixes MDIO/frame-engine cleanup for deferred probes and reprobes.
The FE-only reset in
fe_stop()is deliberately limited to the teardown path where DMA did not quiesce before its rings are freed. It does not address stale network state across a system restart; that separate condition is handled by #24724.Testing
The unchanged DSA code was functionally tested on an MT7620N rev 2 eco 6 using a local, intentionally unsubmitted D-Link DWR-921 C1 DT migration:
sysupgrade -n, runtime Ethernet-driver unbind/rebind, and a hard power cycle;kmod-dsa-mt7620and noswconfig;NET_DSA,NET_DSA_MT7620,NET_DSA_TAG_RALINK, andNET_SWITCHDEVdisabled;The current two-commit series was also applied to
namiltd/openwrt#138and built from a clean tree. Its package manifest and 6,750,503-byte sysupgrade image remained identical; only the initramfs build metadata changed. The integrated-switch module is not selected by that external-switch profile.The earlier warm-reboot matrix included the reset change now split into #24724. Warm-reboot recovery is therefore not claimed by this DSA PR alone.
Related work
Hardware flow offload/PPE support is intentionally outside this PR.