[PATCH] net/af_packet: fix statistics

Stephen Hemminger stephen at networkplumber.org
Wed May 1 18:43:03 CEST 2024


On Wed, 1 May 2024 17:25:59 +0100
Ferruh Yigit <ferruh.yigit at amd.com> wrote:

> >  - Do not mark statistics as volatile.
> >    Instead, READ_ONCE() where necessary.
> >   
> 
> I did similar [1], and Mattias has some comments on it.
> Issue is not in the reader (stats_get) side. Without volatile writer
> (datapath thread) may end up *not* storing updated stats to memory.
> 
> For reader side, I expect value not been in the register when function
> called, so it ends up reading from memory, which doesn't require
> volatile casting.

These are per-queue stats, and anybody foolish enough to have multiple
threads sharing same queue without locking is playing with fire.
It is documented that DPDK PMD's don't support that.


More information about the dev mailing list