DPDK patches and discussions
 help / color / Atom feed
* [dpdk-dev] net/e1000: correct mb function
@ 2019-09-10 17:41 Xiao Zhang
  2019-09-11  3:21 ` Gavin Hu (Arm Technology China)
  2019-09-11  9:30 ` Ye Xiaolong
  0 siblings, 2 replies; 3+ messages in thread
From: Xiao Zhang @ 2019-09-10 17:41 UTC (permalink / raw)
  To: dev; +Cc: wenzhuo.lu, Xiao Zhang, stable

Use rte_cio_wmb instead of rte_wmb when writing TX descriptor since it's
CIO memory.
Replace rte_io_wmb and E1000_PCI_REG_WRITE_RELAXED with
E1000_PCI_REG_WRITE since it has rte_io_wmb inside, which will be more
clear.

Fixes: 1fc9701238ed ("net/e1000: fix i219 hang on reset/close")
Cc: stable@dpdk.org

Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
---
 drivers/net/e1000/em_rxtx.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index 5925e49..49c5371 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -2049,13 +2049,12 @@ e1000_flush_tx_ring(struct rte_eth_dev *dev)
 		tx_desc->lower.data = rte_cpu_to_le_32(txd_lower | size);
 		tx_desc->upper.data = 0;
 
-		rte_wmb();
+		rte_cio_wmb();
 		txq->tx_tail++;
 		if (txq->tx_tail == txq->nb_tx_desc)
 			txq->tx_tail = 0;
-		rte_io_wmb();
 		tdt_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_TDT(i));
-		E1000_PCI_REG_WRITE_RELAXED(tdt_reg_addr, txq->tx_tail);
+		E1000_PCI_REG_WRITE(tdt_reg_addr, txq->tx_tail);
 		usec_delay(250);
 	}
 }
-- 
2.7.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] net/e1000: correct mb function
  2019-09-10 17:41 [dpdk-dev] net/e1000: correct mb function Xiao Zhang
@ 2019-09-11  3:21 ` Gavin Hu (Arm Technology China)
  2019-09-11  9:30 ` Ye Xiaolong
  1 sibling, 0 replies; 3+ messages in thread
From: Gavin Hu (Arm Technology China) @ 2019-09-11  3:21 UTC (permalink / raw)
  To: Xiao Zhang, dev
  Cc: wenzhuo.lu, stable, Honnappa Nagarahalli, Steve Capper,
	Phil Yang (Arm Technology China),
	Joyce Kong (Arm Technology China),
	nd



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Xiao Zhang
> Sent: Wednesday, September 11, 2019 1:41 AM
> To: dev@dpdk.org
> Cc: wenzhuo.lu@intel.com; Xiao Zhang <xiao.zhang@intel.com>;
> stable@dpdk.org
> Subject: [dpdk-dev] net/e1000: correct mb function
> 
> Use rte_cio_wmb instead of rte_wmb when writing TX descriptor since it's
> CIO memory.
> Replace rte_io_wmb and E1000_PCI_REG_WRITE_RELAXED with
> E1000_PCI_REG_WRITE since it has rte_io_wmb inside, which will be more
> clear.
> 
> Fixes: 1fc9701238ed ("net/e1000: fix i219 hang on reset/close")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
> ---
>  drivers/net/e1000/em_rxtx.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
> index 5925e49..49c5371 100644
> --- a/drivers/net/e1000/em_rxtx.c
> +++ b/drivers/net/e1000/em_rxtx.c
> @@ -2049,13 +2049,12 @@ e1000_flush_tx_ring(struct rte_eth_dev *dev)
>  		tx_desc->lower.data = rte_cpu_to_le_32(txd_lower | size);
>  		tx_desc->upper.data = 0;
> 
> -		rte_wmb();
> +		rte_cio_wmb();
>  		txq->tx_tail++;
>  		if (txq->tx_tail == txq->nb_tx_desc)
>  			txq->tx_tail = 0;
> -		rte_io_wmb();
>  		tdt_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_TDT(i));
> -		E1000_PCI_REG_WRITE_RELAXED(tdt_reg_addr, txq->tx_tail);
> +		E1000_PCI_REG_WRITE(tdt_reg_addr, txq->tx_tail);
>  		usec_delay(250);
>  	}
>  }

Reviewed-by: Gavin Hu <gavin.hu@arm.com> 
> --
> 2.7.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] net/e1000: correct mb function
  2019-09-10 17:41 [dpdk-dev] net/e1000: correct mb function Xiao Zhang
  2019-09-11  3:21 ` Gavin Hu (Arm Technology China)
@ 2019-09-11  9:30 ` Ye Xiaolong
  1 sibling, 0 replies; 3+ messages in thread
From: Ye Xiaolong @ 2019-09-11  9:30 UTC (permalink / raw)
  To: Xiao Zhang; +Cc: dev, wenzhuo.lu, stable

On 09/11, Xiao Zhang wrote:
>Use rte_cio_wmb instead of rte_wmb when writing TX descriptor since it's
>CIO memory.
>Replace rte_io_wmb and E1000_PCI_REG_WRITE_RELAXED with
>E1000_PCI_REG_WRITE since it has rte_io_wmb inside, which will be more
>clear.
>
>Fixes: 1fc9701238ed ("net/e1000: fix i219 hang on reset/close")
>Cc: stable@dpdk.org
>
>Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
>---
> drivers/net/e1000/em_rxtx.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
>diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
>index 5925e49..49c5371 100644
>--- a/drivers/net/e1000/em_rxtx.c
>+++ b/drivers/net/e1000/em_rxtx.c
>@@ -2049,13 +2049,12 @@ e1000_flush_tx_ring(struct rte_eth_dev *dev)
> 		tx_desc->lower.data = rte_cpu_to_le_32(txd_lower | size);
> 		tx_desc->upper.data = 0;
> 
>-		rte_wmb();
>+		rte_cio_wmb();
> 		txq->tx_tail++;
> 		if (txq->tx_tail == txq->nb_tx_desc)
> 			txq->tx_tail = 0;
>-		rte_io_wmb();
> 		tdt_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_TDT(i));
>-		E1000_PCI_REG_WRITE_RELAXED(tdt_reg_addr, txq->tx_tail);
>+		E1000_PCI_REG_WRITE(tdt_reg_addr, txq->tx_tail);
> 		usec_delay(250);
> 	}
> }
>-- 
>2.7.4
>

Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>

Applied to dpdk-next-net-intel with Gavin's reviewed-by tag.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-10 17:41 [dpdk-dev] net/e1000: correct mb function Xiao Zhang
2019-09-11  3:21 ` Gavin Hu (Arm Technology China)
2019-09-11  9:30 ` Ye Xiaolong

DPDK patches and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox