Article View: linux.kernel.netdev
Article #7261Re: [PATCH net 1/2] net: dsa: mv88e6xxx: fix 88E6171 statistics snapshot
From: Andrew Lunn
Date: Sun, 25 Oct 2026 23:14
Date: Sun, 25 Oct 2026 23:14
84 lines
11226 bytes
11226 bytes
On Sat, Oct 24, 2026 at 11:21:23AM -0700, Florian Fainelli wrote:
> The 88E6171 belongs to the 6351 family and takes the port number in the
> low bits of the statistics operation register. The 6320 snapshot helper
> instead encodes the port as (port + 1) << 5. On an EA4500, this causes
> ethtool -S to return physical port 0's MIB counters for every user port.
> Traffic on other ports does not update their reported hardware counters.
>
> Before the snapshot operation was moved into the chip operations, only
> the 6320 and 6352 families used the shifted encoding. The refactoring
> incorrectly assigned that encoding to the 88E6171 as well.
>
> Use the unshifted snapshot helper for the 88E6171. Tested on an EA4500:
> pings through different switch ports now update only the corresponding
> port's hardware counters.
>
> Fixes: a605a0fe7115 ("net: dsa: mv88e6xxx: Abstract stats_snapshot into ops structure")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> drivers/net/dsa/mv88e6xxx/chip.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
> index 7f68a0c55802..67daf3b9cb48 100644
> --- a/drivers/net/dsa/mv88e6xxx/chip.c
> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
> @@ -4610,7 +4610,7 @@ static const struct mv88e6xxx_ops mv88e6171_ops = {
> .port_disable_pri_override = mv88e6xxx_port_disable_pri_override,
> .port_get_cmode = mv88e6352_port_get_cmode,
> .port_setup_message_port = mv88e6xxx_setup_message_port,
> - .stats_snapshot = mv88e6320_g1_stats_snapshot,
> + .stats_snapshot = mv88e6xxx_g1_stats_snapshot,
> .stats_set_histogram = mv88e6095_g1_stats_set_histogram,
> .stats_get_sset_count = mv88e6095_stats_get_sset_count,
> .stats_get_strings = mv88e6095_stats_get_strings,
static const struct mv88e6xxx_ops mv88e6171_ops = {
/* MV88E6XXX_FAMILY_6351 */
...
.stats_snapshot = mv88e6320_g1_stats_snapshot,
static const struct mv88e6xxx_ops mv88e6175_ops = {
/* MV88E6XXX_FAMILY_6351 */
...
.stats_snapshot = mv88e6320_g1_stats_snapshot,
static const struct mv88e6xxx_ops mv88e6350_ops = {
/* MV88E6XXX_FAMILY_6351 */
...
.stats_snapshot = mv88e6320_g1_stats_snapshot,
static const struct mv88e6xxx_ops mv88e6351_ops = {
/* MV88E6XXX_FAMILY_6351 */
...
.stats_snapshot = mv88e6320_g1_stats_snapshot,
Should these be changed as well?
Looking at DSDT:
static GT_STATUS statsCapture
(
IN GT_QD_DEV *dev,
IN GT_U8 port,
IN GT_U8 bank
)
...
if (IS_IN_DEV_GROUP(dev,DEV_RMON_PORT_BITS))
{
portNum = (port + 1) << 5;
}
else
{
portNum = (GT_U16)port;
}
and
#define DEV_RMON_PORT_BITS \
( DEV_88E6065 | DEV_88E6065 | DEV_88E6352_FAMILY )
So your change looks correct, just not complete.
Andrew
Technical Details
Message-ID:
<404d5f2d-24a5-4edc-897b-b1b3c54a20e1@lunn.ch>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-351625-linux-kernel-netdev=dewy.ruReferences:
<20261024182124.296988-1-f.fainelli@gmail.com> <20261024182124.296988-2-f.fainelli@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-351625-linux-kernel-netdev=dewy.ru From: andrew@lunn.ch (Andrew Lunn) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net 1/2] net: dsa: mv88e6xxx: fix 88E6171 statistics snapshot Date: Mon, 26 Oct 2026 00:14:27 +0100 Organization: Usenet Network Message-ID: <404d5f2d-24a5-4edc-897b-b1b3c54a20e1@lunn.ch> References: <20261024182124.296988-1-f.fainelli@gmail.com> <20261024182124.296988-2-f.fainelli@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="1166660"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:Gvz0l32QKnFTNzIeSvmOj9F8zVg= sha256:OCopKqtaz26DuWs7aZfzNwyW9DTHdLS//TDFJ4DAg6U= sha1:NIpPfUtK7CnVoyQqCH1SC7E7MwA= sha256:UlJgmehBBkxVBU2qmhv004oVhCGBMWQ4izklNpo3WEY= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 963A7125B81; Mon, 26 Oct 2026 02:14:53 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=lunn.ch X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jgOBbk6ntWjE; Mon, 26 Oct 2026 02:14:50 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-351625-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=lunn.ch X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 76F5A125B7E; Mon, 26 Oct 2026 02:14:40 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 84F632A14D; Sun, 25 Oct 2026 23:14:39 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1792970079; b=VIsupDxBxk72hg2h8rEWvG6sb72CGfgZfGxHm24loXBbOklccIS1T3OZaeAJOu0+8ysY qes+J5k4wXwXwWAU4PO2TxQLBqpvZI5hNU9n6I0QYNFSk5KukaHuQcdEbJs9PIYPU3Iu/ v3iKHOsmbi4/GxwMA+xmQZuXf/i23ATkBAE1IudeMzhUiOnTm1RB0asvPE01wyG97sINy RubR/L/vuKxOKkKjF09C4GhyQUfXk7J1CrMNylIrUNR/b2lX013O7RkbodspZH2iYcPqg 21MrNDyN7xpjYw8c1d9fuHpK8W8KKY0e80KlEZGCw0ymTWyMJbsNj5DkywMevah0Qnw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792970079; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:Date: From:To:Cc:Subject:Message-ID:References:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=tQaes7bNYqS+ZJDcrEFv5Xvce1CpAz6+FFTd4+Au/aE=; b=bQuZvGDktGBU4BqAEXT/jUzLschHRqrkafE2j7G7ce0YavMoktVxbWQ2ae/GRWd9Ub36 WLRJ+Xx6ahJf7oUlheJ/C9fcl2z07H8mqGwAlwIzZ1nQ1MfCeEkdwY40WiLlVq5U+mdtW Vp/dyyaQ5qP2bmDEejIJlzW5QXzWAWBx0x04Jw0BNElgmYftM9Mg6mqWW8Og7kZ8UAZ8o ZLfP3hW9qTguxDDB9W1QRjg14x9xQ1FgPPtXMokc0G+mHsfoIHr3hpkqiyZBp871Oi5Sx Ww/jzDLRj77Ud6VbGY+CeP2F6K8f8g8kZCthTF4t3C2uweI3cm0u+RstlSGt1/7slzA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=BPRr55t8; dmarc=pass header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F19A1606A323; Sun, 25 Oct 2026 23:14:38 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=BPRr55t8 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=156.67.10.101 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792970078; b=c4unc+1GiurKyc877wcp14rKIOtG2FIiQwMVveBJAeoS4ymd63V8DmjyLmsGKWfplo9s cFjNcNTVG5A2Z1Rb+mgqipAlqe6HGM9GFp+fBKdqwkP6BzKTIAIJbxKBzK2YGE5V37IxW EeWpBNGjpPx4wTWDiOhxA2ndlAOSj8dn5jxER81ZJnWkt/cEj7tGrWiIQNAA/V8sys/GA ZsOtB+yVUyzgLCTdGKwX8sXCN4yhutBkuGdSQnMIY1S35X3MI0Qa7k7tAJS9Df4MEdyIR ux1Mh2umvo+c2ZqscgRk47g1CMVsXWRydBQuVVhd1V0CAY+egWZzREabsyhhJwDpcTw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792970078; h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject: Message-ID:References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; bh=tQaes7bNYqS+ZJDcrEFv5Xvce1CpAz6+FFTd4+Au/aE=; b=Y/daZ6EXsWeoUGgLzTisuiOLC78stqCzC7VWMsGvrdHf2l2v2tNC8fifi1M151MgVfSM XIjBuyH1zPbEkdu2BmwRYur4ua3kjqzk6AJGSrVkHC6tGt/1Ji8QinXQu5xVkZzMvdTV/ GRYE220aNSkbKFRWBZqSWSbxy/8msR58JA3iuq2xS0mDd/MCMI2w1D6CETrFIY94yEeyi 9S/+GRWJ0OD9GUx1NtaEVJiz2RIz/25H8URlXWzwQrmvS+oMfj5cYX7xHcjerZ8QerlzH Pv/dAR4XiUSx9cJXV9Lk+txO0YJwDdzDmo4MeMr5TQzBSzv/ky7hsKBmiArQDL3ZzBw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=BPRr55t8; arc=none smtp.remote-ip=156.67.10.101 X-Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C602606A31A; Sun, 25 Oct 2026 23:14:37 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5C602606A31A X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=tQaes7bNYqS+ZJDcrEFv5Xvce1CpAz6+FFTd4+Au/aE=; b=BPRr55t8hjrvM70KGh0K9OThhl pgGVr5QQZ7GfJhItI3GSzZn8qJu3QopA1vSd8qqnmOF7k2iv+CWLjJ6xAnx9fQgd8vDoaFBX52k39 K4+HoQwpi+CjFbFHyNRkKsBpd3iYi9IbJam+uWeeFZCRSpP8X+6ethznfrLdBWzFsEio=; X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from <andrew@lunn.ch>) id 1xL7Q3-00Cj0N-To; Mon, 26 Oct 2026 00:14:27 +0100 X-Cc: netdev@vger.kernel.org, Vladimir Oltean <olteanv@gmail.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>, open list <linux-kernel@vger.kernel.org> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <20261024182124.296988-2-f.fainelli@gmail.com>