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 ice_tx_func_type enum and only defining a value
for the Tx path if it is implemented in the ice_tx_path_infos array.

Fixes: 058abc74f380 ("net/ice: use common Tx path selection infrastructure")

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

diff --git a/drivers/net/intel/ice/ice_ethdev.h 
b/drivers/net/intel/ice/ice_ethdev.h
index a2379a68c2..d1d31760d5 100644
--- a/drivers/net/intel/ice/ice_ethdev.h
+++ b/drivers/net/intel/ice/ice_ethdev.h
@@ -211,11 +211,15 @@ enum ice_rx_func_type {
 enum ice_tx_func_type {
        ICE_TX_DEFAULT,
        ICE_TX_SIMPLE,
+#ifdef RTE_ARCH_X86
        ICE_TX_SSE,
        ICE_TX_AVX2,
        ICE_TX_AVX2_OFFLOAD,
+#ifdef CC_AVX512_SUPPORT
        ICE_TX_AVX512,
        ICE_TX_AVX512_OFFLOAD,
+#endif
+#endif
 };
 
 struct ice_adapter;
-- 
2.43.0

Reply via email to