linux/tools/net/ynl
Jakub Kicinski c61a375315 tools: ynltool: add qstats analysis for HW-GRO efficiency / savings
Extend ynltool to compute HW GRO savings metric - how many
packets has HW GRO been able to save the kernel from seeing.

Note that this definition does not actually take into account
whether the segments were or weren't eligible for HW GRO.
If a machine is receiving all-UDP traffic - new metric will show
HW-GRO savings of 0%. Conversely since the super-packet still
counts as a received packet, savings of 100% is not achievable.
Perfect HW-GRO on a machine with 4k MTU and 64kB super-frames
would show ~93.75% savings. With 1.5k MTU we may see up to
~97.8% savings (if my math is right).

Example after 10 sec of iperf on a freshly booted machine
with 1.5k MTU:

  $ ynltool qstats show
  eth0     rx-packets:  40681280               rx-bytes:   61575208437
        rx-alloc-fail:         0      rx-hw-gro-packets:       1225133
                                 rx-hw-gro-wire-packets:      40656633
  $ ynltool qstats hw-gro
  eth0: 96.9% savings

None of the NICs I have access to can report "missed" HW-GRO
opportunities so computing a true "effectiveness" metric
is not possible. One could also argue that effectiveness metric
is inferior in environments where we control both senders and
receivers, the savings metrics will capture both regressions
in receiver's HW GRO effectiveness but also regressions in senders
sending smaller TSO trains. And we care about both. The main
downside is that it's hard to tell at a glance how well the NIC
is doing because the savings will be dependent on traffic patterns.

Reviewed-by: Petr Machata <petrm@nvidia.com>
Link: https://patch.msgid.link/20260207003509.3927744-4-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-02-09 21:08:32 -08:00
..
generated tools: ynl: enable codegen for TC 2025-05-21 12:38:23 -07:00
lib tools: ynl: fix string attribute length to include null terminator 2025-10-27 16:47:29 -07:00
pyynl tools: ynl: cli: make the output compact 2026-02-02 17:06:14 -08:00
samples ynl: samples: Fix spelling mistake "failedq" -> "failed" 2025-12-01 11:54:09 -08:00
tests tools: ynl: add YNL test framework 2025-11-26 17:58:49 -08:00
ynltool tools: ynltool: add qstats analysis for HW-GRO efficiency / savings 2026-02-09 21:08:32 -08:00
Makefile tools/net/ynl: Makefile's install target now installs ynltool 2026-01-20 17:10:50 -08:00
Makefile.deps tools: ynl: fix build on systems with old kernel headers 2025-12-08 23:53:17 -08:00
pyproject.toml tools: ynl: add initial pyproject.toml for packaging 2025-01-09 12:53:27 -08:00
requirements.txt tools: ynl: add the Python requirements.txt file 2023-03-24 19:11:02 -07:00
ynl-regen.sh tools: ynl: Specify --no-line-number in ynl-regen.sh. 2026-01-17 16:00:23 -08:00