DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tyler Retzlaff <roretzla@linux.microsoft.com>
To: dev@dpdk.org
Cc: Honnappa.Nagarahalli@arm.com, Ruifeng.Wang@arm.com,
	thomas@monjalon.net,
	Tyler Retzlaff <roretzla@linux.microsoft.com>
Subject: [PATCH 2/3] crypto/ccp: use C11 memory model GCC builtin atomics
Date: Mon, 27 Mar 2023 07:30:19 -0700	[thread overview]
Message-ID: <1679927420-26737-3-git-send-email-roretzla@linux.microsoft.com> (raw)
In-Reply-To: <1679927420-26737-1-git-send-email-roretzla@linux.microsoft.com>

Replace use of __sync_fetch_and_or and __sync_fetch_and_and with
__atomic_fetch_or and __atomic_fetch_and.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 drivers/crypto/ccp/ccp_dev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/ccp/ccp_dev.c b/drivers/crypto/ccp/ccp_dev.c
index ee30f5a..b7ca3af 100644
--- a/drivers/crypto/ccp/ccp_dev.c
+++ b/drivers/crypto/ccp/ccp_dev.c
@@ -116,13 +116,15 @@ struct ccp_queue *
 static inline void
 ccp_set_bit(unsigned long *bitmap, int n)
 {
-	__sync_fetch_and_or(&bitmap[WORD_OFFSET(n)], (1UL << BIT_OFFSET(n)));
+	__atomic_fetch_or(&bitmap[WORD_OFFSET(n)], (1UL << BIT_OFFSET(n)),
+		__ATOMIC_SEQ_CST);
 }
 
 static inline void
 ccp_clear_bit(unsigned long *bitmap, int n)
 {
-	__sync_fetch_and_and(&bitmap[WORD_OFFSET(n)], ~(1UL << BIT_OFFSET(n)));
+	__atomic_fetch_and(&bitmap[WORD_OFFSET(n)], ~(1UL << BIT_OFFSET(n)),
+		__ATOMIC_SEQ_CST);
 }
 
 static inline uint32_t
-- 
1.8.3.1


  parent reply	other threads:[~2023-03-27 14:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-27 14:30 [PATCH 0/3] " Tyler Retzlaff
2023-03-27 14:30 ` [PATCH 1/3] bus/vmbus: " Tyler Retzlaff
2023-03-27 14:30 ` Tyler Retzlaff [this message]
2023-03-27 14:30 ` [PATCH 3/3] eal: " Tyler Retzlaff
2023-03-27 15:25 ` [PATCH 0/3] " Morten Brørup
2023-05-24 12:51 ` David Marchand
2023-05-24 16:05   ` Tyler Retzlaff
2023-06-02  4:18     ` Tyler Retzlaff
2023-06-07 16:36       ` David Marchand
2023-06-07 16:46 ` David Marchand

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=1679927420-26737-3-git-send-email-roretzla@linux.microsoft.com \
    --to=roretzla@linux.microsoft.com \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=Ruifeng.Wang@arm.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    /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).