From 155e2da43497ec305ae7e716a0f34056ea708855 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Thu, 18 May 2017 19:21:38 +0100 Subject: Add option to disable docs build Takes some good time to build the documentation, so add a DEB_BUILD_OPTIONS nodocs variable to let users disable it. Change-Id: I8cb44d31329367784d2987ecba008143be089376 Signed-off-by: Luca Boccassi --- debian/rules | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/debian/rules b/debian/rules index 9e272aa6..5d2f1590 100755 --- a/debian/rules +++ b/debian/rules @@ -75,6 +75,12 @@ else PAR := "1" endif +ifneq (,$(findstring nodocs,$(DEB_BUILD_OPTIONS))) +BUILD_DOCS=n +else +BUILD_DOCS=y +endif + # kernel_modules can be passed via DEB_BUILD_OPTIONS to enable building the # optional binary kernel modules package. By default it will be built against # the current kernel, or ksrc can be passed with a path to the target kernel @@ -159,14 +165,18 @@ endif dh_auto_configure override_dh_auto_build-indep: +ifeq (y,$(BUILD_DOCS)) $(MAKE) -j $(PAR) V=$(DH_VERBOSE) O=$(DPDK_STATIC_DIR) doc-api-html doc-guides-html \ doc-guides-man +endif override_dh_auto_install-indep: # Package: dpdk-doc # All files based on the install-doc rule (includes examples) +ifeq (y,$(BUILD_DOCS)) $(MAKE) V=$(DH_VERBOSE) O=$(DPDK_STATIC_DIR) prefix=/usr \ DESTDIR=debian/dpdk-doc install-doc +endif override_dh_auto_build-arch: $(MAKE) -j $(PAR) V=$(DH_VERBOSE) O=$(DPDK_STATIC_DIR) RTE_KERNELDIR=$(KSRC) build -- cgit 1.2.3-korg From 7c050e2c5af0b0c17a6a16ba0ce0d225f48800c6 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Thu, 18 May 2017 19:23:09 +0100 Subject: Mention nodocs in the changelog Change-Id: I783260ab87439108b96010ff3c5b1c5ea3b48555 Signed-off-by: Luca Boccassi --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index 7d9b322d..dfe2574d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,8 @@ dpdk (16.11.1-1~git1) UNRELEASED; urgency=medium and Debian's multiarch dir. Thanks Jan Blunck! * Clarify that only the kni and igb_uio kernel modules are distributed exclusively under the GPL2 in debian/copyright + * Add new DEB_BUILD_OPTIONS "nodocs" to allow users to avoid + building the DPDK documentation -- Christian Ehrhardt Thu, 08 Dec 2016 16:58:37 +0100 -- cgit 1.2.3-korg From 5608358c4fb189d7991cd7f5a2e615ac8e558b36 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Thu, 18 May 2017 19:24:45 +0100 Subject: Add option to disable static libraries build Upstream's build system requires a complete rebuild to have both static and shared libraries, which takes time. Add a DEB_BUILD_OPTIONS nostatic variable to let users disable it. Change-Id: If33884e0b85f8fb00c8293bae3e1668db6c74e4c Signed-off-by: Luca Boccassi --- debian/rules | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/debian/rules b/debian/rules index 5d2f1590..3a4b3197 100755 --- a/debian/rules +++ b/debian/rules @@ -81,6 +81,12 @@ else BUILD_DOCS=y endif +ifneq (,$(findstring nostatic,$(DEB_BUILD_OPTIONS))) +BUILD_STATIC_LIB=n +else +BUILD_STATIC_LIB=y +endif + # kernel_modules can be passed via DEB_BUILD_OPTIONS to enable building the # optional binary kernel modules package. By default it will be built against # the current kernel, or ksrc can be passed with a path to the target kernel @@ -179,7 +185,9 @@ ifeq (y,$(BUILD_DOCS)) endif override_dh_auto_build-arch: +ifeq (y,$(BUILD_STATIC_LIB)) $(MAKE) -j $(PAR) V=$(DH_VERBOSE) O=$(DPDK_STATIC_DIR) RTE_KERNELDIR=$(KSRC) build +endif # Unfortunately the decision about having static or shared libraries is # made for the whole build, which then produces only .a or .so files # (but not both). @@ -197,8 +205,10 @@ override_dh_auto_build-arch: override_dh_auto_install-arch: LIBDIR=/usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH) override_dh_auto_install-arch: # Package: dpdk (runtime) +ifeq (y,$(BUILD_STATIC_LIB)) $(MAKE) V=$(DH_VERBOSE) O=$(DPDK_STATIC_DIR) prefix=/usr libdir=$(LIBDIR) \ DESTDIR=debian/dpdk install-runtime +endif $(MAKE) V=$(DH_VERBOSE) O=$(DPDK_SHARED_DIR) prefix=/usr libdir=$(LIBDIR) \ DESTDIR=debian/dpdk install-runtime mkdir -p debian/dpdk/etc/dpdk @@ -234,7 +244,9 @@ override_dh_auto_install-arch: mkdir -p debian/libdpdk-dev/usr/include mv debian/dpdk-dev/usr/include/dpdk debian/libdpdk-dev/usr/include/ # all static libs are in the dev package +ifeq (y,$(BUILD_STATIC_LIB)) mv debian/dpdk/$(LIBDIR)/lib*.a debian/libdpdk-dev/$(LIBDIR)/ +endif # symlinks to last .so's are in the non versioned libdpdk-dev as well # this allows multiple libdpdk- at different VER concurrently # libdpdk-dev depends on all sublibs so symlinks are never broken -- cgit 1.2.3-korg From cf68ea1a942bda6d7610440eba1fea70ec8cd42e Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Thu, 18 May 2017 19:26:08 +0100 Subject: Mention nostatic in the changelog Change-Id: I3547273ac7728105f52fa0465cadd7d39aa43fb2 Signed-off-by: Luca Boccassi --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index dfe2574d..826d7edc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,8 @@ dpdk (16.11.1-1~git1) UNRELEASED; urgency=medium distributed exclusively under the GPL2 in debian/copyright * Add new DEB_BUILD_OPTIONS "nodocs" to allow users to avoid building the DPDK documentation + * Add new DEB_BUILD_OPTIONS "nostatic" to allow users to avoid + building the DPDK static libraries -- Christian Ehrhardt Thu, 08 Dec 2016 16:58:37 +0100 -- cgit 1.2.3-korg From 0339153291daecfe3da67d785f2f22495ca2a31f Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 18 May 2017 10:42:39 +0200 Subject: sPAPR IOMMU based pci probing This fixes probing on ppc64el for vfio-pci devices Change-Id: I92fd6108e9e3cb00f9cb66ce94eee51202b925e5 Signed-off-by: Christian Ehrhardt --- ...rt-in-pci-probing-for-vfio-pci-in-ppc64le.patch | 165 +++++++++++++++++++++ debian/patches/series | 2 +- 2 files changed, 166 insertions(+), 1 deletion(-) create mode 100644 debian/patches/dpdk-dev-v3-eal-sPAPR-IOMMU-support-in-pci-probing-for-vfio-pci-in-ppc64le.patch diff --git a/debian/patches/dpdk-dev-v3-eal-sPAPR-IOMMU-support-in-pci-probing-for-vfio-pci-in-ppc64le.patch b/debian/patches/dpdk-dev-v3-eal-sPAPR-IOMMU-support-in-pci-probing-for-vfio-pci-in-ppc64le.patch new file mode 100644 index 00000000..14435be2 --- /dev/null +++ b/debian/patches/dpdk-dev-v3-eal-sPAPR-IOMMU-support-in-pci-probing-for-vfio-pci-in-ppc64le.patch @@ -0,0 +1,165 @@ +Description: eal: sPAPR IOMMU support in pci probing for vfio-pci in ppc64le + + From: Gowrishankar Muthukrishnan + + Below changes adds pci probing support for vfio-pci devices in power8. + + v3 - better validation for kernel not implementing few iocts called + v2 - kernel version checked and doc updated + + Signed-off-by: Gowrishankar Muthukrishnan + +Note: can be dropped >=DPDK 17.05 + +Forwarded: yes, http://dpdk.org/dev/patchwork/patch/21482/ +Original-Author: Gowrishankar Muthukrishnan +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/dpdk/+bug/1670689 +Author: Christian Ehrhardt +Last-Update: 2017-03-07 + +--- 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}, + }; +@@ -537,6 +540,93 @@ + } + + return 0; ++} ++ ++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 +--- 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 diff --git a/debian/patches/series b/debian/patches/series index 6921ee07..9242e897 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,3 @@ fix-vhost-user-socket-permission.patch fix-power-default-config.patch - +dpdk-dev-v3-eal-sPAPR-IOMMU-support-in-pci-probing-for-vfio-pci-in-ppc64le.patch -- cgit 1.2.3-korg From 00a414e72a6c3ca7a5a3ed68bd2ba029bcb92d7d Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 18 May 2017 11:05:13 +0200 Subject: changelog: sPAPR IOMMU based pci probing Change-Id: I48fecc96cfacf2cb94836f687a385d280f2ce685 Signed-off-by: Christian Ehrhardt --- debian/changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index 826d7edc..ef54a1ef 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,9 @@ dpdk (16.11.1-1~git1) UNRELEASED; urgency=medium see http://dpdk.org/ml/archives/dev/2017-March/058930.html * dpdk.conf: add info about unwanted effects of multiple hugepage mountpoints + * d/p/dpdk-dev-v3-eal-sPAPR-IOMMU-support-in-pci-probing-for-vfio-pci- + in-ppc64le.patch: sPAPR IOMMU based pci probing enabled for vfio-pci + devices. [ Luca Boccassi ] * Simplify debian/rules by using upstream's install target -- cgit 1.2.3-korg From 7e013c6935818ed748ddd09c4aa37081b3a0ccf7 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 18 May 2017 10:49:58 +0200 Subject: i40e PMD / i40e vector PMD on ppc64el Change-Id: Id483b5f72c83b5f5860ea6cfb74ff21b494b1643 Signed-off-by: Christian Ehrhardt --- debian/control | 6 +- ...-v4-i40e-implement-vector-PMD-for-altivec.patch | 724 +++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 728 insertions(+), 3 deletions(-) create mode 100644 debian/patches/dpdk-dev-v4-i40e-implement-vector-PMD-for-altivec.patch diff --git a/debian/control b/debian/control index 37c14d33..5e25515d 100644 --- a/debian/control +++ b/debian/control @@ -45,7 +45,7 @@ Recommends: dpdk-igb-uio-dkms (= ${binary:Version}) [arm64], librte-pmd-ena1 (= ${binary:Version}), librte-pmd-enic1 (= ${binary:Version}) [amd64 arm64 i386], librte-pmd-fm10k1 (= ${binary:Version}) [amd64 i386], - librte-pmd-i40e1 (= ${binary:Version}) [amd64 i386], + librte-pmd-i40e1 (= ${binary:Version}) [amd64 i386 ppc64el], librte-pmd-ixgbe1 (= ${binary:Version}) [amd64 arm64 i386], librte-pmd-null-crypto1 (= ${binary:Version}), librte-pmd-null1 (= ${binary:Version}), @@ -152,7 +152,7 @@ Depends: libpcap-dev, librte-pmd-ena1 (= ${binary:Version}), librte-pmd-enic1 (= ${binary:Version}) [amd64 arm64 i386], librte-pmd-fm10k1 (= ${binary:Version}) [amd64 i386], - librte-pmd-i40e1 (= ${binary:Version}) [amd64 i386], + librte-pmd-i40e1 (= ${binary:Version}) [amd64 i386 ppc64el], librte-pmd-ixgbe1 (= ${binary:Version}) [amd64 arm64 i386], librte-pmd-null-crypto1 (= ${binary:Version}), librte-pmd-null1 (= ${binary:Version}), @@ -522,7 +522,7 @@ Description: Data Plane Development Kit (librte-pmd-fm10k runtime library) This package contains the runtime libraries for librte_pmd_fm10k. Package: librte-pmd-i40e1 -Architecture: amd64 i386 +Architecture: amd64 i386 ppc64el Multi-Arch: same Homepage: http://dpdk.org/doc/guides/nics/i40e.html Pre-Depends: ${misc:Pre-Depends} diff --git a/debian/patches/dpdk-dev-v4-i40e-implement-vector-PMD-for-altivec.patch b/debian/patches/dpdk-dev-v4-i40e-implement-vector-PMD-for-altivec.patch new file mode 100644 index 00000000..a1001cf0 --- /dev/null +++ b/debian/patches/dpdk-dev-v4-i40e-implement-vector-PMD-for-altivec.patch @@ -0,0 +1,724 @@ +Description: i40e: implement vector PMD for altivec + + From: Gowrishankar Muthukrishnan + + This patch enables i40e driver in powerpc along with its altivec + intrinsic support. + + Changes: + v4 - docs and config update. + v3 - minor corrections for coding style standard. + v2 - minor corrections for gcc strict aliasing and coding style standard. + + Signed-off-by: Gowrishankar Muthukrishnan + +Note: can be dropped >=DPDK 17.05 + +Forwarded: yes, http://dpdk.org/dev/patchwork/patch/20680/ +Original-Author: Gowrishankar Muthukrishnan +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/dpdk/+bug/1670686 +Author: Christian Ehrhardt +Last-Update: 2017-03-07 + +--- a/MAINTAINERS ++++ b/MAINTAINERS +@@ -166,6 +166,7 @@ + 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 +--- a/config/defconfig_ppc_64-power8-linuxapp-gcc ++++ b/config/defconfig_ppc_64-power8-linuxapp-gcc +@@ -49,7 +49,6 @@ + # 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_ENIC_PMD=n +--- a/doc/guides/nics/features/i40e.ini ++++ b/doc/guides/nics/features/i40e.ini +@@ -46,3 +46,4 @@ + x86-32 = Y + x86-64 = Y + ARMv8 = Y ++Power8 = Y +--- a/doc/guides/nics/features/i40e_vec.ini ++++ b/doc/guides/nics/features/i40e_vec.ini +@@ -38,3 +38,4 @@ + x86-32 = Y + x86-64 = Y + ARMv8 = Y ++Power8 = Y +--- a/drivers/net/i40e/Makefile ++++ b/drivers/net/i40e/Makefile +@@ -99,6 +99,8 @@ + 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 +--- /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); ++} diff --git a/debian/patches/series b/debian/patches/series index 9242e897..a8f48505 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ fix-vhost-user-socket-permission.patch fix-power-default-config.patch dpdk-dev-v3-eal-sPAPR-IOMMU-support-in-pci-probing-for-vfio-pci-in-ppc64le.patch +dpdk-dev-v4-i40e-implement-vector-PMD-for-altivec.patch -- cgit 1.2.3-korg From a4d083825004249635967c65981c68b98e952272 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 18 May 2017 10:53:11 +0200 Subject: changelog: i40e PMD / vector PMD on ppc64el Change-Id: I4d564d589827d1f97c21a0fc65f633feb6ceb283 Signed-off-by: Christian Ehrhardt --- debian/changelog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/debian/changelog b/debian/changelog index ef54a1ef..59a6ce8e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,10 @@ dpdk (16.11.1-1~git1) UNRELEASED; urgency=medium * d/p/dpdk-dev-v3-eal-sPAPR-IOMMU-support-in-pci-probing-for-vfio-pci- in-ppc64le.patch: sPAPR IOMMU based pci probing enabled for vfio-pci devices. + * enable librte-pmd-i40e1 for ppc64el + - debian/control: enable arch onpackage + - d/p/dpdk-dev-v4-i40e-implement-vector-PMD-for-altivec.patch: add i40e + PMD / vector PMD implementation and enable by default on ppc64el [ Luca Boccassi ] * Simplify debian/rules by using upstream's install target -- cgit 1.2.3-korg From 2732340d33c9b92603573a94fd42222c13031c40 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 18 May 2017 11:04:07 +0200 Subject: fix library availability/dependency Change-Id: Icd75917e74c7b629e7e43b01c2d5811c48863940 Signed-off-by: Christian Ehrhardt --- debian/control | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/debian/control b/debian/control index 5e25515d..1d75a9e8 100644 --- a/debian/control +++ b/debian/control @@ -45,7 +45,7 @@ Recommends: dpdk-igb-uio-dkms (= ${binary:Version}) [arm64], librte-pmd-ena1 (= ${binary:Version}), librte-pmd-enic1 (= ${binary:Version}) [amd64 arm64 i386], librte-pmd-fm10k1 (= ${binary:Version}) [amd64 i386], - librte-pmd-i40e1 (= ${binary:Version}) [amd64 i386 ppc64el], + librte-pmd-i40e1 (= ${binary:Version}), librte-pmd-ixgbe1 (= ${binary:Version}) [amd64 arm64 i386], librte-pmd-null-crypto1 (= ${binary:Version}), librte-pmd-null1 (= ${binary:Version}), @@ -135,7 +135,7 @@ Depends: libpcap-dev, librte-hash2 (= ${binary:Version}), librte-ip-frag1 (= ${binary:Version}), librte-jobstats1 (= ${binary:Version}), - librte-kni2 (= ${binary:Version}) [amd64 arm64], + librte-kni2 (= ${binary:Version}) [amd64 arm64 ppc64el], librte-kvargs1 (= ${binary:Version}), librte-lpm2 (= ${binary:Version}), librte-mbuf2 (= ${binary:Version}), @@ -152,7 +152,7 @@ Depends: libpcap-dev, librte-pmd-ena1 (= ${binary:Version}), librte-pmd-enic1 (= ${binary:Version}) [amd64 arm64 i386], librte-pmd-fm10k1 (= ${binary:Version}) [amd64 i386], - librte-pmd-i40e1 (= ${binary:Version}) [amd64 i386 ppc64el], + librte-pmd-i40e1 (= ${binary:Version}), librte-pmd-ixgbe1 (= ${binary:Version}) [amd64 arm64 i386], librte-pmd-null-crypto1 (= ${binary:Version}), librte-pmd-null1 (= ${binary:Version}), @@ -509,7 +509,7 @@ Description: Data Plane Development Kit (librte-pmd-enic runtime library) This package contains the runtime libraries for librte_pmd_enic. Package: librte-pmd-fm10k1 -Architecture: amd64 i386 ppc64el +Architecture: amd64 i386 Multi-Arch: same Homepage: http://dpdk.org/doc/guides/nics/fm10k.html Pre-Depends: ${misc:Pre-Depends} @@ -522,7 +522,7 @@ Description: Data Plane Development Kit (librte-pmd-fm10k runtime library) This package contains the runtime libraries for librte_pmd_fm10k. Package: librte-pmd-i40e1 -Architecture: amd64 i386 ppc64el +Architecture: amd64 arm64 i386 ppc64el Multi-Arch: same Homepage: http://dpdk.org/doc/guides/nics/i40e.html Pre-Depends: ${misc:Pre-Depends} -- cgit 1.2.3-korg From 49290e33ba32abb8d61afa46a320ebaff14be321 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 18 May 2017 11:04:18 +0200 Subject: changelog:fix library availability/dependency Change-Id: I670fc3a59912215fc46bdde7ee6251d576e36c50 Signed-off-by: Christian Ehrhardt --- debian/changelog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/debian/changelog b/debian/changelog index 59a6ce8e..7957c454 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,10 @@ dpdk (16.11.1-1~git1) UNRELEASED; urgency=medium - debian/control: enable arch onpackage - d/p/dpdk-dev-v4-i40e-implement-vector-PMD-for-altivec.patch: add i40e PMD / vector PMD implementation and enable by default on ppc64el + * fix library availability/dependency + - librte-kni is built on ppc64el, fix dependency from libdpdk-dev + - librte-pmd-fm10k1 is not built on ppc64el (empty pkg atm) adapt arch + - librte-pmd-i40e is built on all architectures now [ Luca Boccassi ] * Simplify debian/rules by using upstream's install target -- cgit 1.2.3-korg From e4562c78c0c5cb1a4080765925209fd23b8bc389 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 18 May 2017 13:12:50 +0200 Subject: Add thunderx (LP: #1691659) To make arm support useful on more devices add, enable and fix thunderx networking - that is the nicvf pmd (LP: #1691659) Change-Id: I17f1d6d63d31df05f1af09054ffddcb478c54dd3 Signed-off-by: Christian Ehrhardt --- ...x-check-data-offset-alignment-requirement.patch | 58 ++++++++++++++++ .../nicvf-0002-net-thunderx-fix-32-bit-build.patch | 58 ++++++++++++++++ .../nicvf-0003-config-enable-thunderx-nicvf.patch | 62 +++++++++++++++++ ...x-sync-mailbox-definitions-with-Linux-PF-.patch | 80 ++++++++++++++++++++++ ...nderx-wait-to-complete-during-link-update.patch | 59 ++++++++++++++++ ...006-mk-fix-lib-filtering-when-linking-app.patch | 71 +++++++++++++++++++ ...et-thunderx-disable-PMD-for-old-compilers.patch | 80 ++++++++++++++++++++++ ...t-thunderx-fix-stats-access-out-of-bounds.patch | 67 ++++++++++++++++++ ...-set-cache-line-as-128B-for-generic-arm64.patch | 65 ++++++++++++++++++ ...0010-net-thunderx-fix-deadlock-in-Rx-path.patch | 58 ++++++++++++++++ debian/patches/series | 10 +++ 11 files changed, 668 insertions(+) create mode 100644 debian/patches/nicvf-0001-net-thunderx-check-data-offset-alignment-requirement.patch create mode 100644 debian/patches/nicvf-0002-net-thunderx-fix-32-bit-build.patch create mode 100644 debian/patches/nicvf-0003-config-enable-thunderx-nicvf.patch create mode 100644 debian/patches/nicvf-0004-net-thunderx-sync-mailbox-definitions-with-Linux-PF-.patch create mode 100644 debian/patches/nicvf-0005-net-thunderx-wait-to-complete-during-link-update.patch create mode 100644 debian/patches/nicvf-0006-mk-fix-lib-filtering-when-linking-app.patch create mode 100644 debian/patches/nicvf-0007-net-thunderx-disable-PMD-for-old-compilers.patch create mode 100644 debian/patches/nicvf-0008-net-thunderx-fix-stats-access-out-of-bounds.patch create mode 100644 debian/patches/nicvf-0009-config-set-cache-line-as-128B-for-generic-arm64.patch create mode 100644 debian/patches/nicvf-0010-net-thunderx-fix-deadlock-in-Rx-path.patch diff --git a/debian/patches/nicvf-0001-net-thunderx-check-data-offset-alignment-requirement.patch b/debian/patches/nicvf-0001-net-thunderx-check-data-offset-alignment-requirement.patch new file mode 100644 index 00000000..d5402b82 --- /dev/null +++ b/debian/patches/nicvf-0001-net-thunderx-check-data-offset-alignment-requirement.patch @@ -0,0 +1,58 @@ +From 34c2e7026fb30f6756d2c84d07d99c94106bb2ab Mon Sep 17 00:00:00 2001 +From: Jerin Jacob +Date: Mon, 13 Mar 2017 13:32:11 +0530 +Subject: [PATCH] net/thunderx: check data offset alignment requirement + +nicvf HW expects the DMA address of the packet data to be +aligned with cache line size. + +Packet data offset is a function of struct mbuf size, +mbuf private size and headroom. mbuf private size can +be changed from the application in pool creation, this +check detects HW alignment requirement constraint in pmd +start function. + +Signed-off-by: Jerin Jacob +Acked-by: Hemant Agrawal +--- + drivers/net/thunderx/nicvf_ethdev.c | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +Origin: http://dpdk.org/browse/dpdk/commit/?id=34c2e7026fb30f6756d2c84d07d99c94106bb2ab +Original-Author: Jerin Jacob +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/dpdk/+bug/1691659 +Author: Christian Ehrhardt +Last-Update: 2017-05-18 + +--- a/drivers/net/thunderx/nicvf_ethdev.c ++++ b/drivers/net/thunderx/nicvf_ethdev.c +@@ -1407,7 +1407,7 @@ + nicvf_vf_start(struct rte_eth_dev *dev, struct nicvf *nic, uint32_t rbdrsz) + { + int ret; +- uint16_t qidx; ++ uint16_t qidx, data_off; + uint32_t total_rxq_desc, nb_rbdr_desc, exp_buffs; + uint64_t mbuf_phys_off = 0; + struct nicvf_rxq *rxq; +@@ -1448,10 +1448,18 @@ + nic->vf_id, qidx, rxq->pool->name); + return -ENOMEM; + } +- rxq->mbuf_phys_off -= nicvf_mbuff_meta_length(mbuf); +- rxq->mbuf_phys_off -= RTE_PKTMBUF_HEADROOM; ++ data_off = nicvf_mbuff_meta_length(mbuf); ++ data_off += RTE_PKTMBUF_HEADROOM; + rte_pktmbuf_free(mbuf); + ++ if (data_off % RTE_CACHE_LINE_SIZE) { ++ PMD_INIT_LOG(ERR, "%s: unaligned data_off=%d delta=%d", ++ rxq->pool->name, data_off, ++ data_off % RTE_CACHE_LINE_SIZE); ++ return -EINVAL; ++ } ++ rxq->mbuf_phys_off -= data_off; ++ + if (mbuf_phys_off == 0) + mbuf_phys_off = rxq->mbuf_phys_off; + if (mbuf_phys_off != rxq->mbuf_phys_off) { diff --git a/debian/patches/nicvf-0002-net-thunderx-fix-32-bit-build.patch b/debian/patches/nicvf-0002-net-thunderx-fix-32-bit-build.patch new file mode 100644 index 00000000..f5653d1e --- /dev/null +++ b/debian/patches/nicvf-0002-net-thunderx-fix-32-bit-build.patch @@ -0,0 +1,58 @@ +From 6d76fde7dba39769c64bee03b62593cc66a1b0e3 Mon Sep 17 00:00:00 2001 +From: Jerin Jacob +Date: Sun, 19 Mar 2017 20:18:46 +0530 +Subject: [PATCH] net/thunderx: fix 32-bit build + +Fixes: e438796617dc ("net/thunderx: add PMD skeleton") + +Signed-off-by: Jerin Jacob +--- + drivers/net/thunderx/nicvf_struct.h | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +Origin: http://dpdk.org/browse/dpdk/commit/?id=6d76fde7dba39769c64bee03b62593cc66a1b0e3 +Original-Author: Jerin Jacob +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/dpdk/+bug/1691659 +Author: Christian Ehrhardt +Last-Update: 2017-05-18 + +diff --git a/drivers/net/thunderx/nicvf_struct.h b/drivers/net/thunderx/nicvf_struct.h +index c900e12..5bc6d57 100644 +--- a/drivers/net/thunderx/nicvf_struct.h ++++ b/drivers/net/thunderx/nicvf_struct.h +@@ -43,8 +43,8 @@ + #include + + struct nicvf_rbdr { +- uint64_t rbdr_status; +- uint64_t rbdr_door; ++ uintptr_t rbdr_status; ++ uintptr_t rbdr_door; + struct rbdr_entry_t *desc; + nicvf_phys_addr_t phys; + uint32_t buffsz; +@@ -58,8 +58,8 @@ struct nicvf_txq { + union sq_entry_t *desc; + nicvf_phys_addr_t phys; + struct rte_mbuf **txbuffs; +- uint64_t sq_head; +- uint64_t sq_door; ++ uintptr_t sq_head; ++ uintptr_t sq_door; + struct rte_mempool *pool; + struct nicvf *nic; + void (*pool_free)(struct nicvf_txq *sq); +@@ -74,8 +74,8 @@ struct nicvf_txq { + + struct nicvf_rxq { + uint64_t mbuf_phys_off; +- uint64_t cq_status; +- uint64_t cq_door; ++ uintptr_t cq_status; ++ uintptr_t cq_door; + nicvf_phys_addr_t phys; + union cq_entry_t *desc; + struct nicvf_rbdr *shared_rbdr; +-- +2.7.4 + diff --git a/debian/patches/nicvf-0003-config-enable-thunderx-nicvf.patch b/debian/patches/nicvf-0003-config-enable-thunderx-nicvf.patch new file mode 100644 index 00000000..465dd491 --- /dev/null +++ b/debian/patches/nicvf-0003-config-enable-thunderx-nicvf.patch @@ -0,0 +1,62 @@ +From 0bc8874b3b2c2da74bb955ce2de2da7eb009a8bf Mon Sep 17 00:00:00 2001 +From: Jerin Jacob +Date: Sun, 19 Mar 2017 20:18:48 +0530 +Subject: [PATCH] config: enable thunderx nicvf + +Enable Thunderx nicvf PMD driver in the common +config as it does not have build dependency +with any external library and/or architecture. + +Signed-off-by: Jerin Jacob +--- + config/common_base | 2 +- + config/defconfig_arm64-thunderx-linuxapp-gcc | 10 ---------- + doc/guides/nics/thunderx.rst | 3 +-- + 3 files changed, 2 insertions(+), 13 deletions(-) + +Origin: http://dpdk.org/browse/dpdk/commit/?id=0bc8874b3b2c2da74bb955ce2de2da7eb009a8bf +Original-Author: Jerin Jacob +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/dpdk/+bug/1691659 +Author: Christian Ehrhardt +Last-Update: 2017-05-18 + +--- a/config/common_base ++++ b/config/common_base +@@ -264,7 +264,7 @@ + # + # Compile burst-oriented Cavium Thunderx NICVF PMD driver + # +-CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD=n ++CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD=y + CONFIG_RTE_LIBRTE_THUNDERX_NICVF_DEBUG_INIT=n + CONFIG_RTE_LIBRTE_THUNDERX_NICVF_DEBUG_RX=n + CONFIG_RTE_LIBRTE_THUNDERX_NICVF_DEBUG_TX=n +--- a/config/defconfig_arm64-thunderx-linuxapp-gcc ++++ b/config/defconfig_arm64-thunderx-linuxapp-gcc +@@ -36,13 +36,3 @@ + CONFIG_RTE_CACHE_LINE_SIZE=128 + CONFIG_RTE_MAX_NUMA_NODES=2 + CONFIG_RTE_MAX_LCORE=96 +- +-# +-# Compile Cavium Thunderx NICVF PMD driver +-# +-CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD=y +-CONFIG_RTE_LIBRTE_THUNDERX_NICVF_DEBUG_INIT=n +-CONFIG_RTE_LIBRTE_THUNDERX_NICVF_DEBUG_RX=n +-CONFIG_RTE_LIBRTE_THUNDERX_NICVF_DEBUG_TX=n +-CONFIG_RTE_LIBRTE_THUNDERX_NICVF_DEBUG_DRIVER=n +-CONFIG_RTE_LIBRTE_THUNDERX_NICVF_DEBUG_MBOX=n +--- a/doc/guides/nics/thunderx.rst ++++ b/doc/guides/nics/thunderx.rst +@@ -77,9 +77,8 @@ + The following options can be modified in the ``config`` file. + Please note that enabling debugging options may affect system performance. + +-- ``CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD`` (default ``n``) ++- ``CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD`` (default ``y``) + +- By default it is enabled only for defconfig_arm64-thunderx-* config. + Toggle compilation of the ``librte_pmd_thunderx_nicvf`` driver. + + - ``CONFIG_RTE_LIBRTE_THUNDERX_NICVF_DEBUG_INIT`` (default ``n``) diff --git a/debian/patches/nicvf-0004-net-thunderx-sync-mailbox-definitions-with-Linux-PF-.patch b/debian/patches/nicvf-0004-net-thunderx-sync-mailbox-definitions-with-Linux-PF-.patch new file mode 100644 index 00000000..2ff3a2db --- /dev/null +++ b/debian/patches/nicvf-0004-net-thunderx-sync-mailbox-definitions-with-Linux-PF-.patch @@ -0,0 +1,80 @@ +From 2d5a4b62ff2d7b79ca937a5c88654deecf4aa986 Mon Sep 17 00:00:00 2001 +From: Jerin Jacob +Date: Mon, 20 Mar 2017 19:40:40 +0530 +Subject: [PATCH] net/thunderx: sync mailbox definitions with Linux PF driver + +- bgx_link_status mbox definition was changed in Linux +commit 1cc702591bae ("net: thunderx: Add ethtool support") +- NIC_MBOX_MSG_RES_BIT related changes were never part of Linux PF driver + +Signed-off-by: Jerin Jacob +--- + drivers/net/thunderx/base/nicvf_mbox.c | 7 ++----- + drivers/net/thunderx/base/nicvf_mbox.h | 11 +++-------- + 2 files changed, 5 insertions(+), 13 deletions(-) + +Origin: http://dpdk.org/browse/dpdk/commit/?id=2d5a4b62ff2d7b79ca937a5c88654deecf4aa986 +Original-Author: Jerin Jacob +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/dpdk/+bug/1691659 +Author: Christian Ehrhardt +Last-Update: 2017-05-18 + +--- a/drivers/net/thunderx/base/nicvf_mbox.c ++++ b/drivers/net/thunderx/base/nicvf_mbox.c +@@ -62,9 +62,6 @@ + [NIC_MBOX_MSG_RESET_STAT_COUNTER] = "NIC_MBOX_MSG_RESET_STAT_COUNTER", + [NIC_MBOX_MSG_CFG_DONE] = "NIC_MBOX_MSG_CFG_DONE", + [NIC_MBOX_MSG_SHUTDOWN] = "NIC_MBOX_MSG_SHUTDOWN", +- [NIC_MBOX_MSG_RES_BIT] = "NIC_MBOX_MSG_RES_BIT", +- [NIC_MBOX_MSG_RSS_SIZE_RES_BIT] = "NIC_MBOX_MSG_RSS_SIZE", +- [NIC_MBOX_MSG_ALLOC_SQS_RES_BIT] = "NIC_MBOX_MSG_ALLOC_SQS", + }; + + static inline const char * __attribute__((unused)) +@@ -176,7 +173,7 @@ + case NIC_MBOX_MSG_NACK: + nic->pf_nacked = true; + break; +- case NIC_MBOX_MSG_RSS_SIZE_RES_BIT: ++ case NIC_MBOX_MSG_RSS_SIZE: + nic->rss_info.rss_size = mbx.rss_size.ind_tbl_size; + nic->pf_acked = true; + break; +@@ -186,7 +183,7 @@ + nic->speed = mbx.link_status.speed; + nic->pf_acked = true; + break; +- case NIC_MBOX_MSG_ALLOC_SQS_RES_BIT: ++ case NIC_MBOX_MSG_ALLOC_SQS: + assert_primary(nic); + if (mbx.sqs_alloc.qs_count != nic->sqs_count) { + nicvf_log_error("Received %" PRIu8 "/%" PRIu8 +--- a/drivers/net/thunderx/base/nicvf_mbox.h ++++ b/drivers/net/thunderx/base/nicvf_mbox.h +@@ -68,16 +68,10 @@ + #define NIC_MBOX_MSG_ALLOC_SQS 0x12 /* Allocate secondary Qset */ + #define NIC_MBOX_MSG_LOOPBACK 0x16 /* Set interface in loopback */ + #define NIC_MBOX_MSG_RESET_STAT_COUNTER 0x17 /* Reset statistics counters */ +-#define NIC_MBOX_MSG_CFG_DONE 0x7E /* VF configuration done */ +-#define NIC_MBOX_MSG_SHUTDOWN 0x7F /* VF is being shutdown */ +-#define NIC_MBOX_MSG_RES_BIT 0x80 /* Reset bit from PF */ ++#define NIC_MBOX_MSG_CFG_DONE 0xF0 /* VF configuration done */ ++#define NIC_MBOX_MSG_SHUTDOWN 0xF1 /* VF is being shutdown */ + #define NIC_MBOX_MSG_MAX 0x100 /* Maximum number of messages */ + +-#define NIC_MBOX_MSG_RSS_SIZE_RES_BIT \ +- (NIC_MBOX_MSG_RSS_SIZE | NIC_MBOX_MSG_RES_BIT) +-#define NIC_MBOX_MSG_ALLOC_SQS_RES_BIT \ +- (NIC_MBOX_MSG_ALLOC_SQS | NIC_MBOX_MSG_RES_BIT) +- + /* Get vNIC VF configuration */ + struct nic_cfg_msg { + uint8_t msg; +@@ -157,6 +151,7 @@ + /* Physical interface link status */ + struct bgx_link_status { + uint8_t msg; ++ uint8_t mac_type; + uint8_t link_up; + uint8_t duplex; + uint32_t speed; diff --git a/debian/patches/nicvf-0005-net-thunderx-wait-to-complete-during-link-update.patch b/debian/patches/nicvf-0005-net-thunderx-wait-to-complete-during-link-update.patch new file mode 100644 index 00000000..32937a1c --- /dev/null +++ b/debian/patches/nicvf-0005-net-thunderx-wait-to-complete-during-link-update.patch @@ -0,0 +1,59 @@ +From 0cca56708d781b42561e382fcbcb1f1647b932b9 Mon Sep 17 00:00:00 2001 +From: Andriy Berestovskyy +Date: Fri, 31 Mar 2017 15:57:49 +0200 +Subject: [PATCH] net/thunderx: wait to complete during link update + +Some DPDK applications/examples check link status on their +start. NICVF does not wait for the link, so those apps fail. + +Wait up to 9 seconds for the link as other PMDs do in order +to fix those apps/examples. + +Signed-off-by: Andriy Berestovskyy +Acked-by: Jerin Jacob +--- + drivers/net/thunderx/nicvf_ethdev.c | 21 +++++++++++++++++---- + 1 file changed, 17 insertions(+), 4 deletions(-) + +Origin: http://dpdk.org/browse/dpdk/commit/?id=0cca56708d781b42561e382fcbcb1f1647b932b9 +Original-Author: Andriy Berestovskyy +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/dpdk/+bug/1691659 +Author: Christian Ehrhardt +Last-Update: 2017-05-18 + +--- a/drivers/net/thunderx/nicvf_ethdev.c ++++ b/drivers/net/thunderx/nicvf_ethdev.c +@@ -145,16 +145,29 @@ + * Return 0 means link status changed, -1 means not changed + */ + static int +-nicvf_dev_link_update(struct rte_eth_dev *dev, +- int wait_to_complete __rte_unused) ++nicvf_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete) + { ++#define CHECK_INTERVAL 100 /* 100ms */ ++#define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */ + struct rte_eth_link link; + struct nicvf *nic = nicvf_pmd_priv(dev); ++ int i; + + PMD_INIT_FUNC_TRACE(); + +- memset(&link, 0, sizeof(link)); +- nicvf_set_eth_link_status(nic, &link); ++ if (wait_to_complete) { ++ /* rte_eth_link_get() might need to wait up to 9 seconds */ ++ for (i = 0; i < MAX_CHECK_TIME; i++) { ++ memset(&link, 0, sizeof(link)); ++ nicvf_set_eth_link_status(nic, &link); ++ if (link.link_status) ++ break; ++ rte_delay_ms(CHECK_INTERVAL); ++ } ++ } else { ++ memset(&link, 0, sizeof(link)); ++ nicvf_set_eth_link_status(nic, &link); ++ } + return nicvf_atomic_write_link_status(dev, &link); + } + diff --git a/debian/patches/nicvf-0006-mk-fix-lib-filtering-when-linking-app.patch b/debian/patches/nicvf-0006-mk-fix-lib-filtering-when-linking-app.patch new file mode 100644 index 00000000..50093364 --- /dev/null +++ b/debian/patches/nicvf-0006-mk-fix-lib-filtering-when-linking-app.patch @@ -0,0 +1,71 @@ +From ab338eb44ebb79840dab1de2742c07070ae3bf0e Mon Sep 17 00:00:00 2001 +From: Olivier Matz +Date: Thu, 6 Apr 2017 16:14:55 +0200 +Subject: [PATCH] mk: fix lib filtering when linking app + +I get the following error when linking the test application: + build/lib/librte_pmd_thunderx_nicvf.a(nicvf_hw.o): + In function `nicvf_qsize_regbit': + drivers/net/thunderx/base/nicvf_hw.c:451: undefined reference to `log2' + build/lib/librte_pmd_thunderx_nicvf.a(nicvf_hw.o): + In function `nicvf_rss_reta_update': + drivers/net/thunderx/base/nicvf_hw.c:804: undefined reference to `log2' + build/lib/librte_pmd_thunderx_nicvf.a(nicvf_hw.o): + In function `nicvf_rss_reta_query': + drivers/net/thunderx/base/nicvf_hw.c:825: undefined reference to `log2' + +While I don't know why it does not happen for a default build, the error +can be explained. The link command line is: + + gcc -o test ... *.o ... -Wl,-lm ... -Wl,-lrte_pmd_thunderx_nicvf ... + +rte_pmd_thunderx_nicvf needs the math library, and it should be +added after. This is not the case because the test application also +adds the math library. + +The makefile already filters the libraries, but it keeps the first +occurrence of the lib. Instead, the last one should be kept. + +Fixes: edf4d331dcdb ("mk: eliminate duplicates from libraries list") +Cc: stable@dpdk.org + +Signed-off-by: Olivier Matz +Acked-by: Thomas Monjalon +--- + mk/rte.app.mk | 19 +++++++++++++++---- + 1 file changed, 15 insertions(+), 4 deletions(-) + +Origin: http://dpdk.org/browse/dpdk/commit/?id=ab338eb44ebb79840dab1de2742c07070ae3bf0e +Original-Author: Olivier Matz +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/dpdk/+bug/1691659 +Author: Christian Ehrhardt +Last-Update: 2017-05-18 + +--- a/mk/rte.app.mk ++++ b/mk/rte.app.mk +@@ -168,10 +168,21 @@ + + LDLIBS += $(_LDLIBS-y) $(CPU_LDLIBS) $(EXTRA_LDLIBS) + +-# Eliminate duplicates without sorting +-LDLIBS := $(shell echo $(LDLIBS) | \ +- awk '{for (i = 1; i <= NF; i++) { \ +- if ($$i !~ /^-l.*/ || !seen[$$i]++) print $$i }}') ++# all the words except the first one ++allbutfirst = $(wordlist 2,$(words $(1)),$(1)) ++ ++# Eliminate duplicates without sorting, only keep the last occurrence ++filter-libs = \ ++ $(if $(1),$(strip\ ++ $(if \ ++ $(and \ ++ $(filter $(firstword $(1)),$(call allbutfirst,$(1))),\ ++ $(filter -l%,$(firstword $(1)))),\ ++ ,\ ++ $(firstword $(1))) \ ++ $(call filter-libs,$(call allbutfirst,$(1))))) ++ ++LDLIBS := $(call filter-libs,$(LDLIBS)) + + ifeq ($(RTE_DEVEL_BUILD)$(CONFIG_RTE_BUILD_SHARED_LIB),yy) + LDFLAGS += -rpath=$(RTE_SDK_BIN)/lib diff --git a/debian/patches/nicvf-0007-net-thunderx-disable-PMD-for-old-compilers.patch b/debian/patches/nicvf-0007-net-thunderx-disable-PMD-for-old-compilers.patch new file mode 100644 index 00000000..61590496 --- /dev/null +++ b/debian/patches/nicvf-0007-net-thunderx-disable-PMD-for-old-compilers.patch @@ -0,0 +1,80 @@ +From 0b9ce550c4f60a69da558da6044e1b394256b43c Mon Sep 17 00:00:00 2001 +From: Ferruh Yigit +Date: Thu, 6 Apr 2017 18:05:09 +0100 +Subject: [PATCH] net/thunderx: disable PMD for old compilers + +Disable for gcc < 4.7 and icc <= 14.0 + +PMD uses some compiler builtins and new compiler options. Tested with +gcc 4.5.1 and following were not supported: + +option: +-Ofast + +macros: +_Static_assert + +__ORDER_LITTLE_ENDIAN__ +__ORDER_BIG_ENDIAN__ +__BYTE_ORDER__ + +__atomic_fetch_add +__ATOMIC_ACQUIRE +__atomic_load_n +__ATOMIC_RELAXED +__atomic_store_n +__ATOMIC_RELEASE + +It is not easy to fix all in PMD, disabling PMD for older compilers. + +Signed-off-by: Ferruh Yigit +--- + drivers/net/Makefile | 5 +++++ + mk/toolchain/gcc/rte.toolchain-compat.mk | 5 +++++ + mk/toolchain/icc/rte.toolchain-compat.mk | 5 +++++ + 3 files changed, 15 insertions(+) + +Origin: http://dpdk.org/browse/dpdk/commit/?id=0b9ce550c4f60a69da558da6044e1b394256b43c +Original-Author: Ferruh Yigit +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/dpdk/+bug/1691659 +Author: Christian Ehrhardt +Last-Update: 2017-05-18 + +--- a/drivers/net/Makefile ++++ b/drivers/net/Makefile +@@ -31,6 +31,11 @@ + + include $(RTE_SDK)/mk/rte.vars.mk + ++# set in mk/toolchain/xxx/rte.toolchain-compat.mk ++ifeq ($(CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD),d) ++ $(warning thunderx pmd is not supported by old compilers) ++endif ++ + DIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += af_packet + DIRS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += bnx2x + DIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += bonding +--- a/mk/toolchain/gcc/rte.toolchain-compat.mk ++++ b/mk/toolchain/gcc/rte.toolchain-compat.mk +@@ -89,4 +89,9 @@ + ifeq ($(shell test $(GCC_VERSION) -lt 42 && echo 1), 1) + MACHINE_CFLAGS := $(filter-out -march% -mtune% -msse%,$(MACHINE_CFLAGS)) + endif ++ ++ # Disable thunderx PMD for gcc < 4.7 ++ ifeq ($(shell test $(GCC_VERSION) -lt 47 && echo 1), 1) ++ CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD=d ++ endif + endif +--- a/mk/toolchain/icc/rte.toolchain-compat.mk ++++ b/mk/toolchain/icc/rte.toolchain-compat.mk +@@ -72,4 +72,9 @@ + # remove march options + MACHINE_CFLAGS := $(patsubst -march=%,-xSSE3,$(MACHINE_CFLAGS)) + endif ++ ++ # Disable thunderx PMD for icc <= 14.0 ++ ifeq ($(shell test $(ICC_MAJOR_VERSION) -le 14 && echo 1), 1) ++ CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD=d ++ endif + endif diff --git a/debian/patches/nicvf-0008-net-thunderx-fix-stats-access-out-of-bounds.patch b/debian/patches/nicvf-0008-net-thunderx-fix-stats-access-out-of-bounds.patch new file mode 100644 index 00000000..cd26df57 --- /dev/null +++ b/debian/patches/nicvf-0008-net-thunderx-fix-stats-access-out-of-bounds.patch @@ -0,0 +1,67 @@ +From 695cd416ce6c02d7a20108765573936998b2dbf0 Mon Sep 17 00:00:00 2001 +From: Marcin Wilk +Date: Tue, 11 Apr 2017 14:35:13 +0200 +Subject: [PATCH] net/thunderx: fix stats access out of bounds + +Trying to assign more queues to stats struct break only from one loop +when the maximum size is reached. Outside loop iteration is continued. +This leads to access an array out of bounds. + +Fixes: 21e3fb0050b9 ("net/thunderx: add final bits for secondary queue support") +Cc: stable@dpdk.org + +Signed-off-by: Marcin Wilk +Acked-by: Jerin Jacob +--- + drivers/net/thunderx/nicvf_ethdev.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +Origin: http://dpdk.org/browse/dpdk/commit/?id=695cd416ce6c02d7a20108765573936998b2dbf0 +Original-Author: Marcin Wilk +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/dpdk/+bug/1691659 +Author: Christian Ehrhardt +Last-Update: 2017-05-18 + +diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c +index b0b9c3b..36ff94f 100644 +--- a/drivers/net/thunderx/nicvf_ethdev.c ++++ b/drivers/net/thunderx/nicvf_ethdev.c +@@ -258,7 +258,7 @@ nicvf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) + + /* Reading per RX ring stats */ + for (qidx = rx_start; qidx <= rx_end; qidx++) { +- if (qidx == RTE_ETHDEV_QUEUE_STAT_CNTRS) ++ if (qidx >= RTE_ETHDEV_QUEUE_STAT_CNTRS) + break; + + nicvf_hw_get_rx_qstats(nic, &rx_qstats, qidx); +@@ -271,7 +271,7 @@ nicvf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) + + /* Reading per TX ring stats */ + for (qidx = tx_start; qidx <= tx_end; qidx++) { +- if (qidx == RTE_ETHDEV_QUEUE_STAT_CNTRS) ++ if (qidx >= RTE_ETHDEV_QUEUE_STAT_CNTRS) + break; + + nicvf_hw_get_tx_qstats(nic, &tx_qstats, qidx); +@@ -290,7 +290,7 @@ nicvf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) + + /* Reading per RX ring stats */ + for (qidx = rx_start; qidx <= rx_end; qidx++) { +- if (qidx == RTE_ETHDEV_QUEUE_STAT_CNTRS) ++ if (qidx >= RTE_ETHDEV_QUEUE_STAT_CNTRS) + break; + + nicvf_hw_get_rx_qstats(snic, &rx_qstats, +@@ -303,7 +303,7 @@ nicvf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) + nicvf_tx_range(dev, snic, &tx_start, &tx_end); + /* Reading per TX ring stats */ + for (qidx = tx_start; qidx <= tx_end; qidx++) { +- if (qidx == RTE_ETHDEV_QUEUE_STAT_CNTRS) ++ if (qidx >= RTE_ETHDEV_QUEUE_STAT_CNTRS) + break; + + nicvf_hw_get_tx_qstats(snic, &tx_qstats, +-- +2.7.4 + diff --git a/debian/patches/nicvf-0009-config-set-cache-line-as-128B-for-generic-arm64.patch b/debian/patches/nicvf-0009-config-set-cache-line-as-128B-for-generic-arm64.patch new file mode 100644 index 00000000..95e02d03 --- /dev/null +++ b/debian/patches/nicvf-0009-config-set-cache-line-as-128B-for-generic-arm64.patch @@ -0,0 +1,65 @@ +From 852572d5db26d1d7d9021648740d9f2e0c4503c1 Mon Sep 17 00:00:00 2001 +From: Jerin Jacob +Date: Wed, 26 Apr 2017 21:59:19 +0530 +Subject: [PATCH] config: set cache line as 128B for generic arm64 + +armv8 implementations may have 64B or 128B cache line. +Setting to the maximum available cache line size in generic config to +address minimum DMA alignment across all arm64 implementations. + +Increasing the cacheline size has no negative impact to cache invalidation +on systems with a smaller cache line. + +The need for the minimum DMA alignment has impact on functional aspects +of the platform so default config should cater the functional aspects. + +There is an impact on memory usage with this scheme, but that's not too +important for the single image arm64 distribution use case. + +The arm64 linux kernel followed the similar approach for single +arm64 image use case. +http://lxr.free-electrons.com/source/arch/arm64/include/asm/cache.h + +Signed-off-by: Jerin Jacob +Acked-by: Jianbo Liu +Acked-by: Santosh Shukla +--- + config/defconfig_arm64-armv8a-linuxapp-gcc | 5 +++++ + config/defconfig_arm64-dpaa2-linuxapp-gcc | 1 + + config/defconfig_arm64-xgene1-linuxapp-gcc | 1 + + 3 files changed, 7 insertions(+) + +Origin: http://dpdk.org/browse/dpdk/commit/?id=852572d5db26d1d7d9021648740d9f2e0c4503c1 +Original-Author: Jerin Jacob +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/dpdk/+bug/1691659 +Author: Christian Ehrhardt +Last-Update: 2017-05-18 + +--- a/config/defconfig_arm64-armv8a-linuxapp-gcc ++++ b/config/defconfig_arm64-armv8a-linuxapp-gcc +@@ -42,6 +42,11 @@ + CONFIG_RTE_TOOLCHAIN="gcc" + CONFIG_RTE_TOOLCHAIN_GCC=y + ++# Maximum available cache line size in arm64 implementations. ++# Setting to maximum available cache line size in generic config ++# to address minimum DMA alignment across all arm64 implementations. ++CONFIG_RTE_CACHE_LINE_SIZE=128 ++ + CONFIG_RTE_EAL_IGB_UIO=n + + CONFIG_RTE_LIBRTE_FM10K_PMD=n +--- a/config/defconfig_arm64-dpaa2-linuxapp-gcc ++++ b/config/defconfig_arm64-dpaa2-linuxapp-gcc +@@ -40,3 +40,4 @@ + # + CONFIG_RTE_MAX_LCORE=8 + CONFIG_RTE_MAX_NUMA_NODES=1 ++CONFIG_RTE_CACHE_LINE_SIZE=64 +--- a/config/defconfig_arm64-xgene1-linuxapp-gcc ++++ b/config/defconfig_arm64-xgene1-linuxapp-gcc +@@ -32,3 +32,4 @@ + #include "defconfig_arm64-armv8a-linuxapp-gcc" + + CONFIG_RTE_MACHINE="xgene1" ++CONFIG_RTE_CACHE_LINE_SIZE=64 diff --git a/debian/patches/nicvf-0010-net-thunderx-fix-deadlock-in-Rx-path.patch b/debian/patches/nicvf-0010-net-thunderx-fix-deadlock-in-Rx-path.patch new file mode 100644 index 00000000..8773671b --- /dev/null +++ b/debian/patches/nicvf-0010-net-thunderx-fix-deadlock-in-Rx-path.patch @@ -0,0 +1,58 @@ +From b31eb105463fa1844c19fde382dd6bd294329831 Mon Sep 17 00:00:00 2001 +From: Jerin Jacob +Date: Tue, 2 May 2017 00:11:55 +0530 +Subject: [PATCH] net/thunderx: fix deadlock in Rx path + +RBDR buffers are refilled when SW consumes the buffers from CQ. +This creates deadlock case when CQ buffers exhausted due to lack +of RBDR buffers. Fix is to refill the RBDR when rx_free_thresh +meet, irrespective of the number of CQ buffers consumed. + +Fixes: e2d7fc9f0a24 ("net/thunderx: add single and multi-segment Rx") +Cc: stable@dpdk.org + +Signed-off-by: Jerin Jacob +--- + drivers/net/thunderx/nicvf_rxtx.c | 18 ++++++++---------- + 1 file changed, 8 insertions(+), 10 deletions(-) + +Origin: http://dpdk.org/browse/dpdk/commit/?id=b31eb105463fa1844c19fde382dd6bd294329831 +Original-Author: Jerin Jacob +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/dpdk/+bug/1691659 +Author: Christian Ehrhardt +Last-Update: 2017-05-18 + +--- a/drivers/net/thunderx/nicvf_rxtx.c ++++ b/drivers/net/thunderx/nicvf_rxtx.c +@@ -469,11 +469,10 @@ + rxq->head = cqe_head; + nicvf_addr_write(rxq->cq_door, to_process); + rxq->recv_buffers += to_process; +- if (rxq->recv_buffers > rxq->rx_free_thresh) { +- rxq->recv_buffers -= nicvf_fill_rbdr(rxq, +- rxq->rx_free_thresh); +- NICVF_RX_ASSERT(rxq->recv_buffers >= 0); +- } ++ } ++ if (rxq->recv_buffers > rxq->rx_free_thresh) { ++ rxq->recv_buffers -= nicvf_fill_rbdr(rxq, rxq->rx_free_thresh); ++ NICVF_RX_ASSERT(rxq->recv_buffers >= 0); + } + + return to_process; +@@ -563,11 +562,10 @@ + rxq->head = cqe_head; + nicvf_addr_write(rxq->cq_door, to_process); + rxq->recv_buffers += buffers_consumed; +- if (rxq->recv_buffers > rxq->rx_free_thresh) { +- rxq->recv_buffers -= +- nicvf_fill_rbdr(rxq, rxq->rx_free_thresh); +- NICVF_RX_ASSERT(rxq->recv_buffers >= 0); +- } ++ } ++ if (rxq->recv_buffers > rxq->rx_free_thresh) { ++ rxq->recv_buffers -= nicvf_fill_rbdr(rxq, rxq->rx_free_thresh); ++ NICVF_RX_ASSERT(rxq->recv_buffers >= 0); + } + + return to_process; diff --git a/debian/patches/series b/debian/patches/series index a8f48505..89f11d64 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -2,3 +2,13 @@ fix-vhost-user-socket-permission.patch fix-power-default-config.patch dpdk-dev-v3-eal-sPAPR-IOMMU-support-in-pci-probing-for-vfio-pci-in-ppc64le.patch dpdk-dev-v4-i40e-implement-vector-PMD-for-altivec.patch +nicvf-0001-net-thunderx-check-data-offset-alignment-requirement.patch +nicvf-0002-net-thunderx-fix-32-bit-build.patch +nicvf-0003-config-enable-thunderx-nicvf.patch +nicvf-0004-net-thunderx-sync-mailbox-definitions-with-Linux-PF-.patch +nicvf-0005-net-thunderx-wait-to-complete-during-link-update.patch +nicvf-0006-mk-fix-lib-filtering-when-linking-app.patch +nicvf-0007-net-thunderx-disable-PMD-for-old-compilers.patch +nicvf-0008-net-thunderx-fix-stats-access-out-of-bounds.patch +nicvf-0009-config-set-cache-line-as-128B-for-generic-arm64.patch +nicvf-0010-net-thunderx-fix-deadlock-in-Rx-path.patch -- cgit 1.2.3-korg From ec141109a4e206343802e8c84220f31d9536732b Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Fri, 19 May 2017 09:06:45 +0200 Subject: changelog: Add thunderx (LP: #1691659) Change-Id: I1a2d87d645a3375a9db1e6bf6926d37bdb420a9a Signed-off-by: Christian Ehrhardt --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index 7957c454..d1a13d4a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,6 +16,8 @@ dpdk (16.11.1-1~git1) UNRELEASED; urgency=medium - librte-kni is built on ppc64el, fix dependency from libdpdk-dev - librte-pmd-fm10k1 is not built on ppc64el (empty pkg atm) adapt arch - librte-pmd-i40e is built on all architectures now + * Fix up thunderx to make arm support useful on more devices (LP: #1691659) + - d/p/nicvf-00[01-10]* backports of 17.02/17.05 fixes for thunderx [ Luca Boccassi ] * Simplify debian/rules by using upstream's install target -- cgit 1.2.3-korg From 631014b0296cfeaaabfd474cad5f3f46b3deef7a Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 18 May 2017 13:36:36 +0200 Subject: d/control deps and pkg for thunderx Change-Id: Iee2c9d08e1eea34735a9b2302317bc1c8a283f48 Signed-off-by: Christian Ehrhardt --- debian/control | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/debian/control b/debian/control index 1d75a9e8..7808f6da 100644 --- a/debian/control +++ b/debian/control @@ -52,6 +52,7 @@ Recommends: dpdk-igb-uio-dkms (= ${binary:Version}) [arm64], librte-pmd-pcap1 (= ${binary:Version}), librte-pmd-qede1 (= ${binary:Version}), librte-pmd-ring2 (= ${binary:Version}), + librte-pmd-thunderx-nicvf1 (= ${binary:Version}), librte-pmd-vhost1 (= ${binary:Version}), librte-pmd-virtio1 (= ${binary:Version}), librte-pmd-vmxnet3-uio1 (= ${binary:Version}) [amd64 arm64 i386], @@ -159,6 +160,7 @@ Depends: libpcap-dev, librte-pmd-pcap1 (= ${binary:Version}), librte-pmd-qede1 (= ${binary:Version}), librte-pmd-ring2 (= ${binary:Version}), + librte-pmd-thunderx-nicvf1 (= ${binary:Version}), librte-pmd-vhost1 (= ${binary:Version}), librte-pmd-virtio1 (= ${binary:Version}), librte-pmd-vmxnet3-uio1 (= ${binary:Version}) [amd64 arm64 i386], @@ -783,6 +785,18 @@ Description: Data Plane Development Kit (librte_pdump runtime library) . This package contains the runtime libraries for librte_pdump. +Package: librte-pmd-thunderx-nicvf1 +Architecture: amd64 arm64 i386 ppc64el +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Conflicts: libdpdk +Description: Data Plane Development Kit (librte_pmd_thunderx_nicvf runtime library) + DPDK is a set of libraries for fast packet processing. Applications run + in user-space and communicate directly with dedicated network interfaces. + . + This package contains the runtime libraries for librte_pmd_thunderx_nicvf. + # All following packages are for ABI compatibility to older releases. # Newer DPDK versions are ABI compatible to older ones for at least one release # and more if maintainable. -- cgit 1.2.3-korg From 7cc28b8bf51333b7dba2e3003435a986b67c0fab Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 18 May 2017 15:29:09 +0200 Subject: changelog: d/control deps and pkg for thunderx Change-Id: Id909be3ec1ee7d95083cbeca9406ccfd63f3ba0c Signed-off-by: Christian Ehrhardt --- debian/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/changelog b/debian/changelog index d1a13d4a..7fdb353f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,6 +18,7 @@ dpdk (16.11.1-1~git1) UNRELEASED; urgency=medium - librte-pmd-i40e is built on all architectures now * Fix up thunderx to make arm support useful on more devices (LP: #1691659) - d/p/nicvf-00[01-10]* backports of 17.02/17.05 fixes for thunderx + - d/control: dependencies and package for librte-pmd-thunderx-nicvf [ Luca Boccassi ] * Simplify debian/rules by using upstream's install target -- cgit 1.2.3-korg From 6556806d3c558386b2ed8dcfbf3f9d1ac28155fa Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 18 May 2017 13:37:18 +0200 Subject: thunderx symbols Change-Id: Ide7f7f3785eb3f25cd6347003678825d64415bc9 Signed-off-by: Christian Ehrhardt --- debian/librte-pmd-thunderx-nicvf1.symbols | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 debian/librte-pmd-thunderx-nicvf1.symbols diff --git a/debian/librte-pmd-thunderx-nicvf1.symbols b/debian/librte-pmd-thunderx-nicvf1.symbols new file mode 100644 index 00000000..eab82e46 --- /dev/null +++ b/debian/librte-pmd-thunderx-nicvf1.symbols @@ -0,0 +1,5 @@ +librte_pmd_thunderx_nicvf.so.1 librte-pmd-thunderx-nicvf1 #MINVER# +# was not built before 16.11 plus updates + DPDK_16.07@DPDK_16.07 16.11 +# INFO: this library exports no symbols, essentially it is a driver that +# registers itself on load and is then only driven by callbacks. -- cgit 1.2.3-korg From c6c543c9fd66fa40f92d6648c7fbeda4bf626c0a Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 18 May 2017 15:29:35 +0200 Subject: changelog: thunderx symbols Change-Id: Ic1aa2dcfd2b3aef1c89f0d33cfd65ff466fa1c04 Signed-off-by: Christian Ehrhardt --- debian/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/changelog b/debian/changelog index 7fdb353f..c571811c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,6 +19,7 @@ dpdk (16.11.1-1~git1) UNRELEASED; urgency=medium * Fix up thunderx to make arm support useful on more devices (LP: #1691659) - d/p/nicvf-00[01-10]* backports of 17.02/17.05 fixes for thunderx - d/control: dependencies and package for librte-pmd-thunderx-nicvf + - d/librte-pmd-thunderx-nicvf1.symbols: tracking library symbols [ Luca Boccassi ] * Simplify debian/rules by using upstream's install target -- cgit 1.2.3-korg From 8e0c599390561feb8b4ea639c2182e9e130fd7b7 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Fri, 19 May 2017 07:39:46 +0200 Subject: fix dkms issues on 4.11 (LP: #1691830) Change-Id: I5b22aa085d3172a294806b62158f0949ef574789 Signed-off-by: Christian Ehrhardt --- .../patches/kni-fix-build-with-kernel-4.11.patch | 82 ++++++++++++++++++++++ .../kni-fix-ethtool-build-with-kernel-4.11.patch | 65 +++++++++++++++++ debian/patches/series | 2 + 3 files changed, 149 insertions(+) create mode 100644 debian/patches/kni-fix-build-with-kernel-4.11.patch create mode 100644 debian/patches/kni-fix-ethtool-build-with-kernel-4.11.patch diff --git a/debian/patches/kni-fix-build-with-kernel-4.11.patch b/debian/patches/kni-fix-build-with-kernel-4.11.patch new file mode 100644 index 00000000..73dfe51d --- /dev/null +++ b/debian/patches/kni-fix-build-with-kernel-4.11.patch @@ -0,0 +1,82 @@ +From d4d2380cbb02980bf0334601d9ce6ec5400413f9 Mon Sep 17 00:00:00 2001 +From: Ferruh Yigit +Date: Tue, 21 Mar 2017 09:54:48 +0000 +Subject: [PATCH] kni: fix build with kernel 4.11 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +compile error: +.../build/build/lib/librte_eal/linuxapp/kni/kni_net.c:124:6: +error: implicit declaration of function ‘signal_pending’ +[-Werror=implicit-function-declaration] + if (signal_pending(current) || ret_val <= 0) { + ^~~~~~~~~~~~~~ + +Linux 4.11 moves signal function declarations to its own header file: +Linux: 174cd4b1e5fb ("sched/headers: Prepare to move signal wakeup & +sigpending methods from into ") + +Use new header file "linux/sched/signal.h" to fix the build error. + +Cc: stable@dpdk.org + +Reported-by: Jerin Jacob +Signed-off-by: Ferruh Yigit +Tested-by: Jerin Jacob +Tested-by: Pankaj Gupta +--- + lib/librte_eal/linuxapp/kni/compat.h | 6 ++++++ + lib/librte_eal/linuxapp/kni/kni_dev.h | 6 ++++++ + 2 files changed, 12 insertions(+) + +Origin: http://dpdk.org/browse/dpdk/commit/?id=d4d2380cbb02980bf0334601d9ce6ec5400413f9 +Original-Author: Ferruh Yigit +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/dpdk/+bug/1691830 +Author: Christian Ehrhardt +Last-Update: 2017-05-19 + +diff --git a/lib/librte_eal/linuxapp/kni/compat.h b/lib/librte_eal/linuxapp/kni/compat.h +index 78da08e..d96275a 100644 +--- a/lib/librte_eal/linuxapp/kni/compat.h ++++ b/lib/librte_eal/linuxapp/kni/compat.h +@@ -2,6 +2,8 @@ + * Minimal wrappers to allow compiling kni on older kernels. + */ + ++#include ++ + #ifndef RHEL_RELEASE_VERSION + #define RHEL_RELEASE_VERSION(a, b) (((a) << 8) + (b)) + #endif +@@ -67,3 +69,7 @@ + (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34))) + #undef NET_NAME_UNKNOWN + #endif ++ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) ++#define HAVE_SIGNAL_FUNCTIONS_OWN_HEADER ++#endif +diff --git a/lib/librte_eal/linuxapp/kni/kni_dev.h b/lib/librte_eal/linuxapp/kni/kni_dev.h +index 002e5fa..72385ab 100644 +--- a/lib/librte_eal/linuxapp/kni/kni_dev.h ++++ b/lib/librte_eal/linuxapp/kni/kni_dev.h +@@ -30,9 +30,15 @@ + #endif + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include "compat.h" ++ + #include + #include ++#ifdef HAVE_SIGNAL_FUNCTIONS_OWN_HEADER ++#include ++#else + #include ++#endif + #include + #include + #include +-- +2.7.4 + diff --git a/debian/patches/kni-fix-ethtool-build-with-kernel-4.11.patch b/debian/patches/kni-fix-ethtool-build-with-kernel-4.11.patch new file mode 100644 index 00000000..cd8c21be --- /dev/null +++ b/debian/patches/kni-fix-ethtool-build-with-kernel-4.11.patch @@ -0,0 +1,65 @@ +From 9fb3cd2c041eeca30b6c46e5d555d857d6096ae7 Mon Sep 17 00:00:00 2001 +From: Ferruh Yigit +Date: Wed, 3 May 2017 17:00:16 +0100 +Subject: [PATCH] kni: fix ethtool build with kernel 4.11 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +build error: +.../lib/librte_eal/linuxapp/kni/igb_main.c:1034:10: +error: implicit declaration of function ‘pci_enable_msix’ + err = pci_enable_msix(pdev, + ^~~~~~~~~~~~~~~ + +This build error observed when CONFIG_RTE_KNI_KMOD_ETHTOOL config option +enabled. + +Following Linux commit removes the pci_enable_msix() +Linux: 4244de1c64de ("PCI: remove pci_enable_msix") + +Switch to pci_enable_msix_range() for kernel > 4.8 since current Linux +igb driver uses this function. + +Signed-off-by: Ferruh Yigit +Acked-by: Nicolas Dichtel +--- + lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 7 +++++++ + lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 4 ++++ + 2 files changed, 11 insertions(+) + +Origin: http://dpdk.org/browse/dpdk/commit/?id=9fb3cd2c041eeca30b6c46e5d555d857d6096ae7 +Original-Author: Ferruh Yigit +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/dpdk/+bug/1691830 +Author: Christian Ehrhardt +Last-Update: 2017-05-19 + +--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c ++++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c +@@ -1031,8 +1031,15 @@ + for (i = 0; i < numvecs; i++) + adapter->msix_entries[i].entry = i; + ++#ifdef HAVE_PCI_ENABLE_MSIX + err = pci_enable_msix(pdev, + adapter->msix_entries, numvecs); ++#else ++ err = pci_enable_msix_range(pdev, ++ adapter->msix_entries, ++ numvecs, ++ numvecs); ++#endif + if (err == 0) + break; + } +--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h ++++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h +@@ -3933,4 +3933,8 @@ + #define HAVE_VF_VLAN_PROTO + #endif /* >= 4.9.0 */ + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0) ++#define HAVE_PCI_ENABLE_MSIX ++#endif ++ + #endif /* _KCOMPAT_H_ */ diff --git a/debian/patches/series b/debian/patches/series index 89f11d64..878e9259 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -12,3 +12,5 @@ nicvf-0007-net-thunderx-disable-PMD-for-old-compilers.patch nicvf-0008-net-thunderx-fix-stats-access-out-of-bounds.patch nicvf-0009-config-set-cache-line-as-128B-for-generic-arm64.patch nicvf-0010-net-thunderx-fix-deadlock-in-Rx-path.patch +kni-fix-build-with-kernel-4.11.patch +kni-fix-ethtool-build-with-kernel-4.11.patch -- cgit 1.2.3-korg From 7d7841c29e4c6a9a8e590448134d7d893778c325 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Fri, 19 May 2017 07:41:25 +0200 Subject: changelog: fix dkms issues on 4.11 (LP: #1691830) Change-Id: Ia523427abeb54027a6d923c51a30822e2dfd6a7c Signed-off-by: Christian Ehrhardt --- debian/changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index c571811c..5040a565 100644 --- a/debian/changelog +++ b/debian/changelog @@ -20,6 +20,9 @@ dpdk (16.11.1-1~git1) UNRELEASED; urgency=medium - d/p/nicvf-00[01-10]* backports of 17.02/17.05 fixes for thunderx - d/control: dependencies and package for librte-pmd-thunderx-nicvf - d/librte-pmd-thunderx-nicvf1.symbols: tracking library symbols + * fix dpdk-rte-kni dkms issues with kernel 4.11 (LP: #1691830) + - d/p/kni-fix-build-with-kernel-4.11.patch: fix pci_enable_msix usage + - d/p/kni-fix-ethtool-build-with-kernel-4.11.patch: Use new signal header [ Luca Boccassi ] * Simplify debian/rules by using upstream's install target -- cgit 1.2.3-korg From bfc76e8a86292e59f442aba7d3cdb1510a652608 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Fri, 19 May 2017 08:54:41 +0200 Subject: debian/control: remove arm64 dkms recommends This was meant when arm64 absolutely required the dkms modules to work. But there are platforms which can work without now. We already have a arch neutral suggests, so no need to replace this. Given the complexity dkms sometimes brings on e.g. kernel updates dropping the recommends helps more systems (by avoiding those issues) than it hurts (by users of those needing it installing the dkms packages) Change-Id: I99a060092d685a8cb87db6d0259e4ab18a823d7e Signed-off-by: Christian Ehrhardt --- debian/control | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/debian/control b/debian/control index 7808f6da..e769ba30 100644 --- a/debian/control +++ b/debian/control @@ -35,9 +35,7 @@ Depends: hwdata, ${misc:Depends}, ${python:Depends}, ${shlibs:Depends} -Recommends: dpdk-igb-uio-dkms (= ${binary:Version}) [arm64], - dpdk-rte-kni-dkms (= ${binary:Version}) [arm64], - librte-pmd-af-packet1 (= ${binary:Version}), +Recommends: librte-pmd-af-packet1 (= ${binary:Version}), librte-pmd-bnxt1 (= ${binary:Version}), librte-pmd-bond1 (= ${binary:Version}), librte-pmd-cxgbe1 (= ${binary:Version}), -- cgit 1.2.3-korg From 784bf02aa60bcb6db6cdc57af06a0ec4e6c8add8 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Fri, 19 May 2017 10:48:43 +0200 Subject: debian/rules: fix man pages on non-x86 These were built only in the arch indep, and therefore usually x86 only. Due to that dh:_installman only picked it up there. Move the make target to the binary section, so that the man pages will be packaged along the executables. Update in v2 - keep it in the BUILD_DOC wrapper to be able to skip it with nodoc build option. Change-Id: I6aa6f2d78014de7764b6a8804711570b0194f66d Signed-off-by: Christian Ehrhardt --- debian/rules | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index 3a4b3197..b2a059ad 100755 --- a/debian/rules +++ b/debian/rules @@ -172,8 +172,7 @@ endif override_dh_auto_build-indep: ifeq (y,$(BUILD_DOCS)) - $(MAKE) -j $(PAR) V=$(DH_VERBOSE) O=$(DPDK_STATIC_DIR) doc-api-html doc-guides-html \ - doc-guides-man + $(MAKE) -j $(PAR) V=$(DH_VERBOSE) O=$(DPDK_STATIC_DIR) doc-api-html doc-guides-html endif override_dh_auto_install-indep: @@ -201,6 +200,10 @@ endif sed -ri 's,(RTE_BUILD_SHARED_LIB=).*,\1y,' \ $(DPDK_SHARED_DIR)/.config $(MAKE) -j $(PAR) V=$(DH_VERBOSE) O=$(DPDK_SHARED_DIR) RTE_KERNELDIR=$(KSRC) build +ifeq (y,$(BUILD_DOCS)) + # need to be around for dh_installman to be picked up + $(MAKE) -j $(PAR) V=$(DH_VERBOSE) O=$(DPDK_SHARED_DIR) RTE_KERNELDIR=$(KSRC) doc-guides-man +endif override_dh_auto_install-arch: LIBDIR=/usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH) override_dh_auto_install-arch: -- cgit 1.2.3-korg From 620d3642469706d7649c5505484406bd614468e1 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Fri, 19 May 2017 10:48:56 +0200 Subject: changelog: fix man pages on non-x86 Change-Id: I4ecd2957e01f9017b0a3f2aa46e67856a3978cd2 Signed-off-by: Christian Ehrhardt --- debian/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/changelog b/debian/changelog index 5040a565..6f554e51 100644 --- a/debian/changelog +++ b/debian/changelog @@ -23,6 +23,7 @@ dpdk (16.11.1-1~git1) UNRELEASED; urgency=medium * fix dpdk-rte-kni dkms issues with kernel 4.11 (LP: #1691830) - d/p/kni-fix-build-with-kernel-4.11.patch: fix pci_enable_msix usage - d/p/kni-fix-ethtool-build-with-kernel-4.11.patch: Use new signal header + * ensure man pages are bundled with executables on all architectures [ Luca Boccassi ] * Simplify debian/rules by using upstream's install target -- cgit 1.2.3-korg From 499849a5cc8a1723500e41206e7d369297c1b36b Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Tue, 23 May 2017 12:17:55 +0200 Subject: d/p/fix-vhost-user-socket-permission update ovs Fix to work with newer openvswitch versions. Change-Id: Iaa10e90611b9cd2cee45328a2cce4bfb1efcbdb2 Signed-off-by: Christian Ehrhardt --- .../patches/fix-vhost-user-socket-permission.patch | 138 +++++++++++---------- 1 file changed, 74 insertions(+), 64 deletions(-) diff --git a/debian/patches/fix-vhost-user-socket-permission.patch b/debian/patches/fix-vhost-user-socket-permission.patch index 1978ac2d..7cd188c5 100644 --- a/debian/patches/fix-vhost-user-socket-permission.patch +++ b/debian/patches/fix-vhost-user-socket-permission.patch @@ -25,9 +25,17 @@ Fixes LP: #1546565 So over time we have to check when we can drop it at the price of a config transition - likely OVS 2.6 won't need it anymore. +*Update* + - the handling and lifecycle of this changed in Openvswitch 2.7 so we can no + more use internal_config. + - Also the upstreaming was aborted as that now clearly goes towards client + mode vhost sockets for this (and other issues). + - But until that is fully working we have to carry the workaround. + - Updated to work with Openvswitch 2.7 (and backward compatible to 2.6) + Forwarded: yes Author: Christian Ehrhardt -Last-Update: 2016-09-28 +Last-Update: 2017-05-23 --- a/doc/guides/testpmd_app_ug/run_app.rst +++ b/doc/guides/testpmd_app_ug/run_app.rst @@ -68,26 +76,6 @@ Last-Update: 2016-09-28 {0, 0, NULL, 0 } }; -@@ -166,6 +168,8 @@ - #endif - internal_cfg->vmware_tsc_map = 0; - internal_cfg->create_uio_dev = 0; -+ internal_cfg->vhost_sock_owner = NULL; -+ internal_cfg->vhost_sock_perm = NULL; - } - - static int ---- a/lib/librte_eal/common/eal_internal_cfg.h -+++ b/lib/librte_eal/common/eal_internal_cfg.h -@@ -83,6 +83,8 @@ - volatile enum rte_intr_mode vfio_intr_mode; - const char *hugefile_prefix; /**< the base filename of hugetlbfs files */ - const char *hugepage_dir; /**< specific hugetlbfs directory to use */ -+ const char *vhost_sock_owner; /**< owner:group of vhost_user sockets */ -+ const char *vhost_sock_perm; /**< permissions of vhost_user sockets */ - - unsigned num_hugepage_sizes; /**< how many sizes on this system */ - struct hugepage_info hugepage_info[MAX_HUGEPAGE_SIZES]; --- a/lib/librte_eal/common/eal_options.h +++ b/lib/librte_eal/common/eal_options.h @@ -83,6 +83,10 @@ @@ -127,7 +115,20 @@ Last-Update: 2016-09-28 #include #include -@@ -354,6 +357,8 @@ +@@ -117,6 +120,12 @@ + /* internal configuration */ + struct internal_config internal_config; + ++/* workaround to be able to create the sockets under a certain set of ++ * owner/permissions as specified to EAL until solved upstream */ ++static uid_t debian_vhost_sock_uid = (uid_t)-1; ++static gid_t debian_vhost_sock_gid = (gid_t)-1; ++static mode_t debian_vhost_sock_perm = 0; ++ + /* used by rte_rdtsc() */ + int rte_cycles_vmware_tsc_map; + +@@ -354,6 +363,8 @@ " --"OPT_CREATE_UIO_DEV" Create /dev/uioX (usually done by hotplug)\n" " --"OPT_VFIO_INTR" Interrupt mode for VFIO (legacy|msi|msix)\n" " --"OPT_XEN_DOM0" Support running on Xen dom0 without hugetlbfs\n" @@ -136,26 +137,10 @@ Last-Update: 2016-09-28 "\n"); /* Allow the application to print its usage message too if hook is set */ if ( rte_application_usage_hook ) { -@@ -611,6 +616,14 @@ - internal_config.create_uio_dev = 1; - break; - -+ case OPT_VHOST_OWNER_NUM: -+ internal_config.vhost_sock_owner = optarg; -+ break; -+ -+ case OPT_VHOST_PERM_NUM: -+ internal_config.vhost_sock_perm = optarg; -+ break; -+ - default: - if (opt < OPT_LONG_MIN_NUM && isprint(opt)) { - RTE_LOG(ERR, EAL, "Option %c is not supported " -@@ -943,3 +956,172 @@ - /* Module has been found */ - return 1; +@@ -515,6 +526,121 @@ + optarg = old_optarg; } -+ + +/* Try to double the size of '*buf', return true + * if successful, and '*sizep' will be updated with + * the new size. Otherwise, return false. */ @@ -270,57 +255,82 @@ Last-Update: 2016-09-28 + free(user_search); + return e; +} ++ + /* Parse the argument given in the command line of the application */ + static int + eal_parse_args(int argc, char **argv) +@@ -611,6 +737,26 @@ + internal_config.create_uio_dev = 1; + break; + ++ case OPT_VHOST_OWNER_NUM: ++ if (get_owners_from_str(optarg, &debian_vhost_sock_uid, ++ &debian_vhost_sock_gid)) { ++ RTE_LOG(ERR, EAL,"vhost-user socket unable to get" ++ " specified user/group: %s\n", optarg); ++ debian_vhost_sock_uid = (uid_t)-1; ++ debian_vhost_sock_gid = (gid_t)-1; ++ } ++ else { ++ RTE_LOG(INFO, EAL,"socket owner specified as %s (%d:%d)\n", ++ optarg, debian_vhost_sock_uid, debian_vhost_sock_gid); ++ } ++ break; ++ ++ case OPT_VHOST_PERM_NUM: ++ debian_vhost_sock_perm = (mode_t)strtoul(optarg, NULL, 0); ++ RTE_LOG(INFO, EAL,"socket perm specified as '%#o' from '%s'\n", ++ debian_vhost_sock_perm, optarg); ++ break; ++ + default: + if (opt < OPT_LONG_MIN_NUM && isprint(opt)) { + RTE_LOG(ERR, EAL, "Option %c is not supported " +@@ -943,3 +1089,47 @@ + /* Module has been found */ + return 1; + } + +static void +vhost_set_permissions(const char *vhost_sock_location) +{ -+ unsigned long int mode = strtoul(internal_config.vhost_sock_perm, NULL, 0); -+ int err = chmod(vhost_sock_location, (mode_t)mode); ++ int err = chmod(vhost_sock_location, debian_vhost_sock_perm); + if (err) { + RTE_LOG(ERR, EAL,"vhost-user socket cannot set" -+ " permissions to %s (%s).\n", -+ internal_config.vhost_sock_perm, strerror(err)); ++ " permissions to %#o (%s).\n", ++ debian_vhost_sock_perm, strerror(err)); + return; + } + RTE_LOG(INFO, EAL,"Socket %s changed permissions" -+ " to %s\n", vhost_sock_location, -+ internal_config.vhost_sock_perm); ++ " to %#o\n", vhost_sock_location, ++ debian_vhost_sock_perm); +} + +static void +vhost_set_ownership(const char *vhost_sock_location) +{ -+ uid_t vhuid=0; -+ gid_t vhgid=0; -+ -+ if (get_owners_from_str(internal_config.vhost_sock_owner, &vhuid, &vhgid)) { -+ RTE_LOG(ERR, EAL,"vhost-user socket unable to get" -+ " specified user/group: %s\n", -+ internal_config.vhost_sock_owner); -+ return; -+ } -+ -+ int err = chown(vhost_sock_location, vhuid, vhgid); ++ int err = chown(vhost_sock_location, debian_vhost_sock_uid, debian_vhost_sock_gid); + if (err) { + RTE_LOG(ERR, EAL,"vhost-user socket unable to set" -+ " ownership to %s (%s).\n", -+ internal_config.vhost_sock_owner, strerror(err)); ++ " ownership to %d:%d (%s).\n", ++ debian_vhost_sock_uid, debian_vhost_sock_gid, ++ strerror(err)); + return; + } + + RTE_LOG(INFO, EAL,"Socket %s changed ownership" -+ " to %s.\n", vhost_sock_location, -+ internal_config.vhost_sock_owner); ++ " to %d:%d.\n", vhost_sock_location, ++ debian_vhost_sock_uid, debian_vhost_sock_gid); +} + +void +rte_eal_set_socket_permissions(const char *path) +{ -+ if (internal_config.vhost_sock_perm) { ++ if (debian_vhost_sock_perm != 0) { + vhost_set_permissions(path); + } + -+ if (internal_config.vhost_sock_owner) { ++ if (debian_vhost_sock_uid != (uid_t)-1 || debian_vhost_sock_gid != (gid_t)-1) { + vhost_set_ownership(path); + } +} -- cgit 1.2.3-korg From a1010a65a23be30d1a1d1d369ff47f8abce391f5 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Wed, 24 May 2017 07:47:41 +0200 Subject: changelog: d/p/fix-vhost-user-socket-permission Changelog entry to the update to d/p/fix-vhost-user-socket-permission to work with newer openvswitch versions. Change-Id: I7705fab315897806763a5897a1c5deaf69651cb4 Signed-off-by: Christian Ehrhardt --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index 6f554e51..b1deb76f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -24,6 +24,8 @@ dpdk (16.11.1-1~git1) UNRELEASED; urgency=medium - d/p/kni-fix-build-with-kernel-4.11.patch: fix pci_enable_msix usage - d/p/kni-fix-ethtool-build-with-kernel-4.11.patch: Use new signal header * ensure man pages are bundled with executables on all architectures + * d/p/fix-vhost-user-socket-permission.patch: updated to work with newer + openvswitch versions [ Luca Boccassi ] * Simplify debian/rules by using upstream's install target -- cgit 1.2.3-korg From 8686692a718455cac01a0f78081ff8fb2193afe7 Mon Sep 17 00:00:00 2001 From: Santiago Date: Tue, 30 May 2017 09:51:23 +0200 Subject: debian/control: fix compatbility typo Change-Id: I2095f6f1292d40ead117a4d22a1dffcfa0c18b7a Gbp-Dch: Ignore Signed-off-by: Santiago --- debian/control | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/control b/debian/control index e769ba30..c842e77b 100644 --- a/debian/control +++ b/debian/control @@ -826,7 +826,7 @@ Description: Data Plane Development Kit (libethdev runtime library) DPDK is a set of libraries for fast packet processing. Applications run in user-space and communicate directly with dedicated network interfaces. . - This package contains an ABI compatbility link for an older version of the + This package contains an ABI compatibility link for an older version of the runtime libraries for libethdev. Package: librte-cryptodev1 @@ -840,7 +840,7 @@ Description: Data Plane Development Kit (librte-cryptodev runtime library) DPDK is a set of libraries for fast packet processing. Applications run in user-space and communicate directly with dedicated network interfaces. . - This package contains an ABI compatbility link for an older version of the + This package contains an ABI compatibility link for an older version of the the runtime libraries for librte_cryptodev. Package: librte-eal2 @@ -854,6 +854,6 @@ Description: Data Plane Development Kit (librte-eal runtime library) DPDK is a set of libraries for fast packet processing. Applications run in user-space and communicate directly with dedicated network interfaces. . - This package contains an ABI compatbility link for an older version of the + This package contains an ABI compatibility link for an older version of the runtime libraries for librte_eal. -- cgit 1.2.3-korg From 5f6021664aa3edf36ab7f37378c032a86bb655b2 Mon Sep 17 00:00:00 2001 From: Santiago Date: Tue, 30 May 2017 13:18:48 +0200 Subject: debian/control: remove duplicated 'the' Change-Id: I77feaaa5dfbb5cd3d1a8397dd6542192af17d46d Gbp-Dch: Ignore Signed-off-by: Santiago --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index c842e77b..9a135064 100644 --- a/debian/control +++ b/debian/control @@ -841,7 +841,7 @@ Description: Data Plane Development Kit (librte-cryptodev runtime library) in user-space and communicate directly with dedicated network interfaces. . This package contains an ABI compatibility link for an older version of the - the runtime libraries for librte_cryptodev. + runtime libraries for librte_cryptodev. Package: librte-eal2 Architecture: amd64 arm64 i386 ppc64el -- cgit 1.2.3-korg From ed7798327d28889f6b6e08c6eb2966c9d92c9cfa Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 30 May 2017 14:05:13 +0100 Subject: Change DEB_BUILD_OPTIONS nodocs to nodoc Debian Policy version 4.0.0 was just released and nodoc is officially recommended and recognised. Rename the option to comply. Change-Id: If80282f5e47b05065dd427d067f6e37c0f349517 Signed-off-by: Luca Boccassi --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index b2a059ad..5c14b37c 100755 --- a/debian/rules +++ b/debian/rules @@ -75,7 +75,7 @@ else PAR := "1" endif -ifneq (,$(findstring nodocs,$(DEB_BUILD_OPTIONS))) +ifneq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS))) BUILD_DOCS=n else BUILD_DOCS=y -- cgit 1.2.3-korg From 6ce014b0d19b7a81bfba9467f69f3c9597b887a2 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 30 May 2017 14:06:23 +0100 Subject: Update changelog for nodocs to nodoc change Change-Id: Ic7a47d8a3b431641ea77c6a6b81caeb22f82cd48 Signed-off-by: Luca Boccassi --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index b1deb76f..2ef8ee3b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -32,7 +32,7 @@ dpdk (16.11.1-1~git1) UNRELEASED; urgency=medium and Debian's multiarch dir. Thanks Jan Blunck! * Clarify that only the kni and igb_uio kernel modules are distributed exclusively under the GPL2 in debian/copyright - * Add new DEB_BUILD_OPTIONS "nodocs" to allow users to avoid + * Add new DEB_BUILD_OPTIONS "nodoc" to allow users to avoid building the DPDK documentation * Add new DEB_BUILD_OPTIONS "nostatic" to allow users to avoid building the DPDK static libraries -- cgit 1.2.3-korg From ec6cf932cdbfd21314a20fe42bfe5f9ae29e868e Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 30 May 2017 14:07:03 +0100 Subject: Use HTTPS for d/copyright format URL Debian Policy v4.0.0 recommends using HTTPS Change-Id: Iba14b202cdc77936da1a3dde739cc68bb87a23a4 Signed-off-by: Luca Boccassi --- debian/copyright | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/copyright b/debian/copyright index 5ad7c10b..9d36e823 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,4 +1,4 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: dpdk Source: http://dpdk.org -- cgit 1.2.3-korg From cb4b4b5088b958c974e048ab9c82835f750ee0b0 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 30 May 2017 14:11:12 +0100 Subject: Add try-restart to init script try-restart is specified in the Debian Policy v4.0.0. We already do nothing for restart, so do the same for try-restart. Change-Id: Ia72f22d9bae7785f1d5557d111dd284bbf799ff2 Signed-off-by: Luca Boccassi --- debian/dpdk.init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/dpdk.init b/debian/dpdk.init index 01b47845..002ba29f 100644 --- a/debian/dpdk.init +++ b/debian/dpdk.init @@ -35,7 +35,7 @@ start) ;; stop) ;; -restart|force-reload) +try-restart|restart|force-reload) ;; status) output=$(/lib/dpdk/dpdk-init --status 2>&1) || error="$?" -- cgit 1.2.3-korg From bf6e314c5180192fe8beb93846b0170c16240fa5 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 30 May 2017 14:12:02 +0100 Subject: Mention try-restart in changelog Change-Id: I44ff94666905cf7dbbdd7033e643f555289ac0ea Signed-off-by: Luca Boccassi --- debian/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/changelog b/debian/changelog index 2ef8ee3b..36b51265 100644 --- a/debian/changelog +++ b/debian/changelog @@ -36,6 +36,7 @@ dpdk (16.11.1-1~git1) UNRELEASED; urgency=medium building the DPDK documentation * Add new DEB_BUILD_OPTIONS "nostatic" to allow users to avoid building the DPDK static libraries + * Add try-restart to dpdk.init script -- Christian Ehrhardt Thu, 08 Dec 2016 16:58:37 +0100 -- cgit 1.2.3-korg From 0af1d7eff76dcd3b78ce334c87e87822b6eecfc0 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 30 May 2017 14:13:53 +0100 Subject: Declare compliance with Debian Policy v4.0.0 Update Standards-Version to 4.0.0 Change-Id: I441d6824e122e459f058de79b6d3e30d50fad342 Signed-off-by: Luca Boccassi --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 9a135064..db3c12eb 100644 --- a/debian/control +++ b/debian/control @@ -20,7 +20,7 @@ Build-Depends: debhelper (>= 9), python-sphinx-rtd-theme, texlive-fonts-recommended, texlive-latex-extra -Standards-Version: 3.9.8 +Standards-Version: 4.0.0 Section: libs Homepage: http://www.dpdk.org Vcs-Git: https://gerrit.fd.io/r/deb_dpdk -- cgit 1.2.3-korg From 98b330d5d42b569850026263bbda81511c583252 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 30 May 2017 14:14:30 +0100 Subject: Mention Standards-Version bump in changelog Change-Id: I8151f4f72fcc8ac7d11a5c8c73f954efd7eb70d3 Signed-off-by: Luca Boccassi --- debian/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/changelog b/debian/changelog index 36b51265..aa45cdd3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -37,6 +37,7 @@ dpdk (16.11.1-1~git1) UNRELEASED; urgency=medium * Add new DEB_BUILD_OPTIONS "nostatic" to allow users to avoid building the DPDK static libraries * Add try-restart to dpdk.init script + * Update Standards-Version to 4.0.0 -- Christian Ehrhardt Thu, 08 Dec 2016 16:58:37 +0100 -- cgit 1.2.3-korg From 9365d6cfd641d5ade83591c5f5dfa2bf32808e4e Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 8 Jun 2017 09:46:51 -0600 Subject: Imported Upstream version 16.11.2 Change-Id: Iae65ee14970fb0a80d1cba3ff77c3cf7db28bd60 Signed-off-by: Christian Ehrhardt --- app/test-pipeline/init.c | 2 +- app/test-pmd/parameters.c | 8 +- app/test-pmd/testpmd.c | 87 ++++++--------- app/test/test_cmdline_num.c | 1 + app/test/test_kni.c | 2 +- app/test/test_link_bonding.c | 4 +- app/test/test_link_bonding_mode4.c | 2 +- app/test/test_link_bonding_rssconf.c | 4 +- app/test/test_mempool.c | 5 +- app/test/test_pmd_perf.c | 2 +- doc/guides/cryptodevs/qat.rst | 1 + doc/guides/nics/bnx2x.rst | 6 +- doc/guides/nics/thunderx.rst | 2 +- doc/guides/rel_notes/release_16_11.rst | 121 +++++++++++++++++++++ doc/guides/testpmd_app_ug/run_app.rst | 4 +- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 +- drivers/crypto/openssl/rte_openssl_pmd_ops.c | 10 +- drivers/crypto/qat/qat_crypto.c | 39 ++++--- drivers/net/bnx2x/bnx2x_rxtx.c | 2 + drivers/net/bnx2x/bnx2x_rxtx.h | 2 +- drivers/net/bonding/rte_eth_bond_pmd.c | 9 +- drivers/net/cxgbe/base/t4_hw.c | 3 + drivers/net/e1000/base/e1000_vf.c | 3 +- drivers/net/e1000/igb_ethdev.c | 12 +- drivers/net/e1000/igb_pf.c | 4 + drivers/net/ena/base/ena_com.c | 2 +- drivers/net/ena/ena_ethdev.c | 18 +-- drivers/net/fm10k/fm10k_ethdev.c | 9 +- drivers/net/fm10k/fm10k_rxtx_vec.c | 16 ++- drivers/net/i40e/base/i40e_dcb.c | 2 + drivers/net/i40e/i40e_ethdev.c | 47 +++++++- drivers/net/i40e/i40e_ethdev_vf.c | 7 ++ drivers/net/i40e/i40e_pf.c | 29 ++++- drivers/net/i40e/i40e_rxtx.c | 29 +++-- drivers/net/i40e/i40e_rxtx.h | 2 +- drivers/net/i40e/i40e_rxtx_vec_common.h | 4 + drivers/net/i40e/i40e_rxtx_vec_neon.c | 2 +- drivers/net/i40e/i40e_rxtx_vec_sse.c | 16 ++- drivers/net/ixgbe/base/ixgbe_phy.c | 29 ++--- drivers/net/ixgbe/ixgbe_ethdev.c | 9 +- drivers/net/ixgbe/ixgbe_pf.c | 14 ++- drivers/net/ixgbe/ixgbe_rxtx.c | 57 ++++++---- drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 16 ++- drivers/net/mlx4/mlx4.c | 19 ++-- drivers/net/mlx5/mlx5.c | 14 +-- drivers/net/mlx5/mlx5_ethdev.c | 8 +- drivers/net/mlx5/mlx5_rxq.c | 13 +++ drivers/net/mlx5/mlx5_rxtx.c | 7 +- drivers/net/mlx5/mlx5_txq.c | 13 +++ drivers/net/nfp/nfp_net.c | 7 +- drivers/net/pcap/rte_eth_pcap.c | 2 +- drivers/net/qede/base/bcm_osal.c | 4 +- drivers/net/qede/qede_ethdev.c | 32 +----- drivers/net/qede/qede_main.c | 9 +- drivers/net/qede/qede_rxtx.c | 5 +- drivers/net/thunderx/base/nicvf_bsvf.c | 12 +- drivers/net/thunderx/base/nicvf_bsvf.h | 2 +- drivers/net/thunderx/nicvf_ethdev.c | 9 +- drivers/net/thunderx/nicvf_rxtx.c | 18 ++- drivers/net/thunderx/nicvf_struct.h | 12 +- drivers/net/virtio/virtio_ethdev.c | 27 +++-- drivers/net/virtio/virtio_pci.c | 6 +- drivers/net/virtio/virtio_pci.h | 4 +- drivers/net/virtio/virtio_user/virtio_user_dev.c | 2 +- drivers/net/virtio/virtio_user/virtio_user_dev.h | 6 +- drivers/net/virtio/virtio_user_ethdev.c | 7 ++ drivers/net/virtio/virtqueue.h | 8 +- drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- drivers/net/vmxnet3/vmxnet3_ring.h | 2 + drivers/net/vmxnet3/vmxnet3_rxtx.c | 37 ++----- examples/bond/main.c | 2 +- examples/dpdk_qat/main.c | 2 +- examples/exception_path/Makefile | 1 + examples/exception_path/main.c | 2 +- examples/ip_fragmentation/main.c | 76 ++++++++++++- examples/ip_pipeline/config_parse.c | 2 +- examples/ip_reassembly/main.c | 2 +- examples/ipsec-secgw/ipsec-secgw.c | 2 +- examples/ipv4_multicast/main.c | 2 +- examples/kni/main.c | 2 +- examples/l2fwd-crypto/main.c | 12 +- examples/l2fwd-jobstats/main.c | 2 +- examples/l2fwd-keepalive/main.c | 2 +- examples/l2fwd/main.c | 2 +- examples/l3fwd-acl/main.c | 2 +- examples/l3fwd-power/main.c | 10 +- examples/l3fwd-vf/main.c | 2 +- examples/l3fwd/main.c | 2 +- examples/link_status_interrupt/main.c | 2 +- examples/load_balancer/init.c | 2 +- examples/load_balancer/runtime.c | 4 +- examples/multi_process/l2fwd_fork/main.c | 4 +- examples/multi_process/symmetric_mp/main.c | 2 +- examples/netmap_compat/bridge/Makefile | 1 + examples/netmap_compat/bridge/bridge.c | 2 +- examples/performance-thread/common/lthread_timer.h | 17 ++- examples/performance-thread/l3fwd-thread/main.c | 6 +- examples/performance-thread/pthread_shim/main.c | 8 +- .../performance-thread/pthread_shim/pthread_shim.c | 38 ++++++- .../performance-thread/pthread_shim/pthread_shim.h | 3 +- examples/qos_meter/main.c | 2 +- examples/qos_sched/Makefile | 1 + examples/qos_sched/init.c | 2 +- examples/quota_watermark/qw/init.c | 4 +- examples/tep_termination/vxlan_setup.c | 2 +- examples/vhost/main.c | 2 +- examples/vhost_xen/main.c | 2 +- lib/librte_cryptodev/rte_crypto_sym.h | 11 +- lib/librte_cryptodev/rte_cryptodev_pmd.h | 8 -- lib/librte_eal/bsdapp/eal/eal_pci.c | 6 +- lib/librte_eal/bsdapp/nic_uio/nic_uio.c | 44 ++++++++ lib/librte_eal/common/include/rte_dev.h | 14 +++ lib/librte_eal/common/include/rte_version.h | 2 +- lib/librte_eal/linuxapp/eal/eal_interrupts.c | 4 +- lib/librte_eal/linuxapp/eal/eal_pci_uio.c | 1 + lib/librte_eal/linuxapp/eal/eal_pci_vfio.c | 3 +- lib/librte_eal/linuxapp/kni/compat.h | 6 + lib/librte_eal/linuxapp/kni/kni_dev.h | 6 + lib/librte_ether/rte_ethdev.c | 2 + lib/librte_ether/rte_ethdev.h | 9 -- lib/librte_kni/rte_kni.c | 46 +++++--- lib/librte_kni/rte_kni_fifo.h | 9 ++ lib/librte_mbuf/rte_mbuf_ptype.h | 3 + lib/librte_net/rte_ether.h | 4 +- lib/librte_vhost/socket.c | 48 ++++++-- lib/librte_vhost/vhost.c | 2 +- lib/librte_vhost/vhost.h | 18 +-- lib/librte_vhost/virtio_net.c | 18 ++- mk/machine/armv7a/rte.vars.mk | 2 +- mk/machine/dpaa2/rte.vars.mk | 2 +- mk/rte.app.mk | 19 +++- mk/toolchain/clang/rte.toolchain-compat.mk | 3 +- pkg/dpdk.spec | 2 +- 133 files changed, 1002 insertions(+), 455 deletions(-) diff --git a/app/test-pipeline/init.c b/app/test-pipeline/init.c index aef082fc..00dbc279 100644 --- a/app/test-pipeline/init.c +++ b/app/test-pipeline/init.c @@ -105,7 +105,7 @@ static struct rte_eth_conf port_conf = { .hw_ip_checksum = 1, /* IP checksum offload enabled */ .hw_vlan_filter = 0, /* VLAN filtering disabled */ .jumbo_frame = 0, /* Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /* CRC stripped by hardware */ + .hw_strip_crc = 1, /* CRC stripped by hardware */ }, .rx_adv_conf = { .rss_conf = { diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index 08e5a76f..2f969539 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -148,7 +148,7 @@ usage(char* progname) "the packet will be enqueued into the rx drop-queue. " "If the drop-queue doesn't exist, the packet is dropped. " "By default drop-queue=127.\n"); - printf(" --crc-strip: enable CRC stripping by hardware.\n"); + printf(" --disable-crc-strip: disable CRC stripping by hardware.\n"); printf(" --enable-lro: enable large receive offload.\n"); printf(" --enable-rx-cksum: enable rx hardware checksum offload.\n"); printf(" --disable-hw-vlan: disable hardware vlan.\n"); @@ -525,7 +525,7 @@ launch_args_parse(int argc, char** argv) { "pkt-filter-report-hash", 1, 0, 0 }, { "pkt-filter-size", 1, 0, 0 }, { "pkt-filter-drop-queue", 1, 0, 0 }, - { "crc-strip", 0, 0, 0 }, + { "disable-crc-strip", 0, 0, 0 }, { "enable-lro", 0, 0, 0 }, { "enable-rx-cksum", 0, 0, 0 }, { "enable-scatter", 0, 0, 0 }, @@ -765,8 +765,8 @@ launch_args_parse(int argc, char** argv) "drop queue %d invalid - must" "be >= 0 \n", n); } - if (!strcmp(lgopts[opt_idx].name, "crc-strip")) - rx_mode.hw_strip_crc = 1; + if (!strcmp(lgopts[opt_idx].name, "disable-crc-strip")) + rx_mode.hw_strip_crc = 0; if (!strcmp(lgopts[opt_idx].name, "enable-lro")) rx_mode.enable_lro = 1; if (!strcmp(lgopts[opt_idx].name, "enable-scatter")) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index a0332c26..ce48ca03 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -283,7 +283,7 @@ struct rte_eth_rxmode rx_mode = { .hw_vlan_strip = 1, /**< VLAN strip enabled. */ .hw_vlan_extend = 0, /**< Extended VLAN disabled. */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled. */ - .hw_strip_crc = 0, /**< CRC stripping by hardware disabled. */ + .hw_strip_crc = 1, /**< CRC stripping by hardware enabled. */ }; struct rte_fdir_conf fdir_conf = { @@ -518,34 +518,6 @@ init_config(void) fwd_lcores[lc_id]->cpuid_idx = lc_id; } - /* - * Create pools of mbuf. - * If NUMA support is disabled, create a single pool of mbuf in - * socket 0 memory by default. - * Otherwise, create a pool of mbuf in the memory of sockets 0 and 1. - * - * Use the maximum value of nb_rxd and nb_txd here, then nb_rxd and - * nb_txd can be configured at run time. - */ - if (param_total_num_mbufs) - nb_mbuf_per_pool = param_total_num_mbufs; - else { - nb_mbuf_per_pool = RTE_TEST_RX_DESC_MAX + (nb_lcores * mb_mempool_cache) - + RTE_TEST_TX_DESC_MAX + MAX_PKT_BURST; - - if (!numa_support) - nb_mbuf_per_pool = - (nb_mbuf_per_pool * RTE_MAX_ETHPORTS); - } - - if (!numa_support) { - if (socket_num == UMA_NO_CONFIG) - mbuf_pool_create(mbuf_data_size, nb_mbuf_per_pool, 0); - else - mbuf_pool_create(mbuf_data_size, nb_mbuf_per_pool, - socket_num); - } - FOREACH_PORT(pid, ports) { port = &ports[pid]; rte_eth_dev_info_get(pid, &port->dev_info); @@ -568,20 +540,37 @@ init_config(void) port->need_reconfig_queues = 1; } + /* + * Create pools of mbuf. + * If NUMA support is disabled, create a single pool of mbuf in + * socket 0 memory by default. + * Otherwise, create a pool of mbuf in the memory of sockets 0 and 1. + * + * Use the maximum value of nb_rxd and nb_txd here, then nb_rxd and + * nb_txd can be configured at run time. + */ + if (param_total_num_mbufs) + nb_mbuf_per_pool = param_total_num_mbufs; + else { + nb_mbuf_per_pool = RTE_TEST_RX_DESC_MAX + + (nb_lcores * mb_mempool_cache) + + RTE_TEST_TX_DESC_MAX + MAX_PKT_BURST; + nb_mbuf_per_pool *= RTE_MAX_ETHPORTS; + } + if (numa_support) { uint8_t i; - unsigned int nb_mbuf; - if (param_total_num_mbufs) - nb_mbuf_per_pool = nb_mbuf_per_pool/nb_ports; - - for (i = 0; i < max_socket; i++) { - nb_mbuf = (nb_mbuf_per_pool * RTE_MAX_ETHPORTS); - if (nb_mbuf) - mbuf_pool_create(mbuf_data_size, - nb_mbuf,i); - } + for (i = 0; i < max_socket; i++) + mbuf_pool_create(mbuf_data_size, nb_mbuf_per_pool, i); + } else { + if (socket_num == UMA_NO_CONFIG) + mbuf_pool_create(mbuf_data_size, nb_mbuf_per_pool, 0); + else + mbuf_pool_create(mbuf_data_size, nb_mbuf_per_pool, + socket_num); } + init_port_config(); /* @@ -1829,24 +1818,13 @@ init_port_config(void) port->dev_conf.rx_adv_conf.rss_conf.rss_hf = 0; } - if (port->dcb_flag == 0 && port->dev_info.max_vfs == 0) { + if (port->dcb_flag == 0) { if( port->dev_conf.rx_adv_conf.rss_conf.rss_hf != 0) port->dev_conf.rxmode.mq_mode = ETH_MQ_RX_RSS; else port->dev_conf.rxmode.mq_mode = ETH_MQ_RX_NONE; } - if (port->dev_info.max_vfs != 0) { - if (port->dev_conf.rx_adv_conf.rss_conf.rss_hf != 0) - port->dev_conf.rxmode.mq_mode = - ETH_MQ_RX_VMDQ_RSS; - else - port->dev_conf.rxmode.mq_mode = - ETH_MQ_RX_NONE; - - port->dev_conf.txmode.mq_mode = ETH_MQ_TX_NONE; - } - rxtx_port_config(port); rte_eth_macaddr_get(pid, &port->eth_addr); @@ -1938,9 +1916,9 @@ get_eth_dcb_conf(struct rte_eth_conf *eth_conf, rx_conf->nb_tcs = num_tcs; tx_conf->nb_tcs = num_tcs; - for (i = 0; i < num_tcs; i++) { - rx_conf->dcb_tc[i] = i; - tx_conf->dcb_tc[i] = i; + for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) { + rx_conf->dcb_tc[i] = i % num_tcs; + tx_conf->dcb_tc[i] = i % num_tcs; } eth_conf->rxmode.mq_mode = ETH_MQ_RX_DCB_RSS; eth_conf->rx_adv_conf.rss_conf.rss_hf = rss_hf; @@ -2140,6 +2118,7 @@ main(int argc, char** argv) start_packet_forwarding(0); } prompt(); + pmd_test_exit(); } else #endif { diff --git a/app/test/test_cmdline_num.c b/app/test/test_cmdline_num.c index 04263d39..e8f60cfa 100644 --- a/app/test/test_cmdline_num.c +++ b/app/test/test_cmdline_num.c @@ -315,6 +315,7 @@ can_parse_signed(int64_t expected_result, enum cmdline_numtype type) case UINT64: if (expected_result < 0) return 0; + break; case INT8: if (expected_result > INT8_MAX || expected_result < INT8_MIN) return 0; diff --git a/app/test/test_kni.c b/app/test/test_kni.c index 309741cb..db17fdf3 100644 --- a/app/test/test_kni.c +++ b/app/test/test_kni.c @@ -92,7 +92,7 @@ static const struct rte_eth_conf port_conf = { .hw_ip_checksum = 0, .hw_vlan_filter = 0, .jumbo_frame = 0, - .hw_strip_crc = 0, + .hw_strip_crc = 1, }, .txmode = { .mq_mode = ETH_DCB_NONE, diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c index 32296604..52d2d052 100644 --- a/app/test/test_link_bonding.c +++ b/app/test/test_link_bonding.c @@ -172,7 +172,7 @@ struct rte_eth_rxmode rx_mode = { .hw_vlan_strip = 1, /**< VLAN strip enabled. */ .hw_vlan_extend = 0, /**< Extended VLAN disabled. */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled. */ - .hw_strip_crc = 0, /**< CRC stripping by hardware disabled. */ + .hw_strip_crc = 1, /**< CRC stripping by hardware enabled. */ }; struct rte_fdir_conf fdir_conf = { @@ -191,7 +191,7 @@ static struct rte_eth_conf default_pmd_conf = { .hw_ip_checksum = 0, /**< IP checksum offload enabled */ .hw_vlan_filter = 0, /**< VLAN filtering disabled */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, diff --git a/app/test/test_link_bonding_mode4.c b/app/test/test_link_bonding_mode4.c index 53caa3e9..dc339735 100644 --- a/app/test/test_link_bonding_mode4.c +++ b/app/test/test_link_bonding_mode4.c @@ -143,7 +143,7 @@ static struct rte_eth_conf default_pmd_conf = { .hw_ip_checksum = 0, /**< IP checksum offload enabled */ .hw_vlan_filter = 0, /**< VLAN filtering disabled */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, diff --git a/app/test/test_link_bonding_rssconf.c b/app/test/test_link_bonding_rssconf.c index 34f1c166..e11da9bf 100644 --- a/app/test/test_link_bonding_rssconf.c +++ b/app/test/test_link_bonding_rssconf.c @@ -116,7 +116,7 @@ static struct rte_eth_conf default_pmd_conf = { .hw_ip_checksum = 0, /**< IP checksum offload enabled */ .hw_vlan_filter = 0, /**< VLAN filtering disabled */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, @@ -133,7 +133,7 @@ static struct rte_eth_conf rss_pmd_conf = { .hw_ip_checksum = 0, /**< IP checksum offload enabled */ .hw_vlan_filter = 0, /**< VLAN filtering disabled */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, diff --git a/app/test/test_mempool.c b/app/test/test_mempool.c index b9880b32..715b250c 100644 --- a/app/test/test_mempool.c +++ b/app/test/test_mempool.c @@ -509,6 +509,7 @@ walk_cb(struct rte_mempool *mp, void *userdata __rte_unused) static int test_mempool(void) { + int ret = -1; struct rte_mempool *mp_cache = NULL; struct rte_mempool *mp_nocache = NULL; struct rte_mempool *mp_stack = NULL; @@ -607,13 +608,13 @@ test_mempool(void) rte_mempool_list_dump(stdout); - return 0; + ret = 0; err: rte_mempool_free(mp_nocache); rte_mempool_free(mp_cache); rte_mempool_free(mp_stack); - return -1; + return ret; } REGISTER_TEST_COMMAND(mempool_autotest, test_mempool); diff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c index e055aa07..1ffd65a5 100644 --- a/app/test/test_pmd_perf.c +++ b/app/test/test_pmd_perf.c @@ -100,7 +100,7 @@ static struct rte_eth_conf port_conf = { .hw_vlan_strip = 0, /**< VLAN strip enabled. */ .hw_vlan_extend = 0, /**< Extended VLAN disabled. */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ .enable_scatter = 0, /**< scatter rx disabled */ }, .txmode = { diff --git a/doc/guides/cryptodevs/qat.rst b/doc/guides/cryptodevs/qat.rst index 52a9ae35..a7b28eb9 100644 --- a/doc/guides/cryptodevs/qat.rst +++ b/doc/guides/cryptodevs/qat.rst @@ -80,6 +80,7 @@ Limitations * SNOW 3G (UEA2) and KASUMI (F8) supported only if cipher length, cipher offset fields are byte-aligned. * SNOW 3G (UIA2) and KASUMI (F9) supported only if hash length, hash offset fields are byte-aligned. * No BSD support as BSD QAT kernel driver not available. +* Maximum additional authenticated data (AAD) for GCM is 240 bytes long. Installation diff --git a/doc/guides/nics/bnx2x.rst b/doc/guides/nics/bnx2x.rst index 6d1768a5..2e34942d 100644 --- a/doc/guides/nics/bnx2x.rst +++ b/doc/guides/nics/bnx2x.rst @@ -96,9 +96,11 @@ Config File Options The following options can be modified in the ``.config`` file. Please note that enabling debugging options may affect system performance. -- ``CONFIG_RTE_LIBRTE_BNX2X_PMD`` (default **y**) +- ``CONFIG_RTE_LIBRTE_BNX2X_PMD`` (default **n**) - Toggle compilation of bnx2x driver. + Toggle compilation of bnx2x driver. To use bnx2x PMD set this config parameter + to 'y'. Also, in order for firmware binary to load user will need zlib devel + package installed. - ``CONFIG_RTE_LIBRTE_BNX2X_DEBUG`` (default **n**) diff --git a/doc/guides/nics/thunderx.rst b/doc/guides/nics/thunderx.rst index 187c9a4a..b12cc8e3 100644 --- a/doc/guides/nics/thunderx.rst +++ b/doc/guides/nics/thunderx.rst @@ -156,7 +156,7 @@ managed by ``librte_pmd_thunderx_nicvf`` in the Linux operating system. .. code-block:: console ./arm64-thunderx-linuxapp-gcc/app/testpmd -c 0xf -n 4 -w 0002:01:00.2 \ - -- -i --disable-hw-vlan-filter --crc-strip --no-flush-rx \ + -- -i --disable-hw-vlan-filter --no-flush-rx \ --port-topology=loop Example output: diff --git a/doc/guides/rel_notes/release_16_11.rst b/doc/guides/rel_notes/release_16_11.rst index fbf2e368..85972b17 100644 --- a/doc/guides/rel_notes/release_16_11.rst +++ b/doc/guides/rel_notes/release_16_11.rst @@ -708,3 +708,124 @@ Fixes in 16.11 LTS Release * vhost: fix guest/host physical address mapping * vhost: fix long stall of negotiation * vhost: fix memory leak + +16.11.2 +~~~~~~~ + +* app/testpmd: fix TC mapping in DCB init config +* app/testpmd: fix crash at mbuf pool creation +* app/testpmd: fix exit without freeing resources +* app/testpmd: fix init config for multi-queue mode +* app/testpmd: fix number of mbufs in pool +* app: enable HW CRC strip by default +* crypto/openssl: fix AAD capabilities for AES-GCM +* crypto/openssl: fix AES-GCM capability +* crypto/qat: fix AES-GCM authentication length +* crypto/qat: fix IV zero physical address +* crypto/qat: fix dequeue statistics +* cryptodev: fix API digest length comments +* doc: add limitation of AAD size to QAT guide +* doc: explain zlib dependency for bnx2x +* eal/linux: fix build with glibc 2.25 +* eal: fix debug macro redefinition +* examples/ip_fragmentation: fix check of packet type +* examples/l2fwd-crypto: fix AEAD tests when AAD is zero +* examples/l2fwd-crypto: fix packets array index +* examples/l2fwd-crypto: fix padding calculation +* examples/l3fwd-power: fix Rx descriptor size +* examples/l3fwd-power: fix handling no Rx queue +* examples/load_balancer: fix Tx flush +* examples/multi_process: fix timer update +* examples/performance-thread: fix build on FreeBSD +* examples/performance-thread: fix build on FreeBSD 10.0 +* examples/performance-thread: fix compilation on Suse 11 SP2 +* examples/quota_watermark: fix requirement for 2M pages +* examples: enable HW CRC strip by default +* examples: fix build clean on FreeBSD +* kni: fix build with kernel 4.11 +* kni: fix crash caused by freeing mempool +* kni: fix possible memory leak +* mbuf: fix missing includes in exported header +* mk: fix lib filtering when linking app +* mk: fix quoting for ARM mtune argument +* mk: fix shell errors when building with clang +* net/bnx2x: fix transmit queue free threshold +* net/bonding: allow configuring jumbo frames without slaves +* net/bonding: fix updating slave link status +* net/cxgbe: fix possible null pointer dereference +* net/e1000/base: fix multicast setting in VF +* net/ena: cleanup if refilling of Rx descriptors fails +* net/ena: fix Rx descriptors allocation +* net/ena: fix delayed cleanup of Rx descriptors +* net/ena: fix return of hash control flushing +* net/fm10k: fix memory overflow in 32-bit SSE Rx +* net/fm10k: fix pointer cast +* net/i40e/base: fix potential out of bound array access +* net/i40e: add missing 25G link speed +* net/i40e: ensure vector mode is not used with QinQ +* net/i40e: fix TC bitmap of VEB +* net/i40e: fix VF link speed +* net/i40e: fix VF link status update +* net/i40e: fix allocation check +* net/i40e: fix compile error +* net/i40e: fix hash input set on X722 +* net/i40e: fix incorrect packet index reference +* net/i40e: fix mbuf alloc failed counter +* net/i40e: fix memory overflow in 32-bit SSE Rx +* net/i40e: fix setup when bulk is disabled +* net/igb: fix VF MAC address setting +* net/igb: fix VF MAC address setting +* net/ixgbe/base: fix build error +* net/ixgbe: fix Rx queue blocking issue +* net/ixgbe: fix TC bandwidth setting +* net/ixgbe: fix VF Rx mode for allmulticast disabled +* net/ixgbe: fix all queues drop setting of DCB +* net/ixgbe: fix memory overflow in 32-bit SSE Rx +* net/ixgbe: fix multi-queue mode check in SRIOV mode +* net/ixgbe: fix setting MTU on stopped device +* net/ixgbevf: set xstats id values +* net/mlx4: fix Rx after mbuf alloc failure +* net/mlx4: fix returned values upon failed probing +* net/mlx4: update link status upon probing with LSC +* net/mlx5: fix Tx when first segment size is too short +* net/mlx5: fix VLAN stripping indication +* net/mlx5: fix an uninitialized variable +* net/mlx5: fix returned values upon failed probing +* net/mlx5: fix reusing Rx/Tx queues +* net/mlx5: fix supported packets types +* net/nfp: fix packet/data length conversion +* net/pcap: fix using mbuf after freeing it +* net/qede/base: fix find zero bit macro +* net/qede: fix FW version string for VF +* net/qede: fix default MAC address handling +* net/qede: fix fastpath rings reset phase +* net/qede: fix missing UDP protocol in RSS offload types +* net/thunderx: fix 32-bit build +* net/thunderx: fix build on FreeBSD +* net/thunderx: fix deadlock in Rx path +* net/thunderx: fix stats access out of bounds +* net/virtio-user: fix address on 32-bit system +* net/virtio-user: fix overflow +* net/virtio: disable LSC interrupt if MSIX not enabled +* net/virtio: fix MSI-X for modern devices +* net/virtio: fix crash when closing twice +* net/virtio: fix link status always being up +* net/virtio: fix link status always down +* net/virtio: fix queue notify +* net/vmxnet3: fix build with gcc 7 +* net/vmxnet3: fix queue size changes +* net: fix stripped VLAN flag for offload emulation +* nic_uio: fix device binding at boot +* pci: fix device registration on FreeBSD +* test/cmdline: fix missing break in switch +* test/mempool: free mempool on exit +* test: enable HW CRC strip by default +* vfio: fix disabling INTx +* vfio: fix secondary process start +* vhost: change log levels in client mode +* vhost: fix dequeue zero copy +* vhost: fix false sharing +* vhost: fix fd leaks for vhost-user server mode +* vhost: fix max queues +* vhost: fix multiple queue not enabled for old kernels +* vhost: fix use after free diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst index d7c51209..ac7d4582 100644 --- a/doc/guides/testpmd_app_ug/run_app.rst +++ b/doc/guides/testpmd_app_ug/run_app.rst @@ -281,9 +281,9 @@ The commandline options are: In perfect filter mode, when a rule is added with queue = -1, the packet will be enqueued into the RX drop-queue. If the drop-queue does not exist, the packet is dropped. The default value is N=127. -* ``--crc-strip`` +* ``--disable-crc-strip`` - Enable hardware CRC stripping. + Disable hardware CRC stripping. * ``--enable-lro`` diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index f1c269a3..70d2e4d7 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -1257,9 +1257,9 @@ Set hardware CRC stripping on or off for all ports:: testpmd> port config all crc-strip (on|off) -CRC stripping is off by default. +CRC stripping is on by default. -The ``on`` option is equivalent to the ``--crc-strip`` command-line option. +The ``off`` option is equivalent to the ``--disable-crc-strip`` command-line option. port config - scatter ~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/drivers/crypto/openssl/rte_openssl_pmd_ops.c b/drivers/crypto/openssl/rte_openssl_pmd_ops.c index 875550c7..139fed14 100644 --- a/drivers/crypto/openssl/rte_openssl_pmd_ops.c +++ b/drivers/crypto/openssl/rte_openssl_pmd_ops.c @@ -350,9 +350,9 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = { .increment = 0 }, .aad_size = { - .min = 8, - .max = 12, - .increment = 4 + .min = 0, + .max = 65535, + .increment = 1 } }, } }, } @@ -366,8 +366,8 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = { .block_size = 16, .key_size = { .min = 16, - .max = 16, - .increment = 0 + .max = 32, + .increment = 8 }, .iv_size = { .min = 12, diff --git a/drivers/crypto/qat/qat_crypto.c b/drivers/crypto/qat/qat_crypto.c index a4119fcd..0fe0b232 100644 --- a/drivers/crypto/qat/qat_crypto.c +++ b/drivers/crypto/qat/qat_crypto.c @@ -1021,17 +1021,24 @@ qat_write_hw_desc_entry(struct rte_crypto_op *op, uint8_t *out_msg) } /* copy IV into request if it fits */ - if (op->sym->cipher.iv.length && (op->sym->cipher.iv.length <= - sizeof(cipher_param->u.cipher_IV_array))) { - rte_memcpy(cipher_param->u.cipher_IV_array, - op->sym->cipher.iv.data, - op->sym->cipher.iv.length); - } else { - ICP_QAT_FW_LA_CIPH_IV_FLD_FLAG_SET( - qat_req->comn_hdr.serv_specif_flags, - ICP_QAT_FW_CIPH_IV_64BIT_PTR); - cipher_param->u.s.cipher_IV_ptr = - op->sym->cipher.iv.phys_addr; + /* + * If IV length is zero do not copy anything but still + * use request descriptor embedded IV + * + */ + if (op->sym->cipher.iv.length) { + if (op->sym->cipher.iv.length <= + sizeof(cipher_param->u.cipher_IV_array)) { + rte_memcpy(cipher_param->u.cipher_IV_array, + op->sym->cipher.iv.data, + op->sym->cipher.iv.length); + } else { + ICP_QAT_FW_LA_CIPH_IV_FLD_FLAG_SET( + qat_req->comn_hdr.serv_specif_flags, + ICP_QAT_FW_CIPH_IV_64BIT_PTR); + cipher_param->u.s.cipher_IV_ptr = + op->sym->cipher.iv.phys_addr; + } } min_ofs = cipher_ofs; } @@ -1062,6 +1069,12 @@ qat_write_hw_desc_entry(struct rte_crypto_op *op, uint8_t *out_msg) } } + } else if (ctx->qat_hash_alg == + ICP_QAT_HW_AUTH_ALGO_GALOIS_128 || + ctx->qat_hash_alg == + ICP_QAT_HW_AUTH_ALGO_GALOIS_64) { + auth_ofs = op->sym->cipher.data.offset; + auth_len = op->sym->cipher.data.length; } else { auth_ofs = op->sym->auth.data.offset; auth_len = op->sym->auth.data.length; @@ -1283,9 +1296,9 @@ void qat_crypto_sym_stats_get(struct rte_cryptodev *dev, } stats->enqueued_count += qp[i]->stats.enqueued_count; - stats->dequeued_count += qp[i]->stats.enqueued_count; + stats->dequeued_count += qp[i]->stats.dequeued_count; stats->enqueue_err_count += qp[i]->stats.enqueue_err_count; - stats->dequeue_err_count += qp[i]->stats.enqueue_err_count; + stats->dequeue_err_count += qp[i]->stats.dequeue_err_count; } } diff --git a/drivers/net/bnx2x/bnx2x_rxtx.c b/drivers/net/bnx2x/bnx2x_rxtx.c index 170e48fb..adf03092 100644 --- a/drivers/net/bnx2x/bnx2x_rxtx.c +++ b/drivers/net/bnx2x/bnx2x_rxtx.c @@ -273,6 +273,8 @@ bnx2x_dev_tx_queue_setup(struct rte_eth_dev *dev, txq->tx_free_thresh = tx_conf->tx_free_thresh ? tx_conf->tx_free_thresh : DEFAULT_TX_FREE_THRESH; + txq->tx_free_thresh = min(txq->tx_free_thresh, + txq->nb_tx_desc - BDS_PER_TX_PKT); PMD_INIT_LOG(DEBUG, "fp[%02d] req_bd=%u, thresh=%u, usable_bd=%lu, " "total_bd=%lu, tx_pages=%u", diff --git a/drivers/net/bnx2x/bnx2x_rxtx.h b/drivers/net/bnx2x/bnx2x_rxtx.h index dd251aaf..2e38ec26 100644 --- a/drivers/net/bnx2x/bnx2x_rxtx.h +++ b/drivers/net/bnx2x/bnx2x_rxtx.h @@ -11,7 +11,7 @@ #ifndef _BNX2X_RXTX_H_ #define _BNX2X_RXTX_H_ -#define DEFAULT_TX_FREE_THRESH 512 +#define DEFAULT_TX_FREE_THRESH 64 #define RTE_PMD_BNX2X_TX_MAX_BURST 1 /** diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index a80b6fa9..aa71e3f8 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -1430,9 +1430,11 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev, } /* If lsc interrupt is set, check initial slave's link status */ - if (slave_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) + if (slave_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) { + slave_eth_dev->dev_ops->link_update(slave_eth_dev, 0); bond_ethdev_lsc_event_callback(slave_eth_dev->data->port_id, RTE_ETH_EVENT_INTR_LSC, &bonded_eth_dev->data->port_id); + } return 0; } @@ -1668,8 +1670,9 @@ bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->max_mac_addrs = 1; - dev_info->max_rx_pktlen = internals->candidate_max_rx_pktlen ? - internals->candidate_max_rx_pktlen : 2048; + dev_info->max_rx_pktlen = internals->candidate_max_rx_pktlen + ? internals->candidate_max_rx_pktlen + : ETHER_MAX_JUMBO_FRAME_LEN; dev_info->max_rx_queues = (uint16_t)128; dev_info->max_tx_queues = (uint16_t)512; diff --git a/drivers/net/cxgbe/base/t4_hw.c b/drivers/net/cxgbe/base/t4_hw.c index c089b068..9dca8da1 100644 --- a/drivers/net/cxgbe/base/t4_hw.c +++ b/drivers/net/cxgbe/base/t4_hw.c @@ -359,6 +359,9 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox, struct mbox_entry entry; u32 pcie_fw = 0; + if (!temp) + return -ENOMEM; + if ((size & 15) || size > MBOX_LEN) { free(temp); return -EINVAL; diff --git a/drivers/net/e1000/base/e1000_vf.c b/drivers/net/e1000/base/e1000_vf.c index 7845b48e..44ab0188 100644 --- a/drivers/net/e1000/base/e1000_vf.c +++ b/drivers/net/e1000/base/e1000_vf.c @@ -421,12 +421,13 @@ void e1000_update_mc_addr_list_vf(struct e1000_hw *hw, DEBUGOUT1("MC Addr Count = %d\n", mc_addr_count); + msgbuf[0] = E1000_VF_SET_MULTICAST; + if (mc_addr_count > 30) { msgbuf[0] |= E1000_VF_SET_MULTICAST_OVERFLOW; mc_addr_count = 30; } - msgbuf[0] = E1000_VF_SET_MULTICAST; msgbuf[0] |= mc_addr_count << E1000_VT_MSGINFO_SHIFT; for (i = 0; i < mc_addr_count; i++) { diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index 2fddf0cb..be2600d4 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -1012,12 +1012,6 @@ eth_igbvf_dev_init(struct rte_eth_dev *eth_dev) /* Generate a random MAC address, if none was assigned by PF. */ if (is_zero_ether_addr(perm_addr)) { eth_random_addr(perm_addr->addr_bytes); - diag = e1000_rar_set(hw, perm_addr->addr_bytes, 0); - if (diag) { - rte_free(eth_dev->data->mac_addrs); - eth_dev->data->mac_addrs = NULL; - return diag; - } PMD_INIT_LOG(INFO, "\tVF MAC address not assigned by Host PF"); PMD_INIT_LOG(INFO, "\tAssign randomly generated MAC address " "%02x:%02x:%02x:%02x:%02x:%02x", @@ -1029,6 +1023,12 @@ eth_igbvf_dev_init(struct rte_eth_dev *eth_dev) perm_addr->addr_bytes[5]); } + diag = e1000_rar_set(hw, perm_addr->addr_bytes, 0); + if (diag) { + rte_free(eth_dev->data->mac_addrs); + eth_dev->data->mac_addrs = NULL; + return diag; + } /* Copy the permanent MAC address */ ether_addr_copy((struct ether_addr *) hw->mac.perm_addr, ð_dev->data->mac_addrs[0]); diff --git a/drivers/net/e1000/igb_pf.c b/drivers/net/e1000/igb_pf.c index 5845bc22..3f8f1525 100644 --- a/drivers/net/e1000/igb_pf.c +++ b/drivers/net/e1000/igb_pf.c @@ -330,12 +330,16 @@ igb_vf_set_mac_addr(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) *(E1000_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private)); int rar_entry = hw->mac.rar_entry_count - (vf + 1); uint8_t *new_mac = (uint8_t *)(&msgbuf[1]); + int rah; if (is_unicast_ether_addr((struct ether_addr *)new_mac)) { if (!is_zero_ether_addr((struct ether_addr *)new_mac)) rte_memcpy(vfinfo[vf].vf_mac_addresses, new_mac, sizeof(vfinfo[vf].vf_mac_addresses)); hw->mac.ops.rar_set(hw, new_mac, rar_entry); + rah = E1000_READ_REG(hw, E1000_RAH(rar_entry)); + rah |= (0x1 << (E1000_RAH_POOLSEL_SHIFT + vf)); + E1000_WRITE_REG(hw, E1000_RAH(rar_entry), rah); return 0; } return -1; diff --git a/drivers/net/ena/base/ena_com.c b/drivers/net/ena/base/ena_com.c index bd6f3c6b..778bc2eb 100644 --- a/drivers/net/ena/base/ena_com.c +++ b/drivers/net/ena/base/ena_com.c @@ -2278,7 +2278,7 @@ int ena_com_set_hash_ctrl(struct ena_com_dev *ena_dev) sizeof(resp)); if (unlikely(ret)) { ena_trc_err("Failed to set hash input. error: %d\n", ret); - ret = ENA_COM_INVAL; + return ENA_COM_INVAL; } return 0; diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index c1fd7bb3..1fc3654e 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -908,7 +908,7 @@ static int ena_start(struct rte_eth_dev *dev) static int ena_queue_restart(struct ena_ring *ring) { - int rc; + int rc, bufs_num; ena_assert_msg(ring->configured == 1, "Trying to restart unconfigured queue\n"); @@ -919,9 +919,10 @@ static int ena_queue_restart(struct ena_ring *ring) if (ring->type == ENA_RING_TYPE_TX) return 0; - rc = ena_populate_rx_queue(ring, ring->ring_size); - if ((unsigned int)rc != ring->ring_size) { - PMD_INIT_LOG(ERR, "Failed to populate rx ring !\n"); + bufs_num = ring->ring_size - 1; + rc = ena_populate_rx_queue(ring, bufs_num); + if (rc != bufs_num) { + PMD_INIT_LOG(ERR, "Failed to populate rx ring !"); return (-1); } @@ -1132,7 +1133,7 @@ static int ena_populate_rx_queue(struct ena_ring *rxq, unsigned int count) return 0; in_use = rxq->next_to_use - rxq->next_to_clean; - ena_assert_msg(((in_use + count) <= ring_size), "bad ring state"); + ena_assert_msg(((in_use + count) < ring_size), "bad ring state"); count = RTE_MIN(count, (uint16_t)(ring_size - (next_to_use & ring_mask))); @@ -1160,6 +1161,8 @@ static int ena_populate_rx_queue(struct ena_ring *rxq, unsigned int count) rc = ena_com_add_single_rx_desc(rxq->ena_com_io_sq, &ebuf, next_to_use_masked); if (unlikely(rc)) { + rte_mempool_put_bulk(rxq->mb_pool, (void **)(&mbuf), + count - i); RTE_LOG(WARNING, PMD, "failed adding rx desc\n"); break; } @@ -1556,12 +1559,13 @@ static uint16_t eth_ena_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, recv_idx++; } + rx_ring->next_to_clean = next_to_clean; + + desc_in_use = desc_in_use - completed + 1; /* Burst refill to save doorbells, memory barriers, const interval */ if (ring_size - desc_in_use > ENA_RING_DESCS_RATIO(ring_size)) ena_populate_rx_queue(rx_ring, ring_size - desc_in_use); - rx_ring->next_to_clean = next_to_clean; - return recv_idx; } diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index 7c51d3b5..32b0ea93 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -1797,7 +1797,8 @@ fm10k_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id, const struct rte_eth_rxconf *conf, struct rte_mempool *mp) { struct fm10k_hw *hw = FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private); - struct fm10k_dev_info *dev_info = FM10K_DEV_PRIVATE_TO_INFO(dev); + struct fm10k_dev_info *dev_info = + FM10K_DEV_PRIVATE_TO_INFO(dev->data->dev_private); struct fm10k_rx_queue *q; const struct rte_memzone *mz; @@ -2767,7 +2768,8 @@ fm10k_set_tx_function(struct rte_eth_dev *dev) static void __attribute__((cold)) fm10k_set_rx_function(struct rte_eth_dev *dev) { - struct fm10k_dev_info *dev_info = FM10K_DEV_PRIVATE_TO_INFO(dev); + struct fm10k_dev_info *dev_info = + FM10K_DEV_PRIVATE_TO_INFO(dev->data->dev_private); uint16_t i, rx_using_sse; uint16_t rx_ftag_en = 0; @@ -2809,7 +2811,8 @@ static void fm10k_params_init(struct rte_eth_dev *dev) { struct fm10k_hw *hw = FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private); - struct fm10k_dev_info *info = FM10K_DEV_PRIVATE_TO_INFO(dev); + struct fm10k_dev_info *info = + FM10K_DEV_PRIVATE_TO_INFO(dev->data->dev_private); /* Inialize bus info. Normally we would call fm10k_get_bus_info(), but * there is no way to get link status without reading BAR4. Until this diff --git a/drivers/net/fm10k/fm10k_rxtx_vec.c b/drivers/net/fm10k/fm10k_rxtx_vec.c index 27f3e43f..3d216526 100644 --- a/drivers/net/fm10k/fm10k_rxtx_vec.c +++ b/drivers/net/fm10k/fm10k_rxtx_vec.c @@ -470,9 +470,13 @@ fm10k_recv_raw_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, __m128i descs0[RTE_FM10K_DESCS_PER_LOOP]; __m128i pkt_mb1, pkt_mb2, pkt_mb3, pkt_mb4; __m128i zero, staterr, sterr_tmp1, sterr_tmp2; - __m128i mbp1, mbp2; /* two mbuf pointer in one XMM reg. */ + __m128i mbp1; + /* 2 64 bit or 4 32 bit mbuf pointers in one XMM reg. */ +#if defined(RTE_ARCH_X86_64) + __m128i mbp2; +#endif - /* B.1 load 1 mbuf point */ + /* B.1 load 2 (64 bit) or 4 (32 bit) mbuf points */ mbp1 = _mm_loadu_si128((__m128i *)&mbufp[pos]); /* Read desc statuses backwards to avoid race condition */ @@ -480,11 +484,13 @@ fm10k_recv_raw_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, descs0[3] = _mm_loadu_si128((__m128i *)(rxdp + 3)); rte_compiler_barrier(); - /* B.2 copy 2 mbuf point into rx_pkts */ + /* B.2 copy 2 64 bit or 4 32 bit mbuf point into rx_pkts */ _mm_storeu_si128((__m128i *)&rx_pkts[pos], mbp1); - /* B.1 load 1 mbuf point */ +#if defined(RTE_ARCH_X86_64) + /* B.1 load 2 64 bit mbuf poitns */ mbp2 = _mm_loadu_si128((__m128i *)&mbufp[pos+2]); +#endif descs0[2] = _mm_loadu_si128((__m128i *)(rxdp + 2)); rte_compiler_barrier(); @@ -493,8 +499,10 @@ fm10k_recv_raw_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, rte_compiler_barrier(); descs0[0] = _mm_loadu_si128((__m128i *)(rxdp)); +#if defined(RTE_ARCH_X86_64) /* B.2 copy 2 mbuf point into rx_pkts */ _mm_storeu_si128((__m128i *)&rx_pkts[pos+2], mbp2); +#endif /* avoid compiler reorder optimization */ rte_compiler_barrier(); diff --git a/drivers/net/i40e/base/i40e_dcb.c b/drivers/net/i40e/base/i40e_dcb.c index 26c344fd..9b5405db 100644 --- a/drivers/net/i40e/base/i40e_dcb.c +++ b/drivers/net/i40e/base/i40e_dcb.c @@ -396,6 +396,8 @@ static void i40e_parse_cee_app_tlv(struct i40e_cee_feat_tlv *tlv, dcbcfg->numapps = length / sizeof(*app); if (!dcbcfg->numapps) return; + if (dcbcfg->numapps > I40E_DCBX_MAX_APPS) + dcbcfg->numapps = I40E_DCBX_MAX_APPS; for (i = 0; i < dcbcfg->numapps; i++) { u8 up, selector; diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index bf7e5a05..4e4cd16a 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -460,6 +460,7 @@ static void i40e_set_default_mac_addr(struct rte_eth_dev *dev, struct ether_addr *mac_addr); static int i40e_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu); +static void i40e_notify_all_vfs_link_status(struct rte_eth_dev *dev); static const struct rte_pci_id pci_id_i40e_map[] = { { RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_XL710) }, @@ -2069,6 +2070,8 @@ out: if (link.link_status == old.link_status) return -1; + i40e_notify_all_vfs_link_status(dev); + return 0; } @@ -4105,6 +4108,7 @@ i40e_veb_setup(struct i40e_pf *pf, struct i40e_vsi *vsi) hw->aq.asq_last_status); goto fail; } + veb->enabled_tc = I40E_DEFAULT_TCMAP; /* get statistics index */ ret = i40e_aq_get_veb_parameters(hw, veb->seid, NULL, NULL, @@ -5504,11 +5508,9 @@ i40e_dev_handle_aq_msg(struct rte_eth_dev *dev) break; case i40e_aqc_opc_get_link_status: ret = i40e_dev_link_update(dev, 0); - if (!ret) { - i40e_notify_all_vfs_link_status(dev); + if (!ret) _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL); - } break; default: PMD_DRV_LOG(ERR, "Request %u is not supported yet", @@ -7051,7 +7053,44 @@ i40e_set_hash_filter_global_config(struct i40e_hw *hw, pctype = i40e_flowtype_to_pctype(i); reg = (g_cfg->sym_hash_enable_mask[0] & (1UL << i)) ? I40E_GLQF_HSYM_SYMH_ENA_MASK : 0; - i40e_write_rx_ctl(hw, I40E_GLQF_HSYM(pctype), reg); + if (hw->mac.type == I40E_MAC_X722) { + if (pctype == I40E_FILTER_PCTYPE_NONF_IPV4_UDP) { + i40e_write_rx_ctl(hw, I40E_GLQF_HSYM( + I40E_FILTER_PCTYPE_NONF_IPV4_UDP), reg); + i40e_write_rx_ctl(hw, I40E_GLQF_HSYM( + I40E_FILTER_PCTYPE_NONF_UNICAST_IPV4_UDP), + reg); + i40e_write_rx_ctl(hw, I40E_GLQF_HSYM( + I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV4_UDP), + reg); + } else if (pctype == I40E_FILTER_PCTYPE_NONF_IPV4_TCP) { + i40e_write_rx_ctl(hw, I40E_GLQF_HSYM( + I40E_FILTER_PCTYPE_NONF_IPV4_TCP), reg); + i40e_write_rx_ctl(hw, I40E_GLQF_HSYM( + I40E_FILTER_PCTYPE_NONF_IPV4_TCP_SYN_NO_ACK), + reg); + } else if (pctype == I40E_FILTER_PCTYPE_NONF_IPV6_UDP) { + i40e_write_rx_ctl(hw, I40E_GLQF_HSYM( + I40E_FILTER_PCTYPE_NONF_IPV6_UDP), reg); + i40e_write_rx_ctl(hw, I40E_GLQF_HSYM( + I40E_FILTER_PCTYPE_NONF_UNICAST_IPV6_UDP), + reg); + i40e_write_rx_ctl(hw, I40E_GLQF_HSYM( + I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV6_UDP), + reg); + } else if (pctype == I40E_FILTER_PCTYPE_NONF_IPV6_TCP) { + i40e_write_rx_ctl(hw, I40E_GLQF_HSYM( + I40E_FILTER_PCTYPE_NONF_IPV6_TCP), reg); + i40e_write_rx_ctl(hw, I40E_GLQF_HSYM( + I40E_FILTER_PCTYPE_NONF_IPV6_TCP_SYN_NO_ACK), + reg); + } else { + i40e_write_rx_ctl(hw, I40E_GLQF_HSYM(pctype), + reg); + } + } else { + i40e_write_rx_ctl(hw, I40E_GLQF_HSYM(pctype), reg); + } } reg = i40e_read_rx_ctl(hw, I40E_GLQF_CTL); diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index 640d316a..efd4fac1 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -1997,6 +1997,10 @@ i40evf_add_del_all_mac_addr(struct rte_eth_dev *dev, bool add) } list = rte_zmalloc("i40evf_del_mac_buffer", len, 0); + if (!list) { + PMD_DRV_LOG(ERR, "fail to allocate memory"); + return; + } for (i = begin; i < next_begin; i++) { addr = &dev->data->mac_addrs[i]; @@ -2142,6 +2146,9 @@ i40evf_dev_link_update(struct rte_eth_dev *dev, case I40E_LINK_SPEED_20GB: new_link.link_speed = ETH_SPEED_NUM_20G; break; + case I40E_LINK_SPEED_25GB: + new_link.link_speed = ETH_SPEED_NUM_25G; + break; case I40E_LINK_SPEED_40GB: new_link.link_speed = ETH_SPEED_NUM_40G; break; diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c index 97b8eccc..b36d9019 100644 --- a/drivers/net/i40e/i40e_pf.c +++ b/drivers/net/i40e/i40e_pf.c @@ -907,8 +907,33 @@ i40e_notify_vf_link_status(struct rte_eth_dev *dev, struct i40e_pf_vf *vf) event.event = I40E_VIRTCHNL_EVENT_LINK_CHANGE; event.event_data.link_event.link_status = dev->data->dev_link.link_status; - event.event_data.link_event.link_speed = - (enum i40e_aq_link_speed)dev->data->dev_link.link_speed; + + /* need to convert the ETH_SPEED_xxx into I40E_LINK_SPEED_xxx */ + switch (dev->data->dev_link.link_speed) { + case ETH_SPEED_NUM_100M: + event.event_data.link_event.link_speed = I40E_LINK_SPEED_100MB; + break; + case ETH_SPEED_NUM_1G: + event.event_data.link_event.link_speed = I40E_LINK_SPEED_1GB; + break; + case ETH_SPEED_NUM_10G: + event.event_data.link_event.link_speed = I40E_LINK_SPEED_10GB; + break; + case ETH_SPEED_NUM_20G: + event.event_data.link_event.link_speed = I40E_LINK_SPEED_20GB; + break; + case ETH_SPEED_NUM_25G: + event.event_data.link_event.link_speed = I40E_LINK_SPEED_25GB; + break; + case ETH_SPEED_NUM_40G: + event.event_data.link_event.link_speed = I40E_LINK_SPEED_40GB; + break; + default: + event.event_data.link_event.link_speed = + I40E_LINK_SPEED_UNKNOWN; + break; + } + i40e_pf_host_send_msg_to_vf(vf, I40E_VIRTCHNL_OP_EVENT, I40E_SUCCESS, (uint8_t *)&event, sizeof(event)); } diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index 1b25b2f2..602e40c9 100644 --- a/drivers/net/i40e/i40e_rxtx.c +++ b/drivers/net/i40e/i40e_rxtx.c @@ -598,6 +598,7 @@ static inline uint16_t rx_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) { struct i40e_rx_queue *rxq = (struct i40e_rx_queue *)rx_queue; + struct rte_eth_dev *dev; uint16_t nb_rx = 0; if (!nb_pkts) @@ -615,9 +616,10 @@ rx_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) if (i40e_rx_alloc_bufs(rxq) != 0) { uint16_t i, j; - PMD_RX_LOG(DEBUG, "Rx mbuf alloc failed for " - "port_id=%u, queue_id=%u", - rxq->port_id, rxq->queue_id); + dev = I40E_VSI_TO_ETH_DEV(rxq->vsi); + dev->data->rx_mbuf_alloc_failed += + rxq->rx_free_thresh; + rxq->rx_nb_avail = 0; rxq->rx_tail = (uint16_t)(rxq->rx_tail - nb_rx); for (i = 0, j = rxq->rx_tail; i < nb_rx; i++, j++) @@ -679,6 +681,7 @@ i40e_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) union i40e_rx_desc rxd; struct i40e_rx_entry *sw_ring; struct i40e_rx_entry *rxe; + struct rte_eth_dev *dev; struct rte_mbuf *rxm; struct rte_mbuf *nmb; uint16_t nb_rx; @@ -707,10 +710,13 @@ i40e_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) break; nmb = rte_mbuf_raw_alloc(rxq->mp); - if (unlikely(!nmb)) + if (unlikely(!nmb)) { + dev = I40E_VSI_TO_ETH_DEV(rxq->vsi); + dev->data->rx_mbuf_alloc_failed++; break; - rxd = *rxdp; + } + rxd = *rxdp; nb_hold++; rxe = &sw_ring[rx_id]; rx_id++; @@ -802,6 +808,7 @@ i40e_recv_scattered_pkts(void *rx_queue, struct rte_mbuf *nmb, *rxm; uint16_t rx_id = rxq->rx_tail; uint16_t nb_rx = 0, nb_hold = 0, rx_packet_len; + struct rte_eth_dev *dev; uint32_t rx_status; uint64_t qword1; uint64_t dma_addr; @@ -818,8 +825,12 @@ i40e_recv_scattered_pkts(void *rx_queue, break; nmb = rte_mbuf_raw_alloc(rxq->mp); - if (unlikely(!nmb)) + if (unlikely(!nmb)) { + dev = I40E_VSI_TO_ETH_DEV(rxq->vsi); + dev->data->rx_mbuf_alloc_failed++; break; + } + rxd = *rxdp; nb_hold++; rxe = &sw_ring[rx_id]; @@ -1717,11 +1728,7 @@ i40e_dev_rx_queue_setup(struct rte_eth_dev *dev, rxq->rx_ring_phys_addr = rte_mem_phy2mch(rz->memseg_id, rz->phys_addr); rxq->rx_ring = (union i40e_rx_desc *)rz->addr; -#ifdef RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC len = (uint16_t)(nb_desc + RTE_PMD_I40E_RX_MAX_BURST); -#else - len = nb_desc; -#endif /* Allocate the software ring. */ rxq->sw_ring = @@ -2129,11 +2136,11 @@ i40e_reset_rx_queue(struct i40e_rx_queue *rxq) for (i = 0; i < len * sizeof(union i40e_rx_desc); i++) ((volatile char *)rxq->rx_ring)[i] = 0; -#ifdef RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC memset(&rxq->fake_mbuf, 0x0, sizeof(rxq->fake_mbuf)); for (i = 0; i < RTE_PMD_I40E_RX_MAX_BURST; ++i) rxq->sw_ring[rxq->nb_rx_desc + i].mbuf = &rxq->fake_mbuf; +#ifdef RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC rxq->rx_nb_avail = 0; rxq->rx_next_avail = 0; rxq->rx_free_trigger = (uint16_t)(rxq->rx_free_thresh - 1); diff --git a/drivers/net/i40e/i40e_rxtx.h b/drivers/net/i40e/i40e_rxtx.h index ecdb13cb..635ed48b 100644 --- a/drivers/net/i40e/i40e_rxtx.h +++ b/drivers/net/i40e/i40e_rxtx.h @@ -113,11 +113,11 @@ struct i40e_rx_queue { uint16_t nb_rx_hold; /**< number of held free RX desc */ struct rte_mbuf *pkt_first_seg; /**< first segment of current packet */ struct rte_mbuf *pkt_last_seg; /**< last segment of current packet */ + struct rte_mbuf fake_mbuf; /**< dummy mbuf */ #ifdef RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC uint16_t rx_nb_avail; /**< number of staged packets ready */ uint16_t rx_next_avail; /**< index of next staged packets */ uint16_t rx_free_trigger; /**< triggers rx buffer allocation */ - struct rte_mbuf fake_mbuf; /**< dummy mbuf */ struct rte_mbuf *rx_stage[RTE_PMD_I40E_RX_MAX_BURST * 2]; #endif diff --git a/drivers/net/i40e/i40e_rxtx_vec_common.h b/drivers/net/i40e/i40e_rxtx_vec_common.h index 990520f3..23b4e352 100644 --- a/drivers/net/i40e/i40e_rxtx_vec_common.h +++ b/drivers/net/i40e/i40e_rxtx_vec_common.h @@ -243,6 +243,10 @@ i40e_rx_vec_dev_conf_condition_check_default(struct rte_eth_dev *dev) if (rxmode->header_split == 1) return -1; + /* no QinQ support */ + if (rxmode->hw_vlan_extend == 1) + return -1; + return 0; #else RTE_SET_USED(dev); diff --git a/drivers/net/i40e/i40e_rxtx_vec_neon.c b/drivers/net/i40e/i40e_rxtx_vec_neon.c index 011c54e0..d235daa7 100644 --- a/drivers/net/i40e/i40e_rxtx_vec_neon.c +++ b/drivers/net/i40e/i40e_rxtx_vec_neon.c @@ -205,7 +205,7 @@ desc_to_ptype_v(uint64x2_t descs[4], struct rte_mbuf **rx_pkts) for (i = 0; i < 4; i++) { tmp = vreinterpretq_u8_u64(vshrq_n_u64(descs[i], 30)); ptype = vgetq_lane_u8(tmp, 8); - rx_pkts[0]->packet_type = i40e_rxd_pkt_type_mapping(ptype); + rx_pkts[i]->packet_type = i40e_rxd_pkt_type_mapping(ptype); } } diff --git a/drivers/net/i40e/i40e_rxtx_vec_sse.c b/drivers/net/i40e/i40e_rxtx_vec_sse.c index b95cc8e1..9644dd61 100644 --- a/drivers/net/i40e/i40e_rxtx_vec_sse.c +++ b/drivers/net/i40e/i40e_rxtx_vec_sse.c @@ -320,20 +320,26 @@ _recv_raw_pkts_vec(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts, __m128i descs[RTE_I40E_DESCS_PER_LOOP]; __m128i pkt_mb1, pkt_mb2, pkt_mb3, pkt_mb4; __m128i zero, staterr, sterr_tmp1, sterr_tmp2; - __m128i mbp1, mbp2; /* two mbuf pointer in one XMM reg. */ + /* 2 64 bit or 4 32 bit mbuf pointers in one XMM reg. */ + __m128i mbp1; +#if defined(RTE_ARCH_X86_64) + __m128i mbp2; +#endif - /* B.1 load 1 mbuf point */ + /* B.1 load 2 (64 bit) or 4 (32 bit) mbuf points */ mbp1 = _mm_loadu_si128((__m128i *)&sw_ring[pos]); /* Read desc statuses backwards to avoid race condition */ /* A.1 load 4 pkts desc */ descs[3] = _mm_loadu_si128((__m128i *)(rxdp + 3)); rte_compiler_barrier(); - /* B.2 copy 2 mbuf point into rx_pkts */ + /* B.2 copy 2 64 bit or 4 32 bit mbuf point into rx_pkts */ _mm_storeu_si128((__m128i *)&rx_pkts[pos], mbp1); - /* B.1 load 1 mbuf point */ +#if defined(RTE_ARCH_X86_64) + /* B.1 load 2 64 bit mbuf points */ mbp2 = _mm_loadu_si128((__m128i *)&sw_ring[pos+2]); +#endif descs[2] = _mm_loadu_si128((__m128i *)(rxdp + 2)); rte_compiler_barrier(); @@ -342,8 +348,10 @@ _recv_raw_pkts_vec(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts, rte_compiler_barrier(); descs[0] = _mm_loadu_si128((__m128i *)(rxdp)); +#if defined(RTE_ARCH_X86_64) /* B.2 copy 2 mbuf point into rx_pkts */ _mm_storeu_si128((__m128i *)&rx_pkts[pos+2], mbp2); +#endif if (split_packet) { rte_mbuf_prefetch_part2(rx_pkts[pos]); diff --git a/drivers/net/ixgbe/base/ixgbe_phy.c b/drivers/net/ixgbe/base/ixgbe_phy.c index 43c55d74..cf9d51dc 100644 --- a/drivers/net/ixgbe/base/ixgbe_phy.c +++ b/drivers/net/ixgbe/base/ixgbe_phy.c @@ -1542,16 +1542,10 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw) status = IXGBE_SUCCESS; } else { if (hw->allow_unsupported_sfp == true) { - EWARN(hw, "WARNING: Intel (R) Network " - "Connections are quality tested " - "using Intel (R) Ethernet Optics." - " Using untested modules is not " - "supported and may cause unstable" - " operation or damage to the " - "module or the adapter. Intel " - "Corporation is not responsible " - "for any harm caused by using " - "untested modules.\n", status); + EWARN(hw, + "WARNING: Intel (R) Network Connections are quality tested using Intel (R) Ethernet Optics. " + "Using untested modules is not supported and may cause unstable operation or damage to the module or the adapter. " + "Intel Corporation is not responsible for any harm caused by using untested modules.\n"); status = IXGBE_SUCCESS; } else { DEBUGOUT("SFP+ module not supported\n"); @@ -1804,16 +1798,10 @@ s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw) status = IXGBE_SUCCESS; } else { if (hw->allow_unsupported_sfp == true) { - EWARN(hw, "WARNING: Intel (R) Network " - "Connections are quality tested " - "using Intel (R) Ethernet Optics." - " Using untested modules is not " - "supported and may cause unstable" - " operation or damage to the " - "module or the adapter. Intel " - "Corporation is not responsible " - "for any harm caused by using " - "untested modules.\n", status); + EWARN(hw, + "WARNING: Intel (R) Network Connections are quality tested using Intel (R) Ethernet Optics. " + "Using untested modules is not supported and may cause unstable operation or damage to the module or the adapter. " + "Intel Corporation is not responsible for any harm caused by using untested modules.\n"); status = IXGBE_SUCCESS; } else { DEBUGOUT("QSFP module not supported\n"); @@ -1838,7 +1826,6 @@ err_read_i2c_eeprom: return IXGBE_ERR_SFP_NOT_PRESENT; } - /** * ixgbe_get_sfp_init_sequence_offsets - Provides offset of PHY init sequence * @hw: pointer to hardware structure diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index bac36e0d..d6686f6c 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -2991,6 +2991,7 @@ ixgbevf_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats, /* Extended stats */ for (i = 0; i < IXGBEVF_NB_XSTATS; i++) { + xstats[i].id = i; xstats[i].value = *(uint64_t *)(((char *)hw_stats) + rte_ixgbevf_stats_strings[i].offset); } @@ -4089,6 +4090,7 @@ ixgbe_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) struct ixgbe_hw *hw; struct rte_eth_dev_info dev_info; uint32_t frame_size = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN; + struct rte_eth_rxmode *rx_conf = &dev->data->dev_conf.rxmode; ixgbe_dev_info_get(dev, &dev_info); @@ -4099,7 +4101,7 @@ ixgbe_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) /* refuse mtu that requires the support of scattered packets when this * feature has not been enabled before. */ - if (!dev->data->scattered_rx && + if (!rx_conf->enable_scatter && (frame_size + 2 * IXGBE_VLAN_TAG_SIZE > dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM)) return -EINVAL; @@ -5722,6 +5724,7 @@ ixgbevf_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu) { struct ixgbe_hw *hw; uint32_t max_frame = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN; + struct rte_eth_rxmode *rx_conf = &dev->data->dev_conf.rxmode; hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -5731,7 +5734,7 @@ ixgbevf_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu) /* refuse mtu that requires the support of scattered packets when this * feature has not been enabled before. */ - if (!dev->data->scattered_rx && + if (!rx_conf->enable_scatter && (max_frame + 2 * IXGBE_VLAN_TAG_SIZE > dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM)) return -EINVAL; @@ -7529,7 +7532,7 @@ ixgbevf_dev_allmulticast_disable(struct rte_eth_dev *dev) { struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); - hw->mac.ops.update_xcast_mode(hw, IXGBEVF_XCAST_MODE_NONE); + hw->mac.ops.update_xcast_mode(hw, IXGBEVF_XCAST_MODE_MULTI); } static void ixgbevf_mbx_process(struct rte_eth_dev *dev) diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c index 26395e41..09440ccb 100644 --- a/drivers/net/ixgbe/ixgbe_pf.c +++ b/drivers/net/ixgbe/ixgbe_pf.c @@ -387,15 +387,27 @@ ixgbe_vf_reset_msg(struct rte_eth_dev *dev, uint16_t vf) uint32_t reg_offset, vf_shift; const uint8_t VFRE_SHIFT = 5; /* VFRE 32 bits per slot */ const uint8_t VFRE_MASK = (uint8_t)((1U << VFRE_SHIFT) - 1); + uint8_t nb_q_per_pool; + int i; vf_shift = vf & VFRE_MASK; reg_offset = (vf >> VFRE_SHIFT) > 0 ? 1 : 0; - /* enable transmit and receive for vf */ + /* enable transmit for vf */ reg = IXGBE_READ_REG(hw, IXGBE_VFTE(reg_offset)); reg |= (reg | (1 << vf_shift)); IXGBE_WRITE_REG(hw, IXGBE_VFTE(reg_offset), reg); + /* enable all queue drop for IOV */ + nb_q_per_pool = RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool; + for (i = vf * nb_q_per_pool; i < (vf + 1) * nb_q_per_pool; i++) { + IXGBE_WRITE_FLUSH(hw); + reg = IXGBE_QDE_ENABLE | IXGBE_QDE_WRITE; + reg |= i << IXGBE_QDE_IDX_SHIFT; + IXGBE_WRITE_REG(hw, IXGBE_QDE, reg); + } + + /* enable receive for vf */ reg = IXGBE_READ_REG(hw, IXGBE_VFRE(reg_offset)); reg |= (reg | (1 << vf_shift)); IXGBE_WRITE_REG(hw, IXGBE_VFRE(reg_offset), reg); diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c index c61ce470..d1e300a5 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/ixgbe/ixgbe_rxtx.c @@ -3323,7 +3323,6 @@ ixgbe_dcb_tx_hw_config(struct rte_eth_dev *dev, struct ixgbe_dcb_config *dcb_config) { uint32_t reg; - uint32_t q; struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); PMD_INIT_FUNC_TRACE(); @@ -3343,18 +3342,6 @@ ixgbe_dcb_tx_hw_config(struct rte_eth_dev *dev, reg |= IXGBE_MTQC_VT_ENA; IXGBE_WRITE_REG(hw, IXGBE_MTQC, reg); - if (RTE_ETH_DEV_SRIOV(dev).active == 0) { - /* Disable drop for all queues in VMDQ mode*/ - for (q = 0; q < 128; q++) - IXGBE_WRITE_REG(hw, IXGBE_QDE, - (IXGBE_QDE_WRITE | (q << IXGBE_QDE_IDX_SHIFT))); - } else { - /* Enable drop for all queues in SRIOV mode */ - for (q = 0; q < 128; q++) - IXGBE_WRITE_REG(hw, IXGBE_QDE, - (IXGBE_QDE_WRITE | (q << IXGBE_QDE_IDX_SHIFT) | IXGBE_QDE_ENABLE)); - } - /* Enable the Tx desc arbiter */ reg = IXGBE_READ_REG(hw, IXGBE_RTTDCS); reg &= ~IXGBE_RTTDCS_ARBDIS; @@ -3488,16 +3475,18 @@ ixgbe_dcb_tx_config(struct rte_eth_dev *dev, /** * ixgbe_dcb_rx_hw_config - Configure general DCB RX HW parameters - * @hw: pointer to hardware structure + * @dev: pointer to eth_dev structure * @dcb_config: pointer to ixgbe_dcb_config structure */ static void -ixgbe_dcb_rx_hw_config(struct ixgbe_hw *hw, - struct ixgbe_dcb_config *dcb_config) +ixgbe_dcb_rx_hw_config(struct rte_eth_dev *dev, + struct ixgbe_dcb_config *dcb_config) { uint32_t reg; uint32_t vlanctrl; uint8_t i; + uint32_t q; + struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); PMD_INIT_FUNC_TRACE(); /* @@ -3535,6 +3524,21 @@ ixgbe_dcb_rx_hw_config(struct ixgbe_hw *hw, } IXGBE_WRITE_REG(hw, IXGBE_MRQC, reg); + + if (RTE_ETH_DEV_SRIOV(dev).active == 0) { + /* Disable drop for all queues in VMDQ mode*/ + for (q = 0; q < IXGBE_MAX_RX_QUEUE_NUM; q++) + IXGBE_WRITE_REG(hw, IXGBE_QDE, + (IXGBE_QDE_WRITE | + (q << IXGBE_QDE_IDX_SHIFT))); + } else { + /* Enable drop for all queues in SRIOV mode */ + for (q = 0; q < IXGBE_MAX_RX_QUEUE_NUM; q++) + IXGBE_WRITE_REG(hw, IXGBE_QDE, + (IXGBE_QDE_WRITE | + (q << IXGBE_QDE_IDX_SHIFT) | + IXGBE_QDE_ENABLE)); + } } /* VLNCTRL: enable vlan filtering and allow all vlan tags through */ @@ -3647,7 +3651,7 @@ ixgbe_dcb_hw_configure(struct rte_eth_dev *dev, /* Get dcb TX configuration parameters from rte_eth_conf */ ixgbe_dcb_rx_config(dev, dcb_config); /*Configure general DCB RX parameters*/ - ixgbe_dcb_rx_hw_config(hw, dcb_config); + ixgbe_dcb_rx_hw_config(dev, dcb_config); break; default: PMD_INIT_LOG(ERR, "Incorrect DCB RX mode configuration"); @@ -3706,6 +3710,15 @@ ixgbe_dcb_hw_configure(struct rte_eth_dev *dev, tc->path[IXGBE_DCB_TX_CONFIG].bwg_percent = 0; tc->path[IXGBE_DCB_RX_CONFIG].bwg_percent = 0; } + } else { + /* Re-configure 8 TCs BW */ + for (i = 0; i < nb_tcs; i++) { + tc = &dcb_config->tc_config[i]; + tc->path[IXGBE_DCB_TX_CONFIG].bwg_percent = + (uint8_t)(100 / nb_tcs + (i & 1)); + tc->path[IXGBE_DCB_RX_CONFIG].bwg_percent = + (uint8_t)(100 / nb_tcs + (i & 1)); + } } switch (hw->mac.type) { @@ -4083,9 +4096,8 @@ ixgbe_dev_mq_rx_configure(struct rte_eth_dev *dev) break; } } else { - /* - * SRIOV active scheme - * Support RSS together with VMDq & SRIOV + /* SRIOV active scheme + * Support RSS together with SRIOV. */ switch (dev->data->dev_conf.rxmode.mq_mode) { case ETH_MQ_RX_RSS: @@ -4093,10 +4105,13 @@ ixgbe_dev_mq_rx_configure(struct rte_eth_dev *dev) ixgbe_config_vf_rss(dev); break; case ETH_MQ_RX_VMDQ_DCB: + case ETH_MQ_RX_DCB: + /* In SRIOV, the configuration is the same as VMDq case */ ixgbe_vmdq_dcb_configure(dev); break; - /* FIXME if support DCB/RSS together with VMDq & SRIOV */ + /* DCB/RSS together with SRIOV is not supported */ case ETH_MQ_RX_VMDQ_DCB_RSS: + case ETH_MQ_RX_DCB_RSS: PMD_INIT_LOG(ERR, "Could not support DCB/RSS with VMDq & SRIOV"); return -1; diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c index abbf2841..dd7d1778 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c @@ -335,9 +335,13 @@ _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq, struct rte_mbuf **rx_pkts, __m128i descs[RTE_IXGBE_DESCS_PER_LOOP]; __m128i pkt_mb1, pkt_mb2, pkt_mb3, pkt_mb4; __m128i zero, staterr, sterr_tmp1, sterr_tmp2; - __m128i mbp1, mbp2; /* two mbuf pointer in one XMM reg. */ + /* 2 64 bit or 4 32 bit mbuf pointers in one XMM reg. */ + __m128i mbp1; +#if defined(RTE_ARCH_X86_64) + __m128i mbp2; +#endif - /* B.1 load 1 mbuf point */ + /* B.1 load 2 (64 bit) or 4 (32 bit) mbuf points */ mbp1 = _mm_loadu_si128((__m128i *)&sw_ring[pos]); /* Read desc statuses backwards to avoid race condition */ @@ -345,11 +349,13 @@ _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq, struct rte_mbuf **rx_pkts, descs[3] = _mm_loadu_si128((__m128i *)(rxdp + 3)); rte_compiler_barrier(); - /* B.2 copy 2 mbuf point into rx_pkts */ + /* B.2 copy 2 64 bit or 4 32 bit mbuf point into rx_pkts */ _mm_storeu_si128((__m128i *)&rx_pkts[pos], mbp1); - /* B.1 load 1 mbuf point */ +#if defined(RTE_ARCH_X86_64) + /* B.1 load 2 64 bit mbuf points */ mbp2 = _mm_loadu_si128((__m128i *)&sw_ring[pos+2]); +#endif descs[2] = _mm_loadu_si128((__m128i *)(rxdp + 2)); rte_compiler_barrier(); @@ -358,8 +364,10 @@ _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq, struct rte_mbuf **rx_pkts, rte_compiler_barrier(); descs[0] = _mm_loadu_si128((__m128i *)(rxdp)); +#if defined(RTE_ARCH_X86_64) /* B.2 copy 2 mbuf point into rx_pkts */ _mm_storeu_si128((__m128i *)&rx_pkts[pos+2], mbp2); +#endif if (split_packet) { rte_mbuf_prefetch_part2(rx_pkts[pos]); diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index 6d43a977..83f9143b 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -3340,6 +3340,8 @@ mlx4_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) /* Increase out of memory counters. */ ++rxq->stats.rx_nombuf; ++rxq->priv->dev->data->rx_mbuf_alloc_failed; + /* Add SGE to array for repost. */ + sges[i] = elt->sge; goto repost; } @@ -5571,10 +5573,8 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) list = ibv_get_device_list(&i); if (list == NULL) { assert(errno); - if (errno == ENOSYS) { - WARN("cannot list devices, is ib_uverbs loaded?"); - return 0; - } + if (errno == ENOSYS) + ERROR("cannot list devices, is ib_uverbs loaded?"); return -errno; } assert(i >= 0); @@ -5606,11 +5606,11 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) ibv_free_device_list(list); switch (err) { case 0: - WARN("cannot access device, is mlx4_ib loaded?"); - return 0; + ERROR("cannot access device, is mlx4_ib loaded?"); + return -ENODEV; case EINVAL: - WARN("cannot use device, are drivers up to date?"); - return 0; + ERROR("cannot use device, are drivers up to date?"); + return -EINVAL; } assert(err > 0); return -err; @@ -5857,6 +5857,9 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) /* Bring Ethernet device up. */ DEBUG("forcing Ethernet interface up"); priv_set_flags(priv, ~IFF_UP, IFF_UP); + /* Update link status once if waiting for LSC. */ + if (eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) + mlx4_link_update(eth_dev, 0); continue; port_error: diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index cb45fd0f..aa9d2dcb 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -384,10 +384,8 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) list = ibv_get_device_list(&i); if (list == NULL) { assert(errno); - if (errno == ENOSYS) { - WARN("cannot list devices, is ib_uverbs loaded?"); - return 0; - } + if (errno == ENOSYS) + ERROR("cannot list devices, is ib_uverbs loaded?"); return -errno; } assert(i >= 0); @@ -427,11 +425,11 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) ibv_free_device_list(list); switch (err) { case 0: - WARN("cannot access device, is mlx5_ib loaded?"); - return 0; + ERROR("cannot access device, is mlx5_ib loaded?"); + return -ENODEV; case EINVAL: - WARN("cannot use device, are drivers up to date?"); - return 0; + ERROR("cannot use device, are drivers up to date?"); + return -EINVAL; } assert(err > 0); return -err; diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c index 06cfd016..0aa274e6 100644 --- a/drivers/net/mlx5/mlx5_ethdev.c +++ b/drivers/net/mlx5/mlx5_ethdev.c @@ -665,10 +665,10 @@ mlx5_dev_supported_ptypes_get(struct rte_eth_dev *dev) { static const uint32_t ptypes[] = { /* refers to rxq_cq_to_pkt_type() */ - RTE_PTYPE_L3_IPV4, - RTE_PTYPE_L3_IPV6, - RTE_PTYPE_INNER_L3_IPV4, - RTE_PTYPE_INNER_L3_IPV6, + RTE_PTYPE_L3_IPV4_EXT_UNKNOWN, + RTE_PTYPE_L3_IPV6_EXT_UNKNOWN, + RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN, + RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN, RTE_PTYPE_UNKNOWN }; diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index 28e93d3e..118f6d67 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -1247,6 +1247,19 @@ mlx5_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, } (*priv->rxqs)[idx] = NULL; rxq_cleanup(rxq_ctrl); + /* Resize if rxq size is changed. */ + if (rxq_ctrl->rxq.elts_n != log2above(desc)) { + rxq_ctrl = rte_realloc(rxq_ctrl, + sizeof(*rxq_ctrl) + + desc * sizeof(struct rte_mbuf *), + RTE_CACHE_LINE_SIZE); + if (!rxq_ctrl) { + ERROR("%p: unable to reallocate queue index %u", + (void *)dev, idx); + priv_unlock(priv); + return -ENOMEM; + } + } } else { rxq_ctrl = rte_calloc_socket("RXQ", 1, sizeof(*rxq_ctrl) + desc * sizeof(struct rte_mbuf *), diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index 3997b27a..58926e39 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -431,7 +431,8 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) #ifdef MLX5_PMD_SOFT_COUNTERS total_length = length; #endif - assert(length >= MLX5_WQE_DWORD_SIZE); + if (length < (MLX5_WQE_DWORD_SIZE + 2)) + break; /* Update element. */ (*txq->elts)[elts_head] = buf; elts_head = (elts_head + 1) & (elts_n - 1); @@ -1290,7 +1291,7 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) &(*rxq->cqes)[rxq->cq_ci & cqe_cnt]; unsigned int i = 0; unsigned int rq_ci = rxq->rq_ci << sges_n; - int len; /* keep its value across iterations. */ + int len = 0; /* keep its value across iterations. */ while (pkts_n) { unsigned int idx = rq_ci & wqe_cnt; @@ -1356,7 +1357,7 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) pkt->ol_flags |= rxq_cq_to_ol_flags(rxq, cqe); } - if (cqe->hdr_type_etc & + if (ntohs(cqe->hdr_type_etc) & MLX5_CQE_VLAN_STRIPPED) { pkt->ol_flags |= PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED; diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c index 439908fc..c2863671 100644 --- a/drivers/net/mlx5/mlx5_txq.c +++ b/drivers/net/mlx5/mlx5_txq.c @@ -496,6 +496,19 @@ mlx5_tx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, } (*priv->txqs)[idx] = NULL; txq_cleanup(txq_ctrl); + /* Resize if txq size is changed. */ + if (txq_ctrl->txq.elts_n != log2above(desc)) { + txq_ctrl = rte_realloc(txq_ctrl, + sizeof(*txq_ctrl) + + desc * sizeof(struct rte_mbuf *), + RTE_CACHE_LINE_SIZE); + if (!txq_ctrl) { + ERROR("%p: unable to reallocate queue index %u", + (void *)dev, idx); + priv_unlock(priv); + return -ENOMEM; + } + } } else { txq_ctrl = rte_calloc_socket("TXQ", 1, diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index 099d82b3..49c52930 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -1916,7 +1916,7 @@ nfp_net_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) struct nfp_net_tx_desc *txds; struct rte_mbuf *pkt; uint64_t dma_addr; - int pkt_size, dma_size; + int pkt_size, pkt_len, dma_size; uint16_t free_descs, issued_descs; struct rte_mbuf **lmbuf; int i; @@ -1964,6 +1964,8 @@ nfp_net_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) * Checksum and VLAN flags just in the first descriptor for a * multisegment packet */ + + txds->data_len = pkt->pkt_len; nfp_net_tx_cksum(txq, txds, pkt); if ((pkt->ol_flags & PKT_TX_VLAN_PKT) && @@ -1981,6 +1983,7 @@ nfp_net_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) * then data_len = pkt_len */ pkt_size = pkt->pkt_len; + pkt_len = pkt->pkt_len; /* Releasing mbuf which was prefetched above */ if (*lmbuf) @@ -1999,7 +2002,7 @@ nfp_net_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) /* Filling descriptors fields */ txds->dma_len = dma_size; - txds->data_len = pkt->pkt_len; + txds->data_len = pkt_len; txds->dma_addr_hi = (dma_addr >> 32) & 0xff; txds->dma_addr_lo = (dma_addr & 0xffffffff); ASSERT(free_descs > 0); diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c index 57b0b315..1a208ffc 100644 --- a/drivers/net/pcap/rte_eth_pcap.c +++ b/drivers/net/pcap/rte_eth_pcap.c @@ -294,9 +294,9 @@ eth_pcap_tx_dumper(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) } } - rte_pktmbuf_free(mbuf); num_tx++; tx_bytes += mbuf->pkt_len; + rte_pktmbuf_free(mbuf); } /* diff --git a/drivers/net/qede/base/bcm_osal.c b/drivers/net/qede/base/bcm_osal.c index 28be9587..3f895cd4 100644 --- a/drivers/net/qede/base/bcm_osal.c +++ b/drivers/net/qede/base/bcm_osal.c @@ -98,9 +98,7 @@ inline u32 qede_find_first_zero_bit(unsigned long *addr, u32 limit) u32 nwords = 0; OSAL_BUILD_BUG_ON(!limit); nwords = (limit - 1) / OSAL_BITS_PER_UL + 1; - for (i = 0; i < nwords; i++) - if (~(addr[i] != 0)) - break; + for (i = 0; i < nwords && ~(addr[i]) == 0; i++); return (i == nwords) ? limit : i * OSAL_BITS_PER_UL + qede_ffz(addr[i]); } diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c index 6d6fb9de..23221478 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -433,8 +433,6 @@ qede_mac_addr_set(struct rte_eth_dev *eth_dev, struct ether_addr *mac_addr) { struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev); struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); - struct ecore_filter_ucast ucast; - int rc; if (IS_VF(edev) && !ecore_vf_check_mac(ECORE_LEADING_HWFN(edev), mac_addr->addr_bytes)) { @@ -444,29 +442,7 @@ qede_mac_addr_set(struct rte_eth_dev *eth_dev, struct ether_addr *mac_addr) return; } - /* First remove the primary mac */ - qede_set_ucast_cmn_params(&ucast); - ucast.opcode = ECORE_FILTER_REMOVE; - ucast.type = ECORE_FILTER_MAC; - ether_addr_copy(&qdev->primary_mac, - (struct ether_addr *)&ucast.mac); - rc = ecore_filter_ucast_cmd(edev, &ucast, ECORE_SPQ_MODE_CB, NULL); - if (rc != 0) { - DP_ERR(edev, "Unable to remove current macaddr" - " Reverting to previous default mac\n"); - ether_addr_copy(&qdev->primary_mac, - ð_dev->data->mac_addrs[0]); - return; - } - - /* Add new MAC */ - ucast.opcode = ECORE_FILTER_ADD; - ether_addr_copy(mac_addr, (struct ether_addr *)&ucast.mac); - rc = ecore_filter_ucast_cmd(edev, &ucast, ECORE_SPQ_MODE_CB, NULL); - if (rc != 0) - DP_ERR(edev, "Unable to add new default mac\n"); - else - ether_addr_copy(mac_addr, &qdev->primary_mac); + qede_mac_addr_add(eth_dev, mac_addr, 0, 0); } static void qede_config_accept_any_vlan(struct qede_dev *qdev, bool action) @@ -741,10 +717,6 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev) SLIST_INIT(&qdev->vlan_list_head); - /* Add primary mac for PF */ - if (IS_PF(edev)) - qede_mac_addr_set(eth_dev, &qdev->primary_mac); - /* Enable VLAN offloads by default */ qede_vlan_offload_set(eth_dev, ETH_VLAN_STRIP_MASK | ETH_VLAN_FILTER_MASK | @@ -1286,6 +1258,8 @@ void qede_init_rss_caps(uint8_t *rss_caps, uint64_t hf) *rss_caps |= (hf & ETH_RSS_NONFRAG_IPV4_TCP) ? ECORE_RSS_IPV4_TCP : 0; *rss_caps |= (hf & ETH_RSS_NONFRAG_IPV6_TCP) ? ECORE_RSS_IPV6_TCP : 0; *rss_caps |= (hf & ETH_RSS_IPV6_TCP_EX) ? ECORE_RSS_IPV6_TCP : 0; + *rss_caps |= (hf & ETH_RSS_NONFRAG_IPV4_UDP) ? ECORE_RSS_IPV4_UDP : 0; + *rss_caps |= (hf & ETH_RSS_NONFRAG_IPV6_UDP) ? ECORE_RSS_IPV6_UDP : 0; } static int qede_rss_hash_update(struct rte_eth_dev *eth_dev, diff --git a/drivers/net/qede/qede_main.c b/drivers/net/qede/qede_main.c index b666e1c7..a6d8ef4e 100644 --- a/drivers/net/qede/qede_main.c +++ b/drivers/net/qede/qede_main.c @@ -345,11 +345,12 @@ qed_fill_dev_info(struct ecore_dev *edev, struct qed_dev_info *dev_info) rte_memcpy(&dev_info->hw_mac, &edev->hwfns[0].hw_info.hw_mac_addr, ETHER_ADDR_LEN); + dev_info->fw_major = FW_MAJOR_VERSION; + dev_info->fw_minor = FW_MINOR_VERSION; + dev_info->fw_rev = FW_REVISION_VERSION; + dev_info->fw_eng = FW_ENGINEERING_VERSION; + if (IS_PF(edev)) { - dev_info->fw_major = FW_MAJOR_VERSION; - dev_info->fw_minor = FW_MINOR_VERSION; - dev_info->fw_rev = FW_REVISION_VERSION; - dev_info->fw_eng = FW_ENGINEERING_VERSION; dev_info->mf_mode = edev->mf_mode; dev_info->tx_switching = false; } else { diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c index a34b6659..9cce13df 100644 --- a/drivers/net/qede/qede_rxtx.c +++ b/drivers/net/qede/qede_rxtx.c @@ -1318,10 +1318,6 @@ int qede_dev_start(struct rte_eth_dev *eth_dev) /* Bring-up the link */ qede_dev_set_link_state(eth_dev, true); - /* Reset ring */ - if (qede_reset_fp_rings(qdev)) - return -ENOMEM; - /* Start/resume traffic */ qdev->ops->fastpath_start(edev); @@ -1490,6 +1486,7 @@ int qede_reset_fp_rings(struct qede_dev *qdev) } } } + qede_reset_fp_rings(qdev); return 0; } diff --git a/drivers/net/thunderx/base/nicvf_bsvf.c b/drivers/net/thunderx/base/nicvf_bsvf.c index 9e028a3a..49a2646d 100644 --- a/drivers/net/thunderx/base/nicvf_bsvf.c +++ b/drivers/net/thunderx/base/nicvf_bsvf.c @@ -37,7 +37,7 @@ #include "nicvf_bsvf.h" #include "nicvf_plat.h" -static SIMPLEQ_HEAD(, svf_entry) head = SIMPLEQ_HEAD_INITIALIZER(head); +static STAILQ_HEAD(, svf_entry) head = STAILQ_HEAD_INITIALIZER(head); void nicvf_bsvf_push(struct svf_entry *entry) @@ -45,7 +45,7 @@ nicvf_bsvf_push(struct svf_entry *entry) assert(entry != NULL); assert(entry->vf != NULL); - SIMPLEQ_INSERT_TAIL(&head, entry, next); + STAILQ_INSERT_TAIL(&head, entry, next); } struct svf_entry * @@ -53,14 +53,14 @@ nicvf_bsvf_pop(void) { struct svf_entry *entry; - assert(!SIMPLEQ_EMPTY(&head)); + assert(!STAILQ_EMPTY(&head)); - entry = SIMPLEQ_FIRST(&head); + entry = STAILQ_FIRST(&head); assert(entry != NULL); assert(entry->vf != NULL); - SIMPLEQ_REMOVE_HEAD(&head, next); + STAILQ_REMOVE_HEAD(&head, next); return entry; } @@ -68,5 +68,5 @@ nicvf_bsvf_pop(void) int nicvf_bsvf_empty(void) { - return SIMPLEQ_EMPTY(&head); + return STAILQ_EMPTY(&head); } diff --git a/drivers/net/thunderx/base/nicvf_bsvf.h b/drivers/net/thunderx/base/nicvf_bsvf.h index 5d5a25e2..fb9b2484 100644 --- a/drivers/net/thunderx/base/nicvf_bsvf.h +++ b/drivers/net/thunderx/base/nicvf_bsvf.h @@ -41,7 +41,7 @@ struct nicvf; * The base queue structure to hold secondary qsets. */ struct svf_entry { - SIMPLEQ_ENTRY(svf_entry) next; /**< Next element's pointer */ + STAILQ_ENTRY(svf_entry) next; /**< Next element's pointer */ struct nicvf *vf; /**< Holder of a secondary qset */ }; diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index 466e49ce..2da5af04 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -41,7 +41,6 @@ #include #include #include -#include #include #include @@ -245,7 +244,7 @@ nicvf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) /* Reading per RX ring stats */ for (qidx = rx_start; qidx <= rx_end; qidx++) { - if (qidx == RTE_ETHDEV_QUEUE_STAT_CNTRS) + if (qidx >= RTE_ETHDEV_QUEUE_STAT_CNTRS) break; nicvf_hw_get_rx_qstats(nic, &rx_qstats, qidx); @@ -258,7 +257,7 @@ nicvf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) /* Reading per TX ring stats */ for (qidx = tx_start; qidx <= tx_end; qidx++) { - if (qidx == RTE_ETHDEV_QUEUE_STAT_CNTRS) + if (qidx >= RTE_ETHDEV_QUEUE_STAT_CNTRS) break; nicvf_hw_get_tx_qstats(nic, &tx_qstats, qidx); @@ -277,7 +276,7 @@ nicvf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) /* Reading per RX ring stats */ for (qidx = rx_start; qidx <= rx_end; qidx++) { - if (qidx == RTE_ETHDEV_QUEUE_STAT_CNTRS) + if (qidx >= RTE_ETHDEV_QUEUE_STAT_CNTRS) break; nicvf_hw_get_rx_qstats(snic, &rx_qstats, @@ -290,7 +289,7 @@ nicvf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) nicvf_tx_range(dev, snic, &tx_start, &tx_end); /* Reading per TX ring stats */ for (qidx = tx_start; qidx <= tx_end; qidx++) { - if (qidx == RTE_ETHDEV_QUEUE_STAT_CNTRS) + if (qidx >= RTE_ETHDEV_QUEUE_STAT_CNTRS) break; nicvf_hw_get_tx_qstats(snic, &tx_qstats, diff --git a/drivers/net/thunderx/nicvf_rxtx.c b/drivers/net/thunderx/nicvf_rxtx.c index fc43b747..87e9de1a 100644 --- a/drivers/net/thunderx/nicvf_rxtx.c +++ b/drivers/net/thunderx/nicvf_rxtx.c @@ -469,11 +469,10 @@ nicvf_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) rxq->head = cqe_head; nicvf_addr_write(rxq->cq_door, to_process); rxq->recv_buffers += to_process; - if (rxq->recv_buffers > rxq->rx_free_thresh) { - rxq->recv_buffers -= nicvf_fill_rbdr(rxq, - rxq->rx_free_thresh); - NICVF_RX_ASSERT(rxq->recv_buffers >= 0); - } + } + if (rxq->recv_buffers > rxq->rx_free_thresh) { + rxq->recv_buffers -= nicvf_fill_rbdr(rxq, rxq->rx_free_thresh); + NICVF_RX_ASSERT(rxq->recv_buffers >= 0); } return to_process; @@ -563,11 +562,10 @@ nicvf_recv_pkts_multiseg(void *rx_queue, struct rte_mbuf **rx_pkts, rxq->head = cqe_head; nicvf_addr_write(rxq->cq_door, to_process); rxq->recv_buffers += buffers_consumed; - if (rxq->recv_buffers > rxq->rx_free_thresh) { - rxq->recv_buffers -= - nicvf_fill_rbdr(rxq, rxq->rx_free_thresh); - NICVF_RX_ASSERT(rxq->recv_buffers >= 0); - } + } + if (rxq->recv_buffers > rxq->rx_free_thresh) { + rxq->recv_buffers -= nicvf_fill_rbdr(rxq, rxq->rx_free_thresh); + NICVF_RX_ASSERT(rxq->recv_buffers >= 0); } return to_process; diff --git a/drivers/net/thunderx/nicvf_struct.h b/drivers/net/thunderx/nicvf_struct.h index c900e121..5bc6d577 100644 --- a/drivers/net/thunderx/nicvf_struct.h +++ b/drivers/net/thunderx/nicvf_struct.h @@ -43,8 +43,8 @@ #include struct nicvf_rbdr { - uint64_t rbdr_status; - uint64_t rbdr_door; + uintptr_t rbdr_status; + uintptr_t rbdr_door; struct rbdr_entry_t *desc; nicvf_phys_addr_t phys; uint32_t buffsz; @@ -58,8 +58,8 @@ struct nicvf_txq { union sq_entry_t *desc; nicvf_phys_addr_t phys; struct rte_mbuf **txbuffs; - uint64_t sq_head; - uint64_t sq_door; + uintptr_t sq_head; + uintptr_t sq_door; struct rte_mempool *pool; struct nicvf *nic; void (*pool_free)(struct nicvf_txq *sq); @@ -74,8 +74,8 @@ struct nicvf_txq { struct nicvf_rxq { uint64_t mbuf_phys_off; - uint64_t cq_status; - uint64_t cq_door; + uintptr_t cq_status; + uintptr_t cq_door; nicvf_phys_addr_t phys; union cq_entry_t *desc; struct nicvf_rbdr *shared_rbdr; diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index f5961ab7..452ad2a5 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -545,6 +545,9 @@ virtio_free_queues(struct virtio_hw *hw) int queue_type; uint16_t i; + if (hw->vqs == NULL) + return; + for (i = 0; i < nr_vq; i++) { vq = hw->vqs[i]; if (!vq) @@ -563,9 +566,11 @@ virtio_free_queues(struct virtio_hw *hw) } rte_free(vq); + hw->vqs[i] = NULL; } rte_free(hw->vqs); + hw->vqs = NULL; } static int @@ -1210,11 +1215,11 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features) rte_eth_copy_pci_info(eth_dev, pci_dev); - /* If host does not support status then disable LSC */ - if (!vtpci_with_feature(hw, VIRTIO_NET_F_STATUS)) - eth_dev->data->dev_flags &= ~RTE_ETH_DEV_INTR_LSC; - else + /* If host does not support both status and MSI-X then disable LSC */ + if (vtpci_with_feature(hw, VIRTIO_NET_F_STATUS) && hw->use_msix) eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC; + else + eth_dev->data->dev_flags &= ~RTE_ETH_DEV_INTR_LSC; rx_func_get(eth_dev); @@ -1550,9 +1555,6 @@ virtio_dev_start(struct rte_eth_dev *dev) } } - /* Initialize Link state */ - virtio_dev_link_update(dev, 0); - /*Notify the backend *Otherwise the tap backend might already stop its queue due to fullness. *vhost backend will have no chance to be waked up @@ -1582,6 +1584,11 @@ virtio_dev_start(struct rte_eth_dev *dev) VIRTQUEUE_DUMP(txvq->vq); } + hw->started = 1; + + /* Initialize Link state */ + virtio_dev_link_update(dev, 0); + return 0; } @@ -1636,6 +1643,7 @@ static void virtio_dev_free_mbufs(struct rte_eth_dev *dev) static void virtio_dev_stop(struct rte_eth_dev *dev) { + struct virtio_hw *hw = dev->data->dev_private; struct rte_eth_link link; PMD_INIT_LOG(DEBUG, "stop"); @@ -1643,6 +1651,7 @@ virtio_dev_stop(struct rte_eth_dev *dev) if (dev->data->dev_conf.intr_conf.lsc) rte_intr_disable(&dev->pci_dev->intr_handle); + hw->started = 0; memset(&link, 0, sizeof(link)); virtio_dev_atomic_write_link_status(dev, &link); } @@ -1659,7 +1668,9 @@ virtio_dev_link_update(struct rte_eth_dev *dev, __rte_unused int wait_to_complet link.link_duplex = ETH_LINK_FULL_DUPLEX; link.link_speed = SPEED_10G; - if (vtpci_with_feature(hw, VIRTIO_NET_F_STATUS)) { + if (hw->started == 0) { + link.link_status = ETH_LINK_DOWN; + } else if (vtpci_with_feature(hw, VIRTIO_NET_F_STATUS)) { PMD_INIT_LOG(DEBUG, "Get link status from hw"); vtpci_read_dev_config(hw, offsetof(struct virtio_net_config, status), diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c index 8d5355c7..f6d697f3 100644 --- a/drivers/net/virtio/virtio_pci.c +++ b/drivers/net/virtio/virtio_pci.c @@ -48,6 +48,7 @@ */ #define PCI_CAPABILITY_LIST 0x34 #define PCI_CAP_ID_VNDR 0x09 +#define PCI_CAP_ID_MSIX 0x11 /* * The remaining space is defined by each driver as the per-driver @@ -517,7 +518,7 @@ modern_del_queue(struct virtio_hw *hw, struct virtqueue *vq) static void modern_notify_queue(struct virtio_hw *hw __rte_unused, struct virtqueue *vq) { - io_write16(1, vq->notify_addr); + io_write16(vq->vq_queue_index, vq->notify_addr); } const struct virtio_pci_ops modern_ops = { @@ -670,6 +671,9 @@ virtio_read_caps(struct rte_pci_device *dev, struct virtio_hw *hw) break; } + if (cap.cap_vndr == PCI_CAP_ID_MSIX) + hw->use_msix = 1; + if (cap.cap_vndr != PCI_CAP_ID_VNDR) { PMD_INIT_LOG(DEBUG, "[%2x] skipping non VNDR cap id: %02x", diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h index 511a1c87..40f7e424 100644 --- a/drivers/net/virtio/virtio_pci.h +++ b/drivers/net/virtio/virtio_pci.h @@ -160,7 +160,8 @@ struct virtnet_ctl; /* * Maximum number of virtqueues per device. */ -#define VIRTIO_MAX_VIRTQUEUES 8 +#define VIRTIO_MAX_VIRTQUEUE_PAIRS 8 +#define VIRTIO_MAX_VIRTQUEUES (VIRTIO_MAX_VIRTQUEUE_PAIRS * 2 + 1) /* Common configuration */ #define VIRTIO_PCI_CAP_COMMON_CFG 1 @@ -248,6 +249,7 @@ struct virtio_hw { uint64_t req_guest_features; uint64_t guest_features; uint32_t max_queue_pairs; + uint16_t started; uint16_t vtnet_hdr_size; uint8_t vlan_strip; uint8_t use_msix; diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c index a38398b8..91f6a59a 100644 --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c @@ -230,7 +230,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues, parse_mac(dev, mac); dev->vhostfd = -1; - for (i = 0; i < VIRTIO_MAX_VIRTQUEUES * 2 + 1; ++i) { + for (i = 0; i < VIRTIO_MAX_VIRTQUEUES; ++i) { dev->kickfds[i] = -1; dev->callfds[i] = -1; } diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.h b/drivers/net/virtio/virtio_user/virtio_user_dev.h index 28fc788e..1326b912 100644 --- a/drivers/net/virtio/virtio_user/virtio_user_dev.h +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.h @@ -40,8 +40,8 @@ struct virtio_user_dev { int vhostfd; - int callfds[VIRTIO_MAX_VIRTQUEUES * 2 + 1]; - int kickfds[VIRTIO_MAX_VIRTQUEUES * 2 + 1]; + int callfds[VIRTIO_MAX_VIRTQUEUES]; + int kickfds[VIRTIO_MAX_VIRTQUEUES]; int mac_specified; uint32_t max_queue_pairs; uint32_t queue_pairs; @@ -53,7 +53,7 @@ struct virtio_user_dev { uint8_t status; uint8_t mac_addr[ETHER_ADDR_LEN]; char path[PATH_MAX]; - struct vring vrings[VIRTIO_MAX_VIRTQUEUES * 2 + 1]; + struct vring vrings[VIRTIO_MAX_VIRTQUEUES]; }; int virtio_user_start_device(struct virtio_user_dev *dev); diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c index 013600e4..f018724f 100644 --- a/drivers/net/virtio/virtio_user_ethdev.c +++ b/drivers/net/virtio/virtio_user_ethdev.c @@ -416,6 +416,13 @@ virtio_user_pmd_probe(const char *name, const char *params) goto end; } + if (queues > VIRTIO_MAX_VIRTQUEUE_PAIRS) { + PMD_INIT_LOG(ERR, "arg %s %" PRIu64 " exceeds the limit %u", + VIRTIO_USER_ARG_QUEUES_NUM, queues, + VIRTIO_MAX_VIRTQUEUE_PAIRS); + goto end; + } + eth_dev = virtio_user_eth_dev_alloc(name); if (!eth_dev) { PMD_INIT_LOG(ERR, "virtio_user fails to alloc device"); diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h index b1070e05..569c251c 100644 --- a/drivers/net/virtio/virtqueue.h +++ b/drivers/net/virtio/virtqueue.h @@ -71,8 +71,14 @@ struct rte_mbuf; /** * Return the physical address (or virtual address in case of * virtio-user) of mbuf data buffer. + * + * The address is firstly casted to the word size (sizeof(uintptr_t)) + * before casting it to uint64_t. This is to make it work with different + * combination of word size (64 bit and 32 bit) and virtio device + * (virtio-pci and virtio-user). */ -#define VIRTIO_MBUF_ADDR(mb, vq) (*(uint64_t *)((uintptr_t)(mb) + (vq)->offset)) +#define VIRTIO_MBUF_ADDR(mb, vq) \ + ((uint64_t)(*(uintptr_t *)((uintptr_t)(mb) + (vq)->offset))) #else #define VIRTIO_MBUF_ADDR(mb, vq) ((mb)->buf_physaddr) #endif diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c index 8bb13e52..f123df90 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c @@ -771,7 +771,7 @@ vmxnet3_dev_link_update(struct rte_eth_dev *dev, __rte_unused int wait_to_complete) { struct vmxnet3_hw *hw = dev->data->dev_private; - struct rte_eth_link old, link; + struct rte_eth_link old = { 0 }, link; uint32_t ret; /* Link status doesn't change for stopped dev */ diff --git a/drivers/net/vmxnet3/vmxnet3_ring.h b/drivers/net/vmxnet3/vmxnet3_ring.h index b50d2b00..a3d330cc 100644 --- a/drivers/net/vmxnet3/vmxnet3_ring.h +++ b/drivers/net/vmxnet3/vmxnet3_ring.h @@ -138,6 +138,7 @@ typedef struct vmxnet3_tx_queue { uint32_t qid; struct Vmxnet3_TxQueueDesc *shared; struct vmxnet3_txq_stats stats; + const struct rte_memzone *mz; bool stopped; uint16_t queue_id; /**< Device TX queue index. */ uint8_t port_id; /**< Device port identifier. */ @@ -161,6 +162,7 @@ typedef struct vmxnet3_rx_queue { struct rte_mbuf *start_seg; struct rte_mbuf *last_seg; struct vmxnet3_rxq_stats stats; + const struct rte_memzone *mz; bool stopped; uint16_t queue_id; /**< Device RX queue index. */ uint8_t port_id; /**< Device port identifier. */ diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c index 93db10fb..3ded18ee 100644 --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c @@ -192,6 +192,8 @@ vmxnet3_dev_tx_queue_release(void *txq) vmxnet3_tx_cmd_ring_release_mbufs(&tq->cmd_ring); /* Release the cmd_ring */ vmxnet3_cmd_ring_release(&tq->cmd_ring); + /* Release the memzone */ + rte_memzone_free(tq->mz); } } @@ -209,6 +211,9 @@ vmxnet3_dev_rx_queue_release(void *rxq) /* Release both the cmd_rings */ for (i = 0; i < VMXNET3_RX_CMDRING_SIZE; i++) vmxnet3_cmd_ring_release(&rq->cmd_ring[i]); + + /* Release the memzone */ + rte_memzone_free(rq->mz); } } @@ -816,30 +821,6 @@ rcd_done: return nb_rx; } -/* - * Create memzone for device rings. malloc can't be used as the physical address is - * needed. If the memzone is already created, then this function returns a ptr - * to the old one. - */ -static const struct rte_memzone * -ring_dma_zone_reserve(struct rte_eth_dev *dev, const char *ring_name, - uint16_t queue_id, uint32_t ring_size, int socket_id) -{ - char z_name[RTE_MEMZONE_NAMESIZE]; - const struct rte_memzone *mz; - - snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d", - dev->driver->pci_drv.driver.name, ring_name, - dev->data->port_id, queue_id); - - mz = rte_memzone_lookup(z_name); - if (mz) - return mz; - - return rte_memzone_reserve_aligned(z_name, ring_size, - socket_id, 0, VMXNET3_RING_BA_ALIGN); -} - int vmxnet3_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, @@ -907,11 +888,13 @@ vmxnet3_dev_tx_queue_setup(struct rte_eth_dev *dev, size += sizeof(struct Vmxnet3_TxCompDesc) * comp_ring->size; size += sizeof(struct Vmxnet3_TxDataDesc) * data_ring->size; - mz = ring_dma_zone_reserve(dev, "txdesc", queue_idx, size, socket_id); + mz = rte_eth_dma_zone_reserve(dev, "txdesc", queue_idx, size, + VMXNET3_RING_BA_ALIGN, socket_id); if (mz == NULL) { PMD_INIT_LOG(ERR, "ERROR: Creating queue descriptors zone"); return -ENOMEM; } + txq->mz = mz; memset(mz->addr, 0, mz->len); /* cmd_ring initialization */ @@ -1009,11 +992,13 @@ vmxnet3_dev_rx_queue_setup(struct rte_eth_dev *dev, size = sizeof(struct Vmxnet3_RxDesc) * (ring0->size + ring1->size); size += sizeof(struct Vmxnet3_RxCompDesc) * comp_ring->size; - mz = ring_dma_zone_reserve(dev, "rxdesc", queue_idx, size, socket_id); + mz = rte_eth_dma_zone_reserve(dev, "rxdesc", queue_idx, size, + VMXNET3_RING_BA_ALIGN, socket_id); if (mz == NULL) { PMD_INIT_LOG(ERR, "ERROR: Creating queue descriptors zone"); return -ENOMEM; } + rxq->mz = mz; memset(mz->addr, 0, mz->len); /* cmd_ring0 initialization */ diff --git a/examples/bond/main.c b/examples/bond/main.c index 6402c6b3..9a4ec807 100644 --- a/examples/bond/main.c +++ b/examples/bond/main.c @@ -160,7 +160,7 @@ static struct rte_eth_conf port_conf = { .hw_ip_checksum = 0, /**< IP checksum offload enabled */ .hw_vlan_filter = 0, /**< VLAN filtering disabled */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .rx_adv_conf = { .rss_conf = { diff --git a/examples/dpdk_qat/main.c b/examples/dpdk_qat/main.c index aa9b1d5c..d3f7bf0e 100644 --- a/examples/dpdk_qat/main.c +++ b/examples/dpdk_qat/main.c @@ -142,7 +142,7 @@ static struct rte_eth_conf port_conf = { .hw_ip_checksum = 1, /**< IP checksum offload enabled */ .hw_vlan_filter = 0, /**< VLAN filtering disabled */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .rx_adv_conf = { .rss_conf = { diff --git a/examples/exception_path/Makefile b/examples/exception_path/Makefile index 959914a2..4b6e0717 100644 --- a/examples/exception_path/Makefile +++ b/examples/exception_path/Makefile @@ -42,6 +42,7 @@ ifneq ($(CONFIG_RTE_EXEC_ENV),"linuxapp") $(info This application can only operate in a linuxapp environment, \ please change the definition of the RTE_TARGET environment variable) all: +clean: else # binary name diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c index 73d50b69..89bf1cc0 100644 --- a/examples/exception_path/main.c +++ b/examples/exception_path/main.c @@ -114,7 +114,7 @@ static const struct rte_eth_conf port_conf = { .hw_ip_checksum = 0, /* IP checksum offload disabled */ .hw_vlan_filter = 0, /* VLAN filtering disabled */ .jumbo_frame = 0, /* Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /* CRC stripped by hardware */ + .hw_strip_crc = 1, /* CRC stripped by hardware */ }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c index e1e32c66..f4e3dc33 100644 --- a/examples/ip_fragmentation/main.c +++ b/examples/ip_fragmentation/main.c @@ -176,7 +176,7 @@ static const struct rte_eth_conf port_conf = { .hw_ip_checksum = 1, /**< IP checksum offload enabled */ .hw_vlan_filter = 0, /**< VLAN filtering disabled */ .jumbo_frame = 1, /**< Jumbo Frame Support enabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, @@ -653,6 +653,74 @@ check_all_ports_link_status(uint8_t port_num, uint32_t port_mask) } } +/* Check L3 packet type detection capablity of the NIC port */ +static int +check_ptype(int portid) +{ + int i, ret; + int ptype_l3_ipv4 = 0, ptype_l3_ipv6 = 0; + uint32_t ptype_mask = RTE_PTYPE_L3_MASK; + + ret = rte_eth_dev_get_supported_ptypes(portid, ptype_mask, NULL, 0); + if (ret <= 0) + return 0; + + uint32_t ptypes[ret]; + + ret = rte_eth_dev_get_supported_ptypes(portid, ptype_mask, ptypes, ret); + for (i = 0; i < ret; ++i) { + if (ptypes[i] & RTE_PTYPE_L3_IPV4) + ptype_l3_ipv4 = 1; + if (ptypes[i] & RTE_PTYPE_L3_IPV6) + ptype_l3_ipv6 = 1; + } + + if (ptype_l3_ipv4 == 0) + printf("port %d cannot parse RTE_PTYPE_L3_IPV4\n", portid); + + if (ptype_l3_ipv6 == 0) + printf("port %d cannot parse RTE_PTYPE_L3_IPV6\n", portid); + + if (ptype_l3_ipv4 && ptype_l3_ipv6) + return 1; + + return 0; + +} + +/* Parse packet type of a packet by SW */ +static inline void +parse_ptype(struct rte_mbuf *m) +{ + struct ether_hdr *eth_hdr; + uint32_t packet_type = RTE_PTYPE_UNKNOWN; + uint16_t ether_type; + + eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + ether_type = eth_hdr->ether_type; + if (ether_type == rte_cpu_to_be_16(ETHER_TYPE_IPv4)) + packet_type |= RTE_PTYPE_L3_IPV4_EXT_UNKNOWN; + else if (ether_type == rte_cpu_to_be_16(ETHER_TYPE_IPv6)) + packet_type |= RTE_PTYPE_L3_IPV6_EXT_UNKNOWN; + + m->packet_type = packet_type; +} + +/* callback function to detect packet type for a queue of a port */ +static uint16_t +cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, + struct rte_mbuf *pkts[], uint16_t nb_pkts, + uint16_t max_pkts __rte_unused, + void *user_param __rte_unused) +{ + uint16_t i; + + for (i = 0; i < nb_pkts; ++i) + parse_ptype(pkts[i]); + + return nb_pkts; +} + static int init_routing_table(void) { @@ -944,6 +1012,12 @@ main(int argc, char **argv) ret, portid); rte_eth_promiscuous_enable(portid); + + if (check_ptype(portid) == 0) { + rte_eth_add_rx_callback(portid, 0, cb_parse_ptype, NULL); + printf("Add Rx callback funciton to detect L3 packet type by SW :" + " port = %d\n", portid); + } } if (init_routing_table() < 0) diff --git a/examples/ip_pipeline/config_parse.c b/examples/ip_pipeline/config_parse.c index 8b372e94..d1671a21 100644 --- a/examples/ip_pipeline/config_parse.c +++ b/examples/ip_pipeline/config_parse.c @@ -103,7 +103,7 @@ static const struct app_link_params link_params_default = { .hw_vlan_strip = 0, /* VLAN strip */ .hw_vlan_extend = 0, /* Extended VLAN */ .jumbo_frame = 0, /* Jumbo frame support */ - .hw_strip_crc = 0, /* CRC strip by HW */ + .hw_strip_crc = 1, /* CRC strip by HW */ .enable_scatter = 0, /* Scattered packets RX handler */ .max_rx_pkt_len = 9000, /* Jumbo frame max packet len */ diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c index 50fe4228..e096b917 100644 --- a/examples/ip_reassembly/main.c +++ b/examples/ip_reassembly/main.c @@ -200,7 +200,7 @@ static struct rte_eth_conf port_conf = { .hw_ip_checksum = 1, /**< IP checksum offload enabled */ .hw_vlan_filter = 0, /**< VLAN filtering disabled */ .jumbo_frame = 1, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .rx_adv_conf = { .rss_conf = { diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c index 5a4c9b71..9cccd8a0 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c @@ -208,7 +208,7 @@ static struct rte_eth_conf port_conf = { .hw_ip_checksum = 1, /**< IP checksum offload enabled */ .hw_vlan_filter = 0, /**< VLAN filtering disabled */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .rx_adv_conf = { .rss_conf = { diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c index 708d76e9..b908b317 100644 --- a/examples/ipv4_multicast/main.c +++ b/examples/ipv4_multicast/main.c @@ -145,7 +145,7 @@ static const struct rte_eth_conf port_conf = { .hw_ip_checksum = 0, /**< IP checksum offload disabled */ .hw_vlan_filter = 0, /**< VLAN filtering disabled */ .jumbo_frame = 1, /**< Jumbo Frame Support enabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, diff --git a/examples/kni/main.c b/examples/kni/main.c index 57313d11..0be57d83 100644 --- a/examples/kni/main.c +++ b/examples/kni/main.c @@ -130,7 +130,7 @@ static struct rte_eth_conf port_conf = { .hw_ip_checksum = 0, /* IP checksum offload disabled */ .hw_vlan_filter = 0, /* VLAN filtering disabled */ .jumbo_frame = 0, /* Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /* CRC stripped by hardware */ + .hw_strip_crc = 1, /* CRC stripped by hardware */ }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c index bc88be5e..07282317 100644 --- a/examples/l2fwd-crypto/main.c +++ b/examples/l2fwd-crypto/main.c @@ -215,7 +215,7 @@ static const struct rte_eth_conf port_conf = { .hw_ip_checksum = 0, /**< IP checksum offload disabled */ .hw_vlan_filter = 0, /**< VLAN filtering disabled */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, @@ -499,6 +499,10 @@ l2fwd_simple_crypto_enqueue(struct rte_mbuf *m, op->sym->auth.aad.data = cparams->aad.data; op->sym->auth.aad.phys_addr = cparams->aad.phys_addr; op->sym->auth.aad.length = cparams->aad.length; + } else { + op->sym->auth.aad.data = NULL; + op->sym->auth.aad.phys_addr = 0; + op->sym->auth.aad.length = 0; } } @@ -699,7 +703,8 @@ l2fwd_main_loop(struct l2fwd_crypto_options *options) generate_random_key(port_cparams[i].aad.data, port_cparams[i].aad.length); - } + } else + port_cparams[i].aad.length = 0; if (options->auth_xform.auth.op == RTE_CRYPTO_AUTH_OP_VERIFY) port_cparams[i].hash_verify = 1; @@ -810,7 +815,7 @@ l2fwd_main_loop(struct l2fwd_crypto_options *options) ops_burst, nb_rx) != nb_rx) { for (j = 0; j < nb_rx; j++) - rte_pktmbuf_free(pkts_burst[i]); + rte_pktmbuf_free(pkts_burst[j]); nb_rx = 0; } @@ -1693,7 +1698,6 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports, continue; } - options->block_size = cap->sym.auth.block_size; /* * Check if length of provided AAD is supported * by the algorithm chosen. diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c index dd9201b2..7cc16e5a 100644 --- a/examples/l2fwd-jobstats/main.c +++ b/examples/l2fwd-jobstats/main.c @@ -126,7 +126,7 @@ static const struct rte_eth_conf port_conf = { .hw_ip_checksum = 0, /**< IP checksum offload disabled */ .hw_vlan_filter = 0, /**< VLAN filtering disabled */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c index 60cccdb1..8b43e630 100644 --- a/examples/l2fwd-keepalive/main.c +++ b/examples/l2fwd-keepalive/main.c @@ -116,7 +116,7 @@ static const struct rte_eth_conf port_conf = { .hw_ip_checksum = 0, /**< IP checksum offload disabled */ .hw_vlan_filter = 0, /**< VLAN filtering disabled */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index b2f58519..94287dfb 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -120,7 +120,7 @@ static const struct rte_eth_conf port_conf = { .hw_ip_checksum = 0, /**< IP checksum offload disabled */ .hw_vlan_filter = 0, /**< VLAN filtering disabled */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c index 3cfbb40e..9307d48c 100644 --- a/examples/l3fwd-acl/main.c +++ b/examples/l3fwd-acl/main.c @@ -163,7 +163,7 @@ static struct rte_eth_conf port_conf = { .hw_ip_checksum = 1, /**< IP checksum offload enabled */ .hw_vlan_filter = 0, /**< VLAN filtering disabled */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .rx_adv_conf = { .rss_conf = { diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index b65d683c..eb5adb6e 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -147,7 +147,7 @@ /* * Configurable number of RX/TX ring descriptors */ -#define RTE_TEST_RX_DESC_DEFAULT 128 +#define RTE_TEST_RX_DESC_DEFAULT 512 #define RTE_TEST_TX_DESC_DEFAULT 512 static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; @@ -221,7 +221,7 @@ static struct rte_eth_conf port_conf = { .hw_ip_checksum = 1, /**< IP checksum offload enabled */ .hw_vlan_filter = 0, /**< VLAN filtering disabled */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .rx_adv_conf = { .rss_conf = { @@ -1545,6 +1545,7 @@ main(int argc, char **argv) uint32_t n_tx_queue, nb_lcores; uint32_t dev_rxq_num, dev_txq_num; uint8_t portid, nb_rx_queue, queue, socketid; + uint16_t org_rxq_intr = port_conf.intr_conf.rxq; /* catch SIGINT and restore cpufreq governor to ondemand */ signal(SIGINT, signal_exit_now); @@ -1605,8 +1606,13 @@ main(int argc, char **argv) n_tx_queue = dev_txq_num; printf("Creating queues: nb_rxq=%d nb_txq=%u... ", nb_rx_queue, (unsigned)n_tx_queue ); + /* If number of Rx queue is 0, no need to enable Rx interrupt */ + if (nb_rx_queue == 0) + port_conf.intr_conf.rxq = 0; ret = rte_eth_dev_configure(portid, nb_rx_queue, (uint16_t)n_tx_queue, &port_conf); + /* Revert to original value */ + port_conf.intr_conf.rxq = org_rxq_intr; if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: " "err=%d, port=%d\n", ret, portid); diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c index f56e8db9..d1aa7f6d 100644 --- a/examples/l3fwd-vf/main.c +++ b/examples/l3fwd-vf/main.c @@ -197,7 +197,7 @@ static struct rte_eth_conf port_conf = { .hw_ip_checksum = 1, /**< IP checksum offload enabled */ .hw_vlan_filter = 0, /**< VLAN filtering disabled */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .rx_adv_conf = { .rss_conf = { diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index 7223e773..a01cabc1 100644 --- a/examples/l3fwd/main.c +++ b/examples/l3fwd/main.c @@ -156,7 +156,7 @@ static struct rte_eth_conf port_conf = { .hw_ip_checksum = 1, /**< IP checksum offload enabled */ .hw_vlan_filter = 0, /**< VLAN filtering disabled */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .rx_adv_conf = { .rss_conf = { diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c index 14a038b7..8110f255 100644 --- a/examples/link_status_interrupt/main.c +++ b/examples/link_status_interrupt/main.c @@ -116,7 +116,7 @@ static const struct rte_eth_conf port_conf = { .hw_ip_checksum = 0, /**< IP checksum offload disabled */ .hw_vlan_filter = 0, /**< VLAN filtering disabled */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c index e07850be..abd05a31 100644 --- a/examples/load_balancer/init.c +++ b/examples/load_balancer/init.c @@ -81,7 +81,7 @@ static struct rte_eth_conf port_conf = { .hw_ip_checksum = 1, /**< IP checksum offload enabled */ .hw_vlan_filter = 0, /**< VLAN filtering disabled */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .rx_adv_conf = { .rss_conf = { diff --git a/examples/load_balancer/runtime.c b/examples/load_balancer/runtime.c index 6944325d..ed63fc91 100644 --- a/examples/load_balancer/runtime.c +++ b/examples/load_balancer/runtime.c @@ -418,10 +418,12 @@ static inline void app_lcore_io_tx_flush(struct app_lcore_params_io *lp) { uint8_t port; + uint32_t i; - for (port = 0; port < lp->tx.n_nic_ports; port ++) { + for (i = 0; i < lp->tx.n_nic_ports; i++) { uint32_t n_pkts; + port = lp->tx.nic_ports[i]; if (likely((lp->tx.mbuf_out_flush[port] == 0) || (lp->tx.mbuf_out[port].n_mbufs == 0))) { lp->tx.mbuf_out_flush[port] = 1; diff --git a/examples/multi_process/l2fwd_fork/main.c b/examples/multi_process/l2fwd_fork/main.c index 2d951d93..820448bc 100644 --- a/examples/multi_process/l2fwd_fork/main.c +++ b/examples/multi_process/l2fwd_fork/main.c @@ -163,7 +163,7 @@ static const struct rte_eth_conf port_conf = { .hw_ip_checksum = 0, /**< IP checksum offload disabled */ .hw_vlan_filter = 0, /**< VLAN filtering disabled */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, @@ -672,6 +672,8 @@ l2fwd_main_loop(void) port_statistics[portid].tx += sent; } + + prev_tsc = cur_tsc; } /* diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c index d30ff4a4..de665286 100644 --- a/examples/multi_process/symmetric_mp/main.c +++ b/examples/multi_process/symmetric_mp/main.c @@ -213,7 +213,7 @@ smp_port_init(uint8_t port, struct rte_mempool *mbuf_pool, uint16_t num_queues) .hw_ip_checksum = 1, /**< IP checksum offload enabled */ .hw_vlan_filter = 0, /**< VLAN filtering disabled */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .rx_adv_conf = { .rss_conf = { diff --git a/examples/netmap_compat/bridge/Makefile b/examples/netmap_compat/bridge/Makefile index 50d96e81..1d4ddfff 100644 --- a/examples/netmap_compat/bridge/Makefile +++ b/examples/netmap_compat/bridge/Makefile @@ -42,6 +42,7 @@ ifneq ($(CONFIG_RTE_EXEC_ENV),"linuxapp") $(info This application can only operate in a linuxapp environment, \ please change the definition of the RTE_TARGET environment variable) all: +clean: else # binary name diff --git a/examples/netmap_compat/bridge/bridge.c b/examples/netmap_compat/bridge/bridge.c index 53f5fdb6..2f2b6baa 100644 --- a/examples/netmap_compat/bridge/bridge.c +++ b/examples/netmap_compat/bridge/bridge.c @@ -59,7 +59,7 @@ struct rte_eth_conf eth_conf = { .hw_ip_checksum = 0, .hw_vlan_filter = 0, .jumbo_frame = 0, - .hw_strip_crc = 0, + .hw_strip_crc = 1, }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, diff --git a/examples/performance-thread/common/lthread_timer.h b/examples/performance-thread/common/lthread_timer.h index b5e6fb0e..2d147577 100644 --- a/examples/performance-thread/common/lthread_timer.h +++ b/examples/performance-thread/common/lthread_timer.h @@ -42,11 +42,22 @@ static inline uint64_t _ns_to_clks(uint64_t ns) { - unsigned __int128 clkns = rte_get_tsc_hz(); + /* + * clkns needs to be divided by 1E9 to get ns clocks. However, + * dividing by this first would lose a lot of accuracy. + * Dividing after a multiply by ns, could cause overflow of + * uint64_t if ns is about 5 seconds [if we assume a max tsc + * rate of 4GHz]. Therefore we first divide by 1E4, then + * multiply and finally divide by 1E5. This allows ns to be + * values many hours long, without overflow, while still keeping + * reasonable accuracy. + */ + uint64_t clkns = rte_get_tsc_hz() / 1e4; clkns *= ns; - clkns /= 1000000000; - return (uint64_t) clkns; + clkns /= 1e5; + + return clkns; } diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c index fdc90b28..dd403ca8 100644 --- a/examples/performance-thread/l3fwd-thread/main.c +++ b/examples/performance-thread/l3fwd-thread/main.c @@ -90,6 +90,10 @@ #define APP_LOOKUP_METHOD APP_LOOKUP_LPM #endif +#ifndef __GLIBC__ /* sched_getcpu() is glibc specific */ +#define sched_getcpu() rte_lcore_id() +#endif + /* * When set to zero, simple forwaring path is eanbled. * When set to one, optimized forwarding path is enabled. @@ -282,7 +286,7 @@ static struct rte_eth_conf port_conf = { .hw_ip_checksum = 1, /**< IP checksum offload enabled */ .hw_vlan_filter = 0, /**< VLAN filtering disabled */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .rx_adv_conf = { .rss_conf = { diff --git a/examples/performance-thread/pthread_shim/main.c b/examples/performance-thread/pthread_shim/main.c index f0357218..850b009d 100644 --- a/examples/performance-thread/pthread_shim/main.c +++ b/examples/performance-thread/pthread_shim/main.c @@ -59,6 +59,10 @@ #define DEBUG_APP 0 #define HELLOW_WORLD_MAX_LTHREADS 10 +#ifndef __GLIBC__ /* sched_getcpu() is glibc-specific */ +#define sched_getcpu() rte_lcore_id() +#endif + __thread int print_count; __thread pthread_mutex_t print_lock; @@ -175,12 +179,12 @@ static void initial_lthread(void *args __attribute__((unused))) * use an attribute to pass the desired lcore */ pthread_attr_t attr; - cpu_set_t cpuset; + rte_cpuset_t cpuset; CPU_ZERO(&cpuset); CPU_SET(lcore, &cpuset); pthread_attr_init(&attr); - pthread_attr_setaffinity_np(&attr, sizeof(cpu_set_t), &cpuset); + pthread_attr_setaffinity_np(&attr, sizeof(rte_cpuset_t), &cpuset); /* create the thread */ pthread_create(&tid[i], &attr, helloworld_pthread, (void *) i); diff --git a/examples/performance-thread/pthread_shim/pthread_shim.c b/examples/performance-thread/pthread_shim/pthread_shim.c index 0d6100c9..113bafa0 100644 --- a/examples/performance-thread/pthread_shim/pthread_shim.c +++ b/examples/performance-thread/pthread_shim/pthread_shim.c @@ -48,6 +48,21 @@ #define POSIX_ERRNO(x) (x) +/* some releases of FreeBSD 10, e.g. 10.0, don't have CPU_COUNT macro */ +#ifndef CPU_COUNT +#define CPU_COUNT(x) __cpu_count(x) + +static inline unsigned int +__cpu_count(const rte_cpuset_t *cpuset) +{ + unsigned int i, count = 0; + for (i = 0; i < RTE_MAX_LCORE; i++) + if (CPU_ISSET(i, cpuset)) + count++; + return count; +} +#endif + /* * this flag determines at run time if we override pthread * calls and map then to equivalent lthread calls @@ -159,7 +174,7 @@ int (*f_pthread_setschedparam) int (*f_pthread_yield) (void); int (*f_pthread_setaffinity_np) - (pthread_t thread, size_t cpusetsize, const cpu_set_t *cpuset); + (pthread_t thread, size_t cpusetsize, const rte_cpuset_t *cpuset); int (*f_nanosleep) (const struct timespec *req, struct timespec *rem); } _sys_pthread_funcs = { @@ -390,11 +405,11 @@ pthread_create(pthread_t *__restrict tid, if (attr != NULL) { /* determine CPU being requested */ - cpu_set_t cpuset; + rte_cpuset_t cpuset; CPU_ZERO(&cpuset); pthread_attr_getaffinity_np(attr, - sizeof(cpu_set_t), + sizeof(rte_cpuset_t), &cpuset); if (CPU_COUNT(&cpuset) != 1) @@ -576,15 +591,26 @@ int pthread_rwlock_wrlock(pthread_rwlock_t *a) return _sys_pthread_funcs.f_pthread_rwlock_wrlock(a); } -int pthread_yield(void) +#ifdef RTE_EXEC_ENV_LINUXAPP +int +pthread_yield(void) { if (override) { lthread_yield(); return 0; } return _sys_pthread_funcs.f_pthread_yield(); - } +#else +void +pthread_yield(void) +{ + if (override) + lthread_yield(); + else + _sys_pthread_funcs.f_pthread_yield(); +} +#endif pthread_t pthread_self(void) { @@ -686,7 +712,7 @@ int nanosleep(const struct timespec *req, struct timespec *rem) int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, - const cpu_set_t *cpuset) + const rte_cpuset_t *cpuset) { if (override) { /* we only allow affinity with a single CPU */ diff --git a/examples/performance-thread/pthread_shim/pthread_shim.h b/examples/performance-thread/pthread_shim/pthread_shim.h index 78bbb5ac..10f87894 100644 --- a/examples/performance-thread/pthread_shim/pthread_shim.h +++ b/examples/performance-thread/pthread_shim/pthread_shim.h @@ -33,7 +33,8 @@ #ifndef _PTHREAD_SHIM_H_ #define _PTHREAD_SHIM_H_ -#include + +#include /* * This pthread shim is an example that demonstrates how legacy code diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c index 15656155..9ef55902 100644 --- a/examples/qos_meter/main.c +++ b/examples/qos_meter/main.c @@ -89,7 +89,7 @@ static struct rte_eth_conf port_conf = { .hw_ip_checksum = 1, .hw_vlan_filter = 0, .jumbo_frame = 0, - .hw_strip_crc = 0, + .hw_strip_crc = 1, }, .rx_adv_conf = { .rss_conf = { diff --git a/examples/qos_sched/Makefile b/examples/qos_sched/Makefile index f59645f5..e41ac500 100644 --- a/examples/qos_sched/Makefile +++ b/examples/qos_sched/Makefile @@ -42,6 +42,7 @@ ifneq ($(CONFIG_RTE_EXEC_ENV),"linuxapp") $(info This application can only operate in a linuxapp environment, \ please change the definition of the RTE_TARGET environment variable) all: +clean: else # binary name diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c index 70e12bb4..fe0221c6 100644 --- a/examples/qos_sched/init.c +++ b/examples/qos_sched/init.c @@ -92,7 +92,7 @@ static const struct rte_eth_conf port_conf = { .hw_ip_checksum = 0, /**< IP checksum offload disabled */ .hw_vlan_filter = 0, /**< VLAN filtering disabled */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .txmode = { .mq_mode = ETH_DCB_NONE, diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c index c2087218..e1dc9b2a 100644 --- a/examples/quota_watermark/qw/init.c +++ b/examples/quota_watermark/qw/init.c @@ -57,7 +57,7 @@ static const struct rte_eth_conf port_conf = { .hw_ip_checksum = 0, /**< IP checksum offload disabled */ .hw_vlan_filter = 0, /**< VLAN filtering disabled */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .txmode = { .mq_mode = ETH_DCB_NONE, @@ -165,7 +165,7 @@ setup_shared_variables(void) const struct rte_memzone *qw_memzone; qw_memzone = rte_memzone_reserve(QUOTA_WATERMARK_MEMZONE_NAME, 2 * sizeof(int), - rte_socket_id(), RTE_MEMZONE_2MB); + rte_socket_id(), 0); if (qw_memzone == NULL) rte_exit(EXIT_FAILURE, "%s\n", rte_strerror(rte_errno)); diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c index 8f1f15bb..7de33022 100644 --- a/examples/tep_termination/vxlan_setup.c +++ b/examples/tep_termination/vxlan_setup.c @@ -102,7 +102,7 @@ static const struct rte_eth_conf port_conf = { .hw_ip_checksum = 0, /**< IP checksum offload disabled */ .hw_vlan_filter = 0, /**< VLAN filtering disabled */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, diff --git a/examples/vhost/main.c b/examples/vhost/main.c index eddaf926..1e9059b4 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -153,7 +153,7 @@ static struct rte_eth_conf vmdq_conf_default = { */ .hw_vlan_strip = 1, /**< VLAN strip enabled. */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .txmode = { diff --git a/examples/vhost_xen/main.c b/examples/vhost_xen/main.c index f4dbaa48..6102b48e 100644 --- a/examples/vhost_xen/main.c +++ b/examples/vhost_xen/main.c @@ -149,7 +149,7 @@ static const struct rte_eth_conf vmdq_conf_default = { */ .hw_vlan_strip = 1, /**< VLAN strip enabled. */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .txmode = { diff --git a/lib/librte_cryptodev/rte_crypto_sym.h b/lib/librte_cryptodev/rte_crypto_sym.h index d3d38e4f..8f81d254 100644 --- a/lib/librte_cryptodev/rte_crypto_sym.h +++ b/lib/librte_cryptodev/rte_crypto_sym.h @@ -276,11 +276,10 @@ struct rte_crypto_auth_xform { * this specifies the length of the digest to be compared for the * session. * + * It is the caller's responsibility to ensure that the + * digest length is compliant with the hash algorithm being used. * If the value is less than the maximum length allowed by the hash, - * the result shall be truncated. If the value is greater than the - * maximum length allowed by the hash then an error will be generated - * by *rte_cryptodev_sym_session_create* or by the - * *rte_cryptodev_sym_enqueue_burst* if using session-less APIs. + * the result shall be truncated. */ uint32_t add_auth_data_length; @@ -571,7 +570,9 @@ struct rte_crypto_sym_op { phys_addr_t phys_addr; /**< Physical address of digest */ uint16_t length; - /**< Length of digest */ + /**< Length of digest. This must be the same value as + * @ref rte_crypto_auth_xform.digest_length. + */ } digest; /**< Digest parameters */ struct { diff --git a/lib/librte_cryptodev/rte_cryptodev_pmd.h b/lib/librte_cryptodev/rte_cryptodev_pmd.h index c6a57945..e82dcf07 100644 --- a/lib/librte_cryptodev/rte_cryptodev_pmd.h +++ b/lib/librte_cryptodev/rte_cryptodev_pmd.h @@ -57,14 +57,6 @@ extern "C" { #include "rte_crypto.h" #include "rte_cryptodev.h" - -#ifdef RTE_LIBRTE_CRYPTODEV_DEBUG -#define RTE_PMD_DEBUG_TRACE(...) \ - rte_pmd_debug_trace(__func__, __VA_ARGS__) -#else -#define RTE_PMD_DEBUG_TRACE(...) -#endif - struct rte_cryptodev_session { RTE_STD_C11 struct { diff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c b/lib/librte_eal/bsdapp/eal/eal_pci.c index 8b3ed881..f1de16ea 100644 --- a/lib/librte_eal/bsdapp/eal/eal_pci.c +++ b/lib/librte_eal/bsdapp/eal/eal_pci.c @@ -323,6 +323,7 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf) /* device is valid, add in list (sorted) */ if (TAILQ_EMPTY(&pci_device_list)) { + rte_eal_device_insert(&dev->device); TAILQ_INSERT_TAIL(&pci_device_list, dev, next); } else { @@ -335,7 +336,7 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf) continue; else if (ret < 0) { TAILQ_INSERT_BEFORE(dev2, dev, next); - return 0; + rte_eal_device_insert(&dev->device); } else { /* already registered */ dev2->kdrv = dev->kdrv; dev2->max_vfs = dev->max_vfs; @@ -343,9 +344,10 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf) dev->mem_resource, sizeof(dev->mem_resource)); free(dev); - return 0; } + return 0; } + rte_eal_device_insert(&dev->device); TAILQ_INSERT_TAIL(&pci_device_list, dev, next); } diff --git a/lib/librte_eal/bsdapp/nic_uio/nic_uio.c b/lib/librte_eal/bsdapp/nic_uio/nic_uio.c index 99a4975c..4bd7545a 100644 --- a/lib/librte_eal/bsdapp/nic_uio/nic_uio.c +++ b/lib/librte_eal/bsdapp/nic_uio/nic_uio.c @@ -180,6 +180,10 @@ nic_uio_probe (device_t dev) unsigned int device = pci_get_slot(dev); unsigned int function = pci_get_function(dev); + char bdf_str[256]; + char *token, *remaining; + + /* First check if we found this on load */ for (i = 0; i < num_detached; i++) if (bus == pci_get_bus(detached_devices[i]) && device == pci_get_slot(detached_devices[i]) && @@ -188,6 +192,45 @@ nic_uio_probe (device_t dev) return BUS_PROBE_SPECIFIC; } + /* otherwise check if it's a new device and if it matches the BDF */ + memset(bdf_str, 0, sizeof(bdf_str)); + TUNABLE_STR_FETCH("hw.nic_uio.bdfs", bdf_str, sizeof(bdf_str)); + remaining = bdf_str; + while (1) { + if (remaining == NULL || remaining[0] == '\0') + break; + token = strsep(&remaining, ",:"); + if (token == NULL) + break; + bus = strtol(token, NULL, 10); + token = strsep(&remaining, ",:"); + if (token == NULL) + break; + device = strtol(token, NULL, 10); + token = strsep(&remaining, ",:"); + if (token == NULL) + break; + function = strtol(token, NULL, 10); + + if (bus == pci_get_bus(dev) && + device == pci_get_slot(dev) && + function == pci_get_function(dev)) { + + if (num_detached < MAX_DETACHED_DEVICES) { + printf("%s: probed dev=%p\n", + __func__, dev); + detached_devices[num_detached++] = dev; + device_set_desc(dev, "DPDK PCI Device"); + return BUS_PROBE_SPECIFIC; + } else { + printf("%s: reached MAX_DETACHED_DEVICES=%d. dev=%p won't be reattached\n", + __func__, MAX_DETACHED_DEVICES, + dev); + break; + } + } + } + return ENXIO; } @@ -248,6 +291,7 @@ nic_uio_load(void) memset(bdf_str, 0, sizeof(bdf_str)); TUNABLE_STR_FETCH("hw.nic_uio.bdfs", bdf_str, sizeof(bdf_str)); remaining = bdf_str; + printf("nic_uio: hw.nic_uio.bdfs = '%s'\n", bdf_str); /* * Users should specify PCI BDFs in the format "b:d:f,b:d:f,b:d:f". * But the code below does not try differentiate between : and , diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h index 8840380d..dcf33d0e 100644 --- a/lib/librte_eal/common/include/rte_dev.h +++ b/lib/librte_eal/common/include/rte_dev.h @@ -49,6 +49,7 @@ extern "C" { #include #include +#include #include __attribute__((format(printf, 2, 0))) @@ -70,6 +71,19 @@ rte_pmd_debug_trace(const char *func_name, const char *fmt, ...) rte_log(RTE_LOG_ERR, RTE_LOGTYPE_PMD, "%s: %s", func_name, buffer); } +/* + * Enable RTE_PMD_DEBUG_TRACE() when at least one component relying on the + * RTE_*_RET() macros defined below is compiled in debug mode. + */ +#if defined(RTE_LIBRTE_ETHDEV_DEBUG) || \ + defined(RTE_LIBRTE_CRYPTODEV_DEBUG) || \ + defined(RTE_LIBRTE_EVENTDEV_DEBUG) +#define RTE_PMD_DEBUG_TRACE(...) \ + rte_pmd_debug_trace(__func__, __VA_ARGS__) +#else +#define RTE_PMD_DEBUG_TRACE(...) (void)0 +#endif + /* Macros for checking for restricting functions to primary instance only */ #define RTE_PROC_PRIMARY_OR_ERR_RET(retval) do { \ if (rte_eal_process_type() != RTE_PROC_PRIMARY) { \ diff --git a/lib/librte_eal/common/include/rte_version.h b/lib/librte_eal/common/include/rte_version.h index 0de35fb7..5bbe906b 100644 --- a/lib/librte_eal/common/include/rte_version.h +++ b/lib/librte_eal/common/include/rte_version.h @@ -66,7 +66,7 @@ extern "C" { /** * Patch level number i.e. the z in yy.mm.z */ -#define RTE_VER_MINOR 1 +#define RTE_VER_MINOR 2 /** * Extra string to be appended to version number diff --git a/lib/librte_eal/linuxapp/eal/eal_interrupts.c b/lib/librte_eal/linuxapp/eal/eal_interrupts.c index 47a3b20a..368863f9 100644 --- a/lib/librte_eal/linuxapp/eal/eal_interrupts.c +++ b/lib/librte_eal/linuxapp/eal/eal_interrupts.c @@ -194,14 +194,14 @@ vfio_disable_intx(struct rte_intr_handle *intr_handle) { irq_set = (struct vfio_irq_set *) irq_set_buf; irq_set->argsz = len; irq_set->count = 1; - irq_set->flags = VFIO_IRQ_SET_DATA_NONE | VFIO_IRQ_SET_ACTION_UNMASK; + irq_set->flags = VFIO_IRQ_SET_DATA_NONE | VFIO_IRQ_SET_ACTION_MASK; irq_set->index = VFIO_PCI_INTX_IRQ_INDEX; irq_set->start = 0; ret = ioctl(intr_handle->vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set); if (ret) { - RTE_LOG(ERR, EAL, "Error unmasking INTx interrupts for fd %d\n", + RTE_LOG(ERR, EAL, "Error masking INTx interrupts for fd %d\n", intr_handle->fd); return -1; } diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c index 3e4ffb57..aac05d7a 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #if defined(RTE_ARCH_X86) diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c index 5f478c59..7d8b9fb2 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c @@ -355,7 +355,8 @@ pci_vfio_map_resource(struct rte_pci_device *dev) } else { /* if we're in a secondary process, just find our tailq entry */ TAILQ_FOREACH(vfio_res, vfio_res_list, next) { - if (memcmp(&vfio_res->pci_addr, &dev->addr, sizeof(dev->addr))) + if (rte_eal_compare_pci_addr(&vfio_res->pci_addr, + &dev->addr)) continue; break; } diff --git a/lib/librte_eal/linuxapp/kni/compat.h b/lib/librte_eal/linuxapp/kni/compat.h index 78da08e5..d96275af 100644 --- a/lib/librte_eal/linuxapp/kni/compat.h +++ b/lib/librte_eal/linuxapp/kni/compat.h @@ -2,6 +2,8 @@ * Minimal wrappers to allow compiling kni on older kernels. */ +#include + #ifndef RHEL_RELEASE_VERSION #define RHEL_RELEASE_VERSION(a, b) (((a) << 8) + (b)) #endif @@ -67,3 +69,7 @@ (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34))) #undef NET_NAME_UNKNOWN #endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) +#define HAVE_SIGNAL_FUNCTIONS_OWN_HEADER +#endif diff --git a/lib/librte_eal/linuxapp/kni/kni_dev.h b/lib/librte_eal/linuxapp/kni/kni_dev.h index 58cbadd3..f0f6e61f 100644 --- a/lib/librte_eal/linuxapp/kni/kni_dev.h +++ b/lib/librte_eal/linuxapp/kni/kni_dev.h @@ -30,9 +30,15 @@ #endif #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#include "compat.h" + #include #include +#ifdef HAVE_SIGNAL_FUNCTIONS_OWN_HEADER +#include +#else #include +#endif #include #include #include diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 5a317594..ea545250 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -1051,8 +1051,10 @@ rte_eth_dev_close(uint8_t port_id) dev->data->dev_started = 0; (*dev->dev_ops->dev_close)(dev); + dev->data->nb_rx_queues = 0; rte_free(dev->data->rx_queues); dev->data->rx_queues = NULL; + dev->data->nb_tx_queues = 0; rte_free(dev->data->tx_queues); dev->data->tx_queues = NULL; } diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 96781792..11ec1fa8 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1001,15 +1001,6 @@ struct rte_eth_dev_callback; /** @internal Structure to keep track of registered callbacks */ TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback); - -#ifdef RTE_LIBRTE_ETHDEV_DEBUG -#define RTE_PMD_DEBUG_TRACE(...) \ - rte_pmd_debug_trace(__func__, __VA_ARGS__) -#else -#define RTE_PMD_DEBUG_TRACE(...) -#endif - - /* Macros to check for valid port */ #define RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, retval) do { \ if (!rte_eth_dev_is_valid_port(port_id)) { \ diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c index a80cefd2..c3f9208c 100644 --- a/lib/librte_kni/rte_kni.c +++ b/lib/librte_kni/rte_kni.c @@ -451,17 +451,35 @@ kni_free_fifo(struct rte_kni_fifo *fifo) } while (ret); } +static void * +va2pa(struct rte_mbuf *m) +{ + return (void *)((unsigned long)m - + ((unsigned long)m->buf_addr - + (unsigned long)m->buf_physaddr)); +} + +static void +obj_free(struct rte_mempool *mp __rte_unused, void *opaque, void *obj, + unsigned obj_idx __rte_unused) +{ + struct rte_mbuf *m = obj; + void *mbuf_phys = opaque; + + if (va2pa(m) == mbuf_phys) + rte_pktmbuf_free(m); +} + static void -kni_free_fifo_phy(struct rte_kni_fifo *fifo) +kni_free_fifo_phy(struct rte_mempool *mp, struct rte_kni_fifo *fifo) { void *mbuf_phys; int ret; do { ret = kni_fifo_get(fifo, &mbuf_phys, 1); - /* - * TODO: free mbufs - */ + if (ret) + rte_mempool_obj_iter(mp, obj_free, mbuf_phys); } while (ret); } @@ -470,6 +488,7 @@ rte_kni_release(struct rte_kni *kni) { struct rte_kni_device_info dev_info; uint32_t slot_id; + uint32_t retry = 5; if (!kni || !kni->in_use) return -1; @@ -481,9 +500,16 @@ rte_kni_release(struct rte_kni *kni) } /* mbufs in all fifo should be released, except request/response */ + + /* wait until all rxq packets processed by kernel */ + while (kni_fifo_count(kni->rx_q) && retry--) + usleep(1000); + + if (kni_fifo_count(kni->rx_q)) + RTE_LOG(ERR, KNI, "Fail to free all Rx-q items\n"); + + kni_free_fifo_phy(kni->pktmbuf_pool, kni->alloc_q); kni_free_fifo(kni->tx_q); - kni_free_fifo_phy(kni->rx_q); - kni_free_fifo_phy(kni->alloc_q); kni_free_fifo(kni->free_q); slot_id = kni->slot_id; @@ -549,14 +575,6 @@ rte_kni_handle_request(struct rte_kni *kni) return 0; } -static void * -va2pa(struct rte_mbuf *m) -{ - return (void *)((unsigned long)m - - ((unsigned long)m->buf_addr - - (unsigned long)m->buf_physaddr)); -} - unsigned rte_kni_tx_burst(struct rte_kni *kni, struct rte_mbuf **mbufs, unsigned num) { diff --git a/lib/librte_kni/rte_kni_fifo.h b/lib/librte_kni/rte_kni_fifo.h index 8cb85873..c7cd5c26 100644 --- a/lib/librte_kni/rte_kni_fifo.h +++ b/lib/librte_kni/rte_kni_fifo.h @@ -91,3 +91,12 @@ kni_fifo_get(struct rte_kni_fifo *fifo, void **data, unsigned num) fifo->read = new_read; return i; } + +/** + * Get the num of elements in the fifo + */ +static inline uint32_t +kni_fifo_count(struct rte_kni_fifo *fifo) +{ + return (fifo->len + fifo->write - fifo->read) & (fifo->len - 1); +} diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h index ff6de9d1..a3269c4c 100644 --- a/lib/librte_mbuf/rte_mbuf_ptype.h +++ b/lib/librte_mbuf/rte_mbuf_ptype.h @@ -91,6 +91,9 @@ * RTE_PTYPE_INNER_L4_UDP. */ +#include +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h index ff3d0654..5edf66c3 100644 --- a/lib/librte_net/rte_ether.h +++ b/lib/librte_net/rte_ether.h @@ -357,7 +357,7 @@ static inline int rte_vlan_strip(struct rte_mbuf *m) return -1; struct vlan_hdr *vh = (struct vlan_hdr *)(eh + 1); - m->ol_flags |= PKT_RX_VLAN_PKT; + m->ol_flags |= PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED; m->vlan_tci = rte_be_to_cpu_16(vh->vlan_tci); /* Copy ether header over rather than moving whole packet */ @@ -407,6 +407,8 @@ static inline int rte_vlan_insert(struct rte_mbuf **m) vh = (struct vlan_hdr *) (nh + 1); vh->vlan_tci = rte_cpu_to_be_16((*m)->vlan_tci); + (*m)->ol_flags &= ~PKT_RX_VLAN_STRIPPED; + return 0; } diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c index aaa9c270..84e05951 100644 --- a/lib/librte_vhost/socket.c +++ b/lib/librte_vhost/socket.c @@ -52,14 +52,18 @@ #include "vhost.h" #include "vhost_user.h" + +TAILQ_HEAD(vhost_user_connection_list, vhost_user_connection); + /* * Every time rte_vhost_driver_register() is invoked, an associated * vhost_user_socket struct will be created. */ struct vhost_user_socket { + struct vhost_user_connection_list conn_list; + pthread_mutex_t conn_mutex; char *path; int listenfd; - int connfd; bool is_server; bool reconnect; bool dequeue_zero_copy; @@ -67,7 +71,10 @@ struct vhost_user_socket { struct vhost_user_connection { struct vhost_user_socket *vsocket; + int connfd; int vid; + + TAILQ_ENTRY(vhost_user_connection) next; }; #define MAX_VHOST_SOCKET 1024 @@ -209,19 +216,24 @@ vhost_user_add_connection(int fd, struct vhost_user_socket *vsocket) RTE_LOG(INFO, VHOST_CONFIG, "new device, handle is %d\n", vid); - vsocket->connfd = fd; + conn->connfd = fd; conn->vsocket = vsocket; conn->vid = vid; ret = fdset_add(&vhost_user.fdset, fd, vhost_user_read_cb, NULL, conn); if (ret < 0) { - vsocket->connfd = -1; + conn->connfd = -1; free(conn); close(fd); RTE_LOG(ERR, VHOST_CONFIG, "failed to add fd %d into vhost server fdset\n", fd); + return; } + + pthread_mutex_lock(&vsocket->conn_mutex); + TAILQ_INSERT_TAIL(&vsocket->conn_list, conn, next); + pthread_mutex_unlock(&vsocket->conn_mutex); } /* call back when there is new vhost-user connection from client */ @@ -247,10 +259,14 @@ vhost_user_read_cb(int connfd, void *dat, int *remove) ret = vhost_user_msg_handler(conn->vid, connfd); if (ret < 0) { - vsocket->connfd = -1; close(connfd); *remove = 1; vhost_destroy_device(conn->vid); + + pthread_mutex_lock(&vsocket->conn_mutex); + TAILQ_REMOVE(&vsocket->conn_list, conn, next); + pthread_mutex_unlock(&vsocket->conn_mutex); + free(conn); if (vsocket->reconnect) @@ -448,7 +464,7 @@ vhost_user_create_client(struct vhost_user_socket *vsocket) return 0; } - RTE_LOG(ERR, VHOST_CONFIG, + RTE_LOG(WARNING, VHOST_CONFIG, "failed to connect to %s: %s\n", path, strerror(errno)); @@ -457,7 +473,7 @@ vhost_user_create_client(struct vhost_user_socket *vsocket) return -1; } - RTE_LOG(ERR, VHOST_CONFIG, "%s: reconnecting...\n", path); + RTE_LOG(INFO, VHOST_CONFIG, "%s: reconnecting...\n", path); reconn = malloc(sizeof(*reconn)); if (reconn == NULL) { RTE_LOG(ERR, VHOST_CONFIG, @@ -502,7 +518,8 @@ rte_vhost_driver_register(const char *path, uint64_t flags) goto out; memset(vsocket, 0, sizeof(struct vhost_user_socket)); vsocket->path = strdup(path); - vsocket->connfd = -1; + TAILQ_INIT(&vsocket->conn_list); + pthread_mutex_init(&vsocket->conn_mutex, NULL); vsocket->dequeue_zero_copy = flags & RTE_VHOST_USER_DEQUEUE_ZERO_COPY; if ((flags & RTE_VHOST_USER_CLIENT) != 0) { @@ -565,7 +582,7 @@ rte_vhost_driver_unregister(const char *path) { int i; int count; - struct vhost_user_connection *conn; + struct vhost_user_connection *conn, *next; pthread_mutex_lock(&vhost_user.mutex); @@ -581,15 +598,22 @@ rte_vhost_driver_unregister(const char *path) vhost_user_remove_reconnect(vsocket); } - conn = fdset_del(&vhost_user.fdset, vsocket->connfd); - if (conn) { + pthread_mutex_lock(&vsocket->conn_mutex); + for (conn = TAILQ_FIRST(&vsocket->conn_list); + conn != NULL; + conn = next) { + next = TAILQ_NEXT(conn, next); + + fdset_del(&vhost_user.fdset, conn->connfd); RTE_LOG(INFO, VHOST_CONFIG, "free connfd = %d for device '%s'\n", - vsocket->connfd, path); - close(vsocket->connfd); + conn->connfd, path); + close(conn->connfd); vhost_destroy_device(conn->vid); + TAILQ_REMOVE(&vsocket->conn_list, conn, next); free(conn); } + pthread_mutex_unlock(&vsocket->conn_mutex); free(vsocket->path); free(vsocket); diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c index e4150934..3c3f6a42 100644 --- a/lib/librte_vhost/vhost.c +++ b/lib/librte_vhost/vhost.c @@ -56,7 +56,7 @@ (1ULL << VIRTIO_NET_F_CTRL_VQ) | \ (1ULL << VIRTIO_NET_F_CTRL_RX) | \ (1ULL << VIRTIO_NET_F_GUEST_ANNOUNCE) | \ - (VHOST_SUPPORTS_MQ) | \ + (1ULL << VIRTIO_NET_F_MQ) | \ (1ULL << VIRTIO_F_VERSION_1) | \ (1ULL << VHOST_F_LOG_ALL) | \ (1ULL << VHOST_USER_F_PROTOCOL_FEATURES) | \ diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h index 22564f1c..d97df1d8 100644 --- a/lib/librte_vhost/vhost.h +++ b/lib/librte_vhost/vhost.h @@ -110,25 +110,15 @@ struct vhost_virtqueue { uint16_t shadow_used_idx; } __rte_cache_aligned; -/* Old kernels have no such macro defined */ +/* Old kernels have no such macros defined */ #ifndef VIRTIO_NET_F_GUEST_ANNOUNCE #define VIRTIO_NET_F_GUEST_ANNOUNCE 21 #endif - -/* - * Make an extra wrapper for VIRTIO_NET_F_MQ and - * VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX as they are - * introduced since kernel v3.8. This makes our - * code buildable for older kernel. - */ -#ifdef VIRTIO_NET_F_MQ - #define VHOST_MAX_QUEUE_PAIRS VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX - #define VHOST_SUPPORTS_MQ (1ULL << VIRTIO_NET_F_MQ) -#else - #define VHOST_MAX_QUEUE_PAIRS 1 - #define VHOST_SUPPORTS_MQ 0 +#ifndef VIRTIO_NET_F_MQ + #define VIRTIO_NET_F_MQ 22 #endif +#define VHOST_MAX_QUEUE_PAIRS 0x80 /* * Define virtio 1.0 for older kernels diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 337470d6..ea027f14 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c @@ -905,6 +905,8 @@ copy_desc_to_mbuf(struct virtio_net *dev, struct vring_desc *descs, "allocate memory for mbuf.\n"); return -1; } + if (unlikely(dev->dequeue_zero_copy)) + rte_mbuf_refcnt_update(cur, 1); prev->next = cur; prev->data_len = mbuf_offset; @@ -1056,9 +1058,21 @@ rte_vhost_dequeue_burst(int vid, uint16_t queue_id, * array, to looks like that guest actually send such packet. * * Check user_send_rarp() for more information. + * + * broadcast_rarp shares a cacheline in the virtio_net structure + * with some fields that are accessed during enqueue and + * rte_atomic16_cmpset() causes a write if using cmpxchg. This could + * result in false sharing between enqueue and dequeue. + * + * Prevent unnecessary false sharing by reading broadcast_rarp first + * and only performing cmpset if the read indicates it is likely to + * be set. */ - if (unlikely(rte_atomic16_cmpset((volatile uint16_t *) - &dev->broadcast_rarp.cnt, 1, 0))) { + + if (unlikely(rte_atomic16_read(&dev->broadcast_rarp) && + rte_atomic16_cmpset((volatile uint16_t *) + &dev->broadcast_rarp.cnt, 1, 0))) { + rarp_mbuf = rte_pktmbuf_alloc(mbuf_pool); if (rarp_mbuf == NULL) { RTE_LOG(ERR, VHOST_DATA, diff --git a/mk/machine/armv7a/rte.vars.mk b/mk/machine/armv7a/rte.vars.mk index 36fa3dea..41c4c408 100644 --- a/mk/machine/armv7a/rte.vars.mk +++ b/mk/machine/armv7a/rte.vars.mk @@ -57,7 +57,7 @@ MACHINE_CFLAGS += -march=armv7-a ifdef CONFIG_RTE_ARCH_ARM_TUNE -MACHINE_CFLAGS += -mtune=$(CONFIG_RTE_ARCH_ARM_TUNE) +MACHINE_CFLAGS += -mtune=$(CONFIG_RTE_ARCH_ARM_TUNE:"%"=%) endif MACHINE_CFLAGS += -mfpu=neon diff --git a/mk/machine/dpaa2/rte.vars.mk b/mk/machine/dpaa2/rte.vars.mk index 8541633c..61ada89a 100644 --- a/mk/machine/dpaa2/rte.vars.mk +++ b/mk/machine/dpaa2/rte.vars.mk @@ -56,5 +56,5 @@ MACHINE_CFLAGS += -march=armv8-a ifdef CONFIG_RTE_ARCH_ARM_TUNE -MACHINE_CFLAGS += -mcpu=$(CONFIG_RTE_ARCH_ARM_TUNE) +MACHINE_CFLAGS += -mcpu=$(CONFIG_RTE_ARCH_ARM_TUNE:"%"=%) endif diff --git a/mk/rte.app.mk b/mk/rte.app.mk index f75f0e24..725e01df 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -168,10 +168,21 @@ _LDLIBS-y += $(EXECENV_LDLIBS) LDLIBS += $(_LDLIBS-y) $(CPU_LDLIBS) $(EXTRA_LDLIBS) -# Eliminate duplicates without sorting -LDLIBS := $(shell echo $(LDLIBS) | \ - awk '{for (i = 1; i <= NF; i++) { \ - if ($$i !~ /^-l.*/ || !seen[$$i]++) print $$i }}') +# all the words except the first one +allbutfirst = $(wordlist 2,$(words $(1)),$(1)) + +# Eliminate duplicates without sorting, only keep the last occurrence +filter-libs = \ + $(if $(1),$(strip\ + $(if \ + $(and \ + $(filter $(firstword $(1)),$(call allbutfirst,$(1))),\ + $(filter -l%,$(firstword $(1)))),\ + ,\ + $(firstword $(1))) \ + $(call filter-libs,$(call allbutfirst,$(1))))) + +LDLIBS := $(call filter-libs,$(LDLIBS)) ifeq ($(RTE_DEVEL_BUILD)$(CONFIG_RTE_BUILD_SHARED_LIB),yy) LDFLAGS += -rpath=$(RTE_SDK_BIN)/lib diff --git a/mk/toolchain/clang/rte.toolchain-compat.mk b/mk/toolchain/clang/rte.toolchain-compat.mk index b734413b..9e095d38 100644 --- a/mk/toolchain/clang/rte.toolchain-compat.mk +++ b/mk/toolchain/clang/rte.toolchain-compat.mk @@ -38,7 +38,8 @@ # find out CLANG version -CLANG_VERSION := $(shell $(CC) -v 2>&1 | grep version | sed "s/.*version \([0-9]*\.[0-9]*\).*/\1/") +CLANG_VERSION := $(shell $(CC) -v 2>&1 | \ + sed -n "s/.*version \([0-9]*\.[0-9]*\).*/\1/p") CLANG_MAJOR_VERSION := $(shell echo $(CLANG_VERSION) | cut -f1 -d.) diff --git a/pkg/dpdk.spec b/pkg/dpdk.spec index 134c2b41..017d959f 100644 --- a/pkg/dpdk.spec +++ b/pkg/dpdk.spec @@ -30,7 +30,7 @@ # OF THE POSSIBILITY OF SUCH DAMAGE. Name: dpdk -Version: 16.11.1 +Version: 16.11.2 Release: 1 Packager: packaging@6wind.com URL: http://dpdk.org -- cgit 1.2.3-korg From 1d15a86e5aaf82b853b5c6811346a328881f6cf2 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 8 Jun 2017 10:06:45 -0600 Subject: Changelog: Merge stable update to 16.11.2 Change-Id: Iff1a96695bc84413780aadc93d23dc9f59272598 Signed-off-by: Christian Ehrhardt --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index aa45cdd3..8d88ceb4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +dpdk (16.11.2-1~git1) UNRELEASED; urgency=medium + + * Merge stable update to 16.11.2; For a list of changes + see http://dpdk.org/ml/archives/announce/2017-May/000131.html + + -- Christian Ehrhardt Thu, 08 Jun 2017 10:05:44 -0600 + dpdk (16.11.1-1~git1) UNRELEASED; urgency=medium [ Christian Ehrhardt ] -- cgit 1.2.3-korg From 58084e746e7f1d6c8b5d894b0ee6debfcb6bb6a7 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 8 Jun 2017 10:13:20 -0600 Subject: Drop patches that are in 16.11.2 Drop patches that were included in the latest stable release: - debian/patches/kni-fix-build-with-kernel-4.11.patch - debian/patches/nicvf-0002-net-thunderx-fix-32-bit-build.patch - debian/patches/nicvf-0006-mk-fix-lib-filtering-when-linking-app.patch - debian/patches/nicvf-0008-net-thunderx-fix-stats-access-out-of-bounds.patch - debian/patches/nicvf-0010-net-thunderx-fix-deadlock-in-Rx-path.patch Change-Id: Iced4e508c5dd2c41adf7589123e367983de9bb89 Signed-off-by: Christian Ehrhardt --- .../patches/kni-fix-build-with-kernel-4.11.patch | 82 ---------------------- .../nicvf-0002-net-thunderx-fix-32-bit-build.patch | 58 --------------- ...006-mk-fix-lib-filtering-when-linking-app.patch | 71 ------------------- ...t-thunderx-fix-stats-access-out-of-bounds.patch | 67 ------------------ ...0010-net-thunderx-fix-deadlock-in-Rx-path.patch | 58 --------------- debian/patches/series | 5 -- 6 files changed, 341 deletions(-) delete mode 100644 debian/patches/kni-fix-build-with-kernel-4.11.patch delete mode 100644 debian/patches/nicvf-0002-net-thunderx-fix-32-bit-build.patch delete mode 100644 debian/patches/nicvf-0006-mk-fix-lib-filtering-when-linking-app.patch delete mode 100644 debian/patches/nicvf-0008-net-thunderx-fix-stats-access-out-of-bounds.patch delete mode 100644 debian/patches/nicvf-0010-net-thunderx-fix-deadlock-in-Rx-path.patch diff --git a/debian/patches/kni-fix-build-with-kernel-4.11.patch b/debian/patches/kni-fix-build-with-kernel-4.11.patch deleted file mode 100644 index 73dfe51d..00000000 --- a/debian/patches/kni-fix-build-with-kernel-4.11.patch +++ /dev/null @@ -1,82 +0,0 @@ -From d4d2380cbb02980bf0334601d9ce6ec5400413f9 Mon Sep 17 00:00:00 2001 -From: Ferruh Yigit -Date: Tue, 21 Mar 2017 09:54:48 +0000 -Subject: [PATCH] kni: fix build with kernel 4.11 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -compile error: -.../build/build/lib/librte_eal/linuxapp/kni/kni_net.c:124:6: -error: implicit declaration of function ‘signal_pending’ -[-Werror=implicit-function-declaration] - if (signal_pending(current) || ret_val <= 0) { - ^~~~~~~~~~~~~~ - -Linux 4.11 moves signal function declarations to its own header file: -Linux: 174cd4b1e5fb ("sched/headers: Prepare to move signal wakeup & -sigpending methods from into ") - -Use new header file "linux/sched/signal.h" to fix the build error. - -Cc: stable@dpdk.org - -Reported-by: Jerin Jacob -Signed-off-by: Ferruh Yigit -Tested-by: Jerin Jacob -Tested-by: Pankaj Gupta ---- - lib/librte_eal/linuxapp/kni/compat.h | 6 ++++++ - lib/librte_eal/linuxapp/kni/kni_dev.h | 6 ++++++ - 2 files changed, 12 insertions(+) - -Origin: http://dpdk.org/browse/dpdk/commit/?id=d4d2380cbb02980bf0334601d9ce6ec5400413f9 -Original-Author: Ferruh Yigit -Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/dpdk/+bug/1691830 -Author: Christian Ehrhardt -Last-Update: 2017-05-19 - -diff --git a/lib/librte_eal/linuxapp/kni/compat.h b/lib/librte_eal/linuxapp/kni/compat.h -index 78da08e..d96275a 100644 ---- a/lib/librte_eal/linuxapp/kni/compat.h -+++ b/lib/librte_eal/linuxapp/kni/compat.h -@@ -2,6 +2,8 @@ - * Minimal wrappers to allow compiling kni on older kernels. - */ - -+#include -+ - #ifndef RHEL_RELEASE_VERSION - #define RHEL_RELEASE_VERSION(a, b) (((a) << 8) + (b)) - #endif -@@ -67,3 +69,7 @@ - (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34))) - #undef NET_NAME_UNKNOWN - #endif -+ -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) -+#define HAVE_SIGNAL_FUNCTIONS_OWN_HEADER -+#endif -diff --git a/lib/librte_eal/linuxapp/kni/kni_dev.h b/lib/librte_eal/linuxapp/kni/kni_dev.h -index 002e5fa..72385ab 100644 ---- a/lib/librte_eal/linuxapp/kni/kni_dev.h -+++ b/lib/librte_eal/linuxapp/kni/kni_dev.h -@@ -30,9 +30,15 @@ - #endif - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include "compat.h" -+ - #include - #include -+#ifdef HAVE_SIGNAL_FUNCTIONS_OWN_HEADER -+#include -+#else - #include -+#endif - #include - #include - #include --- -2.7.4 - diff --git a/debian/patches/nicvf-0002-net-thunderx-fix-32-bit-build.patch b/debian/patches/nicvf-0002-net-thunderx-fix-32-bit-build.patch deleted file mode 100644 index f5653d1e..00000000 --- a/debian/patches/nicvf-0002-net-thunderx-fix-32-bit-build.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 6d76fde7dba39769c64bee03b62593cc66a1b0e3 Mon Sep 17 00:00:00 2001 -From: Jerin Jacob -Date: Sun, 19 Mar 2017 20:18:46 +0530 -Subject: [PATCH] net/thunderx: fix 32-bit build - -Fixes: e438796617dc ("net/thunderx: add PMD skeleton") - -Signed-off-by: Jerin Jacob ---- - drivers/net/thunderx/nicvf_struct.h | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -Origin: http://dpdk.org/browse/dpdk/commit/?id=6d76fde7dba39769c64bee03b62593cc66a1b0e3 -Original-Author: Jerin Jacob -Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/dpdk/+bug/1691659 -Author: Christian Ehrhardt -Last-Update: 2017-05-18 - -diff --git a/drivers/net/thunderx/nicvf_struct.h b/drivers/net/thunderx/nicvf_struct.h -index c900e12..5bc6d57 100644 ---- a/drivers/net/thunderx/nicvf_struct.h -+++ b/drivers/net/thunderx/nicvf_struct.h -@@ -43,8 +43,8 @@ - #include - - struct nicvf_rbdr { -- uint64_t rbdr_status; -- uint64_t rbdr_door; -+ uintptr_t rbdr_status; -+ uintptr_t rbdr_door; - struct rbdr_entry_t *desc; - nicvf_phys_addr_t phys; - uint32_t buffsz; -@@ -58,8 +58,8 @@ struct nicvf_txq { - union sq_entry_t *desc; - nicvf_phys_addr_t phys; - struct rte_mbuf **txbuffs; -- uint64_t sq_head; -- uint64_t sq_door; -+ uintptr_t sq_head; -+ uintptr_t sq_door; - struct rte_mempool *pool; - struct nicvf *nic; - void (*pool_free)(struct nicvf_txq *sq); -@@ -74,8 +74,8 @@ struct nicvf_txq { - - struct nicvf_rxq { - uint64_t mbuf_phys_off; -- uint64_t cq_status; -- uint64_t cq_door; -+ uintptr_t cq_status; -+ uintptr_t cq_door; - nicvf_phys_addr_t phys; - union cq_entry_t *desc; - struct nicvf_rbdr *shared_rbdr; --- -2.7.4 - diff --git a/debian/patches/nicvf-0006-mk-fix-lib-filtering-when-linking-app.patch b/debian/patches/nicvf-0006-mk-fix-lib-filtering-when-linking-app.patch deleted file mode 100644 index 50093364..00000000 --- a/debian/patches/nicvf-0006-mk-fix-lib-filtering-when-linking-app.patch +++ /dev/null @@ -1,71 +0,0 @@ -From ab338eb44ebb79840dab1de2742c07070ae3bf0e Mon Sep 17 00:00:00 2001 -From: Olivier Matz -Date: Thu, 6 Apr 2017 16:14:55 +0200 -Subject: [PATCH] mk: fix lib filtering when linking app - -I get the following error when linking the test application: - build/lib/librte_pmd_thunderx_nicvf.a(nicvf_hw.o): - In function `nicvf_qsize_regbit': - drivers/net/thunderx/base/nicvf_hw.c:451: undefined reference to `log2' - build/lib/librte_pmd_thunderx_nicvf.a(nicvf_hw.o): - In function `nicvf_rss_reta_update': - drivers/net/thunderx/base/nicvf_hw.c:804: undefined reference to `log2' - build/lib/librte_pmd_thunderx_nicvf.a(nicvf_hw.o): - In function `nicvf_rss_reta_query': - drivers/net/thunderx/base/nicvf_hw.c:825: undefined reference to `log2' - -While I don't know why it does not happen for a default build, the error -can be explained. The link command line is: - - gcc -o test ... *.o ... -Wl,-lm ... -Wl,-lrte_pmd_thunderx_nicvf ... - -rte_pmd_thunderx_nicvf needs the math library, and it should be -added after. This is not the case because the test application also -adds the math library. - -The makefile already filters the libraries, but it keeps the first -occurrence of the lib. Instead, the last one should be kept. - -Fixes: edf4d331dcdb ("mk: eliminate duplicates from libraries list") -Cc: stable@dpdk.org - -Signed-off-by: Olivier Matz -Acked-by: Thomas Monjalon ---- - mk/rte.app.mk | 19 +++++++++++++++---- - 1 file changed, 15 insertions(+), 4 deletions(-) - -Origin: http://dpdk.org/browse/dpdk/commit/?id=ab338eb44ebb79840dab1de2742c07070ae3bf0e -Original-Author: Olivier Matz -Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/dpdk/+bug/1691659 -Author: Christian Ehrhardt -Last-Update: 2017-05-18 - ---- a/mk/rte.app.mk -+++ b/mk/rte.app.mk -@@ -168,10 +168,21 @@ - - LDLIBS += $(_LDLIBS-y) $(CPU_LDLIBS) $(EXTRA_LDLIBS) - --# Eliminate duplicates without sorting --LDLIBS := $(shell echo $(LDLIBS) | \ -- awk '{for (i = 1; i <= NF; i++) { \ -- if ($$i !~ /^-l.*/ || !seen[$$i]++) print $$i }}') -+# all the words except the first one -+allbutfirst = $(wordlist 2,$(words $(1)),$(1)) -+ -+# Eliminate duplicates without sorting, only keep the last occurrence -+filter-libs = \ -+ $(if $(1),$(strip\ -+ $(if \ -+ $(and \ -+ $(filter $(firstword $(1)),$(call allbutfirst,$(1))),\ -+ $(filter -l%,$(firstword $(1)))),\ -+ ,\ -+ $(firstword $(1))) \ -+ $(call filter-libs,$(call allbutfirst,$(1))))) -+ -+LDLIBS := $(call filter-libs,$(LDLIBS)) - - ifeq ($(RTE_DEVEL_BUILD)$(CONFIG_RTE_BUILD_SHARED_LIB),yy) - LDFLAGS += -rpath=$(RTE_SDK_BIN)/lib diff --git a/debian/patches/nicvf-0008-net-thunderx-fix-stats-access-out-of-bounds.patch b/debian/patches/nicvf-0008-net-thunderx-fix-stats-access-out-of-bounds.patch deleted file mode 100644 index cd26df57..00000000 --- a/debian/patches/nicvf-0008-net-thunderx-fix-stats-access-out-of-bounds.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 695cd416ce6c02d7a20108765573936998b2dbf0 Mon Sep 17 00:00:00 2001 -From: Marcin Wilk -Date: Tue, 11 Apr 2017 14:35:13 +0200 -Subject: [PATCH] net/thunderx: fix stats access out of bounds - -Trying to assign more queues to stats struct break only from one loop -when the maximum size is reached. Outside loop iteration is continued. -This leads to access an array out of bounds. - -Fixes: 21e3fb0050b9 ("net/thunderx: add final bits for secondary queue support") -Cc: stable@dpdk.org - -Signed-off-by: Marcin Wilk -Acked-by: Jerin Jacob ---- - drivers/net/thunderx/nicvf_ethdev.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -Origin: http://dpdk.org/browse/dpdk/commit/?id=695cd416ce6c02d7a20108765573936998b2dbf0 -Original-Author: Marcin Wilk -Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/dpdk/+bug/1691659 -Author: Christian Ehrhardt -Last-Update: 2017-05-18 - -diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c -index b0b9c3b..36ff94f 100644 ---- a/drivers/net/thunderx/nicvf_ethdev.c -+++ b/drivers/net/thunderx/nicvf_ethdev.c -@@ -258,7 +258,7 @@ nicvf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) - - /* Reading per RX ring stats */ - for (qidx = rx_start; qidx <= rx_end; qidx++) { -- if (qidx == RTE_ETHDEV_QUEUE_STAT_CNTRS) -+ if (qidx >= RTE_ETHDEV_QUEUE_STAT_CNTRS) - break; - - nicvf_hw_get_rx_qstats(nic, &rx_qstats, qidx); -@@ -271,7 +271,7 @@ nicvf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) - - /* Reading per TX ring stats */ - for (qidx = tx_start; qidx <= tx_end; qidx++) { -- if (qidx == RTE_ETHDEV_QUEUE_STAT_CNTRS) -+ if (qidx >= RTE_ETHDEV_QUEUE_STAT_CNTRS) - break; - - nicvf_hw_get_tx_qstats(nic, &tx_qstats, qidx); -@@ -290,7 +290,7 @@ nicvf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) - - /* Reading per RX ring stats */ - for (qidx = rx_start; qidx <= rx_end; qidx++) { -- if (qidx == RTE_ETHDEV_QUEUE_STAT_CNTRS) -+ if (qidx >= RTE_ETHDEV_QUEUE_STAT_CNTRS) - break; - - nicvf_hw_get_rx_qstats(snic, &rx_qstats, -@@ -303,7 +303,7 @@ nicvf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) - nicvf_tx_range(dev, snic, &tx_start, &tx_end); - /* Reading per TX ring stats */ - for (qidx = tx_start; qidx <= tx_end; qidx++) { -- if (qidx == RTE_ETHDEV_QUEUE_STAT_CNTRS) -+ if (qidx >= RTE_ETHDEV_QUEUE_STAT_CNTRS) - break; - - nicvf_hw_get_tx_qstats(snic, &tx_qstats, --- -2.7.4 - diff --git a/debian/patches/nicvf-0010-net-thunderx-fix-deadlock-in-Rx-path.patch b/debian/patches/nicvf-0010-net-thunderx-fix-deadlock-in-Rx-path.patch deleted file mode 100644 index 8773671b..00000000 --- a/debian/patches/nicvf-0010-net-thunderx-fix-deadlock-in-Rx-path.patch +++ /dev/null @@ -1,58 +0,0 @@ -From b31eb105463fa1844c19fde382dd6bd294329831 Mon Sep 17 00:00:00 2001 -From: Jerin Jacob -Date: Tue, 2 May 2017 00:11:55 +0530 -Subject: [PATCH] net/thunderx: fix deadlock in Rx path - -RBDR buffers are refilled when SW consumes the buffers from CQ. -This creates deadlock case when CQ buffers exhausted due to lack -of RBDR buffers. Fix is to refill the RBDR when rx_free_thresh -meet, irrespective of the number of CQ buffers consumed. - -Fixes: e2d7fc9f0a24 ("net/thunderx: add single and multi-segment Rx") -Cc: stable@dpdk.org - -Signed-off-by: Jerin Jacob ---- - drivers/net/thunderx/nicvf_rxtx.c | 18 ++++++++---------- - 1 file changed, 8 insertions(+), 10 deletions(-) - -Origin: http://dpdk.org/browse/dpdk/commit/?id=b31eb105463fa1844c19fde382dd6bd294329831 -Original-Author: Jerin Jacob -Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/dpdk/+bug/1691659 -Author: Christian Ehrhardt -Last-Update: 2017-05-18 - ---- a/drivers/net/thunderx/nicvf_rxtx.c -+++ b/drivers/net/thunderx/nicvf_rxtx.c -@@ -469,11 +469,10 @@ - rxq->head = cqe_head; - nicvf_addr_write(rxq->cq_door, to_process); - rxq->recv_buffers += to_process; -- if (rxq->recv_buffers > rxq->rx_free_thresh) { -- rxq->recv_buffers -= nicvf_fill_rbdr(rxq, -- rxq->rx_free_thresh); -- NICVF_RX_ASSERT(rxq->recv_buffers >= 0); -- } -+ } -+ if (rxq->recv_buffers > rxq->rx_free_thresh) { -+ rxq->recv_buffers -= nicvf_fill_rbdr(rxq, rxq->rx_free_thresh); -+ NICVF_RX_ASSERT(rxq->recv_buffers >= 0); - } - - return to_process; -@@ -563,11 +562,10 @@ - rxq->head = cqe_head; - nicvf_addr_write(rxq->cq_door, to_process); - rxq->recv_buffers += buffers_consumed; -- if (rxq->recv_buffers > rxq->rx_free_thresh) { -- rxq->recv_buffers -= -- nicvf_fill_rbdr(rxq, rxq->rx_free_thresh); -- NICVF_RX_ASSERT(rxq->recv_buffers >= 0); -- } -+ } -+ if (rxq->recv_buffers > rxq->rx_free_thresh) { -+ rxq->recv_buffers -= nicvf_fill_rbdr(rxq, rxq->rx_free_thresh); -+ NICVF_RX_ASSERT(rxq->recv_buffers >= 0); - } - - return to_process; diff --git a/debian/patches/series b/debian/patches/series index 878e9259..a104d100 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -3,14 +3,9 @@ fix-power-default-config.patch dpdk-dev-v3-eal-sPAPR-IOMMU-support-in-pci-probing-for-vfio-pci-in-ppc64le.patch dpdk-dev-v4-i40e-implement-vector-PMD-for-altivec.patch nicvf-0001-net-thunderx-check-data-offset-alignment-requirement.patch -nicvf-0002-net-thunderx-fix-32-bit-build.patch nicvf-0003-config-enable-thunderx-nicvf.patch nicvf-0004-net-thunderx-sync-mailbox-definitions-with-Linux-PF-.patch nicvf-0005-net-thunderx-wait-to-complete-during-link-update.patch -nicvf-0006-mk-fix-lib-filtering-when-linking-app.patch nicvf-0007-net-thunderx-disable-PMD-for-old-compilers.patch -nicvf-0008-net-thunderx-fix-stats-access-out-of-bounds.patch nicvf-0009-config-set-cache-line-as-128B-for-generic-arm64.patch -nicvf-0010-net-thunderx-fix-deadlock-in-Rx-path.patch -kni-fix-build-with-kernel-4.11.patch kni-fix-ethtool-build-with-kernel-4.11.patch -- cgit 1.2.3-korg From 1d7acbfcb3f013d88b3a35403a54285bd3ef0be1 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 8 Jun 2017 10:22:59 -0600 Subject: Changelog: mention dropped changes Change-Id: Ic0545215730e1debebebb977cac0922c23af5a07 Signed-off-by: Christian Ehrhardt --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 8d88ceb4..c22deec1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,12 @@ dpdk (16.11.2-1~git1) UNRELEASED; urgency=medium * Merge stable update to 16.11.2; For a list of changes see http://dpdk.org/ml/archives/announce/2017-May/000131.html + * Dropped changes - patches that were included in 16.11.2 stable: + - d/p/kni-fix-build-with-kernel-4.11.patch + - d/p/nicvf-0002-net-thunderx-fix-32-bit-build.patch + - d/p/nicvf-0006-mk-fix-lib-filtering-when-linking-app.patch + - d/p/nicvf-0008-net-thunderx-fix-stats-access-out-of-bounds.patch + - d/p/nicvf-0010-net-thunderx-fix-deadlock-in-Rx-path.patch -- Christian Ehrhardt Thu, 08 Jun 2017 10:05:44 -0600 -- cgit 1.2.3-korg From a3362a8a9236fd59949fb86b4079423b22dde3ce Mon Sep 17 00:00:00 2001 From: Jan Blunck Date: Tue, 4 Apr 2017 12:12:22 +0200 Subject: Pass jobs argument via MAKEFLAGS variable Change-Id: I23f329a3116563d70b318f6c4c9ad9159a48e997 Signed-off-by: Luca Boccassi --- debian/rules | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/debian/rules b/debian/rules index 5c14b37c..bc593fa2 100755 --- a/debian/rules +++ b/debian/rules @@ -71,8 +71,7 @@ DPDK_SHARED_DIR = "debian/build/shared-root" # now stable with parallel comilation, so support -j ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) PAR := $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) -else - PAR := "1" + MAKEFLAGS += -j$(PAR) endif ifneq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS))) @@ -172,7 +171,7 @@ endif override_dh_auto_build-indep: ifeq (y,$(BUILD_DOCS)) - $(MAKE) -j $(PAR) V=$(DH_VERBOSE) O=$(DPDK_STATIC_DIR) doc-api-html doc-guides-html + $(MAKE) V=$(DH_VERBOSE) O=$(DPDK_STATIC_DIR) doc-api-html doc-guides-html endif override_dh_auto_install-indep: @@ -185,7 +184,7 @@ endif override_dh_auto_build-arch: ifeq (y,$(BUILD_STATIC_LIB)) - $(MAKE) -j $(PAR) V=$(DH_VERBOSE) O=$(DPDK_STATIC_DIR) RTE_KERNELDIR=$(KSRC) build + $(MAKE) V=$(DH_VERBOSE) O=$(DPDK_STATIC_DIR) RTE_KERNELDIR=$(KSRC) build endif # Unfortunately the decision about having static or shared libraries is # made for the whole build, which then produces only .a or .so files @@ -199,10 +198,10 @@ endif cp -a $(DPDK_STATIC_DIR) $(DPDK_SHARED_DIR) sed -ri 's,(RTE_BUILD_SHARED_LIB=).*,\1y,' \ $(DPDK_SHARED_DIR)/.config - $(MAKE) -j $(PAR) V=$(DH_VERBOSE) O=$(DPDK_SHARED_DIR) RTE_KERNELDIR=$(KSRC) build + $(MAKE) V=$(DH_VERBOSE) O=$(DPDK_SHARED_DIR) RTE_KERNELDIR=$(KSRC) build ifeq (y,$(BUILD_DOCS)) # need to be around for dh_installman to be picked up - $(MAKE) -j $(PAR) V=$(DH_VERBOSE) O=$(DPDK_SHARED_DIR) RTE_KERNELDIR=$(KSRC) doc-guides-man + $(MAKE) V=$(DH_VERBOSE) O=$(DPDK_SHARED_DIR) RTE_KERNELDIR=$(KSRC) doc-guides-man endif override_dh_auto_install-arch: LIBDIR=/usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH) -- cgit 1.2.3-korg From b121ff27dbb03c1da9afd078d0ab3818440519ca Mon Sep 17 00:00:00 2001 From: "Charles (Chas) Williams" Date: Mon, 12 Jun 2017 13:00:50 +0100 Subject: Add support for building mempool packages Change-Id: Ia7e55570cdc8aa93c82fbd2d7403331ecee95030 Signed-off-by: Luca Boccassi --- debian/rules | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/debian/rules b/debian/rules index bc593fa2..f6e7ccd4 100755 --- a/debian/rules +++ b/debian/rules @@ -273,6 +273,11 @@ endif echo "PMD: linking $${LIBF} into RTE_EAL_PMD_PATH at $${LIBD}/dpdk-pmds/"; \ ln -s --relative --target-directory=$${LIBD}/dpdk-pmds/ $${LIBD}/$${LIBF}; \ fi; \ + if [ "$${LIBF#librte_mempool_}x" != "$${LIBF}x" ]; then \ + mkdir -p $${LIBD}/dpdk-pmds; \ + echo "MEMPOOL: linking $${LIBF} into RTE_EAL_PMD_PATH at $${LIBD}/dpdk-pmds/"; \ + ln -s --relative --target-directory=$${LIBD}/dpdk-pmds/ $${LIBD}/$${LIBF}; \ + fi; \ if [ "$${LIBF#librte_eal}x" != "$${LIBF}x" ]; then \ mkdir -p $${LIBD}/dpdk-pmds; \ fi; \ -- cgit 1.2.3-korg From 84fc024c38dc0277dd25776fdc99670ef00b39cb Mon Sep 17 00:00:00 2001 From: Jan Blunck Date: Tue, 11 Apr 2017 10:19:53 +0200 Subject: Add dbgsym meta-package This adds a meta-package to install all generated -dbgsym packages. Change-Id: If2d802317628d5858ce2a60add445da39ab980e8 Signed-off-by: Luca Boccassi --- debian/dh-dbgsym-metapkg | 24 ++++++++++++++++++++++++ debian/rules | 6 ++++++ 2 files changed, 30 insertions(+) create mode 100755 debian/dh-dbgsym-metapkg diff --git a/debian/dh-dbgsym-metapkg b/debian/dh-dbgsym-metapkg new file mode 100755 index 00000000..fecbed18 --- /dev/null +++ b/debian/dh-dbgsym-metapkg @@ -0,0 +1,24 @@ +#!/bin/sh -e + +PACKAGE=${1:?Missing parameter} + +dh_installdocs -p${PACKAGE} +dh_installchangelogs -p${PACKAGE} +dh_compress -p${PACKAGE} + +install -d debian/${PACKAGE}/DEBIAN + +echo -n 'misc:Depends=' > debian/${PACKAGE}.substvars +grep -E 'lib.*-dbgsym' debian/files | tr '_' ' ' | \ + awk '{ print $1,"(=",$2 ")" }' | paste -sd ',' - | \ + sed -e 's/,/, /g' >> debian/${PACKAGE}.substvars + +dh_gencontrol -p libdpdk-dev -- \ + -Pdebian/${PACKAGE} \ + -Tdebian/${PACKAGE}.substvars \ + -UPre-Depends -URecommends -USuggests -UEnhances -UProvides \ + -UEssential -UConflicts -UReplaces -UBreaks \ + -DSection=debug -DPriority=extra \ + -DAuto-Built-Package=debug-symbols \ + -DPackage=${PACKAGE} "-DDepends=\${misc:Depends}" \ + "-DDescription=Debug symbols for libdpdk-dev (meta-package)" diff --git a/debian/rules b/debian/rules index f6e7ccd4..bd5ec0b5 100755 --- a/debian/rules +++ b/debian/rules @@ -5,6 +5,7 @@ export DH_VERBOSE=1 export DH_OPTIONS=-v VERSION := $(shell dpkg-parsechangelog | sed -nr '/^Version:/s/Version: (.*:)?(.*)-(.*)/\2/p') +DPDK_ABI := $(shell echo $(VERSION) | cut -d '.' -f1-2) # see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/* include /usr/share/dpkg/default.mk @@ -117,6 +118,11 @@ override_dh_gencontrol: dh_gencontrol -p dpdk-modules-$(KVERS) -- \ -v`cat debian/VERSION` \ -V'built:using:kernel=$(call get_built_using,linux-headers-$(KVERS))' + ./debian/dh-dbgsym-metapkg libdpdk$(DPDK_ABI)-dbgsym + +override_dh_builddeb: + dh_builddeb + dh_builddeb -plibdpdk$(DPDK_ABI)-dbgsym build: @if [ x"$(KVERS)" = x ] ; then \ -- cgit 1.2.3-korg From 864973804fe71a7a00292fdb15777cddf87716ca Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Mon, 12 Jun 2017 13:54:44 +0100 Subject: Hide dbgsym metapackage behind DEB_BUILD_OPTIONS dbgsym packages go in the -debug section of the archive, and various DDs and FTP Masters have strongly recommended to avoid uploading any such metapackage to Main for this reason. It can be still very useful for users and rebuilders, so leave it disabled behind a dbgsym_meta DEB_BUILD_OPTIONS flag. Change-Id: I112f3195755cc6bafef3167b39d3d47273572377 Signed-off-by: Luca Boccassi --- debian/rules | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/debian/rules b/debian/rules index bd5ec0b5..33b98b5a 100755 --- a/debian/rules +++ b/debian/rules @@ -113,17 +113,6 @@ DPDK_CONFIG_BUILD_KMOD=y # dpkg-genchanges, and also would require a lot of overrides for debhelpers. get_built_using ?= $(filter-out (=),$(shell dpkg-query -f='$${source:Package} (=$${source:Version})' -W $1)) -override_dh_gencontrol: - dh_gencontrol - dh_gencontrol -p dpdk-modules-$(KVERS) -- \ - -v`cat debian/VERSION` \ - -V'built:using:kernel=$(call get_built_using,linux-headers-$(KVERS))' - ./debian/dh-dbgsym-metapkg libdpdk$(DPDK_ABI)-dbgsym - -override_dh_builddeb: - dh_builddeb - dh_builddeb -plibdpdk$(DPDK_ABI)-dbgsym - build: @if [ x"$(KVERS)" = x ] ; then \ echo 'No version in $(KSRC)/include/linux/version.h' >&2; \ @@ -137,6 +126,29 @@ endif %: dh $@ --with python2,dkms +override_dh_gencontrol: + dh_gencontrol +ifneq (,$(findstring kernel_modules,$(DEB_BUILD_OPTIONS))) + dh_gencontrol -p dpdk-modules-$(KVERS) -- \ + -v`cat debian/VERSION` \ + -V'built:using:kernel=$(call get_built_using,linux-headers-$(KVERS))' +endif +ifneq (,$(findstring dbgsym_meta,$(DEB_BUILD_OPTIONS))) + ./debian/dh-dbgsym-metapkg libdpdk$(DPDK_ABI)-dbgsym +endif + +# dbgsym_meta can be passed via DEB_BUILD_OPTIONS to enable building the +# optional dbgsym meta package libdpdk-dbgsym. +# This is not built by default as it would go in main but depend on +# packages in the debian-debug archive. +# Debian Developers and FTP masters strongly discourage this. +# We provide this optional flag as a convenience for rebuilders. +ifneq (,$(findstring dbgsym_meta,$(DEB_BUILD_OPTIONS))) +override_dh_builddeb: + dh_builddeb + dh_builddeb -plibdpdk$(DPDK_ABI)-dbgsym +endif + override_dh_auto_clean: rm -rf debian/build debian/tmp debian/dpdk-modules-* \ debian/control.modules debian/VERSION -- cgit 1.2.3-korg From 6e1ca2647e3582e41dc33757c49f628f8c740388 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Mon, 12 Jun 2017 13:57:06 +0100 Subject: Generate libdpdk-dev dependencies and dpdk recommends There are many, many binary packages in DPDK, and they constantly change. To avoid having to manually maintain the list of dependencies of libdpdk-dev and recommends of dpdk, generate them at build time depending on what is actually built for each architecture. Change-Id: I19f5f037c41dc4b1d61fb5b2c00e0f005431d8f0 Signed-off-by: Luca Boccassi --- debian/control | 69 ++-------------------------------------------------------- debian/rules | 7 ++++++ 2 files changed, 9 insertions(+), 67 deletions(-) diff --git a/debian/control b/debian/control index db3c12eb..57f41d78 100644 --- a/debian/control +++ b/debian/control @@ -35,26 +35,7 @@ Depends: hwdata, ${misc:Depends}, ${python:Depends}, ${shlibs:Depends} -Recommends: librte-pmd-af-packet1 (= ${binary:Version}), - librte-pmd-bnxt1 (= ${binary:Version}), - librte-pmd-bond1 (= ${binary:Version}), - librte-pmd-cxgbe1 (= ${binary:Version}), - librte-pmd-e1000-1 (= ${binary:Version}), - librte-pmd-ena1 (= ${binary:Version}), - librte-pmd-enic1 (= ${binary:Version}) [amd64 arm64 i386], - librte-pmd-fm10k1 (= ${binary:Version}) [amd64 i386], - librte-pmd-i40e1 (= ${binary:Version}), - librte-pmd-ixgbe1 (= ${binary:Version}) [amd64 arm64 i386], - librte-pmd-null-crypto1 (= ${binary:Version}), - librte-pmd-null1 (= ${binary:Version}), - librte-pmd-pcap1 (= ${binary:Version}), - librte-pmd-qede1 (= ${binary:Version}), - librte-pmd-ring2 (= ${binary:Version}), - librte-pmd-thunderx-nicvf1 (= ${binary:Version}), - librte-pmd-vhost1 (= ${binary:Version}), - librte-pmd-virtio1 (= ${binary:Version}), - librte-pmd-vmxnet3-uio1 (= ${binary:Version}) [amd64 arm64 i386], - librte-pmd-xenvirt1 (= ${binary:Version}) [amd64 arm64 i386] +Recommends: ${librte:Recommends}, Suggests: dpdk-doc, dpdk-igb-uio-dkms (= ${binary:Version}), dpdk-rte-kni-dkms (= ${binary:Version}), @@ -124,53 +105,7 @@ Architecture: amd64 arm64 i386 ppc64el Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} Depends: libpcap-dev, - librte-acl2 (= ${binary:Version}), - librte-cfgfile2 (= ${binary:Version}), - librte-cmdline2 (= ${binary:Version}), - librte-cryptodev2 (= ${binary:Version}), - librte-distributor1 (= ${binary:Version}), - librte-eal3 (= ${binary:Version}), - librte-ethdev5 (= ${binary:Version}), - librte-hash2 (= ${binary:Version}), - librte-ip-frag1 (= ${binary:Version}), - librte-jobstats1 (= ${binary:Version}), - librte-kni2 (= ${binary:Version}) [amd64 arm64 ppc64el], - librte-kvargs1 (= ${binary:Version}), - librte-lpm2 (= ${binary:Version}), - librte-mbuf2 (= ${binary:Version}), - librte-mempool2 (= ${binary:Version}), - librte-meter1 (= ${binary:Version}), - librte-net1 (= ${binary:Version}), - librte-pdump1 (= ${binary:Version}), - librte-pipeline3 (= ${binary:Version}), - librte-pmd-af-packet1 (= ${binary:Version}), - librte-pmd-bnxt1 (= ${binary:Version}), - librte-pmd-bond1 (= ${binary:Version}), - librte-pmd-cxgbe1 (= ${binary:Version}), - librte-pmd-e1000-1 (= ${binary:Version}), - librte-pmd-ena1 (= ${binary:Version}), - librte-pmd-enic1 (= ${binary:Version}) [amd64 arm64 i386], - librte-pmd-fm10k1 (= ${binary:Version}) [amd64 i386], - librte-pmd-i40e1 (= ${binary:Version}), - librte-pmd-ixgbe1 (= ${binary:Version}) [amd64 arm64 i386], - librte-pmd-null-crypto1 (= ${binary:Version}), - librte-pmd-null1 (= ${binary:Version}), - librte-pmd-pcap1 (= ${binary:Version}), - librte-pmd-qede1 (= ${binary:Version}), - librte-pmd-ring2 (= ${binary:Version}), - librte-pmd-thunderx-nicvf1 (= ${binary:Version}), - librte-pmd-vhost1 (= ${binary:Version}), - librte-pmd-virtio1 (= ${binary:Version}), - librte-pmd-vmxnet3-uio1 (= ${binary:Version}) [amd64 arm64 i386], - librte-pmd-xenvirt1 (= ${binary:Version}) [amd64 arm64 i386], - librte-port3 (= ${binary:Version}), - librte-power1 (= ${binary:Version}), - librte-reorder1 (= ${binary:Version}), - librte-ring1 (= ${binary:Version}), - librte-sched1 (= ${binary:Version}), - librte-table2 (= ${binary:Version}), - librte-timer1 (= ${binary:Version}), - librte-vhost3 (= ${binary:Version}), + ${librte:Depends}, ${misc:Depends} Description: Data Plane Development Kit (basic development files) DPDK is a set of libraries for fast packet processing. Applications run diff --git a/debian/rules b/debian/rules index 33b98b5a..82eb417b 100755 --- a/debian/rules +++ b/debian/rules @@ -128,6 +128,13 @@ endif override_dh_gencontrol: dh_gencontrol + # debian/files will not exist until dh_gencontrol has ran at least once, + # so we need to run gencontrol for libdpdk-dev and libdpdk-dbgsym after. + # The list of libraries and PMDs is everchanging, so generate the dependency + # list for libdpdk-dev to avoid having to maintain it manually. + # Same for the recommends list for dpdk, were we want the PMDs and the mempools. + dh_gencontrol -p libdpdk-dev -- -V"librte:Depends=`grep -E 'librte-*' ./debian/files | grep -v dbgsym | tr '_' ' ' | awk '{ print $$1,"(=",$$2 ")" }' | paste -sd ',' - | sed -e 's/,/, /g'`" + dh_gencontrol -p dpdk -- -V"librte:Recommends=`grep -E 'librte-(pmd|mempool).*' ./debian/files | grep -v dbgsym | tr '_' ' ' | awk '{ print $$1,"(=",$$2 ")" }' | paste -sd ',' - | sed -e 's/,/, /g'`" ifneq (,$(findstring kernel_modules,$(DEB_BUILD_OPTIONS))) dh_gencontrol -p dpdk-modules-$(KVERS) -- \ -v`cat debian/VERSION` \ -- cgit 1.2.3-korg From a4c7776ffe18b92f0ca9380f5477076ad073157b Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Mon, 12 Jun 2017 14:01:15 +0100 Subject: Mention libpdk-dbgsym in changelog Change-Id: I51ef8a929dc54067fe3389098e5009e086e43770 Signed-off-by: Luca Boccassi --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index c22deec1..f0fc6529 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ dpdk (16.11.2-1~git1) UNRELEASED; urgency=medium + [ Christian Ehrhardt ] * Merge stable update to 16.11.2; For a list of changes see http://dpdk.org/ml/archives/announce/2017-May/000131.html * Dropped changes - patches that were included in 16.11.2 stable: @@ -9,6 +10,12 @@ dpdk (16.11.2-1~git1) UNRELEASED; urgency=medium - d/p/nicvf-0008-net-thunderx-fix-stats-access-out-of-bounds.patch - d/p/nicvf-0010-net-thunderx-fix-deadlock-in-Rx-path.patch + [ Luca Boccassi ] + * Optionally generate libdpdk-dbgsym metapackage that depends on every + librte/PMD binary package's dbgsym. Keep it disabled by default, and + let users choose to enable it by passing dbgsym_meta via DEB_BUILD_OPTIONS. + Thanks Jan Blunck for the patch! + -- Christian Ehrhardt Thu, 08 Jun 2017 10:05:44 -0600 dpdk (16.11.1-1~git1) UNRELEASED; urgency=medium -- cgit 1.2.3-korg From 8e085c53da268eb35edf1a521aade6348a9562aa Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Mon, 12 Jun 2017 14:03:18 +0100 Subject: Mention dependency generation in changelog Change-Id: Ic73a9bba1ccaf1843b3c246f291dd1ef185f38c4 Signed-off-by: Luca Boccassi --- debian/changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index f0fc6529..d104c977 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,6 +15,9 @@ dpdk (16.11.2-1~git1) UNRELEASED; urgency=medium librte/PMD binary package's dbgsym. Keep it disabled by default, and let users choose to enable it by passing dbgsym_meta via DEB_BUILD_OPTIONS. Thanks Jan Blunck for the patch! + * Generate dependency list of libdpdk-dev to all librte and PMDs packages + dynamically at build time. + * Generate list of recommends for dpdk dynamically at build time. -- Christian Ehrhardt Thu, 08 Jun 2017 10:05:44 -0600 -- cgit 1.2.3-korg From 7e67194fcc89ecaeea59fbc0b33807e24854a673 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Mon, 12 Jun 2017 15:52:53 +0100 Subject: Set strict dependency on kernel version The in-kernel API/ABI is (intentionally) not stable, so the binary kernel modules package must strictly depend on the same kernel that it was built against. Change-Id: I85cd6d465678e7693fb33659e3b4525730992cb0 Signed-off-by: Luca Boccassi --- debian/control.modules.in | 2 +- debian/prep-modules | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/debian/control.modules.in b/debian/control.modules.in index dd1d9f83..88141546 100644 --- a/debian/control.modules.in +++ b/debian/control.modules.in @@ -1,8 +1,8 @@ Package: dpdk-modules-#KVERS# Section: kernel Architecture: amd64 arm64 i386 +Depends: linux-image-#KVERS# #KDREV# Provides: dpdk-modules -Recommends: linux-image-#KVERS# Conflicts: dpdk-igb-uio-dkms, dpdk-rte-kni-dkms Built-Using: ${built:using:kernel} Description: Data Plane Development Kit (rte kni, igb uio modules) diff --git a/debian/prep-modules b/debian/prep-modules index 3e1f9f88..0caf81ed 100755 --- a/debian/prep-modules +++ b/debian/prep-modules @@ -31,10 +31,10 @@ # in the Debian kernel package names (in other words, the ABI version, not # the package version). # -# * Make the package recommend linux-image-$(KVERS) as appropriate for the -# kernel version that we're building against. Use recommend rather than -# depends since the user may have built their own kernel outside of the -# Debian package infrastructure. +# * Make the package depend on linux-image-$(KVERS) (= version) as appropriate +# for the kernel version that we're building against. Use depend as the +# kernel ABI is not stable and it's not guaranteed that a module built +# against a version of the headers will work under a different kernel. # # * Save the version number of the binary package in debian/VERSION for later # use by dh_gencontrol. This will be the version number of the source @@ -79,7 +79,12 @@ elif [ ! -f "$changelog" ] ; then dpdk_kvers=`perl debian/kernel-version "$1"` fi if [ -z "$KDREV" ] ; then - dpdk_kdrev="${dpdk_kvers}-1" + set +e + dpdk_kdrev=`dpkg-query -W -f='${Version}\n' linux-headers-${dpdk_kvers} 2> /dev/null` + if [ $? -ne 0 ] ; then + dpdk_kdrev="${dpdk_kvers}-1" + fi + set -e else dpdk_kvers="${dpdk_kvers}${INT_SUBARCH}" dpdk_kdrev="${KDREV}" @@ -101,7 +106,7 @@ dpdk_kdrev="$(echo "$dpdk_kdrev" | tr _ -)" # Generate the control file from the template. -sed "s/#KVERS#/${dpdk_kvers}/g" debian/control.modules.in > debian/control.modules +sed -e "s/#KVERS#/${dpdk_kvers}/g" -e "s/#KDREV#/(= ${dpdk_kdrev})/g" debian/control.modules.in > debian/control.modules # Now, calcuate the binary package version. Extract the epoch from the kernel # package revision and add it to the beginning of the binary package version -- cgit 1.2.3-korg From 23cb5563dab4773a05597fb6531aa0eb40cbc091 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Mon, 12 Jun 2017 15:54:11 +0100 Subject: Mention dpdk-modules-* dependency change in changelog Change-Id: Ifa63cb12d931a081819195a36020df1ed8e4f262 Signed-off-by: Luca Boccassi --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index d104c977..5c5da247 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,6 +18,8 @@ dpdk (16.11.2-1~git1) UNRELEASED; urgency=medium * Generate dependency list of libdpdk-dev to all librte and PMDs packages dynamically at build time. * Generate list of recommends for dpdk dynamically at build time. + * dpdk-modules-$KVERS: depend on same kernel version used to build rather than + just recommend - in-kernel API/ABI is not stable. -- Christian Ehrhardt Thu, 08 Jun 2017 10:05:44 -0600 -- cgit 1.2.3-korg From c162fd41a0d90e50e9860d08aae7ffa433c40adf Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 13 Jun 2017 11:18:21 +0100 Subject: Mention mempool changes in changelog Change-Id: I071246b42bab99996c3edbdfff451651441617da Signed-off-by: Luca Boccassi --- debian/changelog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/debian/changelog b/debian/changelog index 5c5da247..9dda9641 100644 --- a/debian/changelog +++ b/debian/changelog @@ -20,6 +20,10 @@ dpdk (16.11.2-1~git1) UNRELEASED; urgency=medium * Generate list of recommends for dpdk dynamically at build time. * dpdk-modules-$KVERS: depend on same kernel version used to build rather than just recommend - in-kernel API/ABI is not stable. + * Support for building packages for the new mempool framework has been added. + In 17.05 and newer a mempool framework was added, that has to be loaded + like a PMD. So any "plugin" will be linked in RTE_EAL_PMD_PATH just like + the PMDs. No mempool plugins are built for now, so it is currently a no-op. -- Christian Ehrhardt Thu, 08 Jun 2017 10:05:44 -0600 -- cgit 1.2.3-korg From 6d0f627c533ccaeac81f11b8ea5639fd873caf61 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 13 Jun 2017 11:20:41 +0100 Subject: Remove old compatibility transitional packages Change-Id: I64ea0708cacbb657895ba2548bd3b02fac9a0c0c Signed-off-by: Luca Boccassi --- debian/control | 62 --------------------------------------- debian/libethdev4.links.in | 1 - debian/librte-cryptodev1.links.in | 1 - debian/librte-eal2.links.in | 1 - debian/rules | 15 ---------- 5 files changed, 80 deletions(-) delete mode 100644 debian/libethdev4.links.in delete mode 100644 debian/librte-cryptodev1.links.in delete mode 100644 debian/librte-eal2.links.in diff --git a/debian/control b/debian/control index 57f41d78..7863adc6 100644 --- a/debian/control +++ b/debian/control @@ -730,65 +730,3 @@ Description: Data Plane Development Kit (librte_pmd_thunderx_nicvf runtime libra . This package contains the runtime libraries for librte_pmd_thunderx_nicvf. -# All following packages are for ABI compatibility to older releases. -# Newer DPDK versions are ABI compatible to older ones for at least one release -# and more if maintainable. -# -# The cross dependencies in DPDK libraries would otherwise force us to conflict -# with older ABI versions to avoid double ld.so resolution -# (https://lists.ubuntu.com/archives/ubuntu-devel/2017-February/039659.html). -# -# But the conflicts in debian/control would make the old versions and thereby -# the dependent applications non-installable until there is a rebuild (as other -# updates would do). -# But for our case that would deny most benefits of version named libraries -# (e.g. the ability to have both). -# -# Instead of adding conflicts fields - whenever possible - provide a backward -# compatible wrapper symlinking to the new (ABI compatible) implementation. -# -# Still as soon as (all) dependendent packages are rebuilt these compat -# wrappers can be autoremoved (apt will take care of that) - -Package: libethdev4 -Architecture: amd64 arm64 i386 ppc64el -Multi-Arch: same -Homepage: http://dpdk.org/doc/api/rte__ethdev_8h.html -Pre-Depends: ${misc:Pre-Depends} -Depends: librte-ethdev5, ${misc:Depends}, ${shlibs:Depends} -Conflicts: libdpdk0 -Description: Data Plane Development Kit (libethdev runtime library) - DPDK is a set of libraries for fast packet processing. Applications run - in user-space and communicate directly with dedicated network interfaces. - . - This package contains an ABI compatibility link for an older version of the - runtime libraries for libethdev. - -Package: librte-cryptodev1 -Architecture: amd64 arm64 i386 ppc64el -Multi-Arch: same -Homepage: http://dpdk.org/doc/api/rte__cryptodev_8h.html -Pre-Depends: ${misc:Pre-Depends} -Depends: librte-cryptodev2, ${misc:Depends}, ${shlibs:Depends} -Conflicts: libdpdk0 -Description: Data Plane Development Kit (librte-cryptodev runtime library) - DPDK is a set of libraries for fast packet processing. Applications run - in user-space and communicate directly with dedicated network interfaces. - . - This package contains an ABI compatibility link for an older version of the - runtime libraries for librte_cryptodev. - -Package: librte-eal2 -Architecture: amd64 arm64 i386 ppc64el -Multi-Arch: same -Homepage: http://dpdk.org/doc/api/rte__eal_8h.html -Pre-Depends: ${misc:Pre-Depends} -Depends: librte-eal3, ${misc:Depends}, ${shlibs:Depends} -Conflicts: libdpdk0 -Description: Data Plane Development Kit (librte-eal runtime library) - DPDK is a set of libraries for fast packet processing. Applications run - in user-space and communicate directly with dedicated network interfaces. - . - This package contains an ABI compatibility link for an older version of the - runtime libraries for librte_eal. - diff --git a/debian/libethdev4.links.in b/debian/libethdev4.links.in deleted file mode 100644 index 6f482f9a..00000000 --- a/debian/libethdev4.links.in +++ /dev/null @@ -1 +0,0 @@ -usr/lib/@DEB_HOST_MULTIARCH@/librte_ethdev.so.5 usr/lib/@DEB_HOST_MULTIARCH@/libethdev.so.4 diff --git a/debian/librte-cryptodev1.links.in b/debian/librte-cryptodev1.links.in deleted file mode 100644 index ddde2520..00000000 --- a/debian/librte-cryptodev1.links.in +++ /dev/null @@ -1 +0,0 @@ -usr/lib/@DEB_HOST_MULTIARCH@/librte_cryptodev.so.2 usr/lib/@DEB_HOST_MULTIARCH@/librte_cryptodev.so.1 diff --git a/debian/librte-eal2.links.in b/debian/librte-eal2.links.in deleted file mode 100644 index c6cd36a3..00000000 --- a/debian/librte-eal2.links.in +++ /dev/null @@ -1 +0,0 @@ -usr/lib/@DEB_HOST_MULTIARCH@/librte_eal.so.3 usr/lib/@DEB_HOST_MULTIARCH@/librte_eal.so.2 diff --git a/debian/rules b/debian/rules index 82eb417b..59569b9c 100755 --- a/debian/rules +++ b/debian/rules @@ -162,12 +162,6 @@ override_dh_auto_clean: sed -i '/Package: dpdk-modules-/,/`tail -n1 debian/control.modules.in`/d' debian/control test -L config/defconfig_$(DPDK_CONFIG) && rm -f config/defconfig_$(DPDK_CONFIG) || true -override_dh_clean: - dh_clean - rm -f debian/libethdev4.links - rm -f debian/librte-cryptodev1.links - rm -f debian/librte-eal2.links - override_dh_auto_configure: # Add support for a custom defconfig file in the debian directory. ifneq (,$(filter dpdk_config=%,$(DEB_BUILD_OPTIONS))) @@ -329,15 +323,6 @@ ifneq (,$(KVERS)) DESTDIR=debian/dpdk-modules-$(KVERS) install-kmod endif -debian/libethdev4.links: debian/libethdev4.links.in - sed -e 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' < $< > $@ -debian/librte-cryptodev1.links: debian/librte-cryptodev1.links.in - sed -e 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' < $< > $@ -debian/librte-eal2.links: debian/librte-eal2.links.in - sed -e 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' < $< > $@ -override_dh_link: debian/libethdev4.links debian/librte-cryptodev1.links debian/librte-eal2.links - dh_link - override_dh_dkms: dh_dkms -V $(VERSION) -- cgit 1.2.3-korg From 893fbab8ee5539b1fd73d0521c6c4d224d023f00 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 13 Jun 2017 11:21:58 +0100 Subject: Mention dropping transitional packages in changelog Change-Id: I864d1887d7bf1c5c9ff0787f57fb1830d6d68dff Signed-off-by: Luca Boccassi --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index 9dda9641..70d85b36 100644 --- a/debian/changelog +++ b/debian/changelog @@ -24,6 +24,8 @@ dpdk (16.11.2-1~git1) UNRELEASED; urgency=medium In 17.05 and newer a mempool framework was added, that has to be loaded like a PMD. So any "plugin" will be linked in RTE_EAL_PMD_PATH just like the PMDs. No mempool plugins are built for now, so it is currently a no-op. + * Drop libethdev4, librte-cryptodev1 and librte-eal2 transitional packages, + no longer needed. -- Christian Ehrhardt Thu, 08 Jun 2017 10:05:44 -0600 -- cgit 1.2.3-korg From b89cea16f018bc65908b085b157ce8f0b4a8fd4c Mon Sep 17 00:00:00 2001 From: "Charles (Chas) Williams" Date: Wed, 14 Jun 2017 13:13:01 +0100 Subject: Fix upstream documentation links in d/control Change-Id: Id08865ce8f7a1991970e4be664497b3cac6e196d Signed-off-by: Luca Boccassi --- debian/control | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index 7863adc6..8963f098 100644 --- a/debian/control +++ b/debian/control @@ -131,7 +131,7 @@ Description: Data Plane Development Kit (libethdev runtime library) Package: librte-acl2 Architecture: amd64 arm64 i386 ppc64el Multi-Arch: same -Homepage: http://dpdk.org/doc/api/rte__ethdev_8h.html +Homepage: http://dpdk.org/doc/api/rte__acl_8h.html Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends} Conflicts: libdpdk0 @@ -157,6 +157,7 @@ Description: Data Plane Development Kit (librte-cfgfile runtime library) Package: librte-cmdline2 Architecture: amd64 arm64 i386 ppc64el Multi-Arch: same +Homepage: http://dpdk.org/doc/api/cmdline_8h.html Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends} Conflicts: libdpdk0 @@ -369,6 +370,7 @@ Description: Data Plane Development Kit (librte-pmd-af-packet runtime library) Package: librte-pmd-bnxt1 Architecture: amd64 arm64 i386 ppc64el Multi-Arch: same +Homepage: http://dpdk.org/doc/guides/nics/bnxt.html Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends} Conflicts: libdpdk0 @@ -696,7 +698,7 @@ Description: Data Plane Development Kit (librte_timer runtime library) Package: librte-vhost3 Architecture: amd64 arm64 i386 ppc64el Multi-Arch: same -Homepage: http://dpdk.org/doc/api/rte__virtio__net_8h.html +Homepage: http://dpdk.org/doc/api/rte__vhost_8h.html Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends} Conflicts: libdpdk0 -- cgit 1.2.3-korg From 8462db66da316418b951eb6ea06cc41f02278e31 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Wed, 14 Jun 2017 13:13:54 +0100 Subject: mention links changes in changelog Change-Id: I44f2dbabd36e1c9ffc1e940afcbc22034380d0a7 Signed-off-by: Luca Boccassi --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index 70d85b36..3a5d1361 100644 --- a/debian/changelog +++ b/debian/changelog @@ -26,6 +26,8 @@ dpdk (16.11.2-1~git1) UNRELEASED; urgency=medium the PMDs. No mempool plugins are built for now, so it is currently a no-op. * Drop libethdev4, librte-cryptodev1 and librte-eal2 transitional packages, no longer needed. + * Fix some upstream documentation links in the packages metadata. + Thanks Chas Williams! -- Christian Ehrhardt Thu, 08 Jun 2017 10:05:44 -0600 -- cgit 1.2.3-korg From 820abfcb99344f78974562a723d15d871fb9200e Mon Sep 17 00:00:00 2001 From: "Charles (Chas) Williams" Date: Wed, 14 Jun 2017 15:42:30 +0100 Subject: Pass -g via EXTRA_CFLAGS Change-Id: Ieddf137bcb8ed68417b61ac7f66969d20231b4ed Signed-off-by: Luca Boccassi --- debian/rules | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/rules b/debian/rules index 59569b9c..9d2d3b91 100755 --- a/debian/rules +++ b/debian/rules @@ -38,6 +38,7 @@ ifeq (yes, $(dpkg_version_lt)) endif export RTE_DEVEL_BUILD=n +export EXTRA_CFLAGS+=-g # People rebuilding this package can overwrite DPDK_CONFIG, RTE_MACHINE and # RTE_TARGET via DEB_BUILD_OPTIONS if they like -- cgit 1.2.3-korg From e17e83e3a136be1a66eb1b580a4f049912b81657 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Wed, 14 Jun 2017 15:44:10 +0100 Subject: Mention fixing dbg symbols in changelog Change-Id: If2976c5bc4fa87d45e86db06613fd3cdbad6ab85 Signed-off-by: Luca Boccassi --- debian/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/changelog b/debian/changelog index 3a5d1361..31b82898 100644 --- a/debian/changelog +++ b/debian/changelog @@ -28,6 +28,7 @@ dpdk (16.11.2-1~git1) UNRELEASED; urgency=medium no longer needed. * Fix some upstream documentation links in the packages metadata. Thanks Chas Williams! + * Fix building debugging symbols for -dbgsym packages. Thanks Chas Williams! -- Christian Ehrhardt Thu, 08 Jun 2017 10:05:44 -0600 -- cgit 1.2.3-korg