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=1795033230; b=JTErp9jET3psDeOVaXAFeydxy5tl7h8hMalAitCCYrVG982Fi3UVmoqCQRtoU7hKdFqL LtHG41P73x0wPULlFx1N72fSnkM8ALPy0c9ZY33Q44yQcSqdN+y8FpWYwPs40uKtq6OeT tbkAXgJ32jYi7RZgTbFDMjAGjQaa/0K4ECA7kq2/7NZ/E6SQmwyjir2zbXBfUyE2QQqp3 cjUUBDhXQvqV9ohZooy4vO/0tVw5nETHqquXusjuJECAGedbKkv4k3sz8DMQJkAP1VhQU anQrSgN58IhUO8EHxkwVRqGq3ERb6rKXxhIB/d5Fx4SzLm1+oDFkGhFz8yRLVtqKQ0A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795033230; 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=MH7qgaWlW04RldR3R3LLhze+vQcCB7czwfpxchYgcQ0=; b=B5O6wM1PI2Qto7QHlNTX9yhqHdX6WjjjT0fadw2gIlyOeXA+sO4HONzAjxlbTGi+O+jd O1vAqbahpZUTR3ziVcwdeEknBOf03xX+MEIvcRhAXzzWebBJWiudMC+4QhWxrJBlY6XsD TZdNUpLXkh6XQfVLhSgL5f2g3CLFAo/15mRbAvm6Vc+4IQ7efDB7ADbN/ogXP1zoeJ4av ZOn3fUnAQNSImTSfLia6at1aSlUYL+TJ4VeZy5SEA3KrxEkB+eKKn2Xcu63+hJ7H8vEo2 sIDmG+0X9k1NfYNGtNUS446tQgqecLCauRlhu+Io3QHhPMGgdonj3yMY4SKlPoZuPrQ== 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=dguEBywM; 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 03DAE606A335; Wed, 18 Nov 2026 20:20:30 +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=dguEBywM Received: by smtp.kernel.org (Postfix) with ESMTPSA id 574721F000C4; Wed, 18 Nov 2026 20:20:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795033229; bh=MH7qgaWlW04RldR3R3LLhze+vQcCB7czwfpxchYgcQ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=dguEBywMIduVUnnbgPRfEPNiLq9t1VGf0/nZ85fUIeNWIHJLHWlnMGjCYONB0Wvjp kwSeDKe/CobTXH5+87AjhAMY9rT6Fe50+MUbwrl3k7hmIagzf0bjpTwRiz1fTAWI2l 99Kf+uT8bDCApE9rQ7FVDZIDlc74ktcPJuZs6nb8= 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.12 1651/1756] net: bcmgenet: restore the Tx coalescing setting when the rings are rebuilt Date: Wed, 18 Nov 2026 16:02:58 +0100 Message-ID: <20261118150115.463289789@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150007.957976754@linuxfoundation.org> References: <20261118150007.957976754@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.12-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 608dd03c6fe69..8be9b18ed7fa1 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -895,10 +895,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); @@ -2682,7 +2685,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); @@ -4060,6 +4064,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 4f18193a6bd09..46d1a9340f154 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.h +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.h @@ -547,6 +547,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