[dpdk-dev,v2,23/29] net/i40e: use eal I/O device memory read/write API

Message ID 20170104135339.GA56511@dpdk19 (mailing list archive)
State Not Applicable, archived
Headers

Checks

Context Check Description
ci/Intel compilation fail Compilation issues

Commit Message

Tiwei Bie Jan. 4, 2017, 1:53 p.m. UTC
  On Tue, Dec 27, 2016 at 03:19:29PM +0530, Jerin Jacob wrote:
> From: Santosh Shukla <santosh.shukla@caviumnetworks.com>
> 
> Replace the raw I/O device memory read/write access with eal abstraction
> for I/O device memory read/write access to fix portability issues across
> different architectures.
> 
[...]
> diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
> index 7ae7d9f..5c41a90 100644
> --- a/drivers/net/i40e/i40e_rxtx.c
> +++ b/drivers/net/i40e/i40e_rxtx.c
> @@ -1228,7 +1228,7 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
>  		   (unsigned) txq->port_id, (unsigned) txq->queue_id,
>  		   (unsigned) tx_id, (unsigned) nb_tx);
>  
> -	I40E_PCI_REG_WRITE(txq->qtx_tail, tx_id);
> +	I40E_PCI_REG_WRITE_RELAXED(txq->qtx_tail, tx_id);
>  	txq->tx_tail = tx_id;
>  
>  	return nb_tx;
> @@ -1380,7 +1380,7 @@ tx_xmit_pkts(struct i40e_tx_queue *txq,
>  
>  	/* Update the tx tail register */
>  	rte_wmb();
> -	I40E_PCI_REG_WRITE(txq->qtx_tail, txq->tx_tail);
> +	I40E_PCI_REG_WRITE_RELAXED(txq->qtx_tail, txq->tx_tail);
>  
>  	return nb_pkts;
>  }

Besides i40e_xmit_pkts() and tx_xmit_pkts(), i40e_rx_alloc_bufs() which is
called by rx_recv_pkts() is also in the fast path. So I40E_PCI_REG_WRITE()
called by it should also be replaced by the relaxed version:


Thanks & regards,
Tiwei Bie

> -- 
> 2.5.5
>
  

Comments

Santosh Shukla Jan. 4, 2017, 3:22 p.m. UTC | #1
On Wed, Jan 04, 2017 at 09:53:40PM +0800, Tiwei Bie wrote:
> On Tue, Dec 27, 2016 at 03:19:29PM +0530, Jerin Jacob wrote:
> > From: Santosh Shukla <santosh.shukla@caviumnetworks.com>
  
> >  	/* Update the tx tail register */
> >  	rte_wmb();
> > -	I40E_PCI_REG_WRITE(txq->qtx_tail, txq->tx_tail);
> > +	I40E_PCI_REG_WRITE_RELAXED(txq->qtx_tail, txq->tx_tail);
> >  
> >  	return nb_pkts;
> >  }
> 
> Besides i40e_xmit_pkts() and tx_xmit_pkts(), i40e_rx_alloc_bufs() which is
> called by rx_recv_pkts() is also in the fast path. So I40E_PCI_REG_WRITE()
> called by it should also be replaced by the relaxed version:
> 
> diff --git i/drivers/net/i40e/i40e_rxtx.c w/drivers/net/i40e/i40e_rxtx.c
> index 7ae7d9f..55a707a 100644
> --- i/drivers/net/i40e/i40e_rxtx.c
> +++ w/drivers/net/i40e/i40e_rxtx.c
> @@ -581,7 +581,7 @@ i40e_rx_alloc_bufs(struct i40e_rx_queue *rxq)
>  
>  	/* Update rx tail regsiter */
>  	rte_wmb();
> -	I40E_PCI_REG_WRITE(rxq->qrx_tail, rxq->rx_free_trigger);
> +	I40E_PCI_REG_WRITE_RELAXED(rxq->qrx_tail, rxq->rx_free_trigger);
>  
>  	rxq->rx_free_trigger =
>  		(uint16_t)(rxq->rx_free_trigger + rxq->rx_free_thresh);
> 

Yes.

Will queue it in v3.

> > -- 
> > 2.5.5
> >
  

Patch

diff --git i/drivers/net/i40e/i40e_rxtx.c w/drivers/net/i40e/i40e_rxtx.c
index 7ae7d9f..55a707a 100644
--- i/drivers/net/i40e/i40e_rxtx.c
+++ w/drivers/net/i40e/i40e_rxtx.c
@@ -581,7 +581,7 @@  i40e_rx_alloc_bufs(struct i40e_rx_queue *rxq)
 
 	/* Update rx tail regsiter */
 	rte_wmb();
-	I40E_PCI_REG_WRITE(rxq->qrx_tail, rxq->rx_free_trigger);
+	I40E_PCI_REG_WRITE_RELAXED(rxq->qrx_tail, rxq->rx_free_trigger);
 
 	rxq->rx_free_trigger =
 		(uint16_t)(rxq->rx_free_trigger + rxq->rx_free_thresh);