[v2,2/5] net/ice: use relaxed and remove duplicate barrier

Message ID 1568633238-47888-3-git-send-email-gavin.hu@arm.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series fix and optimize barriers usage with some PMDs |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Gavin Hu Sept. 16, 2019, 11:27 a.m. UTC
  To guarantee the orderings of successive stores to CIO and MMIO memory,
a lighter weight rte_io_wmb [1] can be used instead of rte_wmb, and since
the ICE_PCI_REG_WRITE API already has an inclusive rte_io_wmb, this
explicit call can even be saved.

[1] http://git.dpdk.org/dpdk/tree/lib/librte_eal/common/include/generic/
rte_atomic.h#n98

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
---
 drivers/net/ice/ice_rxtx.c | 6 ------
 1 file changed, 6 deletions(-)
  

Comments

Qi Zhang Sept. 17, 2019, 1:51 a.m. UTC | #1
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Gavin Hu
> Sent: Monday, September 16, 2019 7:27 PM
> To: dev@dpdk.org
> Cc: nd@arm.com; thomas@monjalon.net; Richardson, Bruce
> <bruce.richardson@intel.com>; Liu, Yong <yong.liu@intel.com>; Wang, Yinan
> <yinan.wang@intel.com>; ajit.khaparde@broadcom.com;
> somnath.kotur@broadcom.com; Honnappa.Nagarahalli@arm.com;
> ruifeng.wang@arm.com; steve.capper@arm.com
> Subject: [dpdk-dev] [PATCH v2 2/5] net/ice: use relaxed and remove duplicate
> barrier
> 
> To guarantee the orderings of successive stores to CIO and MMIO memory, a
> lighter weight rte_io_wmb [1] can be used instead of rte_wmb, and since the
> ICE_PCI_REG_WRITE API already has an inclusive rte_io_wmb, this explicit call
> can even be saved.
> 
> [1] http://git.dpdk.org/dpdk/tree/lib/librte_eal/common/include/generic/
> rte_atomic.h#n98
> 
> Signed-off-by: Gavin Hu <gavin.hu@arm.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>
  

Patch

diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index 81af814..2366119 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -363,8 +363,6 @@  ice_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 		return -ENOMEM;
 	}
 
-	rte_wmb();
-
 	/* Init the RX tail register. */
 	ICE_PCI_REG_WRITE(rxq->qrx_tail, rxq->nb_rx_desc - 1);
 
@@ -1212,7 +1210,6 @@  ice_rx_alloc_bufs(struct ice_rx_queue *rxq)
 	}
 
 	/* Update rx tail regsiter */
-	rte_wmb();
 	ICE_PCI_REG_WRITE(rxq->qrx_tail, rxq->rx_free_trigger);
 
 	rxq->rx_free_trigger =
@@ -2132,8 +2129,6 @@  ice_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 					 ICE_TXD_QW1_CMD_S);
 	}
 end_of_tx:
-	rte_wmb();
-
 	/* update Tail register */
 	ICE_PCI_REG_WRITE(txq->qtx_tail, tx_id);
 	txq->tx_tail = tx_id;
@@ -2289,7 +2284,6 @@  tx_xmit_pkts(struct ice_tx_queue *txq,
 		txq->tx_tail = 0;
 
 	/* Update the tx tail register */
-	rte_wmb();
 	ICE_PCI_REG_WRITE(txq->qtx_tail, txq->tx_tail);
 
 	return nb_pkts;