To fall in line with other drivers using the Rx path selection
infrastructure, prevent Rx path selection after the device has started.

Signed-off-by: Ciara Loftus <[email protected]>
---
v2:
* Fix unused label error for non x86 arch
---
 drivers/net/intel/idpf/idpf_rxtx.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/intel/idpf/idpf_rxtx.c 
b/drivers/net/intel/idpf/idpf_rxtx.c
index cee454244f..e7d44f7beb 100644
--- a/drivers/net/intel/idpf/idpf_rxtx.c
+++ b/drivers/net/intel/idpf/idpf_rxtx.c
@@ -782,11 +782,17 @@ idpf_set_rx_function(struct rte_eth_dev *dev)
 #ifdef RTE_ARCH_X86
        struct idpf_rx_queue *rxq;
        int i;
+#endif
+
+       /* If the device has started the function has already been selected. */
+       if (dev->data->dev_started)
+               goto out;
 
+#ifdef RTE_ARCH_X86
        if (idpf_rx_vec_dev_check_default(dev) == IDPF_VECTOR_PATH &&
            rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
                req_features.simd_width = idpf_get_max_simd_bitwidth();
-#endif /* RTE_ARCH_X86 */
+#endif
 
        req_features.single_queue = (vport->rxq_model == 
VIRTCHNL2_QUEUE_MODEL_SINGLE);
        req_features.scattered = dev->data->scattered_rx;
@@ -814,6 +820,7 @@ idpf_set_rx_function(struct rte_eth_dev *dev)
        }
 #endif
 
+out:
        dev->rx_pkt_burst = idpf_rx_path_infos[ad->rx_func_type].pkt_burst;
        PMD_DRV_LOG(NOTICE, "Using %s Rx (port %d).",
                        idpf_rx_path_infos[ad->rx_func_type].info, 
dev->data->port_id);
-- 
2.43.0

Reply via email to