]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ovpn: disable BHs when updating device stats
authorRalf Lici <ralf@mandelbit.com>
Wed, 13 May 2026 13:26:10 +0000 (15:26 +0200)
committerAntonio Quartulli <antonio@openvpn.net>
Thu, 14 May 2026 22:43:55 +0000 (00:43 +0200)
commit0c0dddc07d272a8d25922e48041e8e4d2434df7e
treeb00d527788abb88a01632fd0d7e94210da728e54
parent982422b11e6f95f766a8cd2c2b1cbdb77e234a61
ovpn: disable BHs when updating device stats

ovpn updates dev->dstats from both process and softirq contexts. In
particular, TCP paths may run from socket callbacks, workqueues or
strparser work, while UDP receive and ovpn's ndo_start_xmit path may
update the same per-device dstats from BH context.

Add ovpn device drop-stat helpers that disable BHs around
dev_dstats_rx_dropped() and dev_dstats_tx_dropped(), and use them for
drop accounting.

The successful RX dev_dstats_rx_add() update is already covered by the
BH-disabled section around gro_cells_receive(). For the successful TCP
TX dev_dstats_tx_add() update, replace the existing preempt-disabled
section with a BH-disabled one.

Fixes: 11851cbd60ea ("ovpn: implement TCP transport")
Signed-off-by: Ralf Lici <ralf@mandelbit.com>
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
drivers/net/ovpn/io.c
drivers/net/ovpn/stats.h
drivers/net/ovpn/tcp.c
drivers/net/ovpn/udp.c