iavf_add_ethtool_stats(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… iavf_add_ethtool_stats(9) β€” Kernel API Manual, bestie edition ✨

Okay so picture this: you're deep in the Kernel API Manual (yes that's the whole manual name, we're fancy) and you find this little icon. It's iavf_add_ethtool_stats, and honestly? It's a vibe. Let me tell you everything about it, no gatekeeping.


πŸŽ€ NAME πŸŽ€

iavf_add_ethtool_stats β€” copy stats into an ethtool-supplied buffer. That's the whole job. It copies. Stats. Into the buffer ethtool handed you. Slay. πŸ’–


✨ SYNOPSIS ✨

iavf_add_ethtool_stats (data , pointer , stats );

Literally that. Three things in, magic out. πŸͺ„


🫢 ARGUMENTS 🫢

  • data β€” the ethtool stats buffer, aka the lil container everything gets copied into πŸŽ€
  • pointer β€” the location where the stats are stored, i.e. where the actual numbers live rn πŸ“
  • stats β€” a static const array of stat definitions, the blueprint of what counts as a stat πŸ‘‘

🌸 DESCRIPTION 🌸

So this is a macro, and its whole purpose in life is to make using __iavf_add_ethtool_stats easier. How? By taking your static constant stats array and passing in the ARRAY_SIZE for you. It's giving "protective best friend who does the annoying math so you don't have to." 🧚

The reason that matters: it avoids typos by making sure the size you pass is actually the size that belongs to that specific stats array. No mismatched sizes, no accidental chaos. Periodt. πŸ’…

⚠️ But listen β€” the parameter stats is evaluated twice. Twice!! So if you were thinking about passing something with side effects, don't. Like, genuinely don't. Parameters with side effects should be avoided, that's the whole warning, I'm not being dramatic, okay maybe a little dramatic but the rule stands πŸ˜­πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

The kernel file that started it all: ./drivers/net/ethernet/intel/iavf/iavf_ethtool.c, and the struct iavf_stats(9). Plus, an absolutely stacked cast of co-stars β€” every single one, in order, because we don't skip anyone in this house πŸ‘‘

Like, an entire friend group. Go say hi to all of them πŸ¦‹


and that's the whole page bestie!! delivered to you straight from the source ./drivers/net/ethernet/intel/iavf, stamped October 2026 β€” mwah, love u, go read the kernel source, bye πŸ’œπŸŽ€βœ¨

πŸ“¦ where this page comes from