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=1796382051; b=jV+mqLShcKbnNmVkYvFtG+YjE866veuVNU8YDDeGs+oje1Gk7rbYTlBppQEwutqY2AZG OIKfrMZyKwVWBhCPbLrxfWcjkajQI9rR7vB1msU/jYb+wwEaiDz6SWwJOxOqtAksDVhS8 OBMjXZulWoIziBCaxITBOqca2jUMSOkoytxAklFhGDtbQZWjTji0hYkb+q7hXLffI/3ak Ya0VHMvk+PJ8urf53+f7B15DZ6pMlXFwjJ8nDqld9pBNjjVGt4Y9IKvqaztgOmJ1d7BR7 jcF/TFkUGXu4sTgJwzte83Ajhf7+SLp7TxY+IzfWTHxZtR+Vi24Q4H/Nr4TpK8412iQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382051; 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=XmRLnOsjav0xmOEFYPW0MpFErUaHS2IgNVZ7BAg6StY=; b=1dbtXAahGPdON5UbyIpdYh5OzLs/JDjPKpUtxmFyMJbGtxfVJ8bpJ9Np6qJWFqlZ3pW2 7JD358hU8uXH8aa7c7Um/xBLNJFoAxAnewQHMAzbqVkPMhKYp5Qb0xovL4SZlfs+kJpwT r/OeduOPqCY7GpmTG3yKRE9+AqTajpKFtlWgpILmSUoCWxEfY2T2vrqtW/3+b3nJEDrxv YZN3RpJty8YoGtF4X/ShFqz8Xdz1Y1z43ARrs1JbWEW/MNMaHfYNMybHpuYWZHn0WdNrZ 1bfohgvK+4/cHfy6wsC6wyZW1XtxacADPUzA4PdMrnP1fbXLfNEWuQIJqJNBdj+LUFA== 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="Ju4bbf/l"; 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 B85FD606A322; Fri, 4 Dec 2026 11:00:51 +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=Ju4bbf/l Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3048C1F000C2; Fri, 4 Dec 2026 11:00:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382051; bh=XmRLnOsjav0xmOEFYPW0MpFErUaHS2IgNVZ7BAg6StY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Ju4bbf/lrZhANpvxXYHBdVQsE9THUbzozlwWiDGt8UKQzSSpbRJ+EbfpPYndEXRum DeBWvA1F5nt80XwkMUNokqehUJ8v9QRwTHuKfjxaou0XnCydhg/wVWjanMa/IERcdY w0O48ec1vl6D12zNSluwH8pBjRwtup33vs7MI68U= 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.18 288/703] net: bcmgenet: accumulate the DIM packet and byte counters Date: Fri, 4 Dec 2026 19:03:07 +0900 Message-ID: <20261204100635.446946463@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@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.18-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 52b5e8daf9276..ec40f373cea07 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -2487,8 +2487,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