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=1796383619; b=vyNHo8442whei6ZRG0wCdL1EHYjAAkjonNStQKNJuaaYtfA/Mf6YnjC+J2HBMZxzh6U0 cwbHHAErsOiyIynlzl6q3eH7tPnNkEZE2fKrhneZIT4coun4YGWH1SxO+EUxIKcq4ohjt ONJ3XPK4HvEMJ3tMO/KzPgnoOgIuMng3812bYZc8dYuj0iVV3UmmZr9m7gytwuz8isqUl DWodQCTNJsvFStY+xSe4vqbvSVL85htYpZ5YKiNEYPPIt0TKcNgM6BzT+V1cKwxw24fjs 6BsXTep5nTIpx0JLCeaiS2y5z+UhI9Ad6jhRnzL8LXdh7xDkqZ1RBQyU6B+165sZK9w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796383619; 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=K7mjKq9JFOOZhv8ZhC4gRBoeGpsbz+x6WCqiOt5+6gQ=; b=3qbUPtWJUfqsqzrp+vazVKzlwYhuldx8idpcvGVeDBEC7ia8eAIfT0MfqKzgedW7AK8N utXRkvKG9LytqYD6eNlIC5hhcI1lAw6fOqRufafjmA/bf/+hyMtyl1DFSIxztLV5ZsuNM EJWyI5lcxb6TkJEP76hmVGFAlpHsfntKAImBqPFGWPa0AAAEOzDD5eHGPtPb65519xb/l aKImszeq3DZyDpiZSRcRKDkLJ2vjOS/FnSJnW4M4xnpdRMJwl1hj6XnT0gKqPBnoL3nsa AsZv1oUrNSavoW2AW7M38ucNddvUmpQb/XfLwKryv9eTPx3dEN9ebhpgqBJWF9CWbig== 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=1DwETn7K; 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 77DD5606A335; Fri, 4 Dec 2026 11:26:59 +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=1DwETn7K Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7B8A1F0092C; Fri, 4 Dec 2026 11:26:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796383619; bh=K7mjKq9JFOOZhv8ZhC4gRBoeGpsbz+x6WCqiOt5+6gQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=1DwETn7Kmq6JBJs4MYOmqMApJJv/gY3RAzEi8e2qDHosVhrMxzPssIpxg/cT7llEY GVjJHIVVQRRRJ+5YOpWEDGw7uaMKeBkMn2ThLdYszx2DCQYBwAErCwIKEudxrGne1g 6jmlSmBVcT39uXKhjk6Y4Ea1U1/a2EEX2Qwi9evY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Florian Fainelli , Nicolai Buchwitz , Willem de Bruijn , Sasha Levin Subject: [PATCH 6.12 282/555] net: bcmgenet: accumulate the DIM packet and byte counters Date: Fri, 4 Dec 2026 19:05:25 +0900 Message-ID: <20261204100619.869831428@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@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 a15079369636f4324d2985cede7ce7fbefddf4b3 ] net_dim() computes rates from the difference between two samples and needs running totals, but bcmgenet_desc_rx() passes the counts of the last poll. Adaptive coalescing then picks profiles from wrong rates. On a CM4 at a steady 300 Mbit/s UDP, DIM changed profile about 1000 times in 20 s. With the fix it settles, and Rx interrupts drop from about 4500/s to 2240/s. Accumulate the counters instead. Fixes: 9f4ca05827a2 ("net: bcmgenet: Add support for adaptive RX coalescing") Reviewed-by: Florian Fainelli Signed-off-by: Nicolai Buchwitz Signed-off-by: Willem de Bruijn Signed-off-by: Sasha Levin --- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index 9e9d079564b77..5413497aba081 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -2411,8 +2411,8 @@ static unsigned int bcmgenet_desc_rx(struct bcmgenet_rx_ring *ring, bcmgenet_rdma_ring_writel(priv, ring->index, ring->c_index, RDMA_CONS_INDEX); } - ring->dim.bytes = bytes_processed; - ring->dim.packets = rxpktprocessed; + ring->dim.bytes += bytes_processed; + ring->dim.packets += rxpktprocessed; return rxpktprocessed; } -- 2.53.0