Skip to content

Commit

Permalink
CI: set machine type to default when building DPDK
Browse files Browse the repository at this point in the history
As part of building statically linked packages DPDK is also compiled
from source. Before this patch the default machine type of "native" was
used. This results in DPDK building with -march=native. This isn't very
portable and can cause issues on CPU's that don't have feature parity
with the build machine's CPU. This patch sets the machine type to
"default". On x86 this will conservatively set "-march=corei7" which is
a lot more portable than "native"

Older versions of DPDK did not export a -march flag in the pkgconfig
file. Virtio-forwarder will set the flag to core2. Change this to corei7
for consistency too.

Signed-off-by: Heinrich Kuhn <[email protected]>
Signed-off-by: Simon Horman <[email protected]>
  • Loading branch information
Heinrich Kuhn committed Sep 17, 2021
1 parent 94feb89 commit de061fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/data/build_templates/template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ echo "Disabling the following drivers: ${disable_list%,}"
meson -Denable_kmods=false \
-Dmax_ethports=64 \
-Ddisable_drivers="${disable_list%,}" \
-Dmachine=default \
build

ninja install -C build && ldconfig
Expand Down
6 changes: 3 additions & 3 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,11 @@ cflags += '-D_GNU_SOURCE'
cflags += '-mavx'

# older versions of the dpdk pc file did not include the baseline architecture
# set it to DPDK's old default (it has since been moved to corei7 in 17.08)
# this can be dropped once support for DPDK < 18.11 is no longer necessary
# set it to corei7. This can be dropped once support for DPDK < 18.11
# is no longer necessary
dpdk_cflags = dpdk.get_pkgconfig_variable('cflags')
if host_machine.cpu_family().startswith('x86') and not dpdk_cflags.contains('-march')
cflags += '-march=core2'
cflags += '-march=corei7'
endif

sources = files('argv.c',
Expand Down

0 comments on commit de061fe

Please sign in to comment.