]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ipvlan: properly track tx_errors
authorEric Dumazet <edumazet@google.com>
Thu, 26 Oct 2023 13:14:46 +0000 (13:14 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 10:08:16 +0000 (11:08 +0100)
commit8fafac4073467152150a04cf4ed2f46c0adb1f71
tree5f83d7f18f8aa318cb11a4ece7575a881dedd3ed
parent3eedc19a9d0f522350b7fbd3d50eeb0e9a2885b7
ipvlan: properly track tx_errors

[ Upstream commit ff672b9ffeb3f82135488ac16c5c5eb4b992999b ]

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: 2ad7bf363841 ("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>
drivers/net/ipvlan/ipvlan_core.c
drivers/net/ipvlan/ipvlan_main.c