diff options
author | Konstantin Ananyev <konstantin.ananyev@intel.com> | 2021-09-30 10:05:39 +0000 |
---|---|---|
committer | Konstantin Ananyev <konstantin.ananyev@intel.com> | 2021-11-10 11:55:12 +0000 |
commit | b792c1f27d58040f3a815da18183d329bd6bd84b (patch) | |
tree | def302a01c2136211651fb90994806ae1ff0a32a /dpdk | |
parent | f71107b4dd6a4b8b1cd28d7339c924f1b013cfa4 (diff) |
tldk: swtich to use DPDK 20.11 LTS
As in DPDK 20.11 'make' is not supported any more,
switch to use pkg-conf approach.
Note that RTE_SDK now should point to your DPDK package installation path.
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Change-Id: I4a3c394758e183a3ddcdb45a0562a81583daaab6
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Diffstat (limited to 'dpdk')
-rw-r--r-- | dpdk/Makefile | 169 |
1 files changed, 49 insertions, 120 deletions
diff --git a/dpdk/Makefile b/dpdk/Makefile index c474433..a4abac8 100644 --- a/dpdk/Makefile +++ b/dpdk/Makefile @@ -14,155 +14,84 @@ # Scripts require non-POSIX parts of bash SHELL := /bin/bash -DPDK_VERSION ?= v20.05 -DPDK_BUILD_DIR ?= $(CURDIR)/_build -DPDK_INSTALL_DIR ?= $(DPDK_BUILD_DIR)/dpdk/$(RTE_TARGET) -DPDK_PKTMBUF_HEADROOM ?= 128 +RTE_OUTPUT ?= $(O) + +DOWNLOAD_DIR := $(CURDIR)/downloads +MESON_DIR := $(CURDIR)/meson + +DPDK_VERSION ?= 20.11 +DPDK_SRC_DIR ?= $(RTE_OUTPUT)-src +DPDK_BUILD_DIR ?= $(RTE_OUTPUT)-build +DPDK_INSTALL_DIR ?= $(RTE_OUTPUT) DPDK_MARCH ?= native -DPDK_TUNE ?= generic -DPDK_DEBUG ?= n +DPDK_BUILD ?= release +S := $(DPDK_SRC_DIR) B := $(DPDK_BUILD_DIR) I := $(DPDK_INSTALL_DIR) -DPDK_GIT_REPO ?= http://dpdk.org/git/dpdk -DPDK_SOURCE := $(B)/dpdk -ifneq (,$(findstring clang,$(CC))) -DPDK_CC=clang -else -DPDK_CC=gcc -endif - -ifeq (,$(DPDK_TARGET)) -DPDK_TARGET := x86_64-native-linuxapp-$(DPDK_CC) -endif +DPDK_GIT_REPO ?= http://dpdk.org/git/dpdk-stable 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) -DPDK_EXTRA_CFLAGS := -g -mtune=$(DPDK_TUNE) -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) \ - RTE_CONFIG_TEMPLATE=../custom-config \ - RTE_OUTPUT=$(I) \ - EXTRA_CFLAGS="$(DPDK_EXTRA_CFLAGS)" \ - EXTRA_LDFLAGS="$(DPDK_EXTRA_LDFLAGS)" \ - CPU_CFLAGS="$(DPDK_CPU_CFLAGS)" \ - CPU_LDFLAGS="$(DPDK_CPU_LDFLAGS)" \ - $(DPDK_MAKE_EXTRA_ARGS) - -DPDK_SOURCE_FILES := $(shell [ -e $(DPDK_SOURCE) ] && \ - find $(DPDK_SOURCE) -name "*.[chS]") - -define set -@if grep -q CONFIG_$1 $@ ; \ - then sed -i -e 's/.*\(CONFIG_$1=\).*/\1$2/' $@ ; \ - else echo CONFIG_$1=$2 >> $@ ; \ -fi -endef - all: build -$(B)/custom-config: $(B)/.patch.ok Makefile - @echo --- generating custom config from \ - $(DPDK_SOURCE)/config/defconfig_$(DPDK_TARGET) --- $@ - @cpp -undef -ffreestanding -x assembler-with-cpp \ - $(DPDK_SOURCE)/config/defconfig_$(DPDK_TARGET) $@ - $(call set,RTE_MACHINE,$(DPDK_MACHINE)) - @# modify options - $(call set,RTE_MAX_LCORE,256) - $(call set,RTE_PKTMBUF_HEADROOM,$(DPDK_PKTMBUF_HEADROOM)) - $(call set,RTE_LIBEAL_USE_HPET,y) - $(call set,RTE_BUILD_COMBINE_LIBS,y) - $(call set,RTE_LIBRTE_I40E_16BYTE_RX_DESC,y) - $(call set,RTE_LIBRTE_I40E_ITR_INTERVAL,16) - $(call set,RTE_LIBRTE_PMD_PCAP,y) - @# enable debug init for device drivers - $(call set,RTE_LIBRTE_I40E_DEBUG_INIT,$(DPDK_DEBUG)) - $(call set,RTE_LIBRTE_IXGBE_DEBUG_INIT,$(DPDK_DEBUG)) - $(call set,RTE_LIBRTE_E1000_DEBUG_INIT,$(DPDK_DEBUG)) - $(call set,RTE_LIBRTE_VIRTIO_DEBUG_INIT,$(DPDK_DEBUG)) - $(call set,RTE_LIBRTE_VMXNET3_DEBUG_INIT,$(DPDK_DEBUG)) - $(call set,RTE_LIBRTE_PMD_BOND,y) - $(call set,RTE_LIBRTE_IP_FRAG,y) - @# not needed - $(call set,RTE_LIBRTE_CFGFILE,n) - $(call set,RTE_LIBRTE_POWER,n) - $(call set,RTE_LIBRTE_DISTRIBUTOR,n) - $(call set,RTE_LIBRTE_REORDER,n) - $(call set,RTE_LIBRTE_FLOW_CLASSIFY,n) - $(call set,RTE_LIBRTE_PMD_CRYPTO_SCHEDULER,n) - $(call set,RTE_KNI_KMOD,n) - @rm -f .config.ok - -$(B)/.download.ok: - @mkdir -p $(B) - @if [ -e $(DPDK_SOURCE) ] ; \ - then rm -rf $(DPDK_SOURCE) ; \ +$(S)/.download.ok: + @if [ -e $(S) ] ; \ + then rm -rf $(S) ; \ fi - @git clone $(DPDK_GIT_REPO) --branch $(DPDK_VERSION) $(DPDK_SOURCE) + $(Q)git clone $(DPDK_GIT_REPO) --branch $(DPDK_VERSION) $(S) @touch $@ .PHONY: download -download: $(B)/.download.ok +download: $(S)/.download.ok -$(B)/.patch.ok: $(B)/.download.ok +$(S)/.patch.ok: $(S)/.download.ok ifneq ($(wildcard $(CURDIR)/dpdk-$(DPDK_VERSION)_patches/*.patch),) @echo --- patching --- for f in $(CURDIR)/dpdk-$(DPDK_VERSION)_patches/*.patch ; do \ echo Applying patch: $$(basename $$f) ; \ - patch -p1 -d $(DPDK_SOURCE) < $$f ; \ + patch -p1 -d $(S) < $$f ; \ done endif @touch $@ .PHONY: patch -patch: $(B)/.patch.ok - -$(B)/.config.ok: $(B)/.patch.ok $(B)/custom-config - @make $(DPDK_MAKE_ARGS) config +patch: $(S)/.patch.ok + +$(MESON_DIR)/meson.ok: + $(Q)mkdir -p $(DOWNLOAD_DIR) + $(Q)mkdir -p $(MESON_DIR) + $(Q)python3 --version + $(Q)python3 -m venv $(MESON_DIR) + $(Q)source $(MESON_DIR)/bin/activate && \ + $(Q)pip3 download -d $(DOWNLOAD_DIR) \ + meson==0.55 setuptools wheel pyelftools && \ + deactivate + $(Q)source $(MESON_DIR)/bin/activate && \ + pip3 install --no-index \ + --find-links=$(DOWNLOAD_DIR) --target=$(MESON_DIR) wheel && \ + deactivate + $(Q)source $(MESON_DIR)/bin/activate && \ + pip3 install --no-index \ + --find-links=$(DOWNLOAD_DIR) --target=$(MESON_DIR) \ + meson==0.55 pyelftools && \ + deactivate @touch $@ .PHONY: config -config: $(B)/.config.ok - -$(B)/.build.ok: $(DPDK_SOURCE_FILES) $(B)/.config.ok - @make $(DPDK_MAKE_ARGS) install - @cp $(I)/.config $(B)/.config - @touch $@ +config: patch $(MESON_DIR)/meson.ok + $(Q)source $(MESON_DIR)/bin/activate && \ + meson --prefix=$(I) --werror -Dtests=false \ + -Dbuildtype=$(DPDK_BUILD) -Dmachine=$(DPDK_MARCH) $(B) $(S) && \ + deactivate .PHONY: build -build: $(B)/.build.ok +build: config $(B)/build.ninja + $(Q)source $(MESON_DIR)/bin/activate && \ + meson install -C $(B) && \ + deactivate .PHONY: clean clean: - @rm -rf $(B) $(I) + $(Q)rm -rf $(B) $(I) $(S) |