From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 87D3B3BB9E0; Mon, 23 Mar 2026 16:14:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774282450; cv=none; b=bqYlqhEi50dUs++JBCsQK5cdRKE7XBV7f/amp5R8sFMrslhDGa2211RF0DJDX95P0J5xvTi3sUdp5hRjMaW4wRbiCgJnRsZbHk6ayvUaKx9vk//vSV4rAES3Okvgu6urnFW+fDLBT6PoyYthSHfWk6ooNk2cmqyYE85ej9gMRJU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774282450; c=relaxed/simple; bh=ItT30xFzQlMVuAqQDVYrhLdB/FQLCsPPtzXms7MoCmo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KsuruRwcaV8byNguUi/CzdAj61KtIB0iK6eZ7TijrQ2RUf6HRc1kzvNVXWiddgl7LJs5Enu5cA2flyB79AbDYWGdWDeKYu4WfE76BbOKMSmOqpMxWBBSWckOAdHl1Bcu39t2MjpOzky5GRqaPFHeVr9/OggaMDnuDS6yK1m3yp8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=RwFF+I3Y; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="RwFF+I3Y" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0037C2BC9E; Mon, 23 Mar 2026 16:14:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774282450; bh=ItT30xFzQlMVuAqQDVYrhLdB/FQLCsPPtzXms7MoCmo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RwFF+I3YiYQpOyBPfPk/rUsgHYaZSIqeSqo1ACeKpGSPADfXbYMAs+Q6TTyeOI5li iEHt3y0xI2Gtssl2zp5giWXB0LR/e17TlZIels7PGWSzDOIWro/9WKnVkY279ivisc 2iaqmcEwU6qAhTSpOgUnWEgY90+kZw4LZx2ZHXNs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mieczyslaw Nalewaj , Luiz Angelo Daros de Luca , Simon Horman , Linus Walleij , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.1 161/481] net: dsa: realtek: rtl8365mb: remove ifOutDiscards from rx_packets Date: Mon, 23 Mar 2026 14:42:23 +0100 Message-ID: <20260323134529.157063052@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323134525.256603107@linuxfoundation.org> References: <20260323134525.256603107@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mieczyslaw Nalewaj [ Upstream commit f76a93241d71fbba8425e3967097b498c29264ed ] rx_packets should report the number of frames successfully received: unicast + multicast + broadcast. Subtracting ifOutDiscards (a TX counter) is incorrect and can undercount RX packets. RX drops are already reported via rx_dropped (e.g. etherStatsDropEvents), so there is no need to adjust rx_packets. This patch removes the subtraction of ifOutDiscards from rx_packets in rtl8365mb_stats_update(). Link: https://lore.kernel.org/netdev/878777925.105015.1763423928520@mail.yahoo.com/ Fixes: 4af2950c50c8 ("net: dsa: realtek-smi: add rtl8365mb subdriver for RTL8365MB-VC") Signed-off-by: Mieczyslaw Nalewaj Signed-off-by: Luiz Angelo Daros de Luca Reviewed-by: Simon Horman Acked-by: Linus Walleij Link: https://patch.msgid.link/20260303-realtek_namiltd_fix2-v1-1-bfa433d3401e@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/dsa/realtek/rtl8365mb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/dsa/realtek/rtl8365mb.c b/drivers/net/dsa/realtek/rtl8365mb.c index abdff73aa9c32..c22e69ab0deb1 100644 --- a/drivers/net/dsa/realtek/rtl8365mb.c +++ b/drivers/net/dsa/realtek/rtl8365mb.c @@ -1451,8 +1451,7 @@ static void rtl8365mb_stats_update(struct realtek_priv *priv, int port) stats->rx_packets = cnt[RTL8365MB_MIB_ifInUcastPkts] + cnt[RTL8365MB_MIB_ifInMulticastPkts] + - cnt[RTL8365MB_MIB_ifInBroadcastPkts] - - cnt[RTL8365MB_MIB_ifOutDiscards]; + cnt[RTL8365MB_MIB_ifInBroadcastPkts]; stats->tx_packets = cnt[RTL8365MB_MIB_ifOutUcastPkts] + cnt[RTL8365MB_MIB_ifOutMulticastPkts] + -- 2.51.0