mxl862xx_stats_poll(9)
π mxl862xx_stats_poll β¨
okay so bestie, you know the kernel API manual mxl862xx_stats_poll(9)? we're doing a whole deep dive on it rn and honestly it's lowkey iconic π
πΈ NAME πΈ
mxl862xx_stats_poll β Read RMON counters and accumulate into 64-bit stats π
fr fr that's the whole vibe: you read the counters, you add 'em up into 64-bit stats. no cap.
β¨ SYNOPSIS β¨
void mxl862xx_stats_poll (struct dsa_switch *ds , int port );
literally that's it. two args, void return, she's clean π«Ά
π¦ ARGUMENTS π¦
dsβ the DSA switch π like, the actual switch object we're working withportβ port index π which port we're polling, bestie
π₯ DESCRIPTION π₯
okay so here's the tea β the firmware RMON counters are free-running 32-bit values β except the byte counters, those are 64-bit, main character energy π
this function reads the hardware via MDIO (and yes, it may sleep, so don't be weird about it π΄), computes deltas from the previous snapshot, and accumulates them into 64-bit per-port stats β all of it under a spinlock π
and here's the part where it gets cute: this is called only from the stats polling workqueue β serialized by the single-threaded delayed_work, so no MDIO locking is needed here π like, the design already handled it, we're just vibing πΈ
β οΈ quick vibe check: it may sleep (MDIO, remember?) β so respect that, bestie. and don't go calling it from random contexts. the workqueue is the whole point π
π§ SEE ALSO π§
- Kernel file
./drivers/net/dsa/mxl862xx/mxl862xx.cβ go read the source, iykyk ππ
aaand that's the page, bestie!! π sign-off time: this one lives under ./drivers/net/dsa/mxl862xx, dated October 2026, and it's literally mxl862xx_stats_poll(9) β slay, periodt π
β¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms