iavf_add_ethtool_stats(9)
π 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 π
iavf_add_one_ethtool_stat(9)__iavf_add_ethtool_stats(9)iavf_add_queue_stats(9)__iavf_add_stat_strings(9)iavf_add_stat_strings(9)iavf_get_link_ksettings(9)iavf_get_sset_count(9)iavf_get_ethtool_stats(9)iavf_get_stat_strings(9)iavf_get_strings(9)iavf_get_msglevel(9)iavf_set_msglevel(9)iavf_get_drvinfo(9)iavf_get_ringparam(9)iavf_set_ringparam(9)__iavf_get_coalesce(9)iavf_get_coalesce(9)iavf_get_per_queue_coalesce(9)iavf_set_itr_per_queue(9)__iavf_set_coalesce(9)iavf_set_coalesce(9)iavf_set_per_queue_coalesce(9)iavf_fltr_to_ethtool_flow(9)iavf_ethtool_flow_to_fltr(9)iavf_is_mask_valid(9)iavf_parse_rx_flow_user_data(9)iavf_fill_rx_flow_ext_data(9)iavf_get_ethtool_fdir_entry(9)iavf_get_fdir_fltr_ids(9)iavf_add_fdir_fltr_info(9)iavf_add_fdir_ethtool(9)iavf_del_fdir_ethtool(9)iavf_set_rxnfc(9)iavf_get_rx_ring_count(9)iavf_get_rxnfc(9)iavf_get_channels(9)iavf_set_channels(9)iavf_get_rxfh_key_size(9)iavf_get_rxfh_indir_size(9)iavf_get_rxfh(9)iavf_set_rxfh(9)iavf_set_ethtool_ops(9)
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
- 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