net/iavf: fix avx512 Tx path
PATCH 1/1 net/iavf: fix avx512 Tx path
This patch fixes the tunneling parameters on avx512 Tx path and adjusts the path selection to fix perf drop.
--- drivers/net/iavf/iavf_rxtx.c | 7 +-- drivers/net/iavf/iavf_rxtx.h | 5 +- drivers/net/iavf/iavf_rxtx_vec_avx512.c | 82 ++++++++++++++++++++++--- drivers/net/iavf/iavf_rxtx_vec_common.h | 23 +++---- 4 files changed, 87 insertions(+), 30 deletions(-)
drivers/net/iavf/iavf_rxtx.c +1 -6
@@ -3877,7 +3877,7 @@ iavf_set_tx_function(struct rte_eth_dev *dev)if (check_ret >=0 &&rte_vect_get_max_simd_bitwidth () >=RTE_VECT_SIMD_128 ) {/* SSE and AVX2 not support offload path yet. */ -if (check_ret ==IAVF_VECTOR_PATH || check_ret ==IAVF_VECTOR_CTX_PATH ) { +if (check_ret ==IAVF_VECTOR_PATH ) { use_sse = true; if ((rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 || rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) &&
@@ -3914,11 +3914,6 @@ iavf_set_tx_function(struct rte_eth_dev *dev) dev->tx_pkt_prepare = iavf_prep_pkts;PMD_DRV_LOG (DEBUG ,"Using AVX512 OFFLOAD Vector Tx (port %d)." , dev->data->port_id); - }else if (check_ret ==IAVF_VECTOR_CTX_PATH ) { - dev->tx_pkt_burst = iavf_xmit_pkts_vec_avx512_ctx; - dev->tx_pkt_prepare = iavf_prep_pkts; -PMD_DRV_LOG (DEBUG ,"Using AVX512 CONTEXT Vector Tx (port %d)." , - dev->data->port_id); }else { dev->tx_pkt_burst = iavf_xmit_pkts_vec_avx512_ctx_offload; dev->tx_pkt_prepare = iavf_prep_pkts;
drivers/net/iavf/iavf_rxtx.h +1 -4
@@ -57,8 +57,7 @@#define IAVF_VECTOR_PATH 0#define IAVF_VECTOR_OFFLOAD_PATH 1 -#define IAVF_VECTOR_CTX_PATH 2 -#define IAVF_VECTOR_CTX_OFFLOAD_PATH 3 +#define IAVF_VECTOR_CTX_OFFLOAD_PATH 2#define DEFAULT_TX_RS_THRESH 32#define DEFAULT_TX_FREE_THRESH 32
@@ -727,8 +726,6 @@ uint16_t iavf_xmit_pkts_vec_avx512(void *tx_queue, struct rte_mbuf **tx_pkts,uint16_t iavf_xmit_pkts_vec_avx512_offload (void *tx_queue,struct rte_mbuf **tx_pkts,uint16_t nb_pkts); -uint16_t iavf_xmit_pkts_vec_avx512_ctx (void *tx_queue,struct rte_mbuf **tx_pkts, -uint16_t nb_pkts);uint16_t iavf_xmit_pkts_vec_avx512_ctx_offload (void *tx_queue,struct rte_mbuf **tx_pkts,uint16_t nb_pkts);int iavf_txq_vec_setup_avx512 (struct iavf_tx_queue *txq);
drivers/net/iavf/iavf_rxtx_vec_avx512.c +75 -7
100 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx_vec_common.h +10 -13
@@ -258,22 +258,19 @@ iavf_tx_vec_queue_default(struct iavf_tx_queue *txq)* Tunneling parameters and other fields need be configured in ctx desc * if the outer checksum offload is enabled. */ -if (txq->vlan_flag ==IAVF_TX_FLAGS_VLAN_TAG_LOC_L2TAG2 ) { - txq->use_ctx =1 ; -if (txq->offloads & (IAVF_TX_VECTOR_OFFLOAD | -IAVF_TX_VECTOR_OFFLOAD_CTX )) -return IAVF_VECTOR_CTX_OFFLOAD_PATH ; -else -return IAVF_VECTOR_CTX_PATH ; - }else { +if (txq->offloads & (IAVF_TX_VECTOR_OFFLOAD |IAVF_TX_VECTOR_OFFLOAD_CTX )) {if (txq->offloads &IAVF_TX_VECTOR_OFFLOAD_CTX ) { - txq->use_ctx =1 ; -return IAVF_VECTOR_CTX_OFFLOAD_PATH ; - }else if (txq->offloads &IAVF_TX_VECTOR_OFFLOAD ) { -return IAVF_VECTOR_OFFLOAD_PATH ; +if (txq->vlan_flag ==IAVF_TX_FLAGS_VLAN_TAG_LOC_L2TAG2 ) { + txq->use_ctx =1 ; +return IAVF_VECTOR_CTX_OFFLOAD_PATH ; + }else { +return -1 ; + } }else { -return IAVF_VECTOR_PATH ; +return IAVF_VECTOR_OFFLOAD_PATH ; } + }else { +return IAVF_VECTOR_PATH ; } }
Signature · 1 line
2.25.1
Quoted 12 lines
-----Original Message-----
From: Zeng, ZhichaoX <[email protected]>
Sent: Wednesday, February 22, 2023 4:13 PM
To: [email protected]
Cc: Zhang, Qi Z <[email protected]>; Xu, Ke1 <[email protected]>; Chu, Haijun <[email protected]>; Zeng, ZhichaoX <[email protected]>; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Richardson, Bruce <[email protected]>; Konstantin Ananyev <[email protected]>; Zhou, YidingX <[email protected]>
Subject: [PATCH] net/iavf: fix avx512 Tx path
Quoted 7 lines
This patch fixes the tunneling parameters on avx512 Tx path and adjusts the path selection to fix perf drop.
Fixes 4f8259df563a ("net/iavf: enable Tx outer checksum offload onAVX512")
Signed-off-by Zhichao Zeng <[email protected]>
Validated function and perf, passed.
Quoted 7 lines
--- drivers/net/iavf/iavf_rxtx.c | 7 +-- drivers/net/iavf/iavf_rxtx.h | 5 +- drivers/net/iavf/iavf_rxtx_vec_avx512.c | 82 ++++++++++++++++++++++--- drivers/net/iavf/iavf_rxtx_vec_common.h | 23 +++---- 4 files changed, 87 insertions(+), 30 deletions(-)
Zhang, Qi Z
AppliedQuoted 35 lines
-----Original Message-----
From: Xu, Ke1 <[email protected]>
Sent: Thursday, February 23, 2023 4:17 PM
To: Zeng, ZhichaoX <[email protected]>; [email protected]
Cc: Zhang, Qi Z <[email protected]>; Chu, Haijun <[email protected]>; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Richardson, Bruce <[email protected]>; Konstantin Ananyev <[email protected]>; Zhou, YidingX <[email protected]>
Subject: RE: [PATCH] net/iavf: fix avx512 Tx pathQuoted 13 lines
-----Original Message-----
From: Zeng, ZhichaoX <[email protected]>
Sent: Wednesday, February 22, 2023 4:13 PM
To: [email protected]
Cc: Zhang, Qi Z <[email protected]>; Xu, Ke1 <[email protected]>; Chu, Haijun <[email protected]>; Zeng, ZhichaoX <[email protected]>; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Richardson, Bruce <[email protected]>; Konstantin Ananyev <[email protected]>; Zhou, YidingX <[email protected]>
Subject: [PATCH] net/iavf: fix avx512 Tx pathQuoted 7 lines
This patch fixes the tunneling parameters on avx512 Tx path and adjusts the path selection to fix perf drop.
Fixes 4f8259df563a ("net/iavf: enable Tx outer checksum offload onAVX512")
Signed-off-by Zhichao Zeng <[email protected]>Validated function and perf, passed.
Quoted 11 lines
Tested-by Ke Xu <[email protected]>Quoted 5 lines
--- drivers/net/iavf/iavf_rxtx.c | 7 +-- drivers/net/iavf/iavf_rxtx.h | 5 +- drivers/net/iavf/iavf_rxtx_vec_avx512.c | 82++++++++++++++++++++++---
drivers/net/iavf/iavf_rxtx_vec_common.h|23
Quoted 3 lines
+++----
4 files changed, 87 insertions(+), 30 deletions(-)
Applied to dpdk-next-net-intel.
Thanks
Qi