From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
"John W. Linville" <linville@tuxdriver.com>
Subject: [RFC 1/4] net/af_packet: remove volatile from statistics
Date: Wed, 28 Jan 2026 09:30:17 -0800 [thread overview]
Message-ID: <20260128173138.151837-2-stephen@networkplumber.org> (raw)
In-Reply-To: <20260128173138.151837-1-stephen@networkplumber.org>
Statistics are only updated from a single thread at a time and
the compiler should not have to worry about optimizing them.
The statistics returned are 64 bit so use uint64_t instead
of arch specific unsigned long.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/af_packet/rte_eth_af_packet.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index ef11b8fb6b..158393dd70 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -57,10 +57,10 @@ struct __rte_cache_aligned pkt_rx_queue {
uint8_t vlan_strip;
uint8_t timestamp_offloading;
- volatile unsigned long rx_pkts;
- volatile unsigned long rx_bytes;
- volatile unsigned long rx_nombuf;
- volatile unsigned long rx_dropped_pkts;
+ uint64_t rx_pkts;
+ uint64_t rx_bytes;
+ uint64_t rx_nombuf;
+ uint64_t rx_dropped_pkts;
};
struct __rte_cache_aligned pkt_tx_queue {
@@ -72,9 +72,9 @@ struct __rte_cache_aligned pkt_tx_queue {
unsigned int framecount;
unsigned int framenum;
- volatile unsigned long tx_pkts;
- volatile unsigned long err_pkts;
- volatile unsigned long tx_bytes;
+ uint64_t tx_pkts;
+ uint64_t tx_bytes;
+ uint64_t err_pkts;
};
struct pmd_internals {
--
2.51.0
next prev parent reply other threads:[~2026-01-28 17:31 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 ` Stephen Hemminger [this message]
2026-01-28 19:57 ` [RFC 1/4] net/af_packet: remove volatile from statistics 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
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=20260128173138.151837-2-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=linville@tuxdriver.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