Use __atomic_fetch_{add,and,or,sub,xor} instead of
__atomic_{add,and,or,sub,xor}_fetch when we have no interest in the
result of the operation.

Reduces unnecessary codegen that provided the result of the atomic
operation that was not used.

Change brings closer alignment with atomics available in C11 standard
and will reduce review effort when they are integrated.

Signed-off-by: Tyler Retzlaff <roret...@linux.microsoft.com>
---
 lib/distributor/rte_distributor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/distributor/rte_distributor.c 
b/lib/distributor/rte_distributor.c
index 3969b2e..68840ce 100644
--- a/lib/distributor/rte_distributor.c
+++ b/lib/distributor/rte_distributor.c
@@ -200,7 +200,7 @@
         * we won't read any mbufs from there even if GET_BUF is set.
         * This allows distributor to retrieve in-flight already sent packets.
         */
-       __atomic_or_fetch(&(buf->bufptr64[0]), RTE_DISTRIB_RETURN_BUF,
+       __atomic_fetch_or(&(buf->bufptr64[0]), RTE_DISTRIB_RETURN_BUF,
                __ATOMIC_ACQ_REL);
 
        /* set the RETURN_BUF on retptr64 even if we got no returns.
-- 
1.8.3.1

Reply via email to