NTB: ntb_netdev: Preserve RX queue depth on allocation failure
authorKoichiro Den <den@valinux.co.jp>
Thu, 6 Aug 2026 03:25:37 +0000 (12:25 +0900)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 11 Aug 2026 09:04:55 +0000 (11:04 +0200)
commitd2121faf133ac3bf9531b53a7e21273649a08517
tree7a488fea4d6cd75828277ec6f6b6e50578fba68c
parentf1b3416ceaf7ca4cb5cbd986ee8fe3ffaeda2d48
NTB: ntb_netdev: Preserve RX queue depth on allocation failure

ntb_netdev_rx_handler() hands the received skb to the network stack
before allocating its replacement. If the allocation fails, nothing is
reposted. Every failure therefore takes one buffer out of the RX queue
while the interface remains up, and enough failures eventually stall
reception.

A retry path could refill the queue later, but ntb_netdev has none.
Allocate the replacement first instead. If that fails, drop the packet
and repost the same skb. This keeps the queue full and lets packet
delivery resume as soon as memory is available again.

Fixes: 548c237c0a99 ("net: Add support for NTB virtual ethernet device")
Cc: stable@vger.kernel.org
Signed-off-by: Koichiro Den <den@valinux.co.jp>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Link: https://patch.msgid.link/20260806032537.3526498-1-den@valinux.co.jp
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ntb_netdev.c