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=1796380401; b=jZKr3nhSMkpbk9Tt4veu/Px+59FhWIEc4hTULVhQ5k5gHYzG+bB98uHuNekg8Vvj8lUc IJvT4+HHCq0iewNpb9aERezb0m6Upg3mmc5grWbVA5e5akjQvrwQaXA/bPbKKpZgZOCKy 2DhjjpyoR1eyXs/BXjUxpDuQ7Kmp72ToHGSfjh4ETwWpq7GieFHK8HRsn42YjxqqpekDW eBpNgB5+gUsPKMtq+llI1GgWOSRRaxPAoEOz06isJ/0DRS4EWhwTReP8n6Bz67cqxyRfd txsd1j9hJ4AgzR2zNFQy8wqDiGWZMnv+gZ6qoNyQ7+H5el54qEsPoQebc2giwF53IEw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380401; 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=1Fxkqc2kOn+S+54fyd5Y83uOtW1OUDPsbcvd2ker6A8=; b=V/pkOTmPM/hnR6R2FXFnnayBnAKTURQqf9+yCAXK4X9xqYyCi1AzORi2BpAd15cyZXcT r12sAutC1pmExqtScXrELTEs3dNHLl2+0nzMUoiA/LRgs00zgTcqlb2MigecNWFondY2M hCgCTVmy4ieXBo/6nhEZmpGhzGJeGftvPEgRCN8et4xqKcBtQc785L4ZTqGeiwDZGyNLh pDLbHO5RmQZK8gH6liHYGeV9Yk3/R1Yn8rBYJ+Rdg+15QtqKtcdxJofAkzmhxyKYj40WY mAJGEgDviojxwHTk+36ycyTmRIQITj5Ak6jvJUE/5o758LorCoV+rr4A0zJrEIZ6Ptg== 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=A6Sn3qO1; 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 A898B606A32C; Fri, 4 Dec 2026 10:33:21 +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=A6Sn3qO1 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2326F1F000C2; Fri, 4 Dec 2026 10:33:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380401; bh=1Fxkqc2kOn+S+54fyd5Y83uOtW1OUDPsbcvd2ker6A8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=A6Sn3qO1IYjyZ75iMmgZDGkJcvotqb3cx91IWYXSoO+qacd+F8AK9cKV8cxo0XPPz XLCXXMpKDa82ZEwCdQibFJineazjFKNcdzGqnuym9YF+9p4LhwzOqs3wHTbtc57vMy IpiK7n8F4SB3Du6a7rcgB4XsctEm9hVuRCOVPpDE= 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 7.3 256/742] net: bcmgenet: accumulate the DIM packet and byte counters Date: Fri, 4 Dec 2026 19:02:00 +0900 Message-ID: <20261204100641.862937390@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@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 7.3-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 2ca5c0be178d3..c43535af02051 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -2491,8 +2491,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