From: Alvin Zhang Date: Sat, 8 May 2021 03:11:28 +0000 (+0800) Subject: net/ice: fix Tx queue vector setup X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=34ca5367d72fa7659f5c3ddaf895a278a611d09e;p=dpdk.git net/ice: fix Tx queue vector setup 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") Signed-off-by: Alvin Zhang Acked-by: Qi Zhang --- diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c index 92fbbc18da..49abcb2f5c 100644 --- a/drivers/net/ice/ice_rxtx.c +++ b/drivers/net/ice/ice_rxtx.c @@ -3303,13 +3303,6 @@ ice_set_tx_function(struct rte_eth_dev *dev) 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 @@ ice_set_tx_function(struct rte_eth_dev *dev) 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; }