net/iavf: fix avx2 path selection

Message ID 20230706031549.1050771-1-zhichaox.zeng@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series net/iavf: fix avx2 path selection |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS

Commit Message

Zhichao Zeng July 6, 2023, 3:15 a.m. UTC
  The AVX2 path does not support outer checksum offload, when AVX2 is
forcibly selected and outer checksum offload is configured, the basic
Tx path will be selected to ensure proper functionality.

Fixes: 5712bf9d6e14 ("net/iavf: add Tx AVX2 offload path")
Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>
---
 drivers/net/iavf/iavf_rxtx.c | 6 ++++++
 1 file changed, 6 insertions(+)
  

Patch

diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index bf7e4546a8..f7df4665d1 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -3950,6 +3950,12 @@  iavf_set_tx_function(struct rte_eth_dev *dev)
 				dev->tx_pkt_burst = iavf_xmit_pkts_vec_avx2;
 				PMD_DRV_LOG(DEBUG, "Using AVX2 Vector Tx (port %d).",
 					    dev->data->port_id);
+			} else if (check_ret == IAVF_VECTOR_CTX_OFFLOAD_PATH) {
+				dev->tx_pkt_burst = iavf_xmit_pkts;
+				dev->tx_pkt_prepare = iavf_prep_pkts;
+				PMD_DRV_LOG(DEBUG,
+					"AVX2 does not support outer checksum offload, using Basic Tx (port %d).",
+					dev->data->port_id);
 			} else {
 				dev->tx_pkt_burst = iavf_xmit_pkts_vec_avx2_offload;
 				dev->tx_pkt_prepare = iavf_prep_pkts;