diff mbox series

net/i40e: fix potential Tx hang

Message ID 1618819116-72683-1-git-send-email-wenzhuo.lu@intel.com (mailing list archive)
State Rejected
Delegated to: Qi Zhang
Headers show
Series net/i40e: fix potential Tx hang | expand

Checks

Context Check Description
ci/iol-abi-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/github-robot success github build: passed
ci/travis-robot success travis build: passed
ci/Intel-compilation fail apply issues
ci/checkpatch success coding style OK

Commit Message

Wenzhuo Lu April 19, 2021, 7:58 a.m. UTC
Tx hang may happen if there's no memory barrier.

Fixes: b4669bb95038 ("i40e: add vector Tx")
Fixes: aed68d5b0e81 ("net/i40e: add AVX2 Tx function")
Fixes: e6a6a138919f ("net/i40e: add AVX512 vector path")
Cc: stable@dpdk.org

Reported-by: Tao Yang <tao.y.yang@intel.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 drivers/net/i40e/i40e_rxtx_vec_avx2.c   | 1 +
 drivers/net/i40e/i40e_rxtx_vec_avx512.c | 1 +
 drivers/net/i40e/i40e_rxtx_vec_sse.c    | 1 +
 3 files changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/i40e/i40e_rxtx_vec_avx2.c b/drivers/net/i40e/i40e_rxtx_vec_avx2.c
index 3b9eef9..a06813c 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_avx2.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_avx2.c
@@ -816,6 +816,7 @@ 
 
 	txq->tx_tail = tx_id;
 
+	rte_io_wmb();
 	I40E_PCI_REG_WC_WRITE(txq->qtx_tail, txq->tx_tail);
 
 	return nb_pkts;
diff --git a/drivers/net/i40e/i40e_rxtx_vec_avx512.c b/drivers/net/i40e/i40e_rxtx_vec_avx512.c
index bd21d64..2f0915e 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_avx512.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_avx512.c
@@ -1111,6 +1111,7 @@ 
 
 	txq->tx_tail = tx_id;
 
+	rte_io_wmb();
 	I40E_PCI_REG_WC_WRITE(txq->qtx_tail, txq->tx_tail);
 
 	return nb_pkts;
diff --git a/drivers/net/i40e/i40e_rxtx_vec_sse.c b/drivers/net/i40e/i40e_rxtx_vec_sse.c
index bfa5aff..b37bc71 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_sse.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_sse.c
@@ -759,6 +759,7 @@ 
 
 	txq->tx_tail = tx_id;
 
+	rte_io_wmb();
 	I40E_PCI_REG_WC_WRITE(txq->qtx_tail, txq->tx_tail);
 
 	return nb_pkts;