summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-02-06 22:28:52 +0100
committerDave Barach <openvpp@barachs.net>2017-02-07 20:24:49 +0000
commit78edb8e722fe2bb72ba7f8e63b420733c7fb51c6 (patch)
treeff7f673ac15c80a42726810d1d4e4c41b0bfd508
parent6fa5568fc4b8de0e12a2907de8e1884e984a3520 (diff)
Multiple platofrm support for dpdk/Makefile, fix optimizations
Using -march=native was causing SIGILLs on Atoms. Change-Id: I98c7fdaa139e3db70c972950dc9c167bf5803656 Signed-off-by: Damjan Marion <damarion@cisco.com>
-rw-r--r--build-data/packages/dpdk.mk12
-rw-r--r--build-data/platforms/thunder.mk36
-rw-r--r--build-data/platforms/vpp.mk3
-rw-r--r--dpdk/Makefile52
4 files changed, 25 insertions, 78 deletions
diff --git a/build-data/packages/dpdk.mk b/build-data/packages/dpdk.mk
index 6938392c04c..ed89bb1b7b2 100644
--- a/build-data/packages/dpdk.mk
+++ b/build-data/packages/dpdk.mk
@@ -1,14 +1,4 @@
-DPDK_MARCH = $(strip $($(PLATFORM)_dpdk_arch))
-ifeq ($(DPDK_MARCH),)
- DPDK_MARCH="native"
-endif
-
-DPDK_TUNE = $(strip $($(PLATFORM)_mtune))
-ifeq ($(DPDK_TUNE),)
- DPDK_TUNE="generic"
-endif
-
ifneq (,$(findstring debug,$(TAG)))
DPDK_DEBUG=y
else
@@ -18,8 +8,6 @@ endif
DPDK_MAKE_ARGS = -C $(call find_source_fn,$(PACKAGE_SOURCE)) \
DPDK_BUILD_DIR=$(PACKAGE_BUILD_DIR) \
DPDK_INSTALL_DIR=$(PACKAGE_INSTALL_DIR) \
- DPDK_MARCH=$(DPDK_MARCH) \
- DPDK_TUNE=$(DPDK_TUNE) \
DPDK_DEBUG=$(DPDK_DEBUG)
DPDK_CRYPTO_SW_PMD=$(strip $($(PLATFORM)_uses_dpdk_cryptodev_sw))
diff --git a/build-data/platforms/thunder.mk b/build-data/platforms/thunder.mk
deleted file mode 100644
index 31b6a510576..00000000000
--- a/build-data/platforms/thunder.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Override OS so we can use the sdk toolchain instead of building one
-thunder_os = thunderx-linux-gnu
-
-# Override CROSS_LDFLAGS so we can use
-# /lib/aarch64-linux-gnu/ld-linux-aarch64.so.1 instead of building glibc
-thunder_cross_ldflags = \
- -Wl,--dynamic-linker=/lib/aarch64-linux-gnu/ld-linux-aarch64.so.1 \
- -Wl,-rpath -Wl,$(lots_of_slashes_to_pad_names)$(TOOL_INSTALL_LIB_DIR)
-
-thunder_arch = aarch64
-# suppress -march=foo, the cross compiler doesn't understand it
-thunder_march = " "
-
-thunder_root_packages = vppinfra vlib-cavium-dpdk vnet-cavium-dpdk cavium-dpdk \
- vpp-cavium-dpdk vpp-api-test-cavium-dpdk
-
-vnet-cavium-dpdk_configure_args_thunder = \
- --with-dpdk --without-libssl
-
-vpp-cavium-dpdk_configure_args_thunder = \
- --with-dpdk --without-libssl
-
-cavium-dpdk_configure_args_thunder = --with-headroom=256
-
-vlib-cavium-dpdk_configure_args_thunder = --with-pre-data=128
-
-# native tool chain additions for this platform
-thunder_native_tools = vppapigen
-
-thunder_debug_TAG_CFLAGS = -g -O0 -DCLIB_DEBUG
-thunder_debug_TAG_LDFLAGS = -g -O0 -DCLIB_DEBUG
-
-thunder_TAG_CFLAGS = -g -O2
-thunder_TAG_LDFLAGS = -g -O2
-
-
diff --git a/build-data/platforms/vpp.mk b/build-data/platforms/vpp.mk
index ee30763986f..401a383ad92 100644
--- a/build-data/platforms/vpp.mk
+++ b/build-data/platforms/vpp.mk
@@ -16,17 +16,14 @@ vpp_arch = native
ifeq ($(shell uname -m),x86_64)
vpp_march = corei7 # Nehalem Instruction set
vpp_mtune = corei7-avx # Optimize for Sandy Bridge
-vpp_dpdk_arch = corei7
else ifeq ($(shell uname -m),aarch64)
ifeq ($(TARGET_PLATFORM),thunderx)
vpp_march = armv8-a+crc
vpp_mtune = thunderx
-vpp_dpdk_arch = armv8a
vpp_dpdk_target = arm64-thunderx-linuxapp-gcc
else
vpp_march = native
vpp_mtune = generic
-vpp_dpdk_arch = native
endif
endif
vpp_native_tools = vppapigen
diff --git a/dpdk/Makefile b/dpdk/Makefile
index 00d606d220b..c9ed87304d3 100644
--- a/dpdk/Makefile
+++ b/dpdk/Makefile
@@ -18,8 +18,6 @@ DPDK_BUILD_DIR ?= $(CURDIR)/_build
DPDK_INSTALL_DIR ?= $(CURDIR)/_install
DPDK_PKTMBUF_HEADROOM ?= 128
DPDK_DOWNLOAD_DIR ?= $(HOME)/Downloads
-DPDK_MARCH ?= native
-DPDK_TUNE ?= generic
DPDK_DEBUG ?= n
DPDK_CRYPTO_SW_PMD ?= n
DPDK_MLX5_PMD ?= n
@@ -27,7 +25,7 @@ DPDK_MLX5_PMD ?= n
B := $(DPDK_BUILD_DIR)
I := $(DPDK_INSTALL_DIR)
DPDK_VERSION ?= 16.11
-PKG_SUFFIX ?= vpp4
+PKG_SUFFIX ?= vpp5
DPDK_BASE_URL ?= http://fast.dpdk.org/rel
DPDK_TARBALL := dpdk-$(DPDK_VERSION).tar.xz
DPDK_TAR_URL := $(DPDK_BASE_URL)/$(DPDK_TARBALL)
@@ -37,20 +35,40 @@ DPDK_SOURCE := $(B)/dpdk-$(DPDK_VERSION)
ifneq (,$(findstring clang,$(CC)))
DPDK_CC=clang
+else ifneq (,$(findstring icc,$(CC)))
+DPDK_CC=icc
else
DPDK_CC=gcc
endif
+##############################################################################
+# Intel x86_64
+##############################################################################
+ifeq ($(shell uname -m),x86_64)
+DPDK_TARGET ?= x86_64-native-linuxapp-$(DPDK_CC)
+DPDK_MACHINE ?= nhm
+DPDK_TUNE ?= core-avx2
+
+##############################################################################
+# Cavium ThunderX
+##############################################################################
+else ifneq (,$(findstring thunder,$(shell cat /sys/bus/pci/devices/0000:00:01.0/uevent | grep cavium)))
+export CROSS=""
+DPDK_TARGET ?= arm64-thunderx-linuxapp-$(DPDK_CC)
+DPDK_MACHINE ?= thunderx
+DPDK_TUNE ?= generic
-ifeq (,$(DPDK_TARGET))
-DPDK_TARGET := x86_64-native-linuxapp-$(DPDK_CC)
+##############################################################################
+# Unknown platofrm
+##############################################################################
+else
+$(error unknown platform)
endif
JOBS := $(shell grep processor /proc/cpuinfo | wc -l)
# compiler/linker custom arguments
DPDK_CPU_CFLAGS := -pie -fPIC
-DPDK_CPU_LDFLAGS :=
DPDK_EXTRA_LDFLAGS := -g
ifeq ($(DPDK_DEBUG),n)
@@ -59,25 +77,6 @@ else
DPDK_EXTRA_CFLAGS := -g -O0
endif
-# translate gcc march values to DPDK arch
-ifeq ($(DPDK_MARCH),native)
-DPDK_MACHINE:=native # autodetect host CPU
-else ifeq ($(DPDK_MARCH),corei7)
-DPDK_MACHINE:=nhm # Nehalem / Westmere
-else ifeq ($(DPDK_MARCH),corei7-avx)
-DPDK_MACHINE:=snb # Sandy Bridge
-else ifeq ($(DPDK_MARCH),core-avx-i)
-DPDK_MACHINE:=ivb # Ivy Bridge
-else ifeq ($(DPDK_MARCH),core-avx2)
-DPDK_MACHINE:=hsw # Haswell
-else ifeq ($(DPDK_MARCH),armv7a)
-DPDK_MACHINE:=armv7a # ARMv7
-else ifeq ($(DPDK_MARCH),armv8a)
-DPDK_MACHINE:=armv8a # ARMv8
-else
-$(error Unknown DPDK_MARCH)
-endif
-
# assemble DPDK make arguments
DPDK_MAKE_ARGS := -C $(DPDK_SOURCE) -j $(JOBS) \
T=$(DPDK_TARGET) \
@@ -85,11 +84,10 @@ DPDK_MAKE_ARGS := -C $(DPDK_SOURCE) -j $(JOBS) \
EXTRA_CFLAGS="$(DPDK_EXTRA_CFLAGS)" \
EXTRA_LDFLAGS="$(DPDK_EXTRA_LDFLAGS)" \
CPU_CFLAGS="$(DPDK_CPU_CFLAGS)" \
- CPU_LDFLAGS="$(DPDK_CPU_LDFLAGS)" \
DESTDIR=$(I) \
$(DPDK_MAKE_EXTRA_ARGS)
-DPDK_SOURCE_FILES := $(shell [ -e $(DPDK_SOURCE) ] && find $(DPDK_SOURCE) -name "*.[chS]")
+DPDK_SOURCE_FILES := $(shell [ -e $(DPDK_SOURCE) ] && find $(DPDK_SOURCE) -name "*.[chS]")
define set
@if grep -q CONFIG_$1 $@ ; \