DPDK patches and discussions
 help / color / mirror / Atom feed
From: Howard Wang <howard_wang@realsil.com.cn>
To: <dev@dpdk.org>
Cc: <pro_nic_dpdk@realtek.com>, Howard Wang <howard_wang@realsil.com.cn>
Subject: [PATCH] net/r8169: replace rte_smp_rmb with atomic read
Date: Wed, 20 Nov 2024 10:45:04 +0800	[thread overview]
Message-ID: <20241120024504.65581-1-howard_wang@realsil.com.cn> (raw)

rte_smp_rmb is deprecated and it is too heavy.

Signed-off-by: Howard Wang <howard_wang@realsil.com.cn>
---
 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


                 reply	other threads:[~2024-11-20  2:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20241120024504.65581-1-howard_wang@realsil.com.cn \
    --to=howard_wang@realsil.com.cn \
    --cc=dev@dpdk.org \
    --cc=pro_nic_dpdk@realtek.com \
    /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).