From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 63DE43264DE for ; Tue, 28 Apr 2026 16:33:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777394012; cv=none; b=JXW6Lxj1+x4sQ2WZj0JFCvo1r3Hn+aTYyRksVbKhNaxz1yIhOoiA/C3OuPtIvKnwTwPLO53mjb89DSy1CxsFo0MuxcqcLzPGurQ7azrTeydbqz83XUGTaajayMIehAyXTj5o/yfSTk3iiSztCLV+POCX9UeRxiaC51wiavtjr1Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777394012; c=relaxed/simple; bh=68AUE+rNo6vS7Yl5grOwzZobGoIdJ5ntoXAFGiShIiQ=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=WqKfeIbytfAvOvm+64mbqF04KHj8Ic+HqeTL6Q79CmYBWlBKDok6U3hCNAZzZFFXjZ/yB+s+LcyinVBZPJSSIFYedxPysMF5JKcLGk9g5kEL5ejiiVQo1U7/1POW6uQe2/2SgS8jQUhxYURRre9SctQ/FAyeLq405ngUSfLdPpU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=ZEih+yr8; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="ZEih+yr8" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id A71191A3455; Tue, 28 Apr 2026 16:33:26 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 71E88601D0; Tue, 28 Apr 2026 16:33:26 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 138D510728EC7; Tue, 28 Apr 2026 18:33:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1777394000; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding; bh=RLmfpWDoWjVy/iLit4ugD0dmNcaraSoRaKNFKWYi+xg=; b=ZEih+yr8bYPQOvySc9JN60576r04K6RRgxPf+V7cnSPcA4iPnSZOMsjY7k20peS9Nm4QLj O3dPK2ulrbLD0tWUVavnnOtYDa6mn6ZMzrkKMzDn9IIrKZ1KfflHs3X7bJcp8k9NDd9ID4 NmiiQRLh1R1W3LsyLD478CrMEWAO84xDF2pni/nW6hU1aetLv/LMBXkC0R8bBiyLnw5CoC JB+FxJ96saRPeyJwmssEcgZSwvM6oBgbS4okhXdg1QUqjaGb0omHu6m0pA0MAcfTJ5QlF7 Ztx2SJt+5bji+A6YGjbSMaRyPQ9MdTVGagU6JSSMHSIu5phQ2xXT1e+g+OvDbA== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Subject: [PATCH net v2 0/4] Drop in-flight Tx SKBs on MACB close Date: Tue, 28 Apr 2026 18:32:56 +0200 Message-Id: <20260428-macb-drop-tx-v2-0-647f5199d8df@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-B4-Tracking: v=1; b=H4sIAAAAAAAC/1WNwQ6CMBBEf8Xs2TWloEVP/ofhQNtF1khL2kowh H8X0IvHmbx5M0GkwBThspsg0MCRvVuC3O/AtLW7E7JdMkghT6KQOXa10WiD7zGN2JwNKamksOI Iy6QP1PC46W7gKEH1LeNLP8ikVbRiLcfkw3s7HbIN/vmLf/+QYYY6J6NVqWxZ2Kv2Pj3ZHYzvo Jrn+QNdSuniwQAAAA== X-Change-ID: 20260423-macb-drop-tx-f9ce72720d05 To: Nicolas Ferre , Claudiu Beznea , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Haavard Skinnemoen , Jeff Garzik Cc: Paolo Valerio , Conor Dooley , Nicolai Buchwitz , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Vladimir Kondratiev , Gregory CLEMENT , =?utf-8?q?Beno=C3=AEt_Monin?= , Tawfik Bayouk , Thomas Petazzoni , Maxime Chevallier , =?utf-8?q?Th=C3=A9o_Lebrun?= , stable@vger.kernel.org X-Mailer: b4 0.15.2 X-Last-TLS-Session-Version: TLSv1.3 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). Last two patches are to fix stats reporting on dropped codepaths. --- 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 To: Claudiu Beznea To: Andrew Lunn To: "David S. Miller" To: Eric Dumazet To: Jakub Kicinski To: Paolo Abeni To: Haavard Skinnemoen To: Jeff Garzik Cc: Paolo Valerio Cc: Conor Dooley Cc: Nicolai Buchwitz Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev Cc: Gregory CLEMENT Cc: Benoît Monin Cc: Tawfik Bayouk Cc: Thomas Petazzoni Cc: Maxime Chevallier Signed-off-by: Théo Lebrun --- Théo Lebrun (4): net: macb: give reasons for Tx SKB kfree net: macb: drop in-flight Tx SKBs on close net: macb: increment stats.tx_dropped on tx error net: macb: increment stats.tx_dropped on DMA map error drivers/net/ethernet/cadence/macb_main.c | 57 +++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 9 deletions(-) --- base-commit: e3684df8e778a9988b7f7a84e08daea8019b661e change-id: 20260423-macb-drop-tx-f9ce72720d05 Best regards, -- Théo Lebrun