netdev_stat_queue_sum(9)
β¨ netdev_stat_queue_sum(9) β¨
okay so this is a page from the Kernel API Manual and honestly? it's a little baddie for adding up queue stats π like literally the whole point is summing stats across a range of queues and it ate.
πΈ NAME πΈ
netdev_stat_queue_sum β add up queue stats from range of queues π
π¦ SYNOPSIS π¦
void netdev_stat_queue_sum (struct net_device *netdev , int rx_start ,
int rx_end , struct netdev_queue_stats_rx *rx_sum , int tx_start , int
tx_end , struct netdev_queue_stats_tx *tx_sum );
π ARGUMENTS π
netdevβ anet_device. that's it, that's the whole vibe π«Άrx_startβ index of the first Rx queue you wanna query β¨rx_endβ index after the last Rx queue, i.e. the first one you're not querying. yes the not is doing numbers there πrx_sumβ output Rx stats, and ngl it should be already initialized before you hand it over π§tx_startβ index of the first Tx queue to query πtx_endβ index after the last Tx queue, again the first one not to query πtx_sumβ output Tx stats, should be already initialized too, fr fr β
π DESCRIPTION π
So what it does: it adds stats from the [start, end) range of queue IDs into the *x_sum structs π and bestie, those sum structs must be already initialized β no cap, don't come in there with uninitialized structs π
Usually this helper gets invoked from the .get_base_stats callbacks of drivers to account for stats of disabled queues π in that case the ranges are usually [netdev->real_num_*x_queues, netdev->num_*x_queues) β iconic behaviour honestly π₯
π SEE ALSO π
- Kernel file
./net/core/netdev-genl.cβ go read it, iykyk π¦
k bye bestie, mwah π«Άπ this cutie lives in ./net/core and the version is dated October 2026 β 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