mxl862xx_stats_poll(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 with
  • port β€” 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