]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: natsemi: fix `rx_dropped` double accounting on `netif_rx()` failure
authorYeounsu Moon <yyyynoom@gmail.com>
Sat, 13 Sep 2025 06:01:36 +0000 (15:01 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Sep 2025 08:58:51 +0000 (10:58 +0200)
commit8f3c4d010f0a223c087347f56ee9af3eb3de73e4
treee5e51ccd9f28db4cde74447d934f8e56ae704614
parentf87aa706aaa42f7b281a971bd440b70f2062b1a1
net: natsemi: fix `rx_dropped` double accounting on `netif_rx()` failure

[ Upstream commit 93ab4881a4e2b9657bdce4b8940073bfb4ed5eab ]

`netif_rx()` already increments `rx_dropped` core stat when it fails.
The driver was also updating `ndev->stats.rx_dropped` in the same path.
Since both are reported together via `ip -s -s` command, this resulted
in drops being counted twice in user-visible stats.

Keep the driver update on `if (unlikely(!skb))`, but skip it after
`netif_rx()` errors.

Fixes: caf586e5f23c ("net: add a core netdev->rx_dropped counter")
Signed-off-by: Yeounsu Moon <yyyynoom@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250913060135.35282-3-yyyynoom@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/natsemi/ns83820.c