From patchwork Thu Feb 15 06:50:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 136820 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 21BE743B06; Thu, 15 Feb 2024 07:51:24 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DDA01433A0; Thu, 15 Feb 2024 07:51:11 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 121CB43392 for ; Thu, 15 Feb 2024 07:51:07 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 5C037207F22D; Wed, 14 Feb 2024 22:51:06 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 5C037207F22D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1707979866; bh=Tf1IWRtGL5pWwpYHUju++bcZEZwnKFQoz+d0bBKad58=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KnyYuSXQRYMQ/KtQWU/OO+KxqXhoQReuD/cwjPriuUAgo9lpKVkMNIV/rhyDXNLZT XfaXHD71qN9s0YX+h8Fy5oV08Gxpt3sycg2vTV3pv+RtIEP8v6Di9YUIQrPZ/nq3LO Tjy2ECBhHToQwiaqZDo59hDFoaTMc/WwBmCItToE= From: Tyler Retzlaff To: dev@dpdk.org Cc: Bruce Richardson , David Hunt , Honnappa Nagarahalli , Jerin Jacob , Konstantin Ananyev , Sameh Gobriel , Sunil Kumar Kori , Vladimir Medvedkin , Yipeng Wang , mb@smartsharesystems.com, thomas@monjalon.net, Tyler Retzlaff Subject: [PATCH v2 3/6] hash: use rte atomic thread fence Date: Wed, 14 Feb 2024 22:50:56 -0800 Message-Id: <1707979859-3984-4-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1707979859-3984-1-git-send-email-roretzla@linux.microsoft.com> References: <1698894265-22963-1-git-send-email-roretzla@linux.microsoft.com> <1707979859-3984-1-git-send-email-roretzla@linux.microsoft.com> MIME-Version: 1.0 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 Use rte_atomic_thread_fence instead of directly using __atomic_thread_fence builtin gcc intrinsic Signed-off-by: Tyler Retzlaff Acked-by: Morten Brørup --- lib/hash/rte_cuckoo_hash.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c index 7045675..9cf9464 100644 --- a/lib/hash/rte_cuckoo_hash.c +++ b/lib/hash/rte_cuckoo_hash.c @@ -878,7 +878,7 @@ struct rte_hash * /* The store to sig_current should not * move above the store to tbl_chng_cnt. */ - __atomic_thread_fence(rte_memory_order_release); + rte_atomic_thread_fence(rte_memory_order_release); } /* Need to swap current/alt sig to allow later @@ -910,7 +910,7 @@ struct rte_hash * /* The store to sig_current should not * move above the store to tbl_chng_cnt. */ - __atomic_thread_fence(rte_memory_order_release); + rte_atomic_thread_fence(rte_memory_order_release); } curr_bkt->sig_current[curr_slot] = sig; @@ -1403,7 +1403,7 @@ struct rte_hash * /* The loads of sig_current in search_one_bucket * should not move below the load from tbl_chng_cnt. */ - __atomic_thread_fence(rte_memory_order_acquire); + rte_atomic_thread_fence(rte_memory_order_acquire); /* Re-read the table change counter to check if the * table has changed during search. If yes, re-do * the search. @@ -1632,7 +1632,7 @@ struct rte_hash * /* The store to sig_current should * not move above the store to tbl_chng_cnt. */ - __atomic_thread_fence(rte_memory_order_release); + rte_atomic_thread_fence(rte_memory_order_release); } last_bkt->sig_current[i] = NULL_SIGNATURE; rte_atomic_store_explicit(&last_bkt->key_idx[i], @@ -2223,7 +2223,7 @@ struct rte_hash * /* The loads of sig_current in compare_signatures * should not move below the load from tbl_chng_cnt. */ - __atomic_thread_fence(rte_memory_order_acquire); + rte_atomic_thread_fence(rte_memory_order_acquire); /* Re-read the table change counter to check if the * table has changed during search. If yes, re-do * the search.