rtl8169_start_xmit() can defer a transmit poll when xmit_more is set.
If a later skb fails preparation or DMA mapping, the shared error
path drops it without issuing that deferred poll. If the failed skb
ends the batch, previously committed packets can remain pending
until another packet or recovery path kicks the device.
Issue a transmit poll after cleaning up the failed skb so earlier
packets can make progress. The failed skb still does not advance
the producer index or contribute to BQL accounting.
Fixes: ef14358546b1 ("r8169: make use of xmit_more")
Assisted-by: LLM
Signed-off-by: iugfdin <redacted>
---
Tested with W=1 driver-target builds on net under x86-64
allmodconfig and allyesconfig, and source-executing ASan/UBSan
checks with modeled kernel/DMA/MMIO boundaries. No physical
Realtek NIC was available; this is not an on-device test claim.
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 045fcd4d..ae8ea0d8 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -4625,6 +4625,8 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
err_dma_0:
dev_kfree_skb_any(skb);
dev->stats.tx_dropped++;
+ /* Flush packets queued with xmit_more before this failure. */
+ rtl8169_doorbell(tp);
return NETDEV_TX_OK;
}