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")

Signed-off-by: Ciara Loftus <ciara.lof...@intel.com>
---
 drivers/net/intel/i40e/i40e_rxtx.c | 29 ++++-------------------------
 1 file changed, 4 insertions(+), 25 deletions(-)

diff --git a/drivers/net/intel/i40e/i40e_rxtx.c 
b/drivers/net/intel/i40e/i40e_rxtx.c
index 434959e1c0..e22233daae 100644
--- a/drivers/net/intel/i40e/i40e_rxtx.c
+++ b/drivers/net/intel/i40e/i40e_rxtx.c
@@ -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
-- 
2.34.1

Reply via email to