Skip to contentSkip to conversation

Fixes for iavf Tx path selection

PATCH In review Ciara Loftus 2 participants 8 messages Sep 4, 2025 Network drivers

lore
Share & tools
lore
#0 lore raw

cover Fixes for iavf Tx path selection

This is a series of fixes for the iavf driver concerning Tx path selection. The first patch fixes the logic for selecting the Tx vector path, which was recently fixed but broken again by another commit. The second patch updates a log and the third ensures the fastest path is selected for VLAN offload regardless of VLAN tag location (L2TAG1 or L2TAG2).

Ciara Loftus (3):
net/iavf: fix Tx vector path selection logic again net/iavf: fix a log during Tx path selection net/iavf: fix Tx path selection for VLAN offload

 drivers/net/intel/iavf/iavf_rxtx.c            |  4 ++--
 drivers/net/intel/iavf/iavf_rxtx.h            |  1 -
 drivers/net/intel/iavf/iavf_rxtx_vec_common.h | 23 +++++++++++--------
 3 files changed, 15 insertions(+), 13 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/3 net/iavf: fix Tx vector path selection logic again

Commit b39aeea703b8 ("net/iavf: fix Tx vector path selection logic") fixed an issue which caused the scalar path to be chosen even when the AVX-512 path could have been a viable candidate. The commit be1a887b83cd ("net/iavf: use the new common vector capability function") accidentally undid this fix, so this commit fixes this again, this time in a new way due to the changed code landscape since the last fix.

Fixes be1a887b83cd ("net/iavf: use the new common vector capability function")
---
 drivers/net/intel/iavf/iavf_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/intel/iavf/iavf_rxtx.c +1 -1
index ab44558a85..ce0a12c348 100644
@@ -4090,7 +4090,7 @@ iavf_set_tx_function(struct rte_eth_dev *dev)
 				    dev->data->port_id);
 			tx_func_type = IAVF_TX_SSE;
 		}
-		if (use_avx2) {
+		if (!use_avx512 && use_avx2) {
 			if (check_ret == IAVF_VECTOR_PATH) {
 				tx_func_type = IAVF_TX_AVX2;
 				PMD_DRV_LOG(DEBUG, "Using AVX2 Vector Tx (port %d).",
Signature · 1 line
2.34.1
Acked-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] net/iavf: fix Tx vector path selection logic again

Quoted 11 lines · Ciara Loftus

Commit b39aeea703b8 ("net/iavf: fix Tx vector path selection logic") fixed an issue which caused the scalar path to be chosen even when the AVX-512 path could have been a viable candidate. The commit be1a887b83cd ("net/iavf: use the new common vector capability function") accidentally undid this fix, so this commit fixes this again, this time in a new way due to the changed code landscape since the last fix.

Fixes be1a887b83cd ("net/iavf: use the new common vector capability function")

---

Will squash into existing commit on next-net-intel.

#3 lore raw

PATCH 2/3 net/iavf: fix a log during Tx path selection

In reply to Ciara Loftus

The vector offload context path is now selected for outerchecksum and qinq insert offloads. Update logging to reflect this.

Fixes abca31f780e1 ("net/iavf: support VLAN insertion for the AVX-512 path")
---
 drivers/net/intel/iavf/iavf_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/intel/iavf/iavf_rxtx.c +1 -1
index ce0a12c348..5b46fa724c 100644
@@ -4097,7 +4097,7 @@ iavf_set_tx_function(struct rte_eth_dev *dev)
 					    dev->data->port_id);
 			} else if (check_ret == IAVF_VECTOR_CTX_OFFLOAD_PATH) {
 				PMD_DRV_LOG(DEBUG,
-					"AVX2 does not support outer checksum offload.");
+					"AVX2 does not support requested Tx offloads.");
 				goto normal;
 			} else {
 				tx_func_type = IAVF_TX_AVX2_OFFLOAD;
Signature · 1 line
2.34.1
Acked-by on v1 2/3
#4 lore raw

Re: [PATCH 2/3] net/iavf: fix a log during Tx path selection

Quoted 10 lines · Ciara Loftus

The vector offload context path is now selected for outerchecksum and qinq insert offloads. Update logging to reflect this.

Fixes abca31f780e1 ("net/iavf: support VLAN insertion for the AVX-512 path")
---
 drivers/net/intel/iavf/iavf_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Will squash into commit on next-net-intel

#5 lore raw

PATCH 3/3 net/iavf: fix Tx path selection for VLAN offload

In reply to Ciara Loftus

For the vlan insert offload a different tx vector offload path is required depending on where the tag must be placed in the descriptor which can vary from one VF to another. Some VFs use the L2TAG2 field which requires the use of a context descriptor. Adjust the logic for selecting the tx path so that the correct path is used for each vlan tag location. Before this fix, if the tag was to be put in the L2TAG1 field, the scalar path was always used which was incorrect, because the AVX-512 vector path also supports this offload.

Fixes abca31f780e1 ("net/iavf: support VLAN insertion for the AVX-512 path")
---
 drivers/net/intel/iavf/iavf_rxtx.h            |  1 -
 drivers/net/intel/iavf/iavf_rxtx_vec_common.h | 23 +++++++++++--------
 2 files changed, 13 insertions(+), 11 deletions(-)
drivers/net/intel/iavf/iavf_rxtx.h +0 -1
index 723c30d05b..a499141049 100644
@@ -53,7 +53,6 @@
 #define IAVF_TX_VECTOR_OFFLOAD_CTX (			\
 		RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM |	\
 		RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM |	\
-		RTE_ETH_TX_OFFLOAD_VLAN_INSERT |	\
 		RTE_ETH_TX_OFFLOAD_QINQ_INSERT)
 
 #define IAVF_RX_NO_OFFLOADS 0
drivers/net/intel/iavf/iavf_rxtx_vec_common.h +13 -10
index a3688baf4b..f513777663 100644
@@ -73,6 +73,8 @@ iavf_rx_vec_queue_default(struct ci_rx_queue *rxq)
 static inline int
 iavf_tx_vec_queue_default(struct ci_tx_queue *txq)
 {
+	bool vlan_offload = false, vlan_needs_ctx = false;
+
 	if (!txq)
 		return -1;
 
@@ -88,20 +90,21 @@ iavf_tx_vec_queue_default(struct ci_tx_queue *txq)
 		return IAVF_VECTOR_CTX_PATH;
 	}
 
+	/* Vlan tci needs to be inserted via ctx desc, if the vlan_flag is L2TAG2. */
+	if (txq->offloads & RTE_ETH_TX_OFFLOAD_VLAN_INSERT) {
+		vlan_offload = true;
+		if (txq->vlan_flag == IAVF_TX_FLAGS_VLAN_TAG_LOC_L2TAG2)
+			vlan_needs_ctx = true;
+	}
+
 	/**
-	 * Vlan tci needs to be inserted via ctx desc, if the vlan_flag is L2TAG2.
 	 * Tunneling parameters and other fields need be configured in ctx desc
 	 * if the outer checksum offload is enabled.
 	 */
-	if (txq->offloads & (IAVF_TX_VECTOR_OFFLOAD | IAVF_TX_VECTOR_OFFLOAD_CTX)) {
-		if (txq->offloads & IAVF_TX_VECTOR_OFFLOAD_CTX) {
-			if (txq->vlan_flag == IAVF_TX_FLAGS_VLAN_TAG_LOC_L2TAG2 ||
-					txq->offloads & RTE_ETH_TX_OFFLOAD_QINQ_INSERT) {
-				txq->use_ctx = 1;
-				return IAVF_VECTOR_CTX_OFFLOAD_PATH;
-			} else {
-				return -1;
-			}
+	if (txq->offloads & (IAVF_TX_VECTOR_OFFLOAD | IAVF_TX_VECTOR_OFFLOAD_CTX) || vlan_offload) {
+		if (txq->offloads & IAVF_TX_VECTOR_OFFLOAD_CTX || vlan_needs_ctx) {
+			txq->use_ctx = 1;
+			return IAVF_VECTOR_CTX_OFFLOAD_PATH;
 		} else {
 			return IAVF_VECTOR_OFFLOAD_PATH;
 		}
Signature · 1 line
2.34.1
Acked-by on v1 3/3
#6 lore raw

Re: [PATCH 3/3] net/iavf: fix Tx path selection for VLAN offload

Quoted 9 lines · Ciara Loftus

For the vlan insert offload a different tx vector offload path is required depending on where the tag must be placed in the descriptor which can vary from one VF to another. Some VFs use the L2TAG2 field which requires the use of a context descriptor. Adjust the logic for selecting the tx path so that the correct path is used for each vlan tag location. Before this fix, if the tag was to be put in the L2TAG1 field, the scalar path was always used which was incorrect, because the AVX-512 vector path also supports this offload.

Quoted 8 lines
Fixes abca31f780e1 ("net/iavf: support VLAN insertion for the AVX-512 path")
---
 drivers/net/intel/iavf/iavf_rxtx.h            |  1 -
 drivers/net/intel/iavf/iavf_rxtx_vec_common.h | 23 +++++++++++--------
 2 files changed, 13 insertions(+), 11 deletions(-)

Will squash into commit on next-net-intel

#7 lore raw
In reply to Ciara Loftus
Quoted 12 lines · Ciara Loftus

This is a series of fixes for the iavf driver concerning Tx path selection. The first patch fixes the logic for selecting the Tx vector path, which was recently fixed but broken again by another commit. The second patch updates a log and the third ensures the fastest path is selected for VLAN offload regardless of VLAN tag location (L2TAG1 or L2TAG2).

Ciara Loftus (3):
net/iavf: fix Tx vector path selection logic again net/iavf: fix a log during Tx path selection net/iavf: fix Tx path selection for VLAN offload

Quoted 6 lines
 drivers/net/intel/iavf/iavf_rxtx.c            |  4 ++--
 drivers/net/intel/iavf/iavf_rxtx.h            |  1 -
 drivers/net/intel/iavf/iavf_rxtx_vec_common.h | 23 +++++++++++--------
 3 files changed, 15 insertions(+), 13 deletions(-)

--

Series applied and squashed into next-net-intel

/Bruce