net/ice: fix generic build on FreeBSD
authorLeyi Rong <leyi.rong@intel.com>
Tue, 19 Oct 2021 03:02:08 +0000 (11:02 +0800)
committerQi Zhang <qi.z.zhang@intel.com>
Tue, 19 Oct 2021 11:02:37 +0000 (13:02 +0200)
commit0d989ff9ca515f80fbab2aad18cede501b759ff9
treeea23df2a6e7db3c799f9715df35cf962a074e94b
parentc454435d883e0dca981eb55e38835036c32d1984
net/ice: fix generic build on FreeBSD

The common header file for vectorization is included in multiple files,
and so must use macros for the current compilation unit, rather than the
compiler-capability flag set for the whole driver. With the current,
incorrect, macro, the AVX512 or AVX2 flags may be set when compiling up
SSE code, leading to compilation errors. Changing from "CC_AVX*_SUPPORT"
to the compiler-defined "__AVX*__" macros fixes this issue. In addition,
splitting AVX-specific code into the new ice_rxtx_common_avx.h header
file to avoid such bugs.

Bugzilla ID: 788
Fixes: a4e480de268e ("net/ice: optimize Tx by using AVX512")
Fixes: 20daa1c978b7 ("net/ice: fix crash in AVX512")
Cc: stable@dpdk.org
Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
drivers/net/ice/ice_rxtx_common_avx.h [new file with mode: 0644]
drivers/net/ice/ice_rxtx_vec_avx2.c
drivers/net/ice/ice_rxtx_vec_avx512.c
drivers/net/ice/ice_rxtx_vec_common.h