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=1796389133; b=WDkVBbAUtTArR2EBMMBscfGLR4F2YrLcZ0c61uyF5BpuTB/2UDEcPTY+jpm20czPB8HC +Ol2WMOdHB6IiajGjM3ann6TmPD5SpdM0SUlpuEMJif+JI3/lr8nnxkowenAymMCZeEfb Z4rXqVAqD+1wBNJdX6pABWtJu21QcCL1tItBXPTZ76R8VeVZB/H7SCTte01lcESLjgIhD m6xtJlqVfGmL1mz8bfRWdkTHd3vmxYYgwQfvQAuS9L4nxo7+5CaYwJmbmrwjE8NpKGZ2R EYRx9dAM+gW7lXEK+jEB1yC5UPZAxDuV7H2fhERinih4dSWsoA/oiwxdtXIPMtMkLlg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796389133; 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=JmHZw0LXWyyn1EC/BBMpmU2CBozv/Xjbbh4cNC7CUcc=; b=HTYg5DzkyBJuEx1kkj3cIDatK8GdD86sMI54Bd9rNoVMjsehTfzSlL1VgqQ8k8Fg+98/ W7HSA/ooJeJKDiJ5vpzI+SkLSvXxts4+6SVMVMI2U4noHTLgGQVYw5DFE1wWTrjLKqRyt GN/Kszb2pHtUSCURmoBG2PAMVFM8GodGnoEhyHm/Of3DRmmBQnqbvWAQ8E3m7bBDIPbbH 1Nu4EaMtEtigGZ1MJesK0ljUqqQBINQpYTA+GmVnbe3sGkxGbLoxBKJbNAUQP7VWwHKlj q9yqTDoB8SGTpqBkjy5oX5bfR99NmO3TKHcMusHMQZ8pJV35ErUkltwIgbGgyjhwDYQ== 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=CfXDEgK+; 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 8DD58606A32C; Fri, 4 Dec 2026 12:58:53 +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=CfXDEgK+ Received: by smtp.kernel.org (Postfix) with ESMTPSA id B68661F00936; Fri, 4 Dec 2026 12:58:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796389133; bh=JmHZw0LXWyyn1EC/BBMpmU2CBozv/Xjbbh4cNC7CUcc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=CfXDEgK+ql0hx9UmxEZVfyfGKibAxx7qnkBzv7xODOhhS/GXEZ16pexF6B3mwzPQO IplQ/J74Gy6G61HeOol8Mw/G90bSbUlmrduhWanOh2+mmO74e3YCe0pffcUejRTkAf IQXCQpnWiWcwvfwiN0QUwJznyh0fbwWstCSvfhwk= 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.1 0876/1059] net: bcmgenet: reset the Rx discard count with the ring Date: Fri, 4 Dec 2026 19:06:47 +0900 Message-ID: <20261204100706.704391065@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@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.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nicolai Buchwitz [ Upstream commit e99faa3a16209ea5d0b83cc58b64785efd2d9045 ] Ring init clears the hardware discard counter but not ring->old_discards. Discards after an ifdown and ifup or a resume are then missing from rx_missed. On a CM4, after an ifdown and ifup, 3666 discards showed up as 0 in rx_missed. Reset old_discards together with the ring. Fixes: d26ea6cc48da ("net: bcmgenet: collect Rx discarded packet count") 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index 34ec41d900577..86ce09a0880d7 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -2731,6 +2731,8 @@ static int bcmgenet_init_rx_ring(struct bcmgenet_priv *priv, ring->read_ptr = start_ptr; ring->cb_ptr = start_ptr; ring->end_ptr = end_ptr - 1; + /* Zeroing RDMA_PROD_INDEX below also clears the discard counter */ + ring->old_discards = 0; ret = bcmgenet_alloc_rx_buffers(priv, ring); if (ret) -- 2.53.0