[dpdk-dev] Problem with popcnt in librte_acl and ixgbe vector code

David Marchand david.marchand at 6wind.com
Thu Jul 17 14:10:32 CEST 2014


I noticed a build issue trying to build 1.7.0 on a (old) laptop of mine.

Problem is the same with either 'default' or 'native' machine.

[grrr at glop dpdk]$ make install T=x86_64-native-linuxapp-gcc V=99

[...]

== Build lib/librte_pmd_ixgbe
gcc -Wp,-MD,./.ixgbe_rxtx_vec.o.d.tmp -m64 -pthread  -march=native
-DRTE_MACHINE_CPUFLAG_SSE -DRTE_MACHINE_CPUFLAG_SSE2
-DRTE_MACHINE_CPUFLAG_SSE3 -DRTE_MACHINE_CPUFLAG_SSSE3
-DRTE_MACHINE_CPUFLAG_SSE4_1
-DRTE_COMPILE_TIME_CPUFLAGS=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1
 -I/home/grrr/git/dpdk/x86_64-native-linuxapp-gcc/include -include
/home/grrr/git/dpdk/x86_64-native-linuxapp-gcc/include/rte_config.h -O3 -W
-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -Wold-style-definition -Wpointer-arith -Wcast-align
-Wnested-externs -Wcast-qual -Wformat-nonliteral -Wformat-security -Wundef
-Wwrite-strings -Wno-deprecated   -o ixgbe_rxtx_vec.o -c
/home/grrr/git/dpdk/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c
In file included from
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/include/smmintrin.h:811:0,
                 from
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/include/nmmintrin.h:31,
                 from
/home/grrr/git/dpdk/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c:41:
/home/grrr/git/dpdk/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c: In function
‘ixgbe_recv_pkts_vec’:
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/include/popcntintrin.h:42:1:
error: inlining failed in call to always_inline ‘_mm_popcnt_u64’: target
specific option mismatch
 _mm_popcnt_u64 (unsigned long long __X)
 ^
/home/grrr/git/dpdk/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c:341:9: error:
called from here
   var = _mm_popcnt_u64(_mm_cvtsi128_si64(staterr));
         ^
/home/grrr/git/dpdk/mk/internal/rte.compile-pre.mk:126: recipe for target
'ixgbe_rxtx_vec.o' failed
make[5]: *** [ixgbe_rxtx_vec.o] Error 1
/home/grrr/git/dpdk/mk/rte.subdir.mk:61: recipe for target
'librte_pmd_ixgbe' failed
make[4]: *** [librte_pmd_ixgbe] Error 2


Here is my cpuinfo :

[grrr at glop ~]$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Genuine Intel(R) CPU           U7300  @ 1.30GHz
stepping : 10
microcode : 0xa07
cpu MHz : 1300.000
cache size : 3072 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat
pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm
constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64
monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm dtherm
tpr_shadow vnmi flexpriority
bogomips : 2679.57
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

[...]


Idem with librte_acl which complains about _mm_popcnt_u32.

I did not look too much into this, but I would say that we should look at
cpu flags __POPCNT__ to use this popcnt and fallback to a simple
implementation otherwise.

A macro in a common header from eal would be useful here.


-- 
David Marchand


More information about the dev mailing list