net/i40e: fix compilation failure on core-avx-i
PATCH 1/1 net/i40e: fix compilation failure on core-avx-i
i40e_rxtx_vec_sse.c fails to compile with below configuration:
- #define RTE_LIBRTE_I40E_16BYTE_RX_DESC 1 in config/rte_config.h
- cpu=core-axv-i
- gcc which supports -mavx2 (e.g. gcc 4.8.5)
This is because commit 0604b1f2208f ("net/i40e: fix crash in AVX512") added i40e_rxq_rearm_common() to i40e_rxtx_vec_common.h which is included by i40e_rxtx_vec_sse.c.
This function is enabled for compilation if CC_AVX2_SUPPORT is defined. As per drivers/net/i40e/meson.build, CC_AVX2_SUPPORT is defined when either CPU supports __AVX2__ or compiler supports -mavx2 option.
So for given configuration, CC_AVX2_SUPPORT gets defined but we don't pass -mavx2 explicitly to gcc while compiling i40e_rxtx_vec_sse.c. Hence it fails due to avx2 specific code from i40e_rxq_rearm_command().
This patch tries to fix the compilation by moving i40e_rxq_rearm_common() to a new header file which will only be included by i40e_rxtx_vec_avx2.c and i40e_rxtx_vec_avx512.c.
--- drivers/net/i40e/i40e_rxtx_vec_avx2.c | 2 +- drivers/net/i40e/i40e_rxtx_vec_avx512.c | 2 +- drivers/net/i40e/i40e_rxtx_vec_avx_common.h | 210 ++++++++++++++++++++ drivers/net/i40e/i40e_rxtx_vec_common.h | 201 ------------------- 4 files changed, 212 insertions(+), 203 deletions(-) create mode 100644 drivers/net/i40e/i40e_rxtx_vec_avx_common.h
drivers/net/i40e/i40e_rxtx_vec_avx2.c +1 -1
@@ -10,7 +10,7 @@#include "base/i40e_type.h" #include "i40e_ethdev.h" #include "i40e_rxtx.h" -#include "i40e_rxtx_vec_common.h" +#include "i40e_rxtx_vec_avx_common.h" #include <rte_vect.h>
drivers/net/i40e/i40e_rxtx_vec_avx512.c +1 -1
@@ -10,7 +10,7 @@#include "base/i40e_type.h" #include "i40e_ethdev.h" #include "i40e_rxtx.h" -#include "i40e_rxtx_vec_common.h" +#include "i40e_rxtx_vec_avx_common.h" #include <rte_vect.h>
drivers/net/i40e/i40e_rxtx_vec_avx_common.h new file +210 -0
210 lines not on this page · raw message
drivers/net/i40e/i40e_rxtx_vec_common.h +0 -201
211 lines not on this page · raw message
--
2.29.2