DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
To: dev@dpdk.org
Cc: stable@dpdk.org
Subject: [dpdk-dev] [PATCH] net/sfc: relax SW packets/bytes atomic ops memory ordering
Date: Fri, 17 Sep 2021 14:15:14 +0300	[thread overview]
Message-ID: <20210917111514.680649-1-andrew.rybchenko@oktetlabs.ru> (raw)

No barriers are required when stats are incremented or read.

Fixes: 96fd2bd69b58 ("net/sfc: support flow action count in transfer rules")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 drivers/net/sfc/sfc_stats.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/sfc/sfc_stats.h b/drivers/net/sfc/sfc_stats.h
index 2d7ab71f14..aae8243c73 100644
--- a/drivers/net/sfc/sfc_stats.h
+++ b/drivers/net/sfc/sfc_stats.h
@@ -53,7 +53,7 @@ sfc_pkts_bytes_add(union sfc_pkts_bytes *st, uint64_t pkts, uint64_t bytes)
 	 * core sees both counter updates together.
 	 */
 	__atomic_store_n(&st->pkts_bytes.int128, result.pkts_bytes.int128,
-			 __ATOMIC_RELEASE);
+			 __ATOMIC_RELAXED);
 #else
 	st->pkts += pkts;
 	st->bytes += bytes;
@@ -68,7 +68,7 @@ sfc_pkts_bytes_get(const union sfc_pkts_bytes *st, union sfc_pkts_bytes *result)
 {
 #if SFC_SW_STATS_ATOMIC
 	result->pkts_bytes.int128 = __atomic_load_n(&st->pkts_bytes.int128,
-						    __ATOMIC_ACQUIRE);
+						    __ATOMIC_RELAXED);
 #else
 	*result = *st;
 #endif
-- 
2.30.2


             reply	other threads:[~2021-09-17 11:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-17 11:15 Andrew Rybchenko [this message]
2021-10-07 14:59 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit

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=20210917111514.680649-1-andrew.rybchenko@oktetlabs.ru \
    --to=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /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;
as well as URLs for NNTP newsgroup(s).