linux/drivers/net/ipvlan
Eric Dumazet 30e77e3ee9 ipvlan: properly track tx_errors
[ Upstream commit ff672b9ffe ]

Both ipvlan_process_v4_outbound() and ipvlan_process_v6_outbound()
increment dev->stats.tx_errors in case of errors.

Unfortunately there are two issues :

1) ipvlan_get_stats64() does not propagate dev->stats.tx_errors to user.

2) Increments are not atomic. KCSAN would complain eventually.

Use DEV_STATS_INC() to not miss an update, and change ipvlan_get_stats64()
to copy the value back to user.

Fixes: 2ad7bf3638 ("ipvlan: Initial check-in of the IPVLAN driver.")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Mahesh Bandewar <maheshb@google.com>
Link: https://lore.kernel.org/r/20231026131446.3933175-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2023-11-20 11:51:55 +01:00
..
ipvlan.h ipvlan: hold lower dev to avoid possible use-after-free 2022-11-18 10:39:22 +00:00
ipvlan_core.c ipvlan: properly track tx_errors 2023-11-20 11:51:55 +01:00
ipvlan_l3s.c ipvlan: fix bound dev checking for IPv6 l3s mode 2023-06-21 16:01:00 +02:00
ipvlan_main.c ipvlan: properly track tx_errors 2023-11-20 11:51:55 +01:00
ipvtap.c net: ipvtap - add __init/__exit annotations to module init/exit funcs 2022-08-23 15:45:53 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00