[PATCH] net/af_packet: cache align Rx/Tx structs
Stephen Hemminger
stephen at networkplumber.org
Wed Apr 24 21:13:30 CEST 2024
On Wed, 24 Apr 2024 18:50:50 +0100
Ferruh Yigit <ferruh.yigit at amd.com> wrote:
> > I don't know how slow af_packet is, but if you care about performance,
> > you don't want to use atomic add for statistics.
> >
>
> There are a few soft drivers already using atomics adds for updating stats.
> If we document expectations from 'rte_eth_stats_reset()', we can update
> those usages.
Using atomic add is lots of extra overhead. The statistics are not guaranteed
to be perfect. If nothing else, the bytes and packets can be skewed.
The soft drivers af_xdp, af_packet, and tun performance is dominated by the
overhead of the kernel system call and copies. Yes, alignment is good
but won't be noticeable.
More information about the dev
mailing list