mbox series

[net-next,0/4] net: add atomic dev->stats infra

Message ID 20221115085358.2230729-1-edumazet@google.com (mailing list archive)
Headers show
Series net: add atomic dev->stats infra | expand

Message

Eric Dumazet Nov. 15, 2022, 8:53 a.m. UTC
Long standing KCSAN issues are caused by data-race around
some dev->stats changes.

Most performance critical paths already use per-cpu
variables, or per-queue ones.

It is reasonable (and more correct) to use atomic operations
for the slow paths.

First patch adds the infrastructure, then three patches address
the most common paths that syzbot is playing with.

Eric Dumazet (4):
  net: add atomic_long_t to net_device_stats fields
  ipv6/sit: use DEV_STATS_INC() to avoid data-races
  ipv6: tunnels: use DEV_STATS_INC()
  ipv4: tunnels: use DEV_STATS_INC()

 include/linux/netdevice.h | 58 +++++++++++++++++++++++----------------
 include/net/dst.h         |  5 ++--
 net/core/dev.c            | 14 ++--------
 net/ipv4/ip_gre.c         | 10 +++----
 net/ipv4/ip_tunnel.c      | 32 ++++++++++-----------
 net/ipv4/ip_vti.c         | 20 +++++++-------
 net/ipv4/ipip.c           |  2 +-
 net/ipv4/ipmr.c           | 12 ++++----
 net/ipv6/ip6_gre.c        | 11 +++-----
 net/ipv6/ip6_tunnel.c     | 26 ++++++++----------
 net/ipv6/ip6_vti.c        | 16 +++++------
 net/ipv6/ip6mr.c          | 10 +++----
 net/ipv6/sit.c            | 22 +++++++--------
 13 files changed, 117 insertions(+), 121 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Nov. 16, 2022, 1:30 p.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Tue, 15 Nov 2022 08:53:54 +0000 you wrote:
> Long standing KCSAN issues are caused by data-race around
> some dev->stats changes.
> 
> Most performance critical paths already use per-cpu
> variables, or per-queue ones.
> 
> It is reasonable (and more correct) to use atomic operations
> for the slow paths.
> 
> [...]

Here is the summary with links:
  - [net-next,1/4] net: add atomic_long_t to net_device_stats fields
    https://git.kernel.org/netdev/net-next/c/6c1c5097781f
  - [net-next,2/4] ipv6/sit: use DEV_STATS_INC() to avoid data-races
    https://git.kernel.org/netdev/net-next/c/cb34b7cf17ec
  - [net-next,3/4] ipv6: tunnels: use DEV_STATS_INC()
    https://git.kernel.org/netdev/net-next/c/2fad1ba354d4
  - [net-next,4/4] ipv4: tunnels: use DEV_STATS_INC()
    https://git.kernel.org/netdev/net-next/c/c4794d22251b

You are awesome, thank you!