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=1796386431; b=2QAtuTAPMxYix7pd2MgkBmGRbmkQEFBsvKzI5OKzmao2zCLgRgbhPMF/RT57UQUHNmW8 eBYfesTiDTeh7nwiVoLGdGS5ZbAzFo8vvbq296B7wLiBgmg4CH2vsmF7fPConkI+aop7t 3qNgi8rFmoDE73Kh+GQtj6TfH7Y542AOjztU1LB7Ei/IuV0YDkzeIBtqvnepZT3l1qjiz b88coaEAeX8Ft/mNzRAl8/MDb0+8Tc1TzOcenW6OfwECsorWE5/cHB663YFcW4WmLQOqp xjB/09nsuq1n+e6icsxr1VAgi/R1PB+ewXb1cyiG2Ya9Dz6obZ7OwsD1A7ICVGCfVWQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796386431; 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=y/zokx65kGlEAwCIq4SpKboipmEZUYFSHN5tW2JdsQM=; b=1kxGLPa5FbhMgIbv2WloN5rp/vXJ6UY8xe5X36q1NjeSx8/P7pCOQk9qK4jy+N8PBAcC BWMEGWJWFhSBV86JdgcNaImSt3yZpeTN/l+fvUW+2D2L3chNJRlDvmUN4UAEVsjHeATXD WqsydDppD69v0hyRU0IMxDCV5+9GovQItTYWp6GUL4dJScisWtrlNjKKmnGEZ00LD63gl qo9rzr5DzxfokNsLIuIK6bOwg95coITsMumMWQxEQ4IuKTW5dsOV+IehK60xWkGW1fLg/ Lfkoe8q5g+Y9vhYQqR0+1D6w7jXPwdkoIWiNgh+x971Zkc1VW8M4ugYweOWhUj8Y0sQ== 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=E7Tx9aWr; 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 74D7D606A322; Fri, 4 Dec 2026 12:13: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=E7Tx9aWr Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97BA71F000C2; Fri, 4 Dec 2026 12:13:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796386431; bh=y/zokx65kGlEAwCIq4SpKboipmEZUYFSHN5tW2JdsQM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=E7Tx9aWrgivFSDrxUa8i+MtCKX9DImYGLAvy+DAhqLSkhmapVjOFDOaVfrCwibzMh uXff3HLj/wGWfKiFt5Zhok/scbhTbmRmla7ZD19giHHfz8mI4vaaaRVQAyi8P4Yk5h om8dkX36Joo8ZAVbvdg6eKOzAqTnR8lEo2UZNguc= 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.6 0959/1167] net: bcmgenet: accumulate the DIM packet and byte counters Date: Fri, 4 Dec 2026 19:06:26 +0900 Message-ID: <20261204100727.170808456@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@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.6-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 b08a934303cf3..43099c7613cc3 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -2420,8 +2420,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