net/sfc: relax SW packets/bytes atomic ops memory ordering
authorAndrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Fri, 17 Sep 2021 11:15:14 +0000 (14:15 +0300)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 7 Oct 2021 14:57:42 +0000 (16:57 +0200)
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

index 2d7ab71..aae8243 100644 (file)
@@ -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