Skip to contentSkip to conversation

net/i40e: fix supported offloads for Rx vector path

PATCH Superseded Ciara Loftus 3 participants 13 messages Sep 1, 2025 – Sep 4, 2025 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/i40e: fix supported offloads for Rx vector path

The set of supported Rx offloads in the vector path had been defined as those supported by the scalar path. This was incorrect so define a new list of supported offloads for the vector path. The list is the same as the scalar path except it excludes vlan extend and qinq strip.

Fixes 052ae311091c ("net/i40e: use the common Rx path selection infrastructure")
---
 drivers/net/intel/i40e/i40e_rxtx.h | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/net/intel/i40e/i40e_rxtx.h +10 -1
index 5d5d4e08b0..1f210dfdff 100644
@@ -80,7 +80,16 @@ enum i40e_header_split_mode {
 		RTE_ETH_RX_OFFLOAD_VLAN_FILTER |	\
 		RTE_ETH_RX_OFFLOAD_RSS_HASH)
 
-#define I40E_RX_VECTOR_OFFLOADS I40E_RX_SCALAR_OFFLOADS
+#define I40E_RX_VECTOR_OFFLOADS (			\
+		RTE_ETH_RX_OFFLOAD_VLAN_STRIP |		\
+		RTE_ETH_RX_OFFLOAD_IPV4_CKSUM |		\
+		RTE_ETH_RX_OFFLOAD_UDP_CKSUM |		\
+		RTE_ETH_RX_OFFLOAD_TCP_CKSUM |		\
+		RTE_ETH_RX_OFFLOAD_OUTER_IPV4_CKSUM |	\
+		RTE_ETH_RX_OFFLOAD_KEEP_CRC |		\
+		RTE_ETH_RX_OFFLOAD_SCATTER |		\
+		RTE_ETH_RX_OFFLOAD_VLAN_FILTER |	\
+		RTE_ETH_RX_OFFLOAD_RSS_HASH)
 
 /** Offload features */
 union i40e_tx_offload {
Signature · 1 line
2.34.1
#1 lore raw

Hello,

Quoted 22 lines · Ciara Loftus

The set of supported Rx offloads in the vector path had been defined as those supported by the scalar path. This was incorrect so define a new list of supported offloads for the vector path. The list is the same as the scalar path except it excludes vlan extend and qinq strip.

Fixes 052ae311091c ("net/i40e: use the common Rx path selection infrastructure")
---
 drivers/net/intel/i40e/i40e_rxtx.h | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/net/intel/i40e/i40e_rxtx.h +0 -1
index 5d5d4e08b0..1f210dfdff 100644
@@ -80,7 +80,16 @@ enum i40e_header_split_mode {
                RTE_ETH_RX_OFFLOAD_VLAN_FILTER |        \
                RTE_ETH_RX_OFFLOAD_RSS_HASH)
 
-#define I40E_RX_VECTOR_OFFLOADS I40E_RX_SCALAR_OFFLOADS

drivers/net/intel/i40e/i40e_rxtx.h enum i40e_header_split_mode { · line 92

Quoted 10 lines
drivers/net/intel/i40e/i40e_rxtx.h +10 -0
+#define I40E_RX_VECTOR_OFFLOADS (                      \
+               RTE_ETH_RX_OFFLOAD_VLAN_STRIP |         \
+               RTE_ETH_RX_OFFLOAD_IPV4_CKSUM |         \
+               RTE_ETH_RX_OFFLOAD_UDP_CKSUM |          \
+               RTE_ETH_RX_OFFLOAD_TCP_CKSUM |          \
+               RTE_ETH_RX_OFFLOAD_OUTER_IPV4_CKSUM |   \
+               RTE_ETH_RX_OFFLOAD_KEEP_CRC |           \
+               RTE_ETH_RX_OFFLOAD_SCATTER |            \
+               RTE_ETH_RX_OFFLOAD_VLAN_FILTER |        \
+               RTE_ETH_RX_OFFLOAD_RSS_HASH)

I was curious about this fix so I have been trying to understand the list of supported offloads, and I have a few interrogations.

How does this new code articulate with function i40e_rx_vec_dev_conf_condition_check_default() (that seems to have a build check on RTE_LIBRTE_IEEE1588).
This seems like redundant logic to me.

Should the dev_info->rx_offload_capa field be filled with the common set of flags of the scalar handler?

Signature · 1 line
David Marchand
#2 lore raw
Quoted 43 lines

Subject: Re: [PATCH] net/i40e: fix supported offloads for Rx vector path

Hello,

Quoted 7 lines · Ciara Loftus

The set of supported Rx offloads in the vector path had been defined as those supported by the scalar path. This was incorrect so define a new list of supported offloads for the vector path. The list is the same as the scalar path except it excludes vlan extend and qinq strip.

Fixes 052ae311091c ("net/i40e: use the common Rx path selection

infrastructure")

Review

Quoted 7 lines
---
 drivers/net/intel/i40e/i40e_rxtx.h | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/net/intel/i40e/i40e_rxtx.h

Quoted 8 lines

index 5d5d4e08b0..1f210dfdff 100644

drivers/net/intel/i40e/i40e_rxtx.h +0 -1
@@ -80,7 +80,16 @@ enum i40e_header_split_mode {
                RTE_ETH_RX_OFFLOAD_VLAN_FILTER |        \
                RTE_ETH_RX_OFFLOAD_RSS_HASH)
 
-#define I40E_RX_VECTOR_OFFLOADS I40E_RX_SCALAR_OFFLOADS

drivers/net/intel/i40e/i40e_rxtx.h enum i40e_header_split_mode { · line 92

Quoted 10 lines
drivers/net/intel/i40e/i40e_rxtx.h +10 -0
+#define I40E_RX_VECTOR_OFFLOADS (                      \
+               RTE_ETH_RX_OFFLOAD_VLAN_STRIP |         \
+               RTE_ETH_RX_OFFLOAD_IPV4_CKSUM |         \
+               RTE_ETH_RX_OFFLOAD_UDP_CKSUM |          \
+               RTE_ETH_RX_OFFLOAD_TCP_CKSUM |          \
+               RTE_ETH_RX_OFFLOAD_OUTER_IPV4_CKSUM |   \
+               RTE_ETH_RX_OFFLOAD_KEEP_CRC |           \
+               RTE_ETH_RX_OFFLOAD_SCATTER |            \
+               RTE_ETH_RX_OFFLOAD_VLAN_FILTER |        \
+               RTE_ETH_RX_OFFLOAD_RSS_HASH)

I was curious about this fix so I have been trying to understand the list of supported offloads, and I have a few interrogations.

Quoted 4 lines

How does this new code articulate with function i40e_rx_vec_dev_conf_condition_check_default() (that seems to have a build check on RTE_LIBRTE_IEEE1588).
This seems like redundant logic to me.

Hi David,

You're right. There is some redundant logic in i40e_rx_vec_dev_conf_condition_check_default that can be removed. I'll include its removal in the next revision.

Quoted 3 lines

Should the dev_info->rx_offload_capa field be filled with the common set of flags of the scalar handler?

I think this can be done, and maybe it can be done in the other drivers that use the new common path selection logic too. I'll take a look.

Thanks,
Ciara

Quoted 4 lines

--
David Marchand

#3 lore raw

v2 cover Fixes for net/intel Rx Path Selection

In reply to Ciara Loftus

This series contains fixes for the code surrounding Rx path selection in the i40e and iavf drivers. It is mostly the removal of redundant and duplicate code. The target is the next-net-intel tree.

Ciara Loftus (4):
net/i40e: fix supported offloads for Rx vector path net/i40e: fix vector Rx queue set up logic net/i40e: remove redundant vector Rx queue setup code net/iavf: remove duplicate in scalar offload list

 drivers/net/intel/i40e/i40e_rxtx.c            | 40 ++-----------------
 drivers/net/intel/i40e/i40e_rxtx.h            | 11 ++++-
 drivers/net/intel/i40e/i40e_rxtx_vec_common.h |  6 ---
 drivers/net/intel/iavf/iavf_rxtx.h            |  1 -
 4 files changed, 14 insertions(+), 44 deletions(-)
Signature · 1 line
2.34.1
#4 lore raw

PATCH v2 1/4 net/i40e: fix supported offloads for Rx vector path

The set of supported Rx offloads in the vector path had been defined as those supported by the scalar path. This was incorrect so define a new list of supported offloads for the vector path. The list is the same as the scalar path except it excludes vlan extend and qinq strip.

Also, remove a redundant check for the VLAN Extend offload in the driver code. This check is now performed in the common rx path selection code.

Fixes 052ae311091c ("net/i40e: use the common Rx path selection infrastructure")
---
 drivers/net/intel/i40e/i40e_rxtx.h            | 11 ++++++++++-
 drivers/net/intel/i40e/i40e_rxtx_vec_common.h |  6 ------
 2 files changed, 10 insertions(+), 7 deletions(-)
drivers/net/intel/i40e/i40e_rxtx.h +10 -1
index 5d5d4e08b0..1f210dfdff 100644
@@ -80,7 +80,16 @@ enum i40e_header_split_mode {
 		RTE_ETH_RX_OFFLOAD_VLAN_FILTER |	\
 		RTE_ETH_RX_OFFLOAD_RSS_HASH)
 
-#define I40E_RX_VECTOR_OFFLOADS I40E_RX_SCALAR_OFFLOADS
+#define I40E_RX_VECTOR_OFFLOADS (			\
+		RTE_ETH_RX_OFFLOAD_VLAN_STRIP |		\
+		RTE_ETH_RX_OFFLOAD_IPV4_CKSUM |		\
+		RTE_ETH_RX_OFFLOAD_UDP_CKSUM |		\
+		RTE_ETH_RX_OFFLOAD_TCP_CKSUM |		\
+		RTE_ETH_RX_OFFLOAD_OUTER_IPV4_CKSUM |	\
+		RTE_ETH_RX_OFFLOAD_KEEP_CRC |		\
+		RTE_ETH_RX_OFFLOAD_SCATTER |		\
+		RTE_ETH_RX_OFFLOAD_VLAN_FILTER |	\
+		RTE_ETH_RX_OFFLOAD_RSS_HASH)
 
 /** Offload features */
 union i40e_tx_offload {
drivers/net/intel/i40e/i40e_rxtx_vec_common.h +0 -6
index e118df9ce0..39c9d2ee10 100644
@@ -54,12 +54,6 @@ static inline int
 i40e_rx_vec_dev_conf_condition_check_default(struct rte_eth_dev *dev)
 {
 #ifndef RTE_LIBRTE_IEEE1588
-	struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode;
-
-	/* no QinQ support */
-	if (rxmode->offloads & RTE_ETH_RX_OFFLOAD_VLAN_EXTEND)
-		return -1;
-
 	/**
 	 * Vector mode is allowed only when number of Rx queue
 	 * descriptor is power of 2.
Signature · 1 line
2.34.1
Acked-by on v2 1/4
#5 lore raw
Quoted 5 lines · Ciara Loftus

The set of supported Rx offloads in the vector path had been defined as those supported by the scalar path. This was incorrect so define a new list of supported offloads for the vector path. The list is the same as the scalar path except it excludes vlan extend and qinq strip.

Quoted 8 lines

Also, remove a redundant check for the VLAN Extend offload in the driver code. This check is now performed in the common rx path selection code.

Fixes 052ae311091c ("net/i40e: use the common Rx path selection infrastructure")

---

Will squash this fix into the referenced commit on the next-net-intel tree, since it hasn't been pulled (and therefore the commit id will be invalid once it is pulled to main).

#6 lore raw

PATCH v2 2/4 net/i40e: fix vector Rx queue set up logic

In reply to Ciara Loftus

The logic to set up a vector Rx queue was present in two places, before and after the Rx path was selected. In some cases, the rx queue would have been set up for vector Rx twice. Another scenario could occur where first the queue was set up for vector rx, then the scalar path selected but the vector rx setup would still persist. This of course would be incorrect behaviour, so it has been fixed by removing the setup logic that was before the path select code.

Fixes 052ae311091c ("net/i40e: use the common Rx path selection infrastructure")
---
 drivers/net/intel/i40e/i40e_rxtx.c | 11 -----------
 1 file changed, 11 deletions(-)
drivers/net/intel/i40e/i40e_rxtx.c +0 -11
index 4c0d12c179..434959e1c0 100644
@@ -3356,17 +3356,6 @@ i40e_set_rx_function(struct rte_eth_dev *dev)
 
 		rx_simd_width = RTE_VECT_SIMD_DISABLED;
 	}
-	if (rx_simd_width != RTE_VECT_SIMD_DISABLED) {
-		for (i = 0; i < dev->data->nb_rx_queues; i++) {
-			struct ci_rx_queue *rxq =
-				dev->data->rx_queues[i];
-
-			if (rxq && i40e_rxq_vec_setup(rxq)) {
-				rx_simd_width = RTE_VECT_SIMD_DISABLED;
-				break;
-			}
-		}
-	}
 
 	req_features.simd_width = rx_simd_width;
 	if (dev->data->scattered_rx)
Signature · 1 line
2.34.1
Acked-by on v2 2/4
#7 lore raw

Re: [PATCH v2 2/4] net/i40e: fix vector Rx queue set up logic

Quoted 9 lines · Ciara Loftus

The logic to set up a vector Rx queue was present in two places, before and after the Rx path was selected. In some cases, the rx queue would have been set up for vector Rx twice. Another scenario could occur where first the queue was set up for vector rx, then the scalar path selected but the vector rx setup would still persist. This of course would be incorrect behaviour, so it has been fixed by removing the setup logic that was before the path select code.

Fixes 052ae311091c ("net/i40e: use the common Rx path selection infrastructure")

I think this code is mostly from an older commit, which is why I'd mark this instead as:

Fixes 8e109464c022 ("i40e: allow vector Rx and Tx usage")
Quoted 3 lines

---

#8 lore raw

PATCH v2 3/4 net/i40e: remove redundant vector Rx queue setup code

In reply to Ciara Loftus

Some assignments were being done twice:
1. Marking each rxq as a vector queue
2. Marking the device as vector allowed

This commit makes sure that these are only performed once.

Fixes 052ae311091c ("net/i40e: use the common Rx path selection infrastructure")
---
 drivers/net/intel/i40e/i40e_rxtx.c | 29 ++++-------------------------
 1 file changed, 4 insertions(+), 25 deletions(-)
drivers/net/intel/i40e/i40e_rxtx.c +4 -25
index 434959e1c0..e22233daae 100644
@@ -3338,7 +3338,7 @@ i40e_set_rx_function(struct rte_eth_dev *dev)
 		.rx_offloads = dev->data->dev_conf.rxmode.offloads,
 		.simd_width = RTE_VECT_SIMD_DISABLED,
 	};
-	uint16_t vector_rx, i;
+	uint16_t i;
 	enum rte_vect_max_simd rx_simd_width = i40e_get_max_simd_bitwidth();
 
 	/* The primary process selects the rx path for all processes. */
@@ -3367,11 +3367,13 @@ i40e_set_rx_function(struct rte_eth_dev *dev)
 						&i40e_rx_path_infos[0],
 						RTE_DIM(i40e_rx_path_infos),
 						I40E_RX_DEFAULT);
-	if (i40e_rx_path_infos[ad->rx_func_type].features.simd_width >= RTE_VECT_SIMD_128)
+	if (i40e_rx_path_infos[ad->rx_func_type].features.simd_width >= RTE_VECT_SIMD_128) {
 		/* Vector function selected. Prepare the rxq accordingly. */
 		for (i = 0; i < dev->data->nb_rx_queues; i++)
 			if (dev->data->rx_queues[i])
 				i40e_rxq_vec_setup(dev->data->rx_queues[i]);
+		ad->rx_vec_allowed = true;
+	}
 
 	if (i40e_rx_path_infos[ad->rx_func_type].features.simd_width >= RTE_VECT_SIMD_128 &&
 			i40e_rx_path_infos[ad->rx_func_type].features.simd_width <
@@ -3382,29 +3384,6 @@ i40e_set_rx_function(struct rte_eth_dev *dev)
 	dev->rx_pkt_burst = i40e_rx_path_infos[ad->rx_func_type].pkt_burst;
 	PMD_DRV_LOG(NOTICE, "Using %s (port %d).",
 			i40e_rx_path_infos[ad->rx_func_type].info, dev->data->port_id);
-
-	/* Propagate information about RX function choice through all queues. */
-	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
-		vector_rx =
-			(dev->rx_pkt_burst == i40e_recv_scattered_pkts_vec ||
-			 dev->rx_pkt_burst == i40e_recv_pkts_vec ||
-#ifdef CC_AVX512_SUPPORT
-			 dev->rx_pkt_burst == i40e_recv_scattered_pkts_vec_avx512 ||
-			 dev->rx_pkt_burst == i40e_recv_pkts_vec_avx512 ||
-#endif
-			 dev->rx_pkt_burst == i40e_recv_scattered_pkts_vec_avx2 ||
-			 dev->rx_pkt_burst == i40e_recv_pkts_vec_avx2);
-
-		for (i = 0; i < dev->data->nb_rx_queues; i++) {
-			struct ci_rx_queue *rxq = dev->data->rx_queues[i];
-
-			if (rxq)
-				rxq->vector_rx = vector_rx;
-		}
-	}
-
-	ad->rx_vec_allowed = i40e_rx_path_infos[ad->rx_func_type].features.simd_width >=
-				RTE_VECT_SIMD_128;
 }
 
 int
Signature · 1 line
2.34.1
Acked-by on v2 3/4
#9 lore raw

Re: [PATCH v2 3/4] net/i40e: remove redundant vector Rx queue setup code

Quoted 4 lines · Ciara Loftus

Some assignments were being done twice:
1. Marking each rxq as a vector queue
2. Marking the device as vector allowed

Quoted 9 lines

This commit makes sure that these are only performed once.

Fixes 052ae311091c ("net/i40e: use the common Rx path selection infrastructure")
---
 drivers/net/intel/i40e/i40e_rxtx.c | 29 ++++-------------------------
 1 file changed, 4 insertions(+), 25 deletions(-)

Will squash into offending commit in next-net-intel tree.

#10 lore raw

PATCH v2 4/4 net/iavf: remove duplicate in scalar offload list

In reply to Ciara Loftus

The scatter offload was listed twice as a supported offload for the Rx scalar path. Remove it.

Fixes cd9889d90b84 ("net/iavf: use the common Rx path selection infrastructure")
---
 drivers/net/intel/iavf/iavf_rxtx.h | 1 -
 1 file changed, 1 deletion(-)
drivers/net/intel/iavf/iavf_rxtx.h +0 -1
index 723c30d05b..10812533c2 100644
@@ -68,7 +68,6 @@
 		RTE_ETH_RX_OFFLOAD_SCATTER |		\
 		RTE_ETH_RX_OFFLOAD_VLAN_FILTER |	\
 		RTE_ETH_RX_OFFLOAD_VLAN_EXTEND |	\
-		RTE_ETH_RX_OFFLOAD_SCATTER |		\
 		RTE_ETH_RX_OFFLOAD_RSS_HASH |		\
 		RTE_ETH_RX_OFFLOAD_OUTER_UDP_CKSUM |	\
 		RTE_ETH_RX_OFFLOAD_KEEP_CRC)
Signature · 1 line
2.34.1
Acked-by on v2 4/4
#11 lore raw

Re: [PATCH v2 4/4] net/iavf: remove duplicate in scalar offload list

Quoted 7 lines · Ciara Loftus

The scatter offload was listed twice as a supported offload for the Rx scalar path. Remove it.

Fixes cd9889d90b84 ("net/iavf: use the common Rx path selection infrastructure")

---

Will squash into commit on next-net-intel

Quoted 18 lines
 drivers/net/intel/iavf/iavf_rxtx.h | 1 -
 1 file changed, 1 deletion(-)
drivers/net/intel/iavf/iavf_rxtx.h +0 -1
index 723c30d05b..10812533c2 100644
@@ -68,7 +68,6 @@
 		RTE_ETH_RX_OFFLOAD_SCATTER |		\
 		RTE_ETH_RX_OFFLOAD_VLAN_FILTER |	\
 		RTE_ETH_RX_OFFLOAD_VLAN_EXTEND |	\
-		RTE_ETH_RX_OFFLOAD_SCATTER |		\
 		RTE_ETH_RX_OFFLOAD_RSS_HASH |		\
 		RTE_ETH_RX_OFFLOAD_OUTER_UDP_CKSUM |	\
 		RTE_ETH_RX_OFFLOAD_KEEP_CRC)
Signature · 1 line
2.34.1
#12 lore raw

Re: [PATCH v2 0/4] Fixes for net/intel Rx Path Selection

In reply to Ciara Loftus
Quoted 10 lines · Ciara Loftus

This series contains fixes for the code surrounding Rx path selection in the i40e and iavf drivers. It is mostly the removal of redundant and duplicate code. The target is the next-net-intel tree.

Ciara Loftus (4):
net/i40e: fix supported offloads for Rx vector path net/i40e: fix vector Rx queue set up logic net/i40e: remove redundant vector Rx queue setup code net/iavf: remove duplicate in scalar offload list

Quoted 7 lines
 drivers/net/intel/i40e/i40e_rxtx.c            | 40 ++-----------------
 drivers/net/intel/i40e/i40e_rxtx.h            | 11 ++++-
 drivers/net/intel/i40e/i40e_rxtx_vec_common.h |  6 ---
 drivers/net/intel/iavf/iavf_rxtx.h            |  1 -
 4 files changed, 14 insertions(+), 44 deletions(-)

Series applied, and squashed where appropriate, into next-net-intel.

Thanks,
/Bruce