From: Stephen Hemminger <stephen@networkplumber.org>
To: Scott Mitchell <scott.k.mitch1@gmail.com>
Cc: dev@dpdk.org, "John W. Linville" <linville@tuxdriver.com>
Subject: Re: [RFC 1/4] net/af_packet: remove volatile from statistics
Date: Mon, 2 Feb 2026 12:12:31 -0800 [thread overview]
Message-ID: <20260202121231.3e5496ed@phoenix.local> (raw)
In-Reply-To: <CAFn2buCc2mACHssDV1zesWCrhju_=V67e=WSNK+0gkrGskKCRg@mail.gmail.com>
On Mon, 2 Feb 2026 11:12:31 -0800
Scott Mitchell <scott.k.mitch1@gmail.com> wrote:
> Thank you for the clarification about the function pointer indirection
> acting as a compiler barrier - that makes sense for the typical case.
>
> I have one remaining question about 32-bit architectures: even with
> the implicit barrier, plain uint64_t reads aren't atomic on 32-bit
> platforms (reader could see torn high/low halves). Is this acceptable
> for stats counters in DPDK, or is 32-bit support not a concern?
DPDK has not worried about torn counters on 32 bit architectures.
Whether it should or not is open question.
People don't care much about 32 bit anymore; other than not breaking it.
> For context, atomic_load/store(memory_order_relaxed) formally
> guarantees both visibility and no tearing across architectures, with
> minimal (GCC) or zero (Clang) overhead for x86-64. I see there's
> precedent in DPDK for plain uint64_t stats, and I'm hoping to
> understand the assumptions/trade-offs better.
The problems is that on relaxed ordering architectures like ARM
it makes the counter update more expensive in the fast path.
next prev parent reply other threads:[~2026-02-02 20:12 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-28 17:30 [RFC 0/4] net/af_packet: cleanups and optimizations Stephen Hemminger
2026-01-28 17:30 ` [RFC 1/4] net/af_packet: remove volatile from statistics Stephen Hemminger
2026-01-28 19:57 ` Scott Mitchell
2026-01-28 21:00 ` Stephen Hemminger
2026-02-02 7:02 ` Scott Mitchell
2026-02-02 17:34 ` Stephen Hemminger
2026-02-02 19:12 ` Scott Mitchell
2026-02-02 20:12 ` Stephen Hemminger [this message]
2026-01-28 17:30 ` [RFC 2/4] test: add test for af_packet Stephen Hemminger
2026-01-28 20:36 ` Scott Mitchell
2026-01-28 21:45 ` Stephen Hemminger
2026-01-28 17:30 ` [RFC 3/4] net/af_packet: fix indentation Stephen Hemminger
2026-01-28 17:30 ` [RFC 4/4] net/af_packet: add VPP-style prefetching to receive path Stephen Hemminger
2026-01-29 1:06 ` Stephen Hemminger
2026-01-29 9:00 ` Morten Brørup
2026-02-02 7:09 ` Scott Mitchell
2026-02-02 18:43 ` Stephen Hemminger
2026-02-03 7:31 ` Morten Brørup
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=20260202121231.3e5496ed@phoenix.local \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=linville@tuxdriver.com \
--cc=scott.k.mitch1@gmail.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