diff --git a/.dpdk.metadata b/.dpdk.metadata index 900a60a..9bd3682 100644 --- a/.dpdk.metadata +++ b/.dpdk.metadata @@ -1,2 +1 @@ -71162be485b35da45d2a303f9e0462814e2a77c1 SOURCES/dpdk-2.2.0.tar.gz -3d9751fa798416ebd8a3fd0faeb7830b29c62c11 SOURCES/driverctl-0.59.tar.gz +59003b90b0037e2e88f9819b9305529717261562 SOURCES/dpdk-stable-16.11.2.tar.xz diff --git a/.gitignore b/.gitignore index 7382d5f..b0a0dd7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -SOURCES/dpdk-2.2.0.tar.gz -SOURCES/driverctl-0.59.tar.gz +SOURCES/dpdk-stable-16.11.2.tar.xz diff --git a/SOURCES/dpdk-2.2-buildopts.patch b/SOURCES/dpdk-2.2-buildopts.patch deleted file mode 100644 index 2fa2796..0000000 --- a/SOURCES/dpdk-2.2-buildopts.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up dpdk-2.1.0-2898.gitf1e779ec/examples/ip_pipeline/Makefile.buildopts dpdk-2.1.0-2898.gitf1e779ec/examples/ip_pipeline/Makefile ---- dpdk-2.1.0-2898.gitf1e779ec/examples/ip_pipeline/Makefile.buildopts 2015-08-11 23:36:41.000000000 +0300 -+++ dpdk-2.1.0-2898.gitf1e779ec/examples/ip_pipeline/Makefile 2015-08-12 12:46:00.212761965 +0300 -@@ -70,7 +70,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PIPELINE) += pi - SRCS-$(CONFIG_RTE_LIBRTE_PIPELINE) += pipeline_routing.c - - CFLAGS += -I$(SRCDIR) -I$(SRCDIR)/pipeline --CFLAGS += -O3 -+CFLAGS += -O3 -mavx2 - CFLAGS += $(WERROR_FLAGS) -Wno-error=unused-function -Wno-error=unused-variable - - include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/SOURCES/dpdk-2.2-dtneeded.patch b/SOURCES/dpdk-2.2-dtneeded.patch deleted file mode 100644 index 28b2a12..0000000 --- a/SOURCES/dpdk-2.2-dtneeded.patch +++ /dev/null @@ -1,152 +0,0 @@ -commit f85ab16a916be178a4cb61575f414c43fc98313d -Author: Panu Matilainen -Date: Tue Dec 8 13:42:26 2015 +0200 - - mk: fix external shared library dependencies of libraries - - Similar to commit 5f9115e58cc6f304ff4ade694cf5823d32887d1a etc, but - for libraries. Clean up librte_vhost CFLAGS/LDFLAGS/LDLIBS confusion - while at it. - - Requiring applications to know about library internal details like - dependencies to external helper libraries is a limitation of - static linkage, shared libraries should always know their own - dependencies for sane operation. - - Linking with the combined library (whether shared or not) still - requires knowing the internal dependencies, and intra-dpdk - dependencies are also not currently recorded. - - Signed-off-by: Panu Matilainen - -diff --git a/app/test/Makefile b/app/test/Makefile -index ec33e1a..abb0545 100644 ---- a/app/test/Makefile -+++ b/app/test/Makefile -@@ -182,6 +182,8 @@ endif - endif - endif - -+LDLIBS += -lm -+ - include $(RTE_SDK)/mk/rte.app.mk - - endif -diff --git a/lib/librte_eal/bsdapp/eal/Makefile b/lib/librte_eal/bsdapp/eal/Makefile -index 65b293f..b7b6016 100644 ---- a/lib/librte_eal/bsdapp/eal/Makefile -+++ b/lib/librte_eal/bsdapp/eal/Makefile -@@ -42,6 +42,9 @@ CFLAGS += -I$(RTE_SDK)/lib/librte_ring - CFLAGS += -I$(RTE_SDK)/lib/librte_mempool - CFLAGS += $(WERROR_FLAGS) -O3 - -+LDLIBS += -lpthread -+LDLIBS += -ldl -+ - EXPORT_MAP := rte_eal_version.map - - LIBABIVER := 2 -diff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile -index 26eced5..0efb9e4 100644 ---- a/lib/librte_eal/linuxapp/eal/Makefile -+++ b/lib/librte_eal/linuxapp/eal/Makefile -@@ -47,6 +47,9 @@ CFLAGS += -I$(RTE_SDK)/lib/librte_mempool - CFLAGS += -I$(RTE_SDK)/lib/librte_ivshmem - CFLAGS += $(WERROR_FLAGS) -O3 - -+LDLIBS += -lpthread -+LDLIBS += -ldl -+ - # specific to linuxapp exec-env - SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) := eal.c - SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_hugepage_info.c -diff --git a/lib/librte_sched/Makefile b/lib/librte_sched/Makefile -index b1cb285..4d631f6 100644 ---- a/lib/librte_sched/Makefile -+++ b/lib/librte_sched/Makefile -@@ -41,6 +41,9 @@ CFLAGS += $(WERROR_FLAGS) - - CFLAGS_rte_red.o := -D_GNU_SOURCE - -+LDLIBS += -lm -+LDLIBS += -lrt -+ - EXPORT_MAP := rte_sched_version.map - - LIBABIVER := 1 -diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile -index 6681f22..4aecc69 100644 ---- a/lib/librte_vhost/Makefile -+++ b/lib/librte_vhost/Makefile -@@ -42,12 +42,12 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -D_FILE_OFFSET_BITS=64 - ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),y) - CFLAGS += -I vhost_user - else --CFLAGS += -I vhost_cuse -lfuse --LDFLAGS += -lfuse -+CFLAGS += -I vhost_cuse -+LDLIBS += -lfuse - endif - - ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y) --LDFLAGS += -lnuma -+LDLIBS += -lnuma - endif - - # all source are stored in SRCS-y -diff --git a/mk/exec-env/linuxapp/rte.vars.mk b/mk/exec-env/linuxapp/rte.vars.mk -index 5fd7d85..d51bd17 100644 ---- a/mk/exec-env/linuxapp/rte.vars.mk -+++ b/mk/exec-env/linuxapp/rte.vars.mk -@@ -48,7 +48,7 @@ endif - # Workaround lack of DT_NEEDED entry - EXECENV_LDFLAGS = --no-as-needed - --EXECENV_LDLIBS = -lrt -lm -+EXECENV_LDLIBS = - EXECENV_ASFLAGS = - - ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) -diff --git a/mk/rte.app.mk b/mk/rte.app.mk -index 8ecab41..4ecaa6c 100644 ---- a/mk/rte.app.mk -+++ b/mk/rte.app.mk -@@ -81,23 +81,11 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_LPM) += -lrte_lpm - _LDLIBS-$(CONFIG_RTE_LIBRTE_POWER) += -lrte_power - _LDLIBS-$(CONFIG_RTE_LIBRTE_ACL) += -lrte_acl - _LDLIBS-$(CONFIG_RTE_LIBRTE_METER) += -lrte_meter -- - _LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrte_sched --_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lm --_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrt -- - _LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lrte_vhost - - endif # ! CONFIG_RTE_BUILD_COMBINE_LIBS - --ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y) --_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lnuma --endif -- --ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),n) --_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lfuse --endif -- - # The static libraries do not know their dependencies. - # The combined library fails also to store this information. - # So linking with static or combined library requires explicit dependencies. -@@ -111,6 +99,14 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lxenstore - _LDLIBS-$(CONFIG_RTE_LIBRTE_MPIPE_PMD) += -lgxio - # QAT PMD has a dependency on libcrypto (from openssl) for calculating HMAC precomputes - _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += -lcrypto -+_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lm -+_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrt -+ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y) -+_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lnuma -+endif -+ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),n) -+_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lfuse -+endif - endif # CONFIG_RTE_BUILD_COMBINE_LIBS or not CONFIG_RTE_BUILD_SHARED_LIBS - - _LDLIBS-y += --start-group diff --git a/SOURCES/dpdk-2.2-warningflags.patch b/SOURCES/dpdk-2.2-warningflags.patch deleted file mode 100644 index 787c65b..0000000 --- a/SOURCES/dpdk-2.2-warningflags.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/drivers/net/i40e/Makefile b/drivers/net/i40e/Makefile -index 033ee4a..3917b0c 100644 ---- a/drivers/net/i40e/Makefile -+++ b/drivers/net/i40e/Makefile -@@ -55,7 +55,6 @@ CFLAGS_BASE_DRIVER += -Wno-sign-compare - CFLAGS_BASE_DRIVER += -Wno-unused-value - CFLAGS_BASE_DRIVER += -Wno-unused-parameter - CFLAGS_BASE_DRIVER += -Wno-strict-aliasing --CFLAGS_BASE_DRIVER += -Wno-format - CFLAGS_BASE_DRIVER += -Wno-missing-field-initializers - CFLAGS_BASE_DRIVER += -Wno-pointer-to-int-cast - CFLAGS_BASE_DRIVER += -Wno-format-nonliteral -@@ -65,11 +64,9 @@ CFLAGS_BASE_DRIVER = -Wno-sign-compare - CFLAGS_BASE_DRIVER += -Wno-unused-value - CFLAGS_BASE_DRIVER += -Wno-unused-parameter - CFLAGS_BASE_DRIVER += -Wno-strict-aliasing --CFLAGS_BASE_DRIVER += -Wno-format - CFLAGS_BASE_DRIVER += -Wno-missing-field-initializers - CFLAGS_BASE_DRIVER += -Wno-pointer-to-int-cast - CFLAGS_BASE_DRIVER += -Wno-format-nonliteral --CFLAGS_BASE_DRIVER += -Wno-format-security - CFLAGS_BASE_DRIVER += -Wno-unused-variable - - ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo 1), 1) diff --git a/SOURCES/dpdk-snapshot.sh b/SOURCES/dpdk-snapshot.sh old mode 100755 new mode 100644 diff --git a/SOURCES/eal-ppc-fix-mmap-for-memory-initialization.patch b/SOURCES/eal-ppc-fix-mmap-for-memory-initialization.patch new file mode 100644 index 0000000..b59a6d8 --- /dev/null +++ b/SOURCES/eal-ppc-fix-mmap-for-memory-initialization.patch @@ -0,0 +1,75 @@ +From 284ae3e9ff9a92575c28c858efd2c85c8de6d440 Mon Sep 17 00:00:00 2001 +From: Chao Zhu +Date: Thu, 6 Apr 2017 15:36:09 +0530 +Subject: [PATCH] eal/ppc: fix mmap for memory initialization + +On IBM POWER platform, when mapping /dev/zero file to hugepage memory +space, mmap will not respect the requested address hint. This will cause +the memory initialization for the second process fails. This patch adds +the required mmap flags to make it work. Beside this, users need to set +the nr_overcommit_hugepages to expand the VA range. When +doing the initialization, users need to set both nr_hugepages and +nr_overcommit_hugepages to the same value, like 64, 128, etc. + +Signed-off-by: Chao Zhu +Acked-by: Sergio Gonzalez Monroy +Acked-by: John McNamara +--- + doc/guides/linux_gsg/sys_reqs.rst | 6 ++++++ + lib/librte_eal/linuxapp/eal/eal_memory.c | 16 ++++++++++++++-- + 2 files changed, 20 insertions(+), 2 deletions(-) + +diff --git a/doc/guides/linux_gsg/sys_reqs.rst b/doc/guides/linux_gsg/sys_reqs.rst +index 61222c699b7d..3a28c9e51775 100644 +--- a/doc/guides/linux_gsg/sys_reqs.rst ++++ b/doc/guides/linux_gsg/sys_reqs.rst +@@ -200,6 +200,12 @@ On a NUMA machine, pages should be allocated explicitly on separate nodes:: + + For 1G pages, it is not possible to reserve the hugepage memory after the system has booted. + ++ On IBM POWER system, the nr_overcommit_hugepages should be set to the same value as nr_hugepages. ++ For example, if the required page number is 128, the following commands are used:: ++ ++ echo 128 > /sys/kernel/mm/hugepages/hugepages-16384kB/nr_hugepages ++ echo 128 > /sys/kernel/mm/hugepages/hugepages-16384kB/nr_overcommit_hugepages ++ + Using Hugepages with the DPDK + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c +index 90cc3224be85..618a09b429bc 100644 +--- a/lib/librte_eal/linuxapp/eal/eal_memory.c ++++ b/lib/librte_eal/linuxapp/eal/eal_memory.c +@@ -331,7 +331,13 @@ get_virtual_area(size_t *size, size_t hugepage_sz) + } + do { + addr = mmap(addr, +- (*size) + hugepage_sz, PROT_READ, MAP_PRIVATE, fd, 0); ++ (*size) + hugepage_sz, PROT_READ, ++#ifdef RTE_ARCH_PPC_64 ++ MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB, ++#else ++ MAP_PRIVATE, ++#endif ++ fd, 0); + if (addr == MAP_FAILED) + *size -= hugepage_sz; + } while (addr == MAP_FAILED && *size > 0); +@@ -1359,7 +1365,13 @@ rte_eal_hugepage_attach(void) + * use mmap to get identical addresses as the primary process. + */ + base_addr = mmap(mcfg->memseg[s].addr, mcfg->memseg[s].len, +- PROT_READ, MAP_PRIVATE, fd_zero, 0); ++ PROT_READ, ++#ifdef RTE_ARCH_PPC_64 ++ MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB, ++#else ++ MAP_PRIVATE, ++#endif ++ fd_zero, 0); + if (base_addr == MAP_FAILED || + base_addr != mcfg->memseg[s].addr) { + max_seg = s; +-- +2.9.4 + diff --git a/SOURCES/eal-ppc-support-sPAPR-IOMMU-for-vfio-pci.patch b/SOURCES/eal-ppc-support-sPAPR-IOMMU-for-vfio-pci.patch new file mode 100644 index 0000000..ed46bfa --- /dev/null +++ b/SOURCES/eal-ppc-support-sPAPR-IOMMU-for-vfio-pci.patch @@ -0,0 +1,184 @@ +From f4ce18acd42d27c8aaa090004989d81b40334715 Mon Sep 17 00:00:00 2001 +From: Gowrishankar Muthukrishnan +Date: Wed, 3 May 2017 12:00:27 +0530 +Subject: [PATCH 2/2] eal/ppc: support sPAPR IOMMU for vfio-pci + +Below changes adds pci probing support for vfio-pci devices in power8. + +Signed-off-by: Gowrishankar Muthukrishnan +Acked-by: Anatoly Burakov +Acked-by: Chao Zhu +--- + doc/guides/rel_notes/release_16_11.rst | 4 ++ + lib/librte_eal/linuxapp/eal/eal_vfio.c | 90 ++++++++++++++++++++++++++++++++++ + lib/librte_eal/linuxapp/eal/eal_vfio.h | 25 ++++++++++ + 3 files changed, 119 insertions(+) + +diff --git a/doc/guides/rel_notes/release_16_11.rst b/doc/guides/rel_notes/release_16_11.rst +index 6186337..1e12002 100644 +--- a/doc/guides/rel_notes/release_16_11.rst ++++ b/doc/guides/rel_notes/release_16_11.rst +@@ -159,6 +159,10 @@ New Features + + i40e PMD and its vector PMD enabled by default in powerpc. + ++* **Added powerpc support in pci probing for vfio-pci devices.** ++ ++ sPAPR IOMMU based pci probing enabled for vfio-pci devices. ++ + Resolved Issues + --------------- + +diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c +index 702f7a2..9377a66 100644 +--- a/lib/librte_eal/linuxapp/eal/eal_vfio.c ++++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c +@@ -50,12 +50,15 @@ + static struct vfio_config vfio_cfg; + + static int vfio_type1_dma_map(int); ++static int vfio_spapr_dma_map(int); + static int vfio_noiommu_dma_map(int); + + /* IOMMU types we support */ + static const struct vfio_iommu_type iommu_types[] = { + /* x86 IOMMU, otherwise known as type 1 */ + { RTE_VFIO_TYPE1, "Type 1", &vfio_type1_dma_map}, ++ /* ppc64 IOMMU, otherwise known as spapr */ ++ { RTE_VFIO_SPAPR, "sPAPR", &vfio_spapr_dma_map}, + /* IOMMU-less mode */ + { RTE_VFIO_NOIOMMU, "No-IOMMU", &vfio_noiommu_dma_map}, + }; +@@ -540,6 +543,93 @@ int vfio_setup_device(const char *sysfs_base, const char *dev_addr, + } + + static int ++vfio_spapr_dma_map(int vfio_container_fd) ++{ ++ const struct rte_memseg *ms = rte_eal_get_physmem_layout(); ++ int i, ret; ++ ++ struct vfio_iommu_spapr_register_memory reg = { ++ .argsz = sizeof(reg), ++ .flags = 0 ++ }; ++ struct vfio_iommu_spapr_tce_info info = { ++ .argsz = sizeof(info), ++ }; ++ struct vfio_iommu_spapr_tce_create create = { ++ .argsz = sizeof(create), ++ }; ++ struct vfio_iommu_spapr_tce_remove remove = { ++ .argsz = sizeof(remove), ++ }; ++ ++ /* query spapr iommu info */ ++ ret = ioctl(vfio_container_fd, VFIO_IOMMU_SPAPR_TCE_GET_INFO, &info); ++ if (ret) { ++ RTE_LOG(ERR, EAL, " cannot get iommu info, " ++ "error %i (%s)\n", errno, strerror(errno)); ++ return -1; ++ } ++ ++ /* remove default DMA of 32 bit window */ ++ remove.start_addr = info.dma32_window_start; ++ ret = ioctl(vfio_container_fd, VFIO_IOMMU_SPAPR_TCE_REMOVE, &remove); ++ if (ret) { ++ RTE_LOG(ERR, EAL, " cannot remove default DMA window, " ++ "error %i (%s)\n", errno, strerror(errno)); ++ return -1; ++ } ++ ++ /* calculate window size based on number of hugepages configured */ ++ create.window_size = rte_eal_get_physmem_size(); ++ create.page_shift = __builtin_ctzll(ms->hugepage_sz); ++ create.levels = 2; ++ ++ ret = ioctl(vfio_container_fd, VFIO_IOMMU_SPAPR_TCE_CREATE, &create); ++ if (ret) { ++ RTE_LOG(ERR, EAL, " cannot create new DMA window, " ++ "error %i (%s)\n", errno, strerror(errno)); ++ return -1; ++ } ++ ++ /* map all DPDK segments for DMA. use 1:1 PA to IOVA mapping */ ++ for (i = 0; i < RTE_MAX_MEMSEG; i++) { ++ struct vfio_iommu_type1_dma_map dma_map; ++ ++ if (ms[i].addr == NULL) ++ break; ++ ++ reg.vaddr = (uintptr_t) ms[i].addr; ++ reg.size = ms[i].len; ++ ret = ioctl(vfio_container_fd, ++ VFIO_IOMMU_SPAPR_REGISTER_MEMORY, ®); ++ if (ret) { ++ RTE_LOG(ERR, EAL, " cannot register vaddr for IOMMU, " ++ "error %i (%s)\n", errno, strerror(errno)); ++ return -1; ++ } ++ ++ memset(&dma_map, 0, sizeof(dma_map)); ++ dma_map.argsz = sizeof(struct vfio_iommu_type1_dma_map); ++ dma_map.vaddr = ms[i].addr_64; ++ dma_map.size = ms[i].len; ++ dma_map.iova = ms[i].phys_addr; ++ dma_map.flags = VFIO_DMA_MAP_FLAG_READ | ++ VFIO_DMA_MAP_FLAG_WRITE; ++ ++ ret = ioctl(vfio_container_fd, VFIO_IOMMU_MAP_DMA, &dma_map); ++ ++ if (ret) { ++ RTE_LOG(ERR, EAL, " cannot set up DMA remapping, " ++ "error %i (%s)\n", errno, strerror(errno)); ++ return -1; ++ } ++ ++ } ++ ++ return 0; ++} ++ ++static int + vfio_noiommu_dma_map(int __rte_unused vfio_container_fd) + { + /* No-IOMMU mode does not need DMA mapping */ +diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.h b/lib/librte_eal/linuxapp/eal/eal_vfio.h +index 29f7f3e..ac31a4f 100644 +--- a/lib/librte_eal/linuxapp/eal/eal_vfio.h ++++ b/lib/librte_eal/linuxapp/eal/eal_vfio.h +@@ -54,6 +54,31 @@ + + #define RTE_VFIO_TYPE1 VFIO_TYPE1_IOMMU + ++#ifndef VFIO_SPAPR_TCE_v2_IOMMU ++#define RTE_VFIO_SPAPR 7 ++#define VFIO_IOMMU_SPAPR_REGISTER_MEMORY _IO(VFIO_TYPE, VFIO_BASE + 17) ++#define VFIO_IOMMU_SPAPR_TCE_CREATE _IO(VFIO_TYPE, VFIO_BASE + 19) ++#define VFIO_IOMMU_SPAPR_TCE_REMOVE _IO(VFIO_TYPE, VFIO_BASE + 20) ++struct vfio_iommu_spapr_register_memory { ++ uint32_t argsz; ++ uint32_t flags; ++ uint64_t vaddr; ++ uint64_t size; ++}; ++struct vfio_iommu_spapr_tce_create { ++ uint32_t argsz; ++ uint32_t page_shift; ++ uint64_t window_size; ++ uint32_t levels; ++}; ++struct vfio_iommu_spapr_tce_remove { ++ uint32_t argsz; ++ uint64_t start_addr; ++}; ++#else ++#define RTE_VFIO_SPAPR VFIO_SPAPR_TCE_v2_IOMMU ++#endif ++ + #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0) + #define RTE_VFIO_NOIOMMU 8 + #else +-- +1.9.1 + diff --git a/SOURCES/mk-move-PMD-libraries-linking-to-applications.patch b/SOURCES/mk-move-PMD-libraries-linking-to-applications.patch new file mode 100644 index 0000000..88aef67 --- /dev/null +++ b/SOURCES/mk-move-PMD-libraries-linking-to-applications.patch @@ -0,0 +1,143 @@ +From ab12f71b310c344a4903a7105ea79ff5b2c25a15 Mon Sep 17 00:00:00 2001 +From: Ferruh Yigit +Date: Tue, 31 Jan 2017 15:04:48 +0000 +Subject: [PATCH] mk: move PMD libraries linking to applications + +Some PMDs provide device specific APIs. Bond and xenvirt are existing +samples for this. + +And since these are PMD libraries, there are two options on how to link +them for shared library build: + +1- They can be linked to all applications by default, using common +rte.app.mk file. + +2- They can be explicitly linked to applications that use device +specific API. + +Currently option one is in use, this patch switches to the option two. + +Moves library linking to the Makefile of application Makefile that uses +device specific API. + +This prevent these PMD libraries to be a dependency to applications +that don't use these device specific APIs. + +Signed-off-by: Ferruh Yigit +--- +JWL -- backported this to 16.11.2 base. Most differences from upstream +are contextual, but references to CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER +were removed due to lack of relevance to 16.11.2 base. + + app/test-pmd/Makefile | 9 +++++++++ + app/test/Makefile | 21 +++++++++++++++++---- + examples/bond/Makefile | 4 ++++ + mk/rte.app.mk | 5 ++--- + 4 files changed, 32 insertions(+), 7 deletions(-) + +diff -up dpdk-stable-16.11.2/app/test-pmd/Makefile.pmd_ring dpdk-stable-16.11.2/app/test-pmd/Makefile +--- dpdk-stable-16.11.2/app/test-pmd/Makefile.pmd_ring 2017-05-31 03:20:05.000000000 -0400 ++++ dpdk-stable-16.11.2/app/test-pmd/Makefile 2017-06-08 12:19:58.681959006 -0400 +@@ -59,6 +59,11 @@ SRCS-y += icmpecho.c + SRCS-$(CONFIG_RTE_LIBRTE_IEEE1588) += ieee1588fwd.c + + ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) ++ ++ifeq ($(CONFIG_RTE_LIBRTE_PMD_BOND),y) ++LDLIBS += -lrte_pmd_bond ++endif ++ + _LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe + endif + +@@ -69,4 +74,8 @@ DEPDIRS-y += lib drivers + + include $(RTE_SDK)/mk/rte.app.mk + ++ifeq ($(CONFIG_RTE_LIBRTE_PMD_XENVIRT),y) ++LDLIBS += -lrte_pmd_xenvirt ++endif ++ + endif +diff -up dpdk-stable-16.11.2/app/test/Makefile.pmd_ring dpdk-stable-16.11.2/app/test/Makefile +--- dpdk-stable-16.11.2/app/test/Makefile.pmd_ring 2017-05-31 03:20:05.000000000 -0400 ++++ dpdk-stable-16.11.2/app/test/Makefile 2017-06-08 12:18:25.439330508 -0400 +@@ -185,9 +185,6 @@ endif + + ifeq ($(CONFIG_RTE_LIBRTE_PMD_NULL),y) + SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding_rssconf.c +-ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) +-LDLIBS += -lrte_pmd_null +-endif + endif + + SRCS-$(CONFIG_RTE_LIBRTE_PMD_RING) += test_pmd_ring.c +@@ -221,11 +218,27 @@ DEPDIRS-y += lib drivers + ifeq ($(CONFIG_RTE_LIBRTE_PMD_BOND),y) + ifneq ($(CONFIG_RTE_LIBRTE_PMD_RING),y) + $(error Link bonding tests require CONFIG_RTE_LIBRTE_PMD_RING=y) +-else ++endif ++endif ++ + ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) ++ ++ifeq ($(CONFIG_RTE_LIBRTE_PMD_BOND),y) ++LDLIBS += -lrte_pmd_bond ++endif ++ ++ifeq ($(CONFIG_RTE_LIBRTE_PMD_NULL),y) ++LDLIBS += -lrte_pmd_null ++endif ++ ++ifeq ($(CONFIG_RTE_LIBRTE_PMD_RING),y) + LDLIBS += -lrte_pmd_ring + endif ++ ++ifeq ($(CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER),y) ++LDLIBS += -lrte_pmd_crypto_scheduler + endif ++ + endif + + ifeq ($(CONFIG_RTE_APP_TEST_RESOURCE_TAR),y) +diff -up dpdk-stable-16.11.2/examples/bond/Makefile.pmd_ring dpdk-stable-16.11.2/examples/bond/Makefile +--- dpdk-stable-16.11.2/examples/bond/Makefile.pmd_ring 2017-05-31 03:20:05.000000000 -0400 ++++ dpdk-stable-16.11.2/examples/bond/Makefile 2017-06-08 12:18:25.440330526 -0400 +@@ -54,4 +54,8 @@ endif + + CFLAGS += -O3 + ++ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) ++LDLIBS += -lrte_pmd_bond ++endif ++ + include $(RTE_SDK)/mk/rte.extapp.mk +diff -up dpdk-stable-16.11.2/mk/rte.app.mk.pmd_ring dpdk-stable-16.11.2/mk/rte.app.mk +--- dpdk-stable-16.11.2/mk/rte.app.mk.pmd_ring 2017-05-31 03:20:05.000000000 -0400 ++++ dpdk-stable-16.11.2/mk/rte.app.mk 2017-06-08 12:22:48.458924188 -0400 +@@ -99,15 +99,13 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_EAL) + _LDLIBS-$(CONFIG_RTE_LIBRTE_CMDLINE) += -lrte_cmdline + _LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE) += -lrte_cfgfile + +-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += -lrte_pmd_bond +-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lrte_pmd_xenvirt -lxenstore +- + ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n) + # plugins (link only if static libraries) + + _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet + _LDLIBS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += -lrte_pmd_bnx2x -lz + _LDLIBS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += -lrte_pmd_bnxt ++_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += -lrte_pmd_bond + _LDLIBS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += -lrte_pmd_cxgbe + _LDLIBS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += -lrte_pmd_e1000 + _LDLIBS-$(CONFIG_RTE_LIBRTE_ENA_PMD) += -lrte_pmd_ena +@@ -130,6 +128,7 @@ ifeq ($(CONFIG_RTE_LIBRTE_VHOST),y) + _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_VHOST) += -lrte_pmd_vhost + endif # $(CONFIG_RTE_LIBRTE_VHOST) + _LDLIBS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += -lrte_pmd_vmxnet3_uio ++_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lrte_pmd_xenvirt -lxenstore + + ifeq ($(CONFIG_RTE_LIBRTE_CRYPTODEV),y) + _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += -lrte_pmd_aesni_mb diff --git a/SOURCES/net-i40e-implement-vector-PMD-for-altivec.patch b/SOURCES/net-i40e-implement-vector-PMD-for-altivec.patch new file mode 100644 index 0000000..0820da1 --- /dev/null +++ b/SOURCES/net-i40e-implement-vector-PMD-for-altivec.patch @@ -0,0 +1,753 @@ +From 6fd9dc71febe68f4033a6330e6c9bb03610ba1ac Mon Sep 17 00:00:00 2001 +From: Gowrishankar Muthukrishnan +Date: Wed, 3 May 2017 11:55:58 +0530 +Subject: [PATCH 1/2] net/i40e: implement vector PMD for altivec + +This patch enables i40e driver in PowerPC along with its altivec +intrinsic support. + +Signed-off-by: Gowrishankar Muthukrishnan +Acked-by: Chao Zhu +--- + MAINTAINERS | 1 + + config/defconfig_ppc_64-power8-linuxapp-gcc | 1 - + doc/guides/nics/features/i40e.ini | 1 + + doc/guides/nics/features/i40e_vec.ini | 1 + + doc/guides/rel_notes/release_16_11.rst | 3 + + drivers/net/i40e/Makefile | 2 + + drivers/net/i40e/i40e_rxtx_vec_altivec.c | 654 ++++++++++++++++++++++++++++ + 7 files changed, 662 insertions(+), 1 deletion(-) + create mode 100644 drivers/net/i40e/i40e_rxtx_vec_altivec.c + +diff --git a/MAINTAINERS b/MAINTAINERS +index 065397b..a380b5d 100644 +--- a/MAINTAINERS ++++ b/MAINTAINERS +@@ -166,6 +166,7 @@ IBM POWER + M: Chao Zhu + F: lib/librte_eal/common/arch/ppc_64/ + F: lib/librte_eal/common/include/arch/ppc_64/ ++F: drivers/net/i40e/i40e_rxtx_vec_altivec.c + + Intel x86 + M: Bruce Richardson +diff --git a/config/defconfig_ppc_64-power8-linuxapp-gcc b/config/defconfig_ppc_64-power8-linuxapp-gcc +index f953e61..5f160bc 100644 +--- a/config/defconfig_ppc_64-power8-linuxapp-gcc ++++ b/config/defconfig_ppc_64-power8-linuxapp-gcc +@@ -49,7 +49,6 @@ CONFIG_RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT=n + # Note: Initially, all of the PMD drivers compilation are turned off on Power + # Will turn on them only after the successful testing on Power + CONFIG_RTE_LIBRTE_IXGBE_PMD=n +-CONFIG_RTE_LIBRTE_I40E_PMD=n + CONFIG_RTE_LIBRTE_VIRTIO_PMD=y + CONFIG_RTE_LIBRTE_VMXNET3_PMD=n + CONFIG_RTE_LIBRTE_PMD_BOND=n +diff --git a/doc/guides/nics/features/i40e.ini b/doc/guides/nics/features/i40e.ini +index 0d143bc..36ac337 100644 +--- a/doc/guides/nics/features/i40e.ini ++++ b/doc/guides/nics/features/i40e.ini +@@ -46,3 +46,4 @@ Linux VFIO = Y + x86-32 = Y + x86-64 = Y + ARMv8 = Y ++Power8 = Y +diff --git a/doc/guides/nics/features/i40e_vec.ini b/doc/guides/nics/features/i40e_vec.ini +index edd6b71..5ec4088 100644 +--- a/doc/guides/nics/features/i40e_vec.ini ++++ b/doc/guides/nics/features/i40e_vec.ini +@@ -38,3 +38,4 @@ Linux VFIO = Y + x86-32 = Y + x86-64 = Y + ARMv8 = Y ++Power8 = Y +diff --git a/doc/guides/rel_notes/release_16_11.rst b/doc/guides/rel_notes/release_16_11.rst +index 8c9ec65..6186337 100644 +--- a/doc/guides/rel_notes/release_16_11.rst ++++ b/doc/guides/rel_notes/release_16_11.rst +@@ -155,6 +155,9 @@ New Features + The GCC 4.9 ``-march`` option supports the Intel processor code names. + The config option ``RTE_MACHINE`` can be used to pass code names to the compiler via the ``-march`` flag. + ++* **Added powerpc support for i40e and its vector PMD .** ++ ++ i40e PMD and its vector PMD enabled by default in powerpc. + + Resolved Issues + --------------- +diff --git a/drivers/net/i40e/Makefile b/drivers/net/i40e/Makefile +index 13085fb..9c9a867 100644 +--- a/drivers/net/i40e/Makefile ++++ b/drivers/net/i40e/Makefile +@@ -99,6 +99,8 @@ SRCS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += i40e_ethdev.c + SRCS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += i40e_rxtx.c + ifeq ($(CONFIG_RTE_ARCH_ARM64),y) + SRCS-$(CONFIG_RTE_LIBRTE_I40E_INC_VECTOR) += i40e_rxtx_vec_neon.c ++else ifeq ($(CONFIG_RTE_ARCH_PPC_64),y) ++SRCS-$(CONFIG_RTE_LIBRTE_I40E_INC_VECTOR) += i40e_rxtx_vec_altivec.c + else + SRCS-$(CONFIG_RTE_LIBRTE_I40E_INC_VECTOR) += i40e_rxtx_vec_sse.c + endif +diff --git a/drivers/net/i40e/i40e_rxtx_vec_altivec.c b/drivers/net/i40e/i40e_rxtx_vec_altivec.c +new file mode 100644 +index 0000000..40d1929 +--- /dev/null ++++ b/drivers/net/i40e/i40e_rxtx_vec_altivec.c +@@ -0,0 +1,654 @@ ++/*- ++ * BSD LICENSE ++ * ++ * Copyright(c) 2010-2015 Intel Corporation. All rights reserved. ++ * Copyright(c) 2017 IBM Corporation. ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * ++ * * Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * * Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in ++ * the documentation and/or other materials provided with the ++ * distribution. ++ * * Neither the name of Intel Corporation nor the names of its ++ * contributors may be used to endorse or promote products derived ++ * from this software without specific prior written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ++ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#include ++#include ++#include ++ ++#include "base/i40e_prototype.h" ++#include "base/i40e_type.h" ++#include "i40e_ethdev.h" ++#include "i40e_rxtx.h" ++#include "i40e_rxtx_vec_common.h" ++ ++#include ++ ++#pragma GCC diagnostic ignored "-Wcast-qual" ++ ++static inline void ++i40e_rxq_rearm(struct i40e_rx_queue *rxq) ++{ ++ int i; ++ uint16_t rx_id; ++ volatile union i40e_rx_desc *rxdp; ++ ++ struct i40e_rx_entry *rxep = &rxq->sw_ring[rxq->rxrearm_start]; ++ struct rte_mbuf *mb0, *mb1; ++ ++ vector unsigned long hdr_room = (vector unsigned long){ ++ RTE_PKTMBUF_HEADROOM, ++ RTE_PKTMBUF_HEADROOM}; ++ vector unsigned long dma_addr0, dma_addr1; ++ ++ rxdp = rxq->rx_ring + rxq->rxrearm_start; ++ ++ /* Pull 'n' more MBUFs into the software ring */ ++ if (rte_mempool_get_bulk(rxq->mp, ++ (void *)rxep, ++ RTE_I40E_RXQ_REARM_THRESH) < 0) { ++ if (rxq->rxrearm_nb + RTE_I40E_RXQ_REARM_THRESH >= ++ rxq->nb_rx_desc) { ++ dma_addr0 = (vector unsigned long){}; ++ for (i = 0; i < RTE_I40E_DESCS_PER_LOOP; i++) { ++ rxep[i].mbuf = &rxq->fake_mbuf; ++ vec_st(dma_addr0, 0, ++ (vector unsigned long *)&rxdp[i].read); ++ } ++ } ++ rte_eth_devices[rxq->port_id].data->rx_mbuf_alloc_failed += ++ RTE_I40E_RXQ_REARM_THRESH; ++ return; ++ } ++ ++ /* Initialize the mbufs in vector, process 2 mbufs in one loop */ ++ for (i = 0; i < RTE_I40E_RXQ_REARM_THRESH; i += 2, rxep += 2) { ++ vector unsigned long vaddr0, vaddr1; ++ uintptr_t p0, p1; ++ ++ mb0 = rxep[0].mbuf; ++ mb1 = rxep[1].mbuf; ++ ++ /* Flush mbuf with pkt template. ++ * Data to be rearmed is 6 bytes long. ++ * Though, RX will overwrite ol_flags that are coming next ++ * anyway. So overwrite whole 8 bytes with one load: ++ * 6 bytes of rearm_data plus first 2 bytes of ol_flags. ++ */ ++ p0 = (uintptr_t)&mb0->rearm_data; ++ *(uint64_t *)p0 = rxq->mbuf_initializer; ++ p1 = (uintptr_t)&mb1->rearm_data; ++ *(uint64_t *)p1 = rxq->mbuf_initializer; ++ ++ /* load buf_addr(lo 64bit) and buf_physaddr(hi 64bit) */ ++ vaddr0 = vec_ld(0, (vector unsigned long *)&mb0->buf_addr); ++ vaddr1 = vec_ld(0, (vector unsigned long *)&mb1->buf_addr); ++ ++ /* convert pa to dma_addr hdr/data */ ++ dma_addr0 = vec_mergel(vaddr0, vaddr0); ++ dma_addr1 = vec_mergel(vaddr1, vaddr1); ++ ++ /* add headroom to pa values */ ++ dma_addr0 = vec_add(dma_addr0, hdr_room); ++ dma_addr1 = vec_add(dma_addr1, hdr_room); ++ ++ /* flush desc with pa dma_addr */ ++ vec_st(dma_addr0, 0, (vector unsigned long *)&rxdp++->read); ++ vec_st(dma_addr1, 0, (vector unsigned long *)&rxdp++->read); ++ } ++ ++ rxq->rxrearm_start += RTE_I40E_RXQ_REARM_THRESH; ++ if (rxq->rxrearm_start >= rxq->nb_rx_desc) ++ rxq->rxrearm_start = 0; ++ ++ rxq->rxrearm_nb -= RTE_I40E_RXQ_REARM_THRESH; ++ ++ rx_id = (uint16_t)((rxq->rxrearm_start == 0) ? ++ (rxq->nb_rx_desc - 1) : (rxq->rxrearm_start - 1)); ++ ++ /* Update the tail pointer on the NIC */ ++ I40E_PCI_REG_WRITE(rxq->qrx_tail, rx_id); ++} ++ ++/* Handling the offload flags (olflags) field takes computation ++ * time when receiving packets. Therefore we provide a flag to disable ++ * the processing of the olflags field when they are not needed. This ++ * gives improved performance, at the cost of losing the offload info ++ * in the received packet ++ */ ++#ifdef RTE_LIBRTE_I40E_RX_OLFLAGS_ENABLE ++ ++static inline void ++desc_to_olflags_v(vector unsigned long descs[4], struct rte_mbuf **rx_pkts) ++{ ++ vector unsigned int vlan0, vlan1, rss, l3_l4e; ++ ++ /* mask everything except RSS, flow director and VLAN flags ++ * bit2 is for VLAN tag, bit11 for flow director indication ++ * bit13:12 for RSS indication. ++ */ ++ const vector unsigned int rss_vlan_msk = (vector unsigned int){ ++ (int32_t)0x1c03804, (int32_t)0x1c03804, ++ (int32_t)0x1c03804, (int32_t)0x1c03804}; ++ ++ /* map rss and vlan type to rss hash and vlan flag */ ++ const vector unsigned char vlan_flags = (vector unsigned char){ ++ 0, 0, 0, 0, ++ PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED, 0, 0, 0, ++ 0, 0, 0, 0, ++ 0, 0, 0, 0}; ++ ++ const vector unsigned char rss_flags = (vector unsigned char){ ++ 0, PKT_RX_FDIR, 0, 0, ++ 0, 0, PKT_RX_RSS_HASH, PKT_RX_RSS_HASH | PKT_RX_FDIR, ++ 0, 0, 0, 0, ++ 0, 0, 0, 0}; ++ ++ const vector unsigned char l3_l4e_flags = (vector unsigned char){ ++ 0, ++ PKT_RX_IP_CKSUM_BAD, ++ PKT_RX_L4_CKSUM_BAD, ++ PKT_RX_L4_CKSUM_BAD | PKT_RX_IP_CKSUM_BAD, ++ PKT_RX_EIP_CKSUM_BAD, ++ PKT_RX_EIP_CKSUM_BAD | PKT_RX_IP_CKSUM_BAD, ++ PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD, ++ PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD ++ | PKT_RX_IP_CKSUM_BAD, ++ 0, 0, 0, 0, 0, 0, 0, 0}; ++ ++ vlan0 = (vector unsigned int)vec_mergel(descs[0], descs[1]); ++ vlan1 = (vector unsigned int)vec_mergel(descs[2], descs[3]); ++ vlan0 = (vector unsigned int)vec_mergeh(vlan0, vlan1); ++ ++ vlan1 = vec_and(vlan0, rss_vlan_msk); ++ vlan0 = (vector unsigned int)vec_perm(vlan_flags, ++ (vector unsigned char){}, ++ *(vector unsigned char *)&vlan1); ++ ++ rss = vec_sr(vlan1, (vector unsigned int){11, 11, 11, 11}); ++ rss = (vector unsigned int)vec_perm(rss_flags, (vector unsigned char){}, ++ *(vector unsigned char *)&rss); ++ ++ l3_l4e = vec_sr(vlan1, (vector unsigned int){22, 22, 22, 22}); ++ l3_l4e = (vector unsigned int)vec_perm(l3_l4e_flags, ++ (vector unsigned char){}, ++ *(vector unsigned char *)&l3_l4e); ++ ++ vlan0 = vec_or(vlan0, rss); ++ vlan0 = vec_or(vlan0, l3_l4e); ++ ++ rx_pkts[0]->ol_flags = (uint64_t)vlan0[2]; ++ rx_pkts[1]->ol_flags = (uint64_t)vlan0[3]; ++ rx_pkts[2]->ol_flags = (uint64_t)vlan0[0]; ++ rx_pkts[3]->ol_flags = (uint64_t)vlan0[1]; ++} ++#else ++#define desc_to_olflags_v(desc, rx_pkts) do {} while (0) ++#endif ++ ++#define PKTLEN_SHIFT 10 ++ ++static inline void ++desc_to_ptype_v(vector unsigned long descs[4], struct rte_mbuf **rx_pkts) ++{ ++ vector unsigned long ptype0 = vec_mergel(descs[0], descs[1]); ++ vector unsigned long ptype1 = vec_mergel(descs[2], descs[3]); ++ ++ ptype0 = vec_sr(ptype0, (vector unsigned long){30, 30}); ++ ptype1 = vec_sr(ptype1, (vector unsigned long){30, 30}); ++ ++ rx_pkts[0]->packet_type = i40e_rxd_pkt_type_mapping( ++ (*(vector unsigned char *)&ptype0)[0]); ++ rx_pkts[1]->packet_type = i40e_rxd_pkt_type_mapping( ++ (*(vector unsigned char *)&ptype0)[8]); ++ rx_pkts[2]->packet_type = i40e_rxd_pkt_type_mapping( ++ (*(vector unsigned char *)&ptype1)[0]); ++ rx_pkts[3]->packet_type = i40e_rxd_pkt_type_mapping( ++ (*(vector unsigned char *)&ptype1)[8]); ++} ++ ++ /* Notice: ++ * - nb_pkts < RTE_I40E_DESCS_PER_LOOP, just return no packet ++ * - nb_pkts > RTE_I40E_VPMD_RX_BURST, only scan RTE_I40E_VPMD_RX_BURST ++ * numbers of DD bits ++ */ ++static inline uint16_t ++_recv_raw_pkts_vec(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts, ++ uint16_t nb_pkts, uint8_t *split_packet) ++{ ++ volatile union i40e_rx_desc *rxdp; ++ struct i40e_rx_entry *sw_ring; ++ uint16_t nb_pkts_recd; ++ int pos; ++ uint64_t var; ++ vector unsigned char shuf_msk; ++ ++ vector unsigned short crc_adjust = (vector unsigned short){ ++ 0, 0, /* ignore pkt_type field */ ++ rxq->crc_len, /* sub crc on pkt_len */ ++ 0, /* ignore high-16bits of pkt_len */ ++ rxq->crc_len, /* sub crc on data_len */ ++ 0, 0, 0 /* ignore non-length fields */ ++ }; ++ vector unsigned long dd_check, eop_check; ++ ++ /* nb_pkts shall be less equal than RTE_I40E_MAX_RX_BURST */ ++ nb_pkts = RTE_MIN(nb_pkts, RTE_I40E_MAX_RX_BURST); ++ ++ /* nb_pkts has to be floor-aligned to RTE_I40E_DESCS_PER_LOOP */ ++ nb_pkts = RTE_ALIGN_FLOOR(nb_pkts, RTE_I40E_DESCS_PER_LOOP); ++ ++ /* Just the act of getting into the function from the application is ++ * going to cost about 7 cycles ++ */ ++ rxdp = rxq->rx_ring + rxq->rx_tail; ++ ++ rte_prefetch0(rxdp); ++ ++ /* See if we need to rearm the RX queue - gives the prefetch a bit ++ * of time to act ++ */ ++ if (rxq->rxrearm_nb > RTE_I40E_RXQ_REARM_THRESH) ++ i40e_rxq_rearm(rxq); ++ ++ /* Before we start moving massive data around, check to see if ++ * there is actually a packet available ++ */ ++ if (!(rxdp->wb.qword1.status_error_len & ++ rte_cpu_to_le_32(1 << I40E_RX_DESC_STATUS_DD_SHIFT))) ++ return 0; ++ ++ /* 4 packets DD mask */ ++ dd_check = (vector unsigned long){0x0000000100000001ULL, ++ 0x0000000100000001ULL}; ++ ++ /* 4 packets EOP mask */ ++ eop_check = (vector unsigned long){0x0000000200000002ULL, ++ 0x0000000200000002ULL}; ++ ++ /* mask to shuffle from desc. to mbuf */ ++ shuf_msk = (vector unsigned char){ ++ 0xFF, 0xFF, /* pkt_type set as unknown */ ++ 0xFF, 0xFF, /* pkt_type set as unknown */ ++ 14, 15, /* octet 15~14, low 16 bits pkt_len */ ++ 0xFF, 0xFF, /* skip high 16 bits pkt_len, zero out */ ++ 14, 15, /* octet 15~14, 16 bits data_len */ ++ 2, 3, /* octet 2~3, low 16 bits vlan_macip */ ++ 4, 5, 6, 7 /* octet 4~7, 32bits rss */ ++ }; ++ ++ /* Cache is empty -> need to scan the buffer rings, but first move ++ * the next 'n' mbufs into the cache ++ */ ++ sw_ring = &rxq->sw_ring[rxq->rx_tail]; ++ ++ /* A. load 4 packet in one loop ++ * [A*. mask out 4 unused dirty field in desc] ++ * B. copy 4 mbuf point from swring to rx_pkts ++ * C. calc the number of DD bits among the 4 packets ++ * [C*. extract the end-of-packet bit, if requested] ++ * D. fill info. from desc to mbuf ++ */ ++ ++ for (pos = 0, nb_pkts_recd = 0; pos < nb_pkts; ++ pos += RTE_I40E_DESCS_PER_LOOP, ++ rxdp += RTE_I40E_DESCS_PER_LOOP) { ++ vector unsigned long descs[RTE_I40E_DESCS_PER_LOOP]; ++ vector unsigned char pkt_mb1, pkt_mb2, pkt_mb3, pkt_mb4; ++ vector unsigned short staterr, sterr_tmp1, sterr_tmp2; ++ vector unsigned long mbp1, mbp2; /* two mbuf pointer ++ * in one XMM reg. ++ */ ++ ++ /* B.1 load 1 mbuf point */ ++ mbp1 = *(vector unsigned long *)&sw_ring[pos]; ++ /* Read desc statuses backwards to avoid race condition */ ++ /* A.1 load 4 pkts desc */ ++ descs[3] = *(vector unsigned long *)(rxdp + 3); ++ rte_compiler_barrier(); ++ ++ /* B.2 copy 2 mbuf point into rx_pkts */ ++ *(vector unsigned long *)&rx_pkts[pos] = mbp1; ++ ++ /* B.1 load 1 mbuf point */ ++ mbp2 = *(vector unsigned long *)&sw_ring[pos + 2]; ++ ++ descs[2] = *(vector unsigned long *)(rxdp + 2); ++ rte_compiler_barrier(); ++ /* B.1 load 2 mbuf point */ ++ descs[1] = *(vector unsigned long *)(rxdp + 1); ++ rte_compiler_barrier(); ++ descs[0] = *(vector unsigned long *)(rxdp); ++ ++ /* B.2 copy 2 mbuf point into rx_pkts */ ++ *(vector unsigned long *)&rx_pkts[pos + 2] = mbp2; ++ ++ if (split_packet) { ++ rte_mbuf_prefetch_part2(rx_pkts[pos]); ++ rte_mbuf_prefetch_part2(rx_pkts[pos + 1]); ++ rte_mbuf_prefetch_part2(rx_pkts[pos + 2]); ++ rte_mbuf_prefetch_part2(rx_pkts[pos + 3]); ++ } ++ ++ /* avoid compiler reorder optimization */ ++ rte_compiler_barrier(); ++ ++ /* pkt 3,4 shift the pktlen field to be 16-bit aligned*/ ++ const vector unsigned int len3 = vec_sl( ++ vec_ld(0, (vector unsigned int *)&descs[3]), ++ (vector unsigned int){0, 0, 0, PKTLEN_SHIFT}); ++ ++ const vector unsigned int len2 = vec_sl( ++ vec_ld(0, (vector unsigned int *)&descs[2]), ++ (vector unsigned int){0, 0, 0, PKTLEN_SHIFT}); ++ ++ /* merge the now-aligned packet length fields back in */ ++ descs[3] = (vector unsigned long)len3; ++ descs[2] = (vector unsigned long)len2; ++ ++ /* D.1 pkt 3,4 convert format from desc to pktmbuf */ ++ pkt_mb4 = vec_perm((vector unsigned char)descs[3], ++ (vector unsigned char){}, shuf_msk); ++ pkt_mb3 = vec_perm((vector unsigned char)descs[2], ++ (vector unsigned char){}, shuf_msk); ++ ++ /* C.1 4=>2 filter staterr info only */ ++ sterr_tmp2 = vec_mergel((vector unsigned short)descs[3], ++ (vector unsigned short)descs[2]); ++ /* C.1 4=>2 filter staterr info only */ ++ sterr_tmp1 = vec_mergel((vector unsigned short)descs[1], ++ (vector unsigned short)descs[0]); ++ /* D.2 pkt 3,4 set in_port/nb_seg and remove crc */ ++ pkt_mb4 = (vector unsigned char)vec_sub( ++ (vector unsigned short)pkt_mb4, crc_adjust); ++ pkt_mb3 = (vector unsigned char)vec_sub( ++ (vector unsigned short)pkt_mb3, crc_adjust); ++ ++ /* pkt 1,2 shift the pktlen field to be 16-bit aligned*/ ++ const vector unsigned int len1 = vec_sl( ++ vec_ld(0, (vector unsigned int *)&descs[1]), ++ (vector unsigned int){0, 0, 0, PKTLEN_SHIFT}); ++ const vector unsigned int len0 = vec_sl( ++ vec_ld(0, (vector unsigned int *)&descs[0]), ++ (vector unsigned int){0, 0, 0, PKTLEN_SHIFT}); ++ ++ /* merge the now-aligned packet length fields back in */ ++ descs[1] = (vector unsigned long)len1; ++ descs[0] = (vector unsigned long)len0; ++ ++ /* D.1 pkt 1,2 convert format from desc to pktmbuf */ ++ pkt_mb2 = vec_perm((vector unsigned char)descs[1], ++ (vector unsigned char){}, shuf_msk); ++ pkt_mb1 = vec_perm((vector unsigned char)descs[0], ++ (vector unsigned char){}, shuf_msk); ++ ++ /* C.2 get 4 pkts staterr value */ ++ staterr = (vector unsigned short)vec_mergeh( ++ sterr_tmp1, sterr_tmp2); ++ ++ /* D.3 copy final 3,4 data to rx_pkts */ ++ vec_st(pkt_mb4, 0, ++ (vector unsigned char *)&rx_pkts[pos + 3] ++ ->rx_descriptor_fields1 ++ ); ++ vec_st(pkt_mb3, 0, ++ (vector unsigned char *)&rx_pkts[pos + 2] ++ ->rx_descriptor_fields1 ++ ); ++ ++ /* D.2 pkt 1,2 set in_port/nb_seg and remove crc */ ++ pkt_mb2 = (vector unsigned char)vec_sub( ++ (vector unsigned short)pkt_mb2, crc_adjust); ++ pkt_mb1 = (vector unsigned char)vec_sub( ++ (vector unsigned short)pkt_mb1, crc_adjust); ++ ++ /* C* extract and record EOP bit */ ++ if (split_packet) { ++ vector unsigned char eop_shuf_mask = ++ (vector unsigned char){ ++ 0xFF, 0xFF, 0xFF, 0xFF, ++ 0xFF, 0xFF, 0xFF, 0xFF, ++ 0xFF, 0xFF, 0xFF, 0xFF, ++ 0x04, 0x0C, 0x00, 0x08 ++ }; ++ ++ /* and with mask to extract bits, flipping 1-0 */ ++ vector unsigned char eop_bits = vec_and( ++ (vector unsigned char)vec_nor(staterr, staterr), ++ (vector unsigned char)eop_check); ++ /* the staterr values are not in order, as the count ++ * count of dd bits doesn't care. However, for end of ++ * packet tracking, we do care, so shuffle. This also ++ * compresses the 32-bit values to 8-bit ++ */ ++ eop_bits = vec_perm(eop_bits, (vector unsigned char){}, ++ eop_shuf_mask); ++ /* store the resulting 32-bit value */ ++ *split_packet = (vec_ld(0, ++ (vector unsigned int *)&eop_bits))[0]; ++ split_packet += RTE_I40E_DESCS_PER_LOOP; ++ ++ /* zero-out next pointers */ ++ rx_pkts[pos]->next = NULL; ++ rx_pkts[pos + 1]->next = NULL; ++ rx_pkts[pos + 2]->next = NULL; ++ rx_pkts[pos + 3]->next = NULL; ++ } ++ ++ /* C.3 calc available number of desc */ ++ staterr = vec_and(staterr, (vector unsigned short)dd_check); ++ ++ /* D.3 copy final 1,2 data to rx_pkts */ ++ vec_st(pkt_mb2, 0, ++ (vector unsigned char *)&rx_pkts[pos + 1] ++ ->rx_descriptor_fields1 ++ ); ++ vec_st(pkt_mb1, 0, ++ (vector unsigned char *)&rx_pkts[pos]->rx_descriptor_fields1 ++ ); ++ desc_to_ptype_v(descs, &rx_pkts[pos]); ++ desc_to_olflags_v(descs, &rx_pkts[pos]); ++ ++ /* C.4 calc avaialbe number of desc */ ++ var = __builtin_popcountll((vec_ld(0, ++ (vector unsigned long *)&staterr)[0])); ++ nb_pkts_recd += var; ++ if (likely(var != RTE_I40E_DESCS_PER_LOOP)) ++ break; ++ } ++ ++ /* Update our internal tail pointer */ ++ rxq->rx_tail = (uint16_t)(rxq->rx_tail + nb_pkts_recd); ++ rxq->rx_tail = (uint16_t)(rxq->rx_tail & (rxq->nb_rx_desc - 1)); ++ rxq->rxrearm_nb = (uint16_t)(rxq->rxrearm_nb + nb_pkts_recd); ++ ++ return nb_pkts_recd; ++} ++ ++ /* Notice: ++ * - nb_pkts < RTE_I40E_DESCS_PER_LOOP, just return no packet ++ * - nb_pkts > RTE_I40E_VPMD_RX_BURST, only scan RTE_I40E_VPMD_RX_BURST ++ * numbers of DD bits ++ */ ++uint16_t ++i40e_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, ++ uint16_t nb_pkts) ++{ ++ return _recv_raw_pkts_vec(rx_queue, rx_pkts, nb_pkts, NULL); ++} ++ ++ /* vPMD receive routine that reassembles scattered packets ++ * Notice: ++ * - nb_pkts < RTE_I40E_DESCS_PER_LOOP, just return no packet ++ * - nb_pkts > RTE_I40E_VPMD_RX_BURST, only scan RTE_I40E_VPMD_RX_BURST ++ * numbers of DD bits ++ */ ++uint16_t ++i40e_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, ++ uint16_t nb_pkts) ++{ ++ struct i40e_rx_queue *rxq = rx_queue; ++ uint8_t split_flags[RTE_I40E_VPMD_RX_BURST] = {0}; ++ ++ /* get some new buffers */ ++ uint16_t nb_bufs = _recv_raw_pkts_vec(rxq, rx_pkts, nb_pkts, ++ split_flags); ++ if (nb_bufs == 0) ++ return 0; ++ ++ /* happy day case, full burst + no packets to be joined */ ++ const uint64_t *split_fl64 = (uint64_t *)split_flags; ++ ++ if (rxq->pkt_first_seg == NULL && ++ split_fl64[0] == 0 && split_fl64[1] == 0 && ++ split_fl64[2] == 0 && split_fl64[3] == 0) ++ return nb_bufs; ++ ++ /* reassemble any packets that need reassembly*/ ++ unsigned int i = 0; ++ ++ if (!rxq->pkt_first_seg) { ++ /* find the first split flag, and only reassemble then*/ ++ while (i < nb_bufs && !split_flags[i]) ++ i++; ++ if (i == nb_bufs) ++ return nb_bufs; ++ } ++ return i + reassemble_packets(rxq, &rx_pkts[i], nb_bufs - i, ++ &split_flags[i]); ++} ++ ++static inline void ++vtx1(volatile struct i40e_tx_desc *txdp, ++ struct rte_mbuf *pkt, uint64_t flags) ++{ ++ uint64_t high_qw = (I40E_TX_DESC_DTYPE_DATA | ++ ((uint64_t)flags << I40E_TXD_QW1_CMD_SHIFT) | ++ ((uint64_t)pkt->data_len << I40E_TXD_QW1_TX_BUF_SZ_SHIFT)); ++ ++ vector unsigned long descriptor = (vector unsigned long){ ++ pkt->buf_physaddr + pkt->data_off, high_qw}; ++ *(vector unsigned long *)txdp = descriptor; ++} ++ ++static inline void ++vtx(volatile struct i40e_tx_desc *txdp, ++ struct rte_mbuf **pkt, uint16_t nb_pkts, uint64_t flags) ++{ ++ int i; ++ ++ for (i = 0; i < nb_pkts; ++i, ++txdp, ++pkt) ++ vtx1(txdp, *pkt, flags); ++} ++ ++uint16_t ++i40e_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts, ++ uint16_t nb_pkts) ++{ ++ struct i40e_tx_queue *txq = (struct i40e_tx_queue *)tx_queue; ++ volatile struct i40e_tx_desc *txdp; ++ struct i40e_tx_entry *txep; ++ uint16_t n, nb_commit, tx_id; ++ uint64_t flags = I40E_TD_CMD; ++ uint64_t rs = I40E_TX_DESC_CMD_RS | I40E_TD_CMD; ++ int i; ++ ++ /* cross rx_thresh boundary is not allowed */ ++ nb_pkts = RTE_MIN(nb_pkts, txq->tx_rs_thresh); ++ ++ if (txq->nb_tx_free < txq->tx_free_thresh) ++ i40e_tx_free_bufs(txq); ++ ++ nb_pkts = (uint16_t)RTE_MIN(txq->nb_tx_free, nb_pkts); ++ nb_commit = nb_pkts; ++ if (unlikely(nb_pkts == 0)) ++ return 0; ++ ++ tx_id = txq->tx_tail; ++ txdp = &txq->tx_ring[tx_id]; ++ txep = &txq->sw_ring[tx_id]; ++ ++ txq->nb_tx_free = (uint16_t)(txq->nb_tx_free - nb_pkts); ++ ++ n = (uint16_t)(txq->nb_tx_desc - tx_id); ++ if (nb_commit >= n) { ++ tx_backlog_entry(txep, tx_pkts, n); ++ ++ for (i = 0; i < n - 1; ++i, ++tx_pkts, ++txdp) ++ vtx1(txdp, *tx_pkts, flags); ++ ++ vtx1(txdp, *tx_pkts++, rs); ++ ++ nb_commit = (uint16_t)(nb_commit - n); ++ ++ tx_id = 0; ++ txq->tx_next_rs = (uint16_t)(txq->tx_rs_thresh - 1); ++ ++ /* avoid reach the end of ring */ ++ txdp = &txq->tx_ring[tx_id]; ++ txep = &txq->sw_ring[tx_id]; ++ } ++ ++ tx_backlog_entry(txep, tx_pkts, nb_commit); ++ ++ vtx(txdp, tx_pkts, nb_commit, flags); ++ ++ tx_id = (uint16_t)(tx_id + nb_commit); ++ if (tx_id > txq->tx_next_rs) { ++ txq->tx_ring[txq->tx_next_rs].cmd_type_offset_bsz |= ++ rte_cpu_to_le_64(((uint64_t)I40E_TX_DESC_CMD_RS) << ++ I40E_TXD_QW1_CMD_SHIFT); ++ txq->tx_next_rs = ++ (uint16_t)(txq->tx_next_rs + txq->tx_rs_thresh); ++ } ++ ++ txq->tx_tail = tx_id; ++ ++ I40E_PCI_REG_WRITE(txq->qtx_tail, txq->tx_tail); ++ ++ return nb_pkts; ++} ++ ++void __attribute__((cold)) ++i40e_rx_queue_release_mbufs_vec(struct i40e_rx_queue *rxq) ++{ ++ _i40e_rx_queue_release_mbufs_vec(rxq); ++} ++ ++int __attribute__((cold)) ++i40e_rxq_vec_setup(struct i40e_rx_queue *rxq) ++{ ++ return i40e_rxq_vec_setup_default(rxq); ++} ++ ++int __attribute__((cold)) ++i40e_txq_vec_setup(struct i40e_tx_queue __rte_unused * txq) ++{ ++ return 0; ++} ++ ++int __attribute__((cold)) ++i40e_rx_vec_dev_conf_condition_check(struct rte_eth_dev *dev) ++{ ++ return i40e_rx_vec_dev_conf_condition_check_default(dev); ++} +-- +1.9.1 + diff --git a/SPECS/dpdk.spec b/SPECS/dpdk.spec index 5022de7..92a8af5 100644 --- a/SPECS/dpdk.spec +++ b/SPECS/dpdk.spec @@ -4,33 +4,30 @@ %bcond_with examples # Add option to build without tools %bcond_without tools -# Add option to build without driverctl -%bcond_without driverctl # Dont edit Version: and Release: directly, only these: -%define ver 2.2.0 -# NOTE: due to driverctl having its own version, only reset release -# to 1 when *both* dpdk and driverctl are updated. -%define rel 3 +%define ver 16.11.2 +%define rel 4 + +%define srcname dpdk-stable # Define when building git snapshots #define snapver 2086.git263333bb %define srcver %{ver}%{?snapver:-%{snapver}} -%define dctlver 0.59 Name: dpdk Version: %{ver} Release: %{?snapver:0.%{snapver}.}%{rel}%{?dist} URL: http://dpdk.org -Source: http://dpdk.org/browse/dpdk/snapshot/dpdk-%{srcver}.tar.gz +Source: http://dpdk.org/browse/%{srcname}/snapshot/%{srcname}-%{srcver}.tar.xz +Patch0: mk-move-PMD-libraries-linking-to-applications.patch +Patch1: net-i40e-implement-vector-PMD-for-altivec.patch +Patch2: eal-ppc-support-sPAPR-IOMMU-for-vfio-pci.patch +Patch3: eal-ppc-fix-mmap-for-memory-initialization.patch # Only needed for creating snapshot tarballs, not used in build itself Source100: dpdk-snapshot.sh -Patch1: dpdk-2.2-warningflags.patch -Patch2: dpdk-2.2-dtneeded.patch -Patch3: dpdk-2.2-buildopts.patch - Summary: Set of libraries and drivers for fast packet processing # @@ -42,12 +39,35 @@ License: BSD and LGPLv2 and GPLv2 # # The DPDK is designed to optimize througput of network traffic using, among -# other techniques, carefully crafted x86 assembly instructions. As such it -# currently (and likely never will) run on non-x86 platforms. -ExclusiveArch: x86_64 +# other techniques, carefully crafted assembly instructions. As such it +# needs extensive work to port it to other architectures. +ExclusiveArch: x86_64 i686 aarch64 ppc64le + +# machine_arch maps between rpm and dpdk arch name, often same as _target_cpu +# machine_tmpl is the config template machine name, often "native" +# machine is the actual machine name used in the dpdk make system +%ifarch x86_64 +%define machine_arch x86_64 +%define machine_tmpl native +%define machine default +%endif +%ifarch i686 +%define machine_arch i686 +%define machine_tmpl native +%define machine atm +%endif +%ifarch aarch64 +%define machine_arch arm64 +%define machine_tmpl armv8a +%define machine armv8a +%endif +%ifarch ppc64le +%define machine_arch ppc_64 +%define machine_tmpl power8 +%define machine power8 +%endif -%define machine native -%define target x86_64-%{machine}-linuxapp-gcc +%define target %{machine_arch}-%{machine_tmpl}-linuxapp-gcc %define sdkdir %{_datadir}/%{name} %define docdir %{_docdir}/%{name} @@ -98,29 +118,12 @@ Example applications utilizing the Data Plane Development Kit, such as L2 and L3 forwarding. %endif -%if %{with driverctl} -%package -n driverctl -Version: %{dctlver} -Summary: Driver control utility -Requires(post,postun): systemd -Requires: coreutils kmod -# for udev macros -BuildRequires: systemd -BuildArch: noarch -Source10: driverctl-%{dctlver}.tar.gz - -%description -n driverctl -%{summary} - -# restore original version, sub-package specific versions are problematic... -%undefine version -%endif - %prep -%setup -q -n %{name}-%{srcver} %{?with_driverctl:-a 10} -%patch1 -p1 -z .warningflags -%patch2 -p1 -z .dtneeded -%patch3 -p1 -z .buildopts +%setup -q -n %{srcname}-%{srcver} +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 %build function setconf() @@ -135,24 +138,29 @@ function setconf() # In case dpdk-devel is installed unset RTE_SDK RTE_INCLUDE RTE_TARGET -# Avoid appending second -Wall to everything, it breaks hand-picked -# disablers like per-file -Wno-strict-aliasing -export EXTRA_CFLAGS="`echo %{optflags} | sed -e 's:-Wall::g'` -fPIC" +# Avoid appending second -Wall to everything, it breaks upstream warning +# disablers in makefiles. Strip expclit -march= from optflags since they +# will only guarantee build failures, DPDK is picky with that. +export EXTRA_CFLAGS="$(echo %{optflags} | sed -e 's:-Wall::g' -e 's:-march=[[:alnum:]]* ::g') -Wformat -fPIC" + +# DPDK defaults to using builder-specific compiler flags. However, +# the config has been changed by specifying CONFIG_RTE_MACHINE=default +# in order to build for a more generic host. NOTE: It is possible that +# the compiler flags used still won't work for all Fedora-supported +# machines, but runtime checks in DPDK will catch those situations. make V=1 O=%{target} T=%{target} %{?_smp_mflags} config -# DPDK defaults to optimizing for the builder host we need generic binaries -setconf CONFIG_RTE_MACHINE '"default"' -setconf CONFIG_RTE_SCHED_VECTOR n +setconf CONFIG_RTE_MACHINE '"%{machine}"' # Enable automatic driver loading from this path setconf CONFIG_RTE_EAL_PMD_PATH '"%{pmddir}"' -# Enable bnx2x, pcap and vhost build, the added deps are ok for us -setconf CONFIG_RTE_LIBRTE_BNX2X_PMD y +# Enable pcap and vhost-numa build, the added deps are ok for us setconf CONFIG_RTE_LIBRTE_PMD_PCAP y -# Disabled for now, causes segfaults -setconf CONFIG_RTE_LIBRTE_VHOST_NUMA n +setconf CONFIG_RTE_LIBRTE_VHOST_NUMA y +# Disable unstable driver(s) +setconf CONFIG_RTE_LIBRTE_BNX2X_PMD n %if %{with shared} setconf CONFIG_RTE_BUILD_SHARED_LIB y @@ -165,8 +173,12 @@ setconf CONFIG_RTE_KNI_KMOD n # Disable experimental and ABI-breaking code setconf CONFIG_RTE_NEXT_ABI n -setconf CONFIG_RTE_LIBRTE_CRYPTODEV n -setconf CONFIG_RTE_LIBRTE_MBUF_OFFLOAD n + +# Disable some PMDs on fdProd +setconf CONFIG_RTE_LIBRTE_BNXT_PMD n +setconf CONFIG_RTE_LIBRTE_ENA_PMD n +setconf CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO n +setconf CONFIG_RTE_LIBRTE_QEDE_PMD n make V=1 O=%{target} %{?_smp_mflags} @@ -194,7 +206,7 @@ done %if ! %{with tools} rm -rf %{buildroot}%{sdkdir}/tools -rm -rf %{buildroot}%{_sbindir}/dpdk_nic_bind +rm -rf %{buildroot}%{_sbindir}/dpdk-devbind %endif rm -f %{buildroot}%{sdkdir}/tools/setup.sh @@ -202,7 +214,7 @@ rm -f %{buildroot}%{sdkdir}/tools/setup.sh find %{target}/examples/ -name "*.map" | xargs rm -f for f in %{target}/examples/*/%{target}/app/*; do bn=`basename ${f}` - cp -p ${f} %{buildroot}%{_bindir}/dpdk_${bn} + cp -p ${f} %{buildroot}%{_bindir}/dpdk-${bn} done %else rm -rf %{buildroot}%{sdkdir}/examples @@ -227,37 +239,14 @@ endif EOF # Fixup target machine mismatch -sed -i -e 's:-%{machine}-:-default-:g' %{buildroot}/%{_sysconfdir}/profile.d/dpdk-sdk* - -# Upstream has an option to build a combined library but it's bloatware which -# wont work at all when library versions start moving, replace it with a -# linker script which avoids these issues. Linking against the script during -# build resolves into links to the actual used libraries which is just fine -# for us, so this combined library is a build-time only construct now. -%if %{with shared} -libext=so -%else -libext=a -%endif -comblib=libdpdk.${libext} - -echo "GROUP (" > ${comblib} -find %{buildroot}/%{_libdir}/ -maxdepth 1 -name "*.${libext}" |\ - sed -e "s:^%{buildroot}/: :g" >> ${comblib} -echo ")" >> ${comblib} -install -m 644 ${comblib} %{buildroot}/%{_libdir}/${comblib} - -%if %{with driverctl} -cd driverctl-%{dctlver} -make install DESTDIR=%{buildroot} -cd - -%endif +sed -i -e 's:-%{machine_tmpl}-:-%{machine}-:g' %{buildroot}/%{_sysconfdir}/profile.d/dpdk-sdk* %files # BSD %doc README MAINTAINERS %{_bindir}/testpmd -%{_bindir}/dpdk_proc_info +%{_bindir}/dpdk-procinfo +%{_bindir}/dpdk-pdump %dir %{pmddir} %if %{with shared} %{_libdir}/*.so.* @@ -286,34 +275,55 @@ cd - %endif %if %{with examples} %files examples -%exclude %{_bindir}/dpdk_proc_info -%{_bindir}/dpdk_* +%exclude %{_bindir}/dpdk-procinfo +%exclude %{_bindir}/dpdk-pdump +%exclude %{_bindir}/dpdk-pmdinfo +%{_bindir}/dpdk-* %doc %{sdkdir}/examples/ %endif %if %{with tools} %files tools %{sdkdir}/tools/ -%{_sbindir}/dpdk_nic_bind +%{_sbindir}/dpdk-devbind +%{_bindir}/dpdk-pmdinfo %endif -%if %{with driverctl} -%post -n driverctl -%udev_rules_update +%changelog +* Fri Jun 23 2017 John W. Linville - 16.11.2-4 +- Backport "eal/ppc: fix mmap for memory initialization" -%postun -n driverctl -%udev_rules_update +* Fri Jun 09 2017 John W. Linville - 16.11.2-3 +- Enable i40e driver in PowerPC along with its altivec intrinsic support +- Add PCI probing support for vfio-pci devices in Power8 -%files -n driverctl -%{_sbindir}/driverctl -/usr/lib/udev/rules.d/*.rules -/usr/lib/udev/vfio_name -%dir %{_sysconfdir}/driverctl.d -%{_sysconfdir}/bash-completion.d/driverctl-bash-completion.sh -%{_mandir}/man8/driverctl.8* -%endif +* Thu Jun 08 2017 John W. Linville - 16.11.2-2 +- Enable aarch64, ppc64le (#1428587) + +* Thu Jun 08 2017 Timothy Redaelli - 16.11.2-1 +- Import from fdProd +- Update to 16.11.2 (#1459333) + +* Wed Mar 22 2017 Timothy Redaelli - 16.11-4 +- Avoid infinite loop while linking with libdpdk.so (#1434907) + +* Thu Feb 02 2017 Timothy Redaelli - 16.11-3 +- Make driverctl a different package + +* Thu Dec 08 2016 Kevin Traynor - 16.11-2 +- Update to DPDK 16.11 (#1335865) + +* Wed Oct 05 2016 Panu Matilainen - 16.07-1 +- Update to DPDK 16.07 (#1383195) +- Disable unstable bnx2x driver (#1330589) +- Enable librte_vhost NUMA support again (#1279525) +- Enable librte_cryptodev, its no longer considered experimental +- Change example prefix to dpdk- for consistency with other utilities +- Update driverctl to 0.89 + +* Thu Jul 21 2016 Flavio Leitner - 16.04-4 +- Updated to DPDK 16.04 -%changelog * Wed Mar 16 2016 Panu Matilainen - 2.2.0-3 - Disable librte_vhost NUMA support for now, it causes segfaults