rte_eth_stats_get seems slow
Stephen Hemminger
stephen at networkplumber.org
Sat Apr 26 17:23:52 CEST 2025
On Fri, 25 Apr 2025 13:52:55 +0200
Morten Brørup <mb at smartsharesystems.com> wrote:
> Bruce,
>
> rte_eth_stats_get() on Intel NICs seems slow to me.
>
> E.g. getting the stats on a single port takes ~132 us (~451,000 CPU cycles) using the igb driver, and ~50 us using the i40e driver.
>
> Referring to the igb driver source code [1], it's 44 calls to E1000_READ_REG(), so the math says that each one takes 3 us (~10,000 CPU cycles).
>
> Is this expected behavior?
>
> It adds up, e.g. it takes a full millisecond to fetch the stats from eight ports using the igb driver.
>
> [1]: https://elixir.bootlin.com/dpdk/v24.11.1/source/drivers/net/e1000/igb_ethdev.c#L1724
>
>
> Med venlig hilsen / Kind regards,
> -Morten Brørup
>
Well reading each stat requires a PCI access. And PCI accesses are non-cached.
More information about the dev
mailing list