[2/6] net/hns3: modify write reg opt API impl

Message ID 1619408092-54050-3-git-send-email-humin29@huawei.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Series optimization and bugfix for hns3 PMD |


Context Check Description
ci/checkpatch success coding style OK

Commit Message

humin (Q) April 26, 2021, 3:34 a.m. UTC
  From: Chengwen Feng <fengchengwen@huawei.com>

This patch modifies hns3_write_reg_opt() API implementation because
the rte_write32() already uses rte_io_wmb().

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
 drivers/net/hns3/hns3_ethdev.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)


diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h
index de17878..68541df 100644
--- a/drivers/net/hns3/hns3_ethdev.h
+++ b/drivers/net/hns3/hns3_ethdev.h
@@ -983,13 +983,13 @@  static inline void hns3_write_reg(void *base, uint32_t reg, uint32_t value)
- * The optimized function for writing registers used in the '.rx_pkt_burst' and
- * '.tx_pkt_burst' ops implementation function.
+ * The optimized function for writing registers reduces one address addition
+ * calculation, it was used in the '.rx_pkt_burst' and '.tx_pkt_burst' ops
+ * implementation function.
 static inline void hns3_write_reg_opt(volatile void *addr, uint32_t value)
-	rte_io_wmb();
-	rte_write32_relaxed(rte_cpu_to_le_32(value), addr);
+	rte_write32(rte_cpu_to_le_32(value), addr);
 static inline uint32_t hns3_read_reg(void *base, uint32_t reg)