span: fix wrong next1 feature index in dual loop
[vpp.git] / dpdk / Makefile
index e6e2b5f..46cc3db 100644 (file)
@@ -19,18 +19,31 @@ 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_PMD        ?= n
 
 B := $(DPDK_BUILD_DIR)
 I := $(DPDK_INSTALL_DIR)
-DPDK_VERSION ?= 2.2.0
-DPDK_BASE_URL ?= http://dpdk.org/browse/dpdk/snapshot
-DPDK_TARBALL := dpdk-$(DPDK_VERSION).tar.gz
+DPDK_VERSION ?= 16.11
+DPDK_BASE_URL ?= http://fast.dpdk.org/rel
+DPDK_TARBALL := dpdk-$(DPDK_VERSION).tar.xz
 DPDK_TAR_URL := $(DPDK_BASE_URL)/$(DPDK_TARBALL)
-DPDK_2.1.0_TARBALL_MD5_CKSUM := 205a0d12bfd6eb717d57506272f43519
-DPDK_2.2.0_TARBALL_MD5_CKSUM := 22e2fd68cd5504f43fe9a5a6fd6dd938
+DPDK_16.07_TARBALL_MD5_CKSUM := 690a2bb570103e58d12f9806e8bf21be
+DPDK_16.11_TARBALL_MD5_CKSUM := 06c1c577795360719d0b4fafaeee21e9
 DPDK_SOURCE := $(B)/dpdk-$(DPDK_VERSION)
-DPDK_TARGET := x86_64-native-linuxapp-gcc
+
+ifneq (,$(findstring clang,$(CC)))
+DPDK_CC=clang
+else
+DPDK_CC=gcc
+endif
+
+
+ifeq (,$(DPDK_TARGET))
+DPDK_TARGET := x86_64-native-linuxapp-$(DPDK_CC)
+endif
+
 JOBS := $(shell grep processor /proc/cpuinfo | wc -l)
 
 # compiler/linker custom arguments
@@ -39,9 +52,9 @@ DPDK_CPU_LDFLAGS :=
 DPDK_EXTRA_LDFLAGS := -g
 
 ifeq ($(DPDK_DEBUG),n)
-DPDK_EXTRA_CFLAGS := -g 
+DPDK_EXTRA_CFLAGS := -g -mtune=$(DPDK_TUNE)
 else
-DPDK_EXTRA_CFLAGS := -g -O0 
+DPDK_EXTRA_CFLAGS := -g -O0
 endif
 
 # translate gcc march values to DPDK arch
@@ -55,6 +68,10 @@ 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
@@ -67,7 +84,8 @@ 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)"
+       CPU_LDFLAGS="$(DPDK_CPU_LDFLAGS)" \
+        $(DPDK_MAKE_EXTRA_ARGS)
 
 DPDK_SOURCE_FILES := $(shell  [ -e $(DPDK_SOURCE) ] && find $(DPDK_SOURCE) -name "*.[chS]")  
 
@@ -81,21 +99,18 @@ endef
 all: build
 
 $(B)/custom-config: $(B)/.patch.ok Makefile
-       @echo --- generating custom config from $(DPDK_SOURCE)/config/common_linuxapp ---
-       @cp $(DPDK_SOURCE)/config/common_linuxapp $@ 
+       @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))
-       $(call set,RTE_ARCH,"x86_64")
-       $(call set,RTE_ARCH_X86_64,y)
-       $(call set,RTE_ARCH_64,y)
-       $(call set,RTE_TOOLCHAIN_GCC,y)
-       $(call set,RTE_TOOLCHAIN,"gcc")
        @# 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_PCI_CONFIG,y)
+       $(call set,RTE_PCI_EXTENDED_TAG,"on")
+       $(call set,RTE_PCI_MAX_READ_REQUEST_SIZE,4096)
        @# enable debug init for device drivers
        $(call set,RTE_LIBRTE_I40E_DEBUG_INIT,$(DPDK_DEBUG))
        $(call set,RTE_LIBRTE_IXGBE_DEBUG_INIT,$(DPDK_DEBUG))
@@ -104,6 +119,9 @@ $(B)/custom-config: $(B)/.patch.ok Makefile
        $(call set,RTE_LIBRTE_VMXNET3_DEBUG_INIT,$(DPDK_DEBUG))
        $(call set,RTE_LIBRTE_PMD_BOND,y)
        $(call set,RTE_LIBRTE_IP_FRAG,y)
+       $(call set,RTE_LIBRTE_PMD_AESNI_MB,$(DPDK_CRYPTO_PMD))
+       $(call set,RTE_LIBRTE_PMD_AESNI_GCM,$(DPDK_CRYPTO_PMD))
+       $(call set,RTE_LIBRTE_PMD_QAT,$(DPDK_CRYPTO_PMD))
        @# not needed
        $(call set,RTE_LIBRTE_TIMER,n)
        $(call set,RTE_LIBRTE_CFGFILE,n)
@@ -138,18 +156,20 @@ download: $(B)/.download.ok
 
 $(B)/.extract.ok: $(B)/.download.ok
        @echo --- extracting $(DPDK_TARBALL) ---
-       @tar --directory $(B) --extract --file $(CURDIR)/$(DPDK_TARBALL) --gzip
+       @tar --directory $(B) --extract --file $(CURDIR)/$(DPDK_TARBALL)
        @touch $@
 
 .PHONY: extract
 extract: $(B)/.extract.ok
 
 $(B)/.patch.ok: $(B)/.extract.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 ; \
        done
+endif
        @touch $@
 
 .PHONY: patch