* [PATCH] net/r8169: replace rte_smp_rmb with atomic read
@ 2024-11-20 2:45 Howard Wang
0 siblings, 0 replies; only message in thread
From: Howard Wang @ 2024-11-20 2:45 UTC (permalink / raw)
To: dev; +Cc: pro_nic_dpdk, Howard Wang
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-11-20 2:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-20 2:45 [PATCH] net/r8169: replace rte_smp_rmb with atomic read Howard Wang
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).