From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795043502; b=cYFxTVeLuxvcamLOy2pBwOUzPHkJWnV/P5/AKE4u29RfLeNLo3I7ZO0eJbS5OppJ3KM6 OkY7/KsKZThhMNV8fLihtXL4hd8CPf5WFi1tkDb7/kaaRgnfkVjagDJ4xI3R0nvoyM2xN SX2YiJelS848SFXC/UufCSJ8g/Z5dTblRW15JlxWiqcpi50aGRtwrmNzmt8IaYTTfCg88 N8IiW0pdAGVxJjmNgY+rg381oRK6afiZuLenyMjST0cs0cGc9Dqd5vZ6SYBfgUnSFfGKx WiJqFWKCy/SEwJleo0BF6hefZuSr3r3hdfb+EyDCT4f7tctWHQSn7KazzqheXYJpE5Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795043502; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=hIF89KtbdUTH9MskemhoLmumtGm3LX9+4fl/jDPhIlQ=; b=RINEdbNIDfp2tt2Bm5JVOxxQVSXb+o9KPll2SEY5UmVd5b1VwOhq9Z69UtrviviQ0hed XRMa3QDuU+DZrd8HCzbU0dDE92HB2xT6r/I107+hHeRZ7bWLQZIPNYQLzsUzVkXWPh/hr uCIwLpvo48khbClx9G4Vh737qKRXxl1Rf9u7JUdgj2PrtPb2E59bx4UF/5pFzlPCTcG45 Syq2CzLO4V0oZiOKEa3os4t22v4Odd72GGrdwRSpiYqElIwIfdAV8jZHPYSwXnoizt2C3 sh6OGFCU9gl1tbYwA2QVp9ihHhTKdD2iwwOnQfF8hQNXTcx3SrEJKqO7yCETwTB3pAA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=hMxdYgdZ; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A389606A32C; Wed, 18 Nov 2026 23:11:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=hMxdYgdZ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 945491F000C4; Wed, 18 Nov 2026 23:11:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795043502; bh=hIF89KtbdUTH9MskemhoLmumtGm3LX9+4fl/jDPhIlQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hMxdYgdZ2su50X9EDWpfNo334dMA9e1BLbgLKSGIEJujriss6Eh1b7jlnauqwI/jd ogNdUQnmOZew93s6Jcs9sC+Zx5m6+DaBlMvMlsOSheD4YxEtTsvbY77MODSQBDOvto 9pL8Bly4Q16elshhs9SSUIFWexsXh/zRMiSjYRyc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Johan Alvarado , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.1 0197/2857] net: stmmac: raise TX completion interrupt at the end of an xmit burst Date: Wed, 18 Nov 2026 15:20:31 +0100 Message-ID: <20261118150208.447479986@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150201.293410965@linuxfoundation.org> References: <20261118150201.293410965@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johan Alvarado [ Upstream commit d21a374995df9d7cfd193427748a19dcc87956a9 ] The TX mitigation logic only sets the Interrupt on Completion bit once every tx_coal_frames descriptors (STMMAC_TX_FRAMES = 25), with the tx_coal_timer hrtimer (STMMAC_COAL_TX_TIMER = 5000 us) as the only fallback. TX skbs are freed exclusively from the TX completion path, so any flow that keeps fewer than 25 frames in flight has all of its skbs held for up to 5 ms after transmission. Paced flows never queue enough frames to reach the frame threshold: TCP Small Queues caps the amount of unfreed data at roughly two pacing intervals worth, which at moderate pacing rates is only a couple of packets. Every small burst then stalls until the coalesce timer fires, and throughput collapses to approximately tsq_limit / tx_coal_timer regardless of link capacity. This is easily reproducible with BBR, which paces its output and thus keeps only a few frames in flight at a time. On a YT6801 (dwmac-motorcomm) equipped Orange Pi 5 Pro, a BBR upload over a ~23 ms RTT path is capped at 5.24 Mbit/s, while CUBIC reaches 207 Mbit/s on the same path. BBR measures the stalled send rate as the path bandwidth and locks its estimate near the floor, so the connection never recovers. Lowering the coalesce settings with ethtool -C (tx-usecs 100 tx-frames 1) lifts the same transfer to 447 Mbit/s, confirming the mechanism. Fix this by setting the IC bit on the last descriptor of every xmit burst, i.e. whenever netdev_xmit_more() reports that no further frames are pending in the current dequeue batch. Frame-based coalescing still applies within a burst, bulk traffic keeps batching through qdisc bulk dequeue and NAPI polling, and the coalesce timer becomes a pure fallback instead of the primary completion mechanism for lightly queued flows. tx-frames 0 keeps its meaning of timer-based mitigation only. Signed-off-by: Johan Alvarado Link: https://patch.msgid.link/20260731194522.55069-1-contact@c127.dev Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 4e427a2f0a7c6..4f8459f1e618d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -4244,6 +4244,8 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev) set_ic = true; else if (!priv->tx_coal_frames[queue]) set_ic = false; + else if (!netdev_xmit_more()) + set_ic = true; else if (tx_packets > priv->tx_coal_frames[queue]) set_ic = true; else if ((tx_q->tx_count_frames % @@ -4502,6 +4504,8 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev) set_ic = true; else if (!priv->tx_coal_frames[queue]) set_ic = false; + else if (!netdev_xmit_more()) + set_ic = true; else if (tx_packets > priv->tx_coal_frames[queue]) set_ic = true; else if ((tx_q->tx_count_frames % -- 2.53.0