[PATCH net v3 0/2] Drop in-flight Tx SKBs on MACB close
From: Théo Lebrun <theo.lebrun@bootlin.com>
Date: 2026-06-17 09:17:53
Also in:
lkml, stable
The first patch is here to allow giving a drop reason. We dissociate consumed packets from dropped ones that way. Second patch is the main one: it drops unsent packets on close. MACB driver forgot freeing its SKBs (and associated DMA mappings). --- Changes in v3: - Drop stats fixing. A proper fix deserves its own net-next refactoring series to migrate to netdev_stat_ops (ynltool uAPI), which will come in later. We keep the tx_dropped++ because they are safe as every other context is disabled when macb_free_consistent() is called. - Rebased to latest net/main (406e8a651a7b), nothing to report. - Link to v2: https://patch.msgid.link/20260428-macb-drop-tx-v2-0-647f5199d8df@bootlin.com Changes in v2: - Increment tx_dropped stat once per SKB, not once per frame. - Reset tx_head & tx_tail to avoid keeping stalled cursors. - Fix SKB dropped reasons throughout by adding the reason as parameter to macb_tx_unmap(). This is a new patch. Then the drop-all-on-close fix can use this ability to report we are not consuming SKBs. - Add increment to stats->tx_dropped on DMA mapping failure and tx_error_task. Done as separate patches (3 and 4). - Rebase upon net/main @ 46f74a3f7d57, nothing to report. - Link to v1: https://patch.msgid.link/20260424-macb-drop-tx-v1-1-b3ecb787d84d@bootlin.com To: Nicolas Ferre <nicolas.ferre@microchip.com> To: Claudiu Beznea <claudiu.beznea@tuxon.dev> To: Andrew Lunn <andrew+netdev@lunn.ch> To: "David S. Miller" <davem@davemloft.net> To: Eric Dumazet <edumazet@google.com> To: Jakub Kicinski <kuba@kernel.org> To: Paolo Abeni <pabeni@redhat.com> To: Haavard Skinnemoen <redacted> To: Jeff Garzik <redacted> To: Conor Dooley <conor.dooley@microchip.com> Cc: Paolo Valerio <redacted> Cc: Nicolai Buchwitz <redacted> Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev <vladimir.kondratiev@mobileye.com> Cc: Gregory CLEMENT <gregory.clement@bootlin.com> Cc: Benoît Monin <benoit.monin@bootlin.com> Cc: Tawfik Bayouk <redacted> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Maxime Chevallier <maxime.chevallier@bootlin.com> Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com> --- Théo Lebrun (2): net: macb: give reasons for Tx SKB kfree net: macb: drop in-flight Tx SKBs on close drivers/net/ethernet/cadence/macb_main.c | 46 +++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 9 deletions(-) --- base-commit: 712927eaa34199bb62cf370af591c0550ba977de change-id: 20260423-macb-drop-tx-f9ce72720d05 Best regards, -- Théo Lebrun [off-list ref]