From patchwork Mon Mar 27 14:30:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 125530 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 889004284B; Mon, 27 Mar 2023 16:30:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 189AC4161A; Mon, 27 Mar 2023 16:30:25 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 0142640F18 for ; Mon, 27 Mar 2023 16:30:22 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 4BBB920FD8BC; Mon, 27 Mar 2023 07:30:22 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 4BBB920FD8BC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1679927422; bh=hs0LCV9NmIVAwZjInoFm1WLDLLnt2EUS+6rY36LylG0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aCTX+S2Jcttr34STcoHzP37Ueq/ZEK/6tluDzKnZy7/XH67zYTnpE+Bj9aJCy+kTf R80gW/QFmxg+hK51ughPhv0ivARyjGIVhcdKD8ZueZ86kQzDCLmKcXCIcBAXaf1X/n 7vIac2+qRG5Y1eblDm7c+2f0bSnZ5hdeIyK9eAfw= From: Tyler Retzlaff To: dev@dpdk.org Cc: Honnappa.Nagarahalli@arm.com, Ruifeng.Wang@arm.com, thomas@monjalon.net, Tyler Retzlaff Subject: [PATCH 2/3] crypto/ccp: use C11 memory model GCC builtin atomics Date: Mon, 27 Mar 2023 07:30:19 -0700 Message-Id: <1679927420-26737-3-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1679927420-26737-1-git-send-email-roretzla@linux.microsoft.com> References: <1679927420-26737-1-git-send-email-roretzla@linux.microsoft.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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