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 7B68945D48; Wed, 20 Nov 2024 03:45:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5003542E92; Wed, 20 Nov 2024 03:45:11 +0100 (CET) Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by mails.dpdk.org (Postfix) with ESMTP id 6783A42E90 for ; Wed, 20 Nov 2024 03:45:09 +0100 (CET) X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 4AK2j5Ka93393133, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=realsil.com.cn; s=dkim; t=1732070706; bh=rw1efjjzAWig6xp6sVib9kCcjHTnnn3c3/oFVATwS18=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:Content-Type; b=gbl//plld+NmK247s3fUz1efHALR4xPSY1ud3rlfUUjmL2XMEIdbKbc7Gj8vA2xEl 90iJb67v7Cd1/bcRDf6QQ82Z61oiOvbsd7+D53ASN/fzFpB+/puYl2cSXzVbdkXacx fCxCI3uN3/BylQKhin5IMGPQ+InoQO77qYadGBVTNOKAAH2TdBK8N2mSMnDRpZeEE8 OHcijURjarLthEWa7Oc5zKb4qnNSYxsjk3vE1CHYwf0oD+XUNLow7MnTOxKhLGMjWz 3EA4fzshWmR7QELTKgXVjCCGc+zqQVepK7BL6k6rFNPZrkRCZbcfBQticxHJTwFz4L 2PRnJUdKHUppA== Received: from RSEXMBS01.realsil.com.cn ([172.29.17.195]) by rtits2.realtek.com.tw (8.15.2/3.06/5.92) with ESMTPS id 4AK2j5Ka93393133 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Wed, 20 Nov 2024 10:45:06 +0800 Received: from RSEXH36502.realsil.com.cn (172.29.17.3) by RSEXMBS01.realsil.com.cn (172.29.17.195) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 20 Nov 2024 10:45:05 +0800 Received: from 172.29.32.27 (172.29.32.27) by RSEXH36502.realsil.com.cn (172.29.17.3) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Wed, 20 Nov 2024 10:45:05 +0800 From: Howard Wang To: CC: , Howard Wang Subject: [PATCH] net/r8169: replace rte_smp_rmb with atomic read Date: Wed, 20 Nov 2024 10:45:04 +0800 Message-ID: <20241120024504.65581-1-howard_wang@realsil.com.cn> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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 rte_smp_rmb is deprecated and it is too heavy. Signed-off-by: Howard Wang --- drivers/net/r8169/r8169_rxtx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/r8169/r8169_rxtx.c b/drivers/net/r8169/r8169_rxtx.c index a3b86300f0..57b97338d4 100644 --- a/drivers/net/r8169/r8169_rxtx.c +++ b/drivers/net/r8169/r8169_rxtx.c @@ -38,7 +38,7 @@ /* Struct TxDesc in kernel r8169 */ struct rtl_tx_desc { - u32 opts1; + RTE_ATOMIC(u32) opts1; u32 opts2; u64 addr; u32 reserved0; @@ -1264,9 +1264,9 @@ rtl_get_hw_clo_ptr(struct rtl_hw *hw) static u32 rtl_get_opts1(struct rtl_tx_desc *txd) { - rte_smp_rmb(); + u32 opts1 = rte_atomic_load_explicit(&txd->opts1, rte_memory_order_acquire); - return rte_le_to_cpu_32(txd->opts1); + return rte_le_to_cpu_32(opts1); } static void -- 2.34.1