Depending on the underlying architecture and CPU flags available, a
different set of Rx paths are defined. The Rx path selection function
iterates sequentially from zero to num_paths where num_paths is the size
of the array as determined by the RTE_DIM macro. However, depending on
the platform, some of these entries may be empty, and valid entries at
the end of the array may never be considered in the selection function.
Fix this by editing the idpf_rx_func_type enum and only defining a value
for the Rx path if it is implemented in the idpf_rx_path_infos array.
Fixes: 12b1c2901761 ("net/idpf: use common Rx path selection infrastructure")
Cc: [email protected]
Signed-off-by: Ciara Loftus <[email protected]>
---
drivers/net/intel/idpf/idpf_common_device.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/intel/idpf/idpf_common_device.h
b/drivers/net/intel/idpf/idpf_common_device.h
index 9d3f35176d..487ca9d93c 100644
--- a/drivers/net/intel/idpf/idpf_common_device.h
+++ b/drivers/net/intel/idpf/idpf_common_device.h
@@ -69,9 +69,13 @@ enum idpf_rx_func_type {
IDPF_RX_DEFAULT,
IDPF_RX_SINGLEQ,
IDPF_RX_SINGLEQ_SCATTERED,
+#ifdef RTE_ARCH_X86
IDPF_RX_SINGLEQ_AVX2,
+#ifdef CC_AVX512_SUPPORT
IDPF_RX_AVX512,
IDPF_RX_SINGLEQ_AVX512,
+#endif
+#endif
IDPF_RX_MAX
};
--
2.43.0