| From 82e15be2d8b9efa6fb1750528d9b6f40e6a8eea7 Mon Sep 17 00:00:00 2001 |
| From: Koichiro Den <den@valinux.co.jp> |
| Date: Thu, 20 Aug 2026 02:25:38 +0900 |
| Subject: net: ntb_netdev: Avoid double-accounting netif_rx() drops |
| |
| From: Koichiro Den <den@valinux.co.jp> |
| |
| commit 82e15be2d8b9efa6fb1750528d9b6f40e6a8eea7 upstream. |
| |
| netif_rx() already accounts packets it drops in the core rx_dropped |
| counter. ntb_netdev counts them again as both errors and drops. |
| |
| Leave netif_rx() drops to the core. Count the packet and bytes |
| unconditionally since it was received successfully by the driver. |
| |
| Fixes: 548c237c0a99 ("net: Add support for NTB virtual ethernet device") |
| Cc: stable@vger.kernel.org |
| Suggested-by: Jakub Kicinski <kuba@kernel.org> |
| Signed-off-by: Koichiro Den <den@valinux.co.jp> |
| Link: https://patch.msgid.link/20260819172539.1450821-2-den@valinux.co.jp |
| Signed-off-by: Jakub Kicinski <kuba@kernel.org> |
| Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| --- |
| drivers/net/ntb_netdev.c | 10 +++------- |
| 1 file changed, 3 insertions(+), 7 deletions(-) |
| |
| --- a/drivers/net/ntb_netdev.c |
| +++ b/drivers/net/ntb_netdev.c |
| @@ -125,13 +125,9 @@ static void ntb_netdev_rx_handler(struct |
| skb->protocol = eth_type_trans(skb, ndev); |
| skb->ip_summed = CHECKSUM_NONE; |
| |
| - if (netif_rx(skb) == NET_RX_DROP) { |
| - ndev->stats.rx_errors++; |
| - ndev->stats.rx_dropped++; |
| - } else { |
| - ndev->stats.rx_packets++; |
| - ndev->stats.rx_bytes += len; |
| - } |
| + netif_rx(skb); |
| + ndev->stats.rx_packets++; |
| + ndev->stats.rx_bytes += len; |
| |
| skb = new_skb; |
| |