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

Fixes: 872b57178709 ("net/ice: use common Rx path selection infrastructure")
Cc: [email protected]

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 d1d31760d5..b682df0717 100644
--- a/drivers/net/intel/ice/ice_ethdev.h
+++ b/drivers/net/intel/ice/ice_ethdev.h
@@ -196,16 +196,20 @@ enum ice_rx_func_type {
        ICE_RX_DEFAULT,
        ICE_RX_SCATTERED,
        ICE_RX_BULK_ALLOC,
+#ifdef RTE_ARCH_X86
        ICE_RX_SSE,
        ICE_RX_SSE_SCATTERED,
        ICE_RX_AVX2,
        ICE_RX_AVX2_SCATTERED,
        ICE_RX_AVX2_OFFLOAD,
        ICE_RX_AVX2_SCATTERED_OFFLOAD,
+#ifdef CC_AVX512_SUPPORT
        ICE_RX_AVX512,
        ICE_RX_AVX512_SCATTERED,
        ICE_RX_AVX512_OFFLOAD,
        ICE_RX_AVX512_SCATTERED_OFFLOAD,
+#endif /* CC_AVX512_SUPPORT */
+#endif /* RTE_ARCH_X86 */
 };
 
 enum ice_tx_func_type {
-- 
2.43.0

Reply via email to