Depending on the underlying architecture and CPU flags available, a
different set of Tx paths are defined. The Tx 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 iavf_tx_func_type enum and only defining a value
for the Tx path if it is implemented in the iavf_tx_path_infos array.

Fixes: d89b61bed380 ("net/iavf: use common Tx path selection infrastructure")

Signed-off-by: Ciara Loftus <[email protected]>
---
 drivers/net/intel/iavf/iavf.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/intel/iavf/iavf.h b/drivers/net/intel/iavf/iavf.h
index 921bf0a607..35d3bd5671 100644
--- a/drivers/net/intel/iavf/iavf.h
+++ b/drivers/net/intel/iavf/iavf.h
@@ -353,13 +353,17 @@ enum iavf_rx_func_type {
 enum iavf_tx_func_type {
        IAVF_TX_DISABLED,
        IAVF_TX_DEFAULT,
+#ifdef RTE_ARCH_X86
        IAVF_TX_SSE,
        IAVF_TX_AVX2,
        IAVF_TX_AVX2_OFFLOAD,
+#ifdef CC_AVX512_SUPPORT
        IAVF_TX_AVX512,
        IAVF_TX_AVX512_OFFLOAD,
        IAVF_TX_AVX512_CTX,
        IAVF_TX_AVX512_CTX_OFFLOAD,
+#endif
+#endif
 };
 
 #define IAVF_MBUF_CHECK_F_TX_MBUF        (1ULL << 0)
-- 
2.43.0

Reply via email to