From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E2B1C43B06; Thu, 15 Feb 2024 07:51:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A1850433F0; Thu, 15 Feb 2024 07:51:15 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id E3D3342EA1 for ; Thu, 15 Feb 2024 07:51:07 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 83D9C207F230; Wed, 14 Feb 2024 22:51:06 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 83D9C207F230 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1707979866; bh=R843Bd5B4BNkiQ7oCKIC8692QQ0pRVF+SVgT/SUdbd8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T/Pl2rfD63GlyB7geVY4unlIa+6y5HRkwlZaINTwLLEG8Xb4+c7UuUruIlHp3RmJi XgK88O0mp0jIWen5JTgaTemowliLE7pR+bhB/JcMCIx9hyad7MtlzhLiD/1eio9Izf S0O7GTbAG4mHF30a1AYFljyNwQ1TbF2mpbVwzGLI= 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 6/6] lpm: use rte atomic thread fence Date: Wed, 14 Feb 2024 22:50:59 -0800 Message-Id: <1707979859-3984-7-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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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/lpm/rte_lpm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/lpm/rte_lpm.c b/lib/lpm/rte_lpm.c index 363058e..9633d63 100644 --- a/lib/lpm/rte_lpm.c +++ b/lib/lpm/rte_lpm.c @@ -1116,7 +1116,7 @@ struct rte_lpm * * Prevent the free of the tbl8 group from hoisting. */ i_lpm->lpm.tbl24[tbl24_index].valid = 0; - __atomic_thread_fence(__ATOMIC_RELEASE); + rte_atomic_thread_fence(rte_memory_order_release); status = tbl8_free(i_lpm, tbl8_group_start); } else if (tbl8_recycle_index > -1) { /* Update tbl24 entry. */ @@ -1132,7 +1132,7 @@ struct rte_lpm * */ __atomic_store(&i_lpm->lpm.tbl24[tbl24_index], &new_tbl24_entry, __ATOMIC_RELAXED); - __atomic_thread_fence(__ATOMIC_RELEASE); + rte_atomic_thread_fence(rte_memory_order_release); status = tbl8_free(i_lpm, tbl8_group_start); } #undef group_idx -- 1.8.3.1