From: Andrew Lunn <andrew@lunn.ch>
To: David Yang <mmyangfl@gmail.com>
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>,
Russell King <linux@armlinux.org.uk>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v2 6/6] net: dsa: motorcomm: Use safe 64-bit counter reader
Date: Mon, 7 Sep 2026 22:33:01 +0200 [thread overview]
Message-ID: <72b90269-bb4d-4efb-9ddf-51daa1b54fce@lunn.ch> (raw)
In-Reply-To: <20260904162952.709368-7-mmyangfl@gmail.com>
On Sat, Sep 05, 2026 at 12:29:48AM +0800, David Yang wrote:
> 64-bit counter registers are read as two separate 32-bit transactions.
> If the low word wraps from about 0xffffffff to a small value while the
> high word increments between the two transactions, the recombined value
> becomes ((new_high << 32) | old_low), producing a spurious ~4 GiB jump.
>
> Use a safe counter reader for this.
>
> Signed-off-by: David Yang <mmyangfl@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
prev parent reply other threads:[~2026-09-07 20:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 16:29 [PATCH net-next v2 0/6] net: dsa: motorcomm: MIB fixup David Yang
2026-09-04 16:29 ` [PATCH net-next v2 1/6] net: dsa: motorcomm: Rename MIB stuffs David Yang
2026-09-07 19:56 ` Andrew Lunn
2026-09-04 16:29 ` [PATCH net-next v2 2/6] net: dsa: motorcomm: Split MIB buffers David Yang
2026-09-07 19:57 ` Andrew Lunn
2026-09-04 16:29 ` [PATCH net-next v2 3/6] net: dsa: motorcomm: Split MIB module David Yang
2026-09-07 20:01 ` Andrew Lunn
2026-09-04 16:29 ` [PATCH net-next v2 4/6] net: dsa: motorcomm: Use u64_stats_t for MIB stats David Yang
2026-09-07 20:02 ` Andrew Lunn
2026-09-04 16:29 ` [PATCH net-next v2 5/6] net: dsa: motorcomm: Fix MIB synchronization David Yang
2026-09-07 20:21 ` Andrew Lunn
2026-09-04 16:29 ` [PATCH net-next v2 6/6] net: dsa: motorcomm: Use safe 64-bit counter reader David Yang
2026-09-07 20:33 ` Andrew Lunn [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=72b90269-bb4d-4efb-9ddf-51daa1b54fce@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mmyangfl@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®