Skip to contentSkip to conversation

net/ice: fix txq mbuf release mode

dpdk-dev Superseded Alvin Zhang 4 participants 10 messages Apr 25, 2021 – May 8, 2021 Network drivers

lore
Share & tools
lore
#0 lore raw

In some cases, it seems that the txq mbuf vector release mode is enabled first, and then it is confirmed that the conditions for using the vector mode are not met.

This patch puts the txq vector mode startup process after the condition detection.

Fixes 28f9002ab67f ("net/ice: add Tx AVX512 offload path")
---
 drivers/net/ice/ice_rxtx.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/net/ice/ice_rxtx.c +9 -7
index 92fbbc1..49abcb2 100644
@@ -3303,13 +3303,6 @@
 		if (tx_check_ret >= 0 &&
 		    rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) {
 			ad->tx_vec_allowed = true;
-			for (i = 0; i < dev->data->nb_tx_queues; i++) {
-				txq = dev->data->tx_queues[i];
-				if (txq && ice_txq_vec_setup(txq)) {
-					ad->tx_vec_allowed = false;
-					break;
-				}
-			}
 
 			if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_512 &&
 			rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 &&
@@ -3329,6 +3322,15 @@
 			if (!use_avx512 && tx_check_ret == ICE_VECTOR_OFFLOAD_PATH)
 				ad->tx_vec_allowed = false;
 
+			if (ad->tx_vec_allowed) {
+				for (i = 0; i < dev->data->nb_tx_queues; i++) {
+					txq = dev->data->tx_queues[i];
+					if (txq && ice_txq_vec_setup(txq)) {
+						ad->tx_vec_allowed = false;
+						break;
+					}
+				}
+			}
 		} else {
 			ad->tx_vec_allowed = false;
 		}
Signature · 1 line
1.8.3.1
Acked-by
#1 lore raw
Quoted 61 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Alvin Zhang
Sent: Sunday, April 25, 2021 5:27 PM
To: Zhang, Qi Z <[email protected]>; Yang, Qiming <[email protected]>
Cc: [email protected]; Zhang, AlvinX <[email protected]>; [email protected]
Subject: [dpdk-dev] [DPDK] net/ice: fix txq mbuf release mode

In some cases, it seems that the txq mbuf vector release mode is enabled first, and then it is confirmed that the conditions for using the vector mode are not met.

This patch puts the txq vector mode startup process after the condition detection.

Fixes 28f9002ab67f ("net/ice: add Tx AVX512 offload path")
---
 drivers/net/ice/ice_rxtx.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/net/ice/ice_rxtx.c index renamed from drivers/net/ice/ice_rxtx.c +0 -0

92fbbc1..49abcb2 100644

drivers/net/ice/ice_rxtx.c +0 -7
@@ -3303,13 +3303,6 @@
 		if (tx_check_ret >= 0 &&
 		    rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128)
 {
 			ad->tx_vec_allowed = true;
-			for (i = 0; i < dev->data->nb_tx_queues; i++) {
-				txq = dev->data->tx_queues[i];
-				if (txq && ice_txq_vec_setup(txq)) {
-					ad->tx_vec_allowed = false;
-					break;
-				}
-			}
 
 			if (rte_vect_get_max_simd_bitwidth() >=

RTE_VECT_SIMD_512 &&
rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) ==
1 && @@ -3329,6 +3322,15 @@
if (!use_avx512 && tx_check_ret ==
ICE_VECTOR_OFFLOAD_PATH)

drivers/net/ice/ice_rxtx.c +9 -1
 				ad->tx_vec_allowed = false;
 
+			if (ad->tx_vec_allowed) {
+				for (i = 0; i < dev->data->nb_tx_queues; i++) {
+					txq = dev->data->tx_queues[i];
+					if (txq && ice_txq_vec_setup(txq)) {
+						ad->tx_vec_allowed = false;
+						break;
+					}
+				}
+			}
 		} else {
 			ad->tx_vec_allowed = false;
 		}
--
Quoted 1 line

1.8.3.1

Applied
#2 lore raw
Quoted 60 lines

-----Original Message-----
From: Rong, Leyi <[email protected]>
Sent: 2021年4月27日 10:32
To: Zhang, AlvinX <[email protected]>; Zhang, Qi Z <[email protected]>; Yang, Qiming <[email protected]>
Cc: [email protected]; Zhang, AlvinX <[email protected]>; [email protected]
Subject: RE: [dpdk-dev] [DPDK] net/ice: fix txq mbuf release mode

Quoted 48 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Alvin Zhang
Sent: Sunday, April 25, 2021 5:27 PM
To: Zhang, Qi Z <[email protected]>; Yang, Qiming <[email protected]>
Cc: [email protected]; Zhang, AlvinX <[email protected]>; [email protected]
Subject: [dpdk-dev] [DPDK] net/ice: fix txq mbuf release mode

In some cases, it seems that the txq mbuf vector release mode is enabled first, and then it is confirmed that the conditions for using the vector mode are not met.

This patch puts the txq vector mode startup process after the condition detection.

Fixes 28f9002ab67f ("net/ice: add Tx AVX512 offload path")
---
 drivers/net/ice/ice_rxtx.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/net/ice/ice_rxtx.c +0 -0

index
92fbbc1..49abcb2 100644

drivers/net/ice/ice_rxtx.c +0 -0
@@ -3303,13 +3303,6 @@
 if (tx_check_ret >= 0 &&
     rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) {
 ad->tx_vec_allowed = true; -for (i = 0; i < dev->data->nb_tx_queues;

i++) { -txq = dev->data->tx_queues[i]; -if (txq && ice_txq_vec_setup(txq)) {

drivers/net/ice/ice_rxtx.c +0 -4
-ad->tx_vec_allowed = false;
-break;
-}
-}
 
 if (rte_vect_get_max_simd_bitwidth() >=

RTE_VECT_SIMD_512 &&
rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) ==
1 && @@ -3329,6 +3322,15 @@
if (!use_avx512 && tx_check_ret ==
ICE_VECTOR_OFFLOAD_PATH)
ad->tx_vec_allowed = false;

Quoted 15 lines
Quoted 12 lines
drivers/net/ice/ice_rxtx.c +8 -1
+if (ad->tx_vec_allowed) {
+for (i = 0; i < dev->data->nb_tx_queues; i++) { txq =
+dev->data->tx_queues[i]; if (txq && ice_txq_vec_setup(txq)) {
+ad->tx_vec_allowed = false;
+break;
+}
+}
+}
 } else {
 ad->tx_vec_allowed = false;
 }
--
Quoted 1 line

1.8.3.1

Applied to dpdk-next-net-intel.

Thanks
Qi

#3 lore raw
In reply to Alvin Zhang
Quoted 4 lines · Alvin Zhang

In some cases, it seems that the txq mbuf vector release mode is enabled first, and then it is confirmed that the conditions for using the vector mode are not met.

Hi Alvin,

As far as I understand the impact is failure in the Tx vector patch selection, can you please update the patch title to reflect it?

Also can you please describe a little more what is "txq mbuf vector release mode" and what is the root cause for it to be enabled first?

Quoted 2 lines

This patch puts the txq vector mode startup process after the condition detection.

What is "txq vector mode startup process"?

Quoted 44 lines
Fixes 28f9002ab67f ("net/ice: add Tx AVX512 offload path")
---
 drivers/net/ice/ice_rxtx.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/net/ice/ice_rxtx.c +9 -7
index 92fbbc1..49abcb2 100644
@@ -3303,13 +3303,6 @@
 		if (tx_check_ret >= 0 &&
 		    rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) {
 			ad->tx_vec_allowed = true;
-			for (i = 0; i < dev->data->nb_tx_queues; i++) {
-				txq = dev->data->tx_queues[i];
-				if (txq && ice_txq_vec_setup(txq)) {
-					ad->tx_vec_allowed = false;
-					break;
-				}
-			}
 
 			if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_512 &&
 			rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 &&
@@ -3329,6 +3322,15 @@
 			if (!use_avx512 && tx_check_ret == ICE_VECTOR_OFFLOAD_PATH)
 				ad->tx_vec_allowed = false;
 
+			if (ad->tx_vec_allowed) {
+				for (i = 0; i < dev->data->nb_tx_queues; i++) {
+					txq = dev->data->tx_queues[i];
+					if (txq && ice_txq_vec_setup(txq)) {
+						ad->tx_vec_allowed = false;
+						break;
+					}
+				}
+			}
 		} else {
 			ad->tx_vec_allowed = false;
 		}
#4 lore raw

Hi Ferruh,

Thanks for your advice. I'll update the commit log in V2. If the following changes are appropriate?

net/ice: fix txq vector path selection

If Tx vector mode is disabled, the txq vector mode should be disabled too. This patch adds checking of Tx vector mode before enabling txq vector mode.

Quoted 61 lines

-----Original Message-----
From: Yigit, Ferruh <[email protected]>
Sent: Wednesday, April 28, 2021 6:03 PM
To: Zhang, AlvinX <[email protected]>; Zhang, Qi Z <[email protected]>; Yang, Qiming <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [dpdk-stable] [DPDK] net/ice: fix txq mbuf release mode

Quoted 4 lines · Alvin Zhang

In some cases, it seems that the txq mbuf vector release mode is enabled first, and then it is confirmed that the conditions for using the vector mode are not met.

Hi Alvin,

As far as I understand the impact is failure in the Tx vector patch selection, can you please update the patch title to reflect it?

Also can you please describe a little more what is "txq mbuf vector release mode" and what is the root cause for it to be enabled first?

Quoted 2 lines

This patch puts the txq vector mode startup process after the condition detection.

What is "txq vector mode startup process"?

Quoted 16 lines
Fixes 28f9002ab67f ("net/ice: add Tx AVX512 offload path")
---
 drivers/net/ice/ice_rxtx.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/net/ice/ice_rxtx.c +0 -0
index 92fbbc1..49abcb2 100644
@@ -3303,13 +3303,6 @@
 		if (tx_check_ret >= 0 &&
 		    rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) {

drivers/net/ice/ice_rxtx.c line 3307

Quoted 10 lines
drivers/net/ice/ice_rxtx.c +0 -7
 			ad->tx_vec_allowed = true;
-			for (i = 0; i < dev->data->nb_tx_queues; i++) {
-				txq = dev->data->tx_queues[i];
-				if (txq && ice_txq_vec_setup(txq)) {
-					ad->tx_vec_allowed = false;
-					break;
-				}
-			}
 
 			if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_512

&&

drivers/net/ice/ice_rxtx.c line 3308

Quoted 1 line
drivers/net/ice/ice_rxtx.c +0 -0
 			rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 &&

@@ -3329,6

Quoted 2 lines

+3322,15 @@
if (!use_avx512 && tx_check_ret ==

ICE_VECTOR_OFFLOAD_PATH)

Quoted 2 lines

ad->tx_vec_allowed = false;

Quoted 13 lines

drivers/net/ice/ice_rxtx.c line 3336

Quoted 13 lines
drivers/net/ice/ice_rxtx.c +9 -0
+			if (ad->tx_vec_allowed) {
+				for (i = 0; i < dev->data->nb_tx_queues; i++) {
+					txq = dev->data->tx_queues[i];
+					if (txq && ice_txq_vec_setup(txq)) {
+						ad->tx_vec_allowed = false;
+						break;
+					}
+				}
+			}
 		} else {
 			ad->tx_vec_allowed = false;
 		}

Thanks,
Alvin Zhang

#5 lore raw

PATCH v2 1/1 net/ice: fix txq vector path selection

In reply to Alvin Zhang

If Tx vector mode is disabled, the txq vector mode should be disabled too.

This patch adds checking of Tx vector mode before enabling txq vector mode.

Fixes 28f9002ab67f ("net/ice: add Tx AVX512 offload path")

---

v2: Update commit log.

---
 drivers/net/ice/ice_rxtx.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/net/ice/ice_rxtx.c +9 -7
index 92fbbc1..49abcb2 100644
@@ -3303,13 +3303,6 @@
 		if (tx_check_ret >= 0 &&
 		    rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) {
 			ad->tx_vec_allowed = true;
-			for (i = 0; i < dev->data->nb_tx_queues; i++) {
-				txq = dev->data->tx_queues[i];
-				if (txq && ice_txq_vec_setup(txq)) {
-					ad->tx_vec_allowed = false;
-					break;
-				}
-			}
 
 			if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_512 &&
 			rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 &&
@@ -3329,6 +3322,15 @@
 			if (!use_avx512 && tx_check_ret == ICE_VECTOR_OFFLOAD_PATH)
 				ad->tx_vec_allowed = false;
 
+			if (ad->tx_vec_allowed) {
+				for (i = 0; i < dev->data->nb_tx_queues; i++) {
+					txq = dev->data->tx_queues[i];
+					if (txq && ice_txq_vec_setup(txq)) {
+						ad->tx_vec_allowed = false;
+						break;
+					}
+				}
+			}
 		} else {
 			ad->tx_vec_allowed = false;
 		}
Signature · 1 line
1.8.3.1
#6 lore raw

Re: [dpdk-dev] [PATCH v2] net/ice: fix txq vector path selection

Quoted 10 lines

-----Original Message-----
From: Zhang, AlvinX <[email protected]>
Sent: Saturday, May 8, 2021 9:21 AM
To: Zhang, Qi Z <[email protected]>; Yigit, Ferruh <[email protected]>
Cc: [email protected]; Zhang, AlvinX <[email protected]>; [email protected]
Subject: [PATCH v2] net/ice: fix txq vector path selection

If Tx vector mode is disabled, the txq vector mode should be disabled too.

If vector mode is not allowed for Tx, no need to perform vector related setup for Tx queue

Quoted 2 lines

This patch adds checking of Tx vector mode before enabling txq vector mode.

The patch deferred vector setup for Tx queue to the place that vector mode is confirmed to be allowed.

Quoted 3 lines
Fixes 28f9002ab67f ("net/ice: add Tx AVX512 offload path")

No need to add Cc stable, if you fix on current release.

Quoted 47 lines

---

v2: Update commit log.

---
 drivers/net/ice/ice_rxtx.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/net/ice/ice_rxtx.c index renamed from drivers/net/ice/ice_rxtx.c +0 -0

92fbbc1..49abcb2 100644

drivers/net/ice/ice_rxtx.c +0 -7
@@ -3303,13 +3303,6 @@
 		if (tx_check_ret >= 0 &&
 		    rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) {
 			ad->tx_vec_allowed = true;
-			for (i = 0; i < dev->data->nb_tx_queues; i++) {
-				txq = dev->data->tx_queues[i];
-				if (txq && ice_txq_vec_setup(txq)) {
-					ad->tx_vec_allowed = false;
-					break;
-				}
-			}
 
 			if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_512

&&

drivers/net/ice/ice_rxtx.c +9 -0
 			rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 &&
@@ -3329,6 +3322,15 @@
 			if (!use_avx512 && tx_check_ret ==
 ICE_VECTOR_OFFLOAD_PATH)
 				ad->tx_vec_allowed = false;
 
+			if (ad->tx_vec_allowed) {
+				for (i = 0; i < dev->data->nb_tx_queues; i++) {
+					txq = dev->data->tx_queues[i];
+					if (txq && ice_txq_vec_setup(txq)) {
+						ad->tx_vec_allowed = false;
+						break;
+					}
+				}
+			}
 		} else {
 			ad->tx_vec_allowed = false;

}
--
1.8.3.1

#7 lore raw

Re: [dpdk-dev] [PATCH v2] net/ice: fix txq vector path selection

Thanks Qi,

Quoted 26 lines

-----Original Message-----
From: Zhang, Qi Z <[email protected]>
Sent: Saturday, May 8, 2021 10:37 AM
To: Zhang, AlvinX <[email protected]>; Yigit, Ferruh <[email protected]>
Cc: [email protected]; [email protected]
Subject: RE: [PATCH v2] net/ice: fix txq vector path selection

Quoted 10 lines

-----Original Message-----
From: Zhang, AlvinX <[email protected]>
Sent: Saturday, May 8, 2021 9:21 AM
To: Zhang, Qi Z <[email protected]>; Yigit, Ferruh <[email protected]>
Cc: [email protected]; Zhang, AlvinX <[email protected]>; [email protected]
Subject: [PATCH v2] net/ice: fix txq vector path selection

If Tx vector mode is disabled, the txq vector mode should be disabled too.

If vector mode is not allowed for Tx, no need to perform vector related setup for Tx queue

Quoted 2 lines

This patch adds checking of Tx vector mode before enabling txq vector mode.

Quoted 9 lines

The patch deferred vector setup for Tx queue to the place that vector mode is confirmed to be allowed.

Quoted 3 lines
Fixes 28f9002ab67f ("net/ice: add Tx AVX512 offload path")

No need to add Cc stable, if you fix on current release.

BRs,
Alvin Zhang

#8 lore raw

PATCH v3 1/1 net/ice: fix txq vector path selection

In reply to Alvin Zhang

If vector mode is not allowed for Tx, no need to perform vector related setup for Tx queue.

The patch deferred vector setup for Tx queue to the place that vector mode is confirmed to be allowed.

Fixes 28f9002ab67f ("net/ice: add Tx AVX512 offload path")

---

v2,v3: Update commit log.

---
 drivers/net/ice/ice_rxtx.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/net/ice/ice_rxtx.c +9 -7
index 92fbbc1..49abcb2 100644
@@ -3303,13 +3303,6 @@
 		if (tx_check_ret >= 0 &&
 		    rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) {
 			ad->tx_vec_allowed = true;
-			for (i = 0; i < dev->data->nb_tx_queues; i++) {
-				txq = dev->data->tx_queues[i];
-				if (txq && ice_txq_vec_setup(txq)) {
-					ad->tx_vec_allowed = false;
-					break;
-				}
-			}
 
 			if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_512 &&
 			rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 &&
@@ -3329,6 +3322,15 @@
 			if (!use_avx512 && tx_check_ret == ICE_VECTOR_OFFLOAD_PATH)
 				ad->tx_vec_allowed = false;
 
+			if (ad->tx_vec_allowed) {
+				for (i = 0; i < dev->data->nb_tx_queues; i++) {
+					txq = dev->data->tx_queues[i];
+					if (txq && ice_txq_vec_setup(txq)) {
+						ad->tx_vec_allowed = false;
+						break;
+					}
+				}
+			}
 		} else {
 			ad->tx_vec_allowed = false;
 		}
Signature · 1 line
1.8.3.1
Acked-by on v3 1/1 Applied
#9 lore raw

Re: [dpdk-dev] [PATCH v3] net/ice: fix txq vector path selection

Quoted 12 lines

-----Original Message-----
From: Zhang, AlvinX <[email protected]>
Sent: Saturday, May 8, 2021 11:11 AM
To: Zhang, Qi Z <[email protected]>; Yigit, Ferruh <[email protected]>
Cc: [email protected]; Zhang, AlvinX <[email protected]>
Subject: [PATCH v3] net/ice: fix txq vector path selection

If vector mode is not allowed for Tx, no need to perform vector related setup for Tx queue.

Quoted 6 lines

The patch deferred vector setup for Tx queue to the place that vector mode is confirmed to be allowed.

Fixes 28f9002ab67f ("net/ice: add Tx AVX512 offload path")

Applied to dpdk-next-net-intel.

Thanks
Qi