diff options
| author | Koichiro Den <den@valinux.co.jp> | 2026-08-20 02:25:39 +0900 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-09-07 17:18:21 +0200 |
| commit | b4b41c08ebc28f792539b54d5f0f688cb272585c (patch) | |
| tree | b60066ac48adc1c64236c23d6bf3ef514c3f76e4 | |
| parent | 69c676d7b090e1e294872616270536ca60c31c9e (diff) | |
| download | linux-b4b41c08ebc28f792539b54d5f0f688cb272585c.tar.gz linux-b4b41c08ebc28f792539b54d5f0f688cb272585c.zip | |
net: ntb_netdev: Count packets dropped on RX refill failure
commit 31ded341c375bb2faac1d77ab0012a732ba3e2a6 upstream.
When replacement skb allocation fails, ntb_netdev drops a packet that
was received successfully and requeues the original buffer. The drop is
counted, but rx_packets and rx_bytes are not.
Count every good packet before allocating its replacement.
Fixes: d2121faf133a ("NTB: ntb_netdev: Preserve RX queue depth on allocation failure")
Cc: stable@vger.kernel.org
Signed-off-by: Koichiro Den <den@valinux.co.jp>
Link: https://patch.msgid.link/20260819172539.1450821-3-den@valinux.co.jp
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/net/ntb_netdev.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ntb_netdev.c b/drivers/net/ntb_netdev.c index e727b51eb69d..ec5c6be87446 100644 --- a/drivers/net/ntb_netdev.c +++ b/drivers/net/ntb_netdev.c @@ -115,6 +115,9 @@ static void ntb_netdev_rx_handler(struct ntb_transport_qp *qp, void *qp_data, goto enqueue_again; } + ndev->stats.rx_packets++; + ndev->stats.rx_bytes += len; + new_skb = netdev_alloc_skb(ndev, ndev->mtu + ETH_HLEN); if (!new_skb) { ndev->stats.rx_dropped++; @@ -126,8 +129,6 @@ static void ntb_netdev_rx_handler(struct ntb_transport_qp *qp, void *qp_data, skb->ip_summed = CHECKSUM_NONE; netif_rx(skb); - ndev->stats.rx_packets++; - ndev->stats.rx_bytes += len; skb = new_skb; |
