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=1795028232; b=bpiEDMwGEGp6hczYXLjtgxnjC8pd0FSEvs4kIAqj5UziFznUDbtlZ8B6uqhFbrhpPyWg MDFUvQVhB0hYC4ufNfmK+1JtGqxtOC4AfiDLuI6okszdRofflPP5phXwymH3y6xkHjS2d /F2WKHRLyh1D/XNiFZgD7nTWtx6//ytI7mfGrcxCHXiEAA+wdIcrESxfy/uFC6gwqqfJG 01VIKYiVVJpIzZSJN/mMoZpaCTK9x841kKJVlkEBxMmrj62HjPwqzSlB+RIc6NmklMNOv hAf4YWiid19NGyBzAIvxVMfQ2cQKt+wpP76XSn0kLYEyYM49NZiyDeDzx1OdGWcTj7A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795028232; 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=4IwoerjT+jR4SgPIw1hmCxMN8Pd2BZJvIYW9P5tUuts=; b=sZvBu9S68lQTqLy0RN/A9Pm6luUkl2JSdjyyb3fKYVfyrFaIyzU4dXEvyXuIxj8TMhIR HOYfw8oGHnur2OPA1/7xl88G1CYe320gMulMg1Qh6s163fnzgLLjVRuhCerecGzrefauy IV6BZbJNHLsH9UNrOnqrI+Rxy/E7yxefnL0fgaS5iaXPZMTs80we4qlG34DMzjH4wiyfp i3Yc2dl8W+cwjhujIPXWdB6Y5yE5Py7DAXD4Xj3KcO1AEDjhXCnueLtaSqoUE1O4xl9Ks G/rUCMkjyFm/NL4r+B2Mk9eUlASAQFqkEdCj8K1GCtGgyF7xDGa5xEDuVXDaqkt/T3Q== 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=KmJiLcRG; 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 BC3AB606A31C; Wed, 18 Nov 2026 18:57:12 +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=KmJiLcRG Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D9F51F000C4; Wed, 18 Nov 2026 18:57:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795028232; bh=4IwoerjT+jR4SgPIw1hmCxMN8Pd2BZJvIYW9P5tUuts=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=KmJiLcRGWGZekij2ZZG99ZhRNvriXQ7Cqjwc7RsmmQ3dLHvCibehkd2YIXuu7agU8 G7O1Rt12eRtNKUUD3qP74CZoU+Mm08b/zi4rW2R5cS0E9cxlEsFzMLC0p6aBVBGPaS zKopOweRW6mAWGUYEFfPTH8hBVSSILWF+Xg2k5Kw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Nicolai Buchwitz , Simon Horman , Florian Fainelli , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.18 2045/2151] net: bcmgenet: restore the Tx coalescing setting when the rings are rebuilt Date: Wed, 18 Nov 2026 16:03:00 +0100 Message-ID: <20261118150236.220125561@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150121.603863898@linuxfoundation.org> References: <20261118150121.603863898@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nicolai Buchwitz [ Upstream commit ff8a7c0c06762a2a2333fbd6148d637bbd3d5090 ] bcmgenet_set_coalesce() writes tx_max_coalesced_frames straight into DMA_MBUF_DONE_THRESH and keeps no copy of it, while bcmgenet_init_tx_ring() programs a fixed 1. An ifdown and ifup or a resume then puts the Tx coalescing back to one frame per interrupt. Rx keeps its value per ring and reapplies it on init. Do the same for Tx. Fixes: 2f9130709d2c ("net: bcmgenet: Implement TX coalescing control knobs") Signed-off-by: Nicolai Buchwitz Reviewed-by: Simon Horman Reviewed-by: Florian Fainelli Link: https://patch.msgid.link/20261022-nb-genet-fini-dma-net-v3-2-6e9fc89c0156@tipi-net.de Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 10 ++++++++-- drivers/net/ethernet/broadcom/genet/bcmgenet.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index 4f2319ce9b6fb..bc7200f70cf31 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -932,10 +932,13 @@ static int bcmgenet_set_coalesce(struct net_device *dev, /* Program all TX queues with the same values, as there is no * ethtool knob to do coalescing on a per-queue basis */ - for (i = 0; i <= priv->hw_params->tx_queues; i++) + for (i = 0; i <= priv->hw_params->tx_queues; i++) { + priv->tx_rings[i].tx_max_coalesced_frames = + ec->tx_max_coalesced_frames; bcmgenet_tdma_ring_writel(priv, i, ec->tx_max_coalesced_frames, DMA_MBUF_DONE_THRESH); + } for (i = 0; i <= priv->hw_params->rx_queues; i++) bcmgenet_set_ring_rx_coalesce(&priv->rx_rings[i], ec); @@ -2754,7 +2757,8 @@ static void bcmgenet_init_tx_ring(struct bcmgenet_priv *priv, bcmgenet_tdma_ring_writel(priv, index, 0, TDMA_PROD_INDEX); bcmgenet_tdma_ring_writel(priv, index, 0, TDMA_CONS_INDEX); - bcmgenet_tdma_ring_writel(priv, index, 1, DMA_MBUF_DONE_THRESH); + bcmgenet_tdma_ring_writel(priv, index, ring->tx_max_coalesced_frames, + DMA_MBUF_DONE_THRESH); /* Disable rate control for now */ bcmgenet_tdma_ring_writel(priv, index, flow_period_val, TDMA_FLOW_PERIOD); @@ -4181,6 +4185,8 @@ static int bcmgenet_probe(struct platform_device *pdev) priv->rx_rings[i].index = i; priv->rx_rings[i].rx_max_coalesced_frames = 1; } + for (i = 0; i <= priv->hw_params->tx_queues; i++) + priv->tx_rings[i].tx_max_coalesced_frames = 1; /* Initialize u64 stats seq counter for 32bit machines */ for (i = 0; i <= GENET_MAX_MQ_CNT; i++) { diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.h b/drivers/net/ethernet/broadcom/genet/bcmgenet.h index 86f2aed20dbe8..e48ce39d3e7c8 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.h +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.h @@ -553,6 +553,7 @@ struct bcmgenet_tx_ring { unsigned int prod_index; /* Tx ring producer index SW copy */ unsigned int cb_ptr; /* Tx ring initial CB ptr */ unsigned int end_ptr; /* Tx ring end CB ptr */ + unsigned int tx_max_coalesced_frames; struct bcmgenet_priv *priv; }; -- 2.53.0