]> git.dujemihanovic.xyz Git - linux.git/commit
vxlan: Fix racy device stats updates.
authorGuillaume Nault <gnault@redhat.com>
Fri, 26 Apr 2024 15:27:17 +0000 (17:27 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 29 Apr 2024 12:39:15 +0000 (13:39 +0100)
commit6dee402daba4eb8677a9438ebdcd8fe90ddd4326
tree73a0067c93be58ed4a8cb57ffc68effca6bd70cd
parentb867247555c4181bf84eb10b72b176862c29112d
vxlan: Fix racy device stats updates.

VXLAN devices update their stats locklessly. Therefore these counters
should either be stored in per-cpu data structures or the updates
should be done using atomic increments.

Since the net_device_core_stats infrastructure is already used in
vxlan_rcv(), use it for the other rx_dropped and tx_dropped counter
updates. Update the other counters atomically using DEV_STATS_INC().

Fixes: d342894c5d2f ("vxlan: virtual extensible lan")
Signed-off-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vxlan/vxlan_core.c