diff -Nru dpdk-17.11.5/app/test-pmd/cmdline_tm.c dpdk-17.11.6/app/test-pmd/cmdline_tm.c --- dpdk-17.11.5/app/test-pmd/cmdline_tm.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/app/test-pmd/cmdline_tm.c 2019-05-21 19:15:57.000000000 +0000 @@ -1176,18 +1176,18 @@ uint16_t port_id; uint32_t wred_profile_id; cmdline_fixed_string_t color_g; - uint16_t min_th_g; - uint16_t max_th_g; + uint64_t min_th_g; + uint64_t max_th_g; uint16_t maxp_inv_g; uint16_t wq_log2_g; cmdline_fixed_string_t color_y; - uint16_t min_th_y; - uint16_t max_th_y; + uint64_t min_th_y; + uint64_t max_th_y; uint16_t maxp_inv_y; uint16_t wq_log2_y; cmdline_fixed_string_t color_r; - uint16_t min_th_r; - uint16_t max_th_r; + uint64_t min_th_r; + uint64_t max_th_r; uint16_t maxp_inv_r; uint16_t wq_log2_r; }; @@ -1226,11 +1226,11 @@ cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_min_th_g = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_wred_profile_result, - min_th_g, UINT16); + min_th_g, UINT64); cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_max_th_g = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_wred_profile_result, - max_th_g, UINT16); + max_th_g, UINT64); cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_maxp_inv_g = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_wred_profile_result, @@ -1246,11 +1246,11 @@ cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_min_th_y = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_wred_profile_result, - min_th_y, UINT16); + min_th_y, UINT64); cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_max_th_y = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_wred_profile_result, - max_th_y, UINT16); + max_th_y, UINT64); cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_maxp_inv_y = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_wred_profile_result, @@ -1266,11 +1266,11 @@ cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_min_th_r = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_wred_profile_result, - min_th_r, UINT16); + min_th_r, UINT64); cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_max_th_r = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_wred_profile_result, - max_th_r, UINT16); + max_th_r, UINT64); cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_maxp_inv_r = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_wred_profile_result, diff -Nru dpdk-17.11.5/app/test-pmd/testpmd.c dpdk-17.11.6/app/test-pmd/testpmd.c --- dpdk-17.11.5/app/test-pmd/testpmd.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/app/test-pmd/testpmd.c 2019-05-21 19:15:57.000000000 +0000 @@ -1965,9 +1965,13 @@ if (ports != NULL) { no_link_check = 1; RTE_ETH_FOREACH_DEV(pt_id) { - printf("\nShutting down port %d...\n", pt_id); + printf("\nStopping port %d...\n", pt_id); fflush(stdout); stop_port(pt_id); + } + RTE_ETH_FOREACH_DEV(pt_id) { + printf("\nShutting down port %d...\n", pt_id); + fflush(stdout); close_port(pt_id); } } diff -Nru dpdk-17.11.5/debian/changelog dpdk-17.11.6/debian/changelog --- dpdk-17.11.5/debian/changelog 2019-02-26 11:34:12.000000000 +0000 +++ dpdk-17.11.6/debian/changelog 2019-07-12 13:03:53.000000000 +0000 @@ -1,3 +1,16 @@ +dpdk (17.11.6-0~ubuntu18.04.1) bionic; urgency=medium + + * New upstream release 17.11.6 (LP: #1836365) + For a full list of changes see: + https://doc.dpdk.org/guides-17.11/rel_notes/release_17_11.html#id6 + - drop patches upstream in 17.11.6: + d/p/0001-kni-fix-build-for-dev_open-in-Linux-5.0.patch + d/p/0002-kni-fix-build-for-igb_ndo_bridge_setlink-in-Linux-5..patch + * d/p/lp-1827102-kni-fix-build-with-Linux-5.1.patch fix kni DKMS build with + Linux 5.1 kernels (LP: #1827102) + + -- Christian Ehrhardt Fri, 12 Jul 2019 15:03:53 +0200 + dpdk (17.11.5-0~ubuntu18.04.1) bionic; urgency=medium * New upstream release 17.11.5; for a full list of changes see: diff -Nru dpdk-17.11.5/debian/patches/0001-kni-fix-build-for-dev_open-in-Linux-5.0.patch dpdk-17.11.6/debian/patches/0001-kni-fix-build-for-dev_open-in-Linux-5.0.patch --- dpdk-17.11.5/debian/patches/0001-kni-fix-build-for-dev_open-in-Linux-5.0.patch 2019-02-26 11:34:12.000000000 +0000 +++ dpdk-17.11.6/debian/patches/0001-kni-fix-build-for-dev_open-in-Linux-5.0.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ -From d01c18ff821b81baa3b99329ebf051c6a1bfd4ee Mon Sep 17 00:00:00 2001 -From: Ferruh Yigit -Date: Tue, 22 Jan 2019 15:44:28 +0000 -Subject: [PATCH 1/2] kni: fix build for dev_open in Linux 5.0 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Build error seen with Linux kernel 5.0 and -when CONFIG_RTE_KNI_KMOD_ETHTOOL is enabled. - -build error: -.../build/build/kernel/linux/kni/ixgbe_ethtool.c:1746:4: - error: too few arguments to function ‘dev_open’ - dev_open(netdev); - ^~~~~~~~ -In file included from .../build/kernel/linux/kni/ixgbe_ethtool.c:18: -.../linux/linux/include/linux/netdevice.h:2620:5: note: declared here - int dev_open(struct net_device *dev, struct netlink_ext_ack *extack); - ^~~~~~~~ - -.../build/build/kernel/linux/kni/igb_ethtool.c:1812:4: - error: too few arguments to function ‘dev_open’ - dev_open(netdev); - ^~~~~~~~ -In file included from .../build/build/kernel/linux/kni/igb_ethtool.c:15: -.../linux/linux/include/linux/netdevice.h:2620:5: note: declared here - int dev_open(struct net_device *dev, struct netlink_ext_ack *extack); - ^~~~~~~~ - -dev_open() is changed in Linux kernel version 5.0 and now requires -a new parameter, 'struct netlink_ext_ack *extack'. -Fixed by defining dev_open as macro when kernel version >= 5.0 - -Signed-off-by: Ferruh Yigit - -Author: Christian Ehrhardt -Original-Author: Ferruh Yigit -Origin: backport, https://git.dpdk.org/dpdk/commit/?id=18cb8293e312bc3bd67211a5a540676f1c667d88 -Bug-Ubuntu: https://bugs.launchpad.net/bugs/1814919 -Last-Update: 2019-02-26 - ---- - kernel/linux/kni/ethtool/igb/kcompat.h | 4 ++++ - kernel/linux/kni/ethtool/ixgbe/kcompat.h | 4 ++++ - 2 files changed, 8 insertions(+) - -diff --git a/kernel/linux/kni/ethtool/igb/kcompat.h b/kernel/linux/kni/ethtool/igb/kcompat.h -index 430aabafe..068cfeb52 100644 ---- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h -+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h -@@ -3940,6 +3940,10 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type) - #define HAVE_PCI_ENABLE_MSIX - #endif - -+#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) ) -+#define dev_open(x) dev_open(x, NULL) -+#endif /* >= 5.0.0 */ -+ - #if defined(timer_setup) && defined(from_timer) - #define HAVE_TIMER_SETUP - #endif -diff --git a/kernel/linux/kni/ethtool/ixgbe/kcompat.h b/kernel/linux/kni/ethtool/ixgbe/kcompat.h -index 7c7d6c317..419fd1f13 100644 ---- a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h -+++ b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h -@@ -3125,6 +3125,10 @@ static inline int __kc_pci_vfs_assigned(struct pci_dev *dev) - #define SET_ETHTOOL_OPS(netdev, ops) ((netdev)->ethtool_ops = (ops)) - #endif /* >= 3.16.0 */ - -+#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) ) -+#define dev_open(x) dev_open(x, NULL) -+#endif /* >= 5.0.0 */ -+ - /* - * vlan_tx_tag_* macros renamed to skb_vlan_tag_* (Linux commit: df8a39defad4) - * For older kernels backported this commit, need to use renamed functions. --- -2.17.1 - diff -Nru dpdk-17.11.5/debian/patches/0002-kni-fix-build-for-igb_ndo_bridge_setlink-in-Linux-5..patch dpdk-17.11.6/debian/patches/0002-kni-fix-build-for-igb_ndo_bridge_setlink-in-Linux-5..patch --- dpdk-17.11.5/debian/patches/0002-kni-fix-build-for-igb_ndo_bridge_setlink-in-Linux-5..patch 2019-02-26 11:34:12.000000000 +0000 +++ dpdk-17.11.6/debian/patches/0002-kni-fix-build-for-igb_ndo_bridge_setlink-in-Linux-5..patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,77 +0,0 @@ -From 18cb8293e312bc3bd67211a5a540676f1c667d88 Mon Sep 17 00:00:00 2001 -From: Ferruh Yigit -Date: Tue, 22 Jan 2019 15:44:29 +0000 -Subject: [PATCH 2/2] kni: fix build for igb_ndo_bridge_setlink in Linux 5.0 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Build error seen with Linux kernel 5.0 and -when CONFIG_RTE_KNI_KMOD_ETHTOOL is enabled. - -build error: -.../build/build/kernel/linux/kni/igb_main.c:2348:24: - error: initialization of - ‘int (*)(struct net_device *, struct nlmsghdr *, u16, - struct netlink_ext_ack *)’ - {aka ‘int (*)(struct net_device *, struct nlmsghdr *, - short unsigned int, struct netlink_ext_ack *)’} - from incompatible pointer type - ‘int (*)(struct net_device *, struct nlmsghdr *, u16)’ - {aka ‘int (*)(struct net_device *, struct nlmsghdr *, - short unsigned int)’} - [-Werror=incompatible-pointer-types] - .ndo_bridge_setlink = igb_ndo_bridge_setlink, - ^~~~~~~~~~~~~~~~~~~~~~ -.../build/build/kernel/linux/kni/igb_main.c:2348:24: - note: (near initialization for ‘igb_netdev_ops.ndo_bridge_setlink’) - -igb_ndo_bridge_setlink() is changed in Linux kernel version 5.0 -and now requires a new parameter, 'struct netlink_ext_ack *extack'. -Fixed by adding a new parameter with a kernel version check. - -Signed-off-by: Ferruh Yigit - -Author: Christian Ehrhardt -Original-Author: Ferruh Yigit -Origin: backport, https://git.dpdk.org/dpdk/commit/?id=18cb8293e312bc3bd67211a5a540676f1c667d88 -Bug-Ubuntu: https://bugs.launchpad.net/bugs/1814919 -Last-Update: 2019-02-26 - ---- - kernel/linux/kni/ethtool/igb/igb_main.c | 5 +++++ - kernel/linux/kni/ethtool/igb/kcompat.h | 1 + - 2 files changed, 6 insertions(+) - -diff --git a/kernel/linux/kni/ethtool/igb/igb_main.c b/kernel/linux/kni/ethtool/igb/igb_main.c -index af378d2f2..0b4faeae5 100644 ---- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c -+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c -@@ -2207,7 +2207,12 @@ static int igb_ndo_fdb_dump(struct sk_buff *skb, - #ifdef HAVE_NDO_BRIDGE_SET_DEL_LINK_FLAGS - static int igb_ndo_bridge_setlink(struct net_device *dev, - struct nlmsghdr *nlh, -+#ifdef HAVE_NDO_BRIDGE_SETLINK_EXTACK -+ u16 flags, struct netlink_ext_ack *extack) -+#else - u16 flags) -+#endif -+ - #else - static int igb_ndo_bridge_setlink(struct net_device *dev, - struct nlmsghdr *nlh) -diff --git a/kernel/linux/kni/ethtool/igb/kcompat.h b/kernel/linux/kni/ethtool/igb/kcompat.h -index 068cfeb52..11b15f3a9 100644 ---- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h -+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h -@@ -3942,6 +3942,7 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type) - - #if ( LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) ) - #define dev_open(x) dev_open(x, NULL) -+#define HAVE_NDO_BRIDGE_SETLINK_EXTACK - #endif /* >= 5.0.0 */ - - #if defined(timer_setup) && defined(from_timer) --- -2.17.1 - diff -Nru dpdk-17.11.5/debian/patches/lp-1827102-kni-fix-build-with-Linux-5.1.patch dpdk-17.11.6/debian/patches/lp-1827102-kni-fix-build-with-Linux-5.1.patch --- dpdk-17.11.5/debian/patches/lp-1827102-kni-fix-build-with-Linux-5.1.patch 1970-01-01 00:00:00.000000000 +0000 +++ dpdk-17.11.6/debian/patches/lp-1827102-kni-fix-build-with-Linux-5.1.patch 2019-07-12 13:03:53.000000000 +0000 @@ -0,0 +1,73 @@ +From db9178c24c1643b5ef58f2a9ff87c3eef8e0e1e4 Mon Sep 17 00:00:00 2001 +From: Ferruh Yigit +Date: Mon, 8 Apr 2019 15:22:26 +0100 +Subject: [PATCH] kni: fix build with Linux 5.1 + +Build error seen with Linux kernel 5.1 and +when CONFIG_RTE_KNI_KMOD_ETHTOOL is enabled. + +Build error: +kernel/linux/kni/igb_main.c:2352:18: + error: initialization of ... from incompatible pointer type ... + [-Werror=incompatible-pointer-types] + .ndo_fdb_add = igb_ndo_fdb_add, + ^~~~~~~~~~~~~~~ + +ndo_fdb_add() is changed in Linux kernel version 5.1 and now requires +a new parameter, 'struct netlink_ext_ack *extack': +Linux Commit 87b0984ebfab ("net: Add extack argument to ndo_fdb_add()") + +ndo_fdb_add() parameter updated with compile time Linux kernel version +check. + +Cc: stable@dpdk.org + +Signed-off-by: Ferruh Yigit +Tested-by: Bruce Richardson +Reviewed-by: Rami Rosen + +Origin: upstream, https://git.dpdk.org/dpdk/commit/?id=db9178c24c1643b5ef58f2a9ff87c3eef8e0e1e4 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1827102 +Last-Update: 2019-05-03 + +--- + lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 6 ++++++ + lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 4 ++++ + 2 files changed, 10 insertions(+) + +diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c +index 0b4faeae5..cda2b063d 100644 +--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c ++++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c +@@ -2112,7 +2112,13 @@ static int igb_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], + #ifdef HAVE_NDO_FDB_ADD_VID + u16 vid, + #endif ++#ifdef HAVE_NDO_FDB_ADD_EXTACK ++ u16 flags, ++ struct netlink_ext_ack *extack) ++#else + u16 flags) ++#endif ++ + #else + static int igb_ndo_fdb_add(struct ndmsg *ndm, + struct net_device *dev, +diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h +index 11b15f3a9..649a69c81 100644 +--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h ++++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h +@@ -3945,6 +3945,10 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type) + #define HAVE_NDO_BRIDGE_SETLINK_EXTACK + #endif /* >= 5.0.0 */ + ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0) ) ++#define HAVE_NDO_FDB_ADD_EXTACK ++#endif /* >= 5.1.0 */ ++ + #if defined(timer_setup) && defined(from_timer) + #define HAVE_TIMER_SETUP + #endif +-- +2.21.0 + diff -Nru dpdk-17.11.5/debian/patches/series dpdk-17.11.6/debian/patches/series --- dpdk-17.11.5/debian/patches/series 2019-02-26 11:34:12.000000000 +0000 +++ dpdk-17.11.6/debian/patches/series 2019-07-12 13:03:53.000000000 +0000 @@ -1,5 +1,4 @@ fix-vhost-user-socket-permission.patch testpmd-link-virtio.patch app-testpmd-add-ethernet-peer-command.patch -0001-kni-fix-build-for-dev_open-in-Linux-5.0.patch -0002-kni-fix-build-for-igb_ndo_bridge_setlink-in-Linux-5..patch +lp-1827102-kni-fix-build-with-Linux-5.1.patch diff -Nru dpdk-17.11.5/devtools/check-git-log.sh dpdk-17.11.6/devtools/check-git-log.sh --- dpdk-17.11.5/devtools/check-git-log.sh 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/devtools/check-git-log.sh 2019-05-21 19:15:57.000000000 +0000 @@ -118,9 +118,10 @@ -e ':.*\<[hsf]w\>' \ -e ':.*\' \ -e ':.*\' \ - -e ':.*\' \ - -e ':.*\' \ - -e ':.*\' \ + -e ':.*\' \ + -e ':.*\<(Aarch64|AArch64|AARCH64|Aarch32|AArch32|AARCH32)\>' \ + -e ':.*\<(Armv7|ARMv7|ArmV7|armV7|ARMV7)\>' \ + -e ':.*\<(Armv8|ARMv8|ArmV8|armV8|ARMV8)\>' \ -e ':.*\' \ -e ':.*\' \ -e ':.*\' \ diff -Nru dpdk-17.11.5/doc/guides/conf.py dpdk-17.11.6/doc/guides/conf.py --- dpdk-17.11.5/doc/guides/conf.py 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/doc/guides/conf.py 2019-05-21 19:15:57.000000000 +0000 @@ -36,6 +36,7 @@ from sphinx.highlighting import PygmentsBridge from pygments.formatters.latex import LatexFormatter from os import listdir +from os import environ from os.path import basename from os.path import dirname from os.path import join as path_join @@ -64,7 +65,9 @@ html_show_copyright = False highlight_language = 'none' -version = subprocess.check_output(['make', '-sRrC', '../../', 'showversion']) +# If MAKEFLAGS is exported by the user, garbage text might end up in version +version = subprocess.check_output(['make', '-sRrC', '../../', 'showversion'], + env=dict(environ, MAKEFLAGS="")) version = version.decode('utf-8').rstrip() release = version diff -Nru dpdk-17.11.5/doc/guides/contributing/documentation.rst dpdk-17.11.6/doc/guides/contributing/documentation.rst --- dpdk-17.11.5/doc/guides/contributing/documentation.rst 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/doc/guides/contributing/documentation.rst 2019-05-21 19:15:57.000000000 +0000 @@ -201,6 +201,19 @@ # Red Hat/Fedora, selective install. sudo dnf -y install texlive-collection-latexextra +`Latexmk `_ is a perl script +for running LaTeX for resolving cross references, +and it also runs auxiliary programs like bibtex, makeindex if necessary, and dvips. +It has also a number of other useful capabilities (see man 1 latexmk). + +.. code-block:: console + + # Ubuntu/Debian. + sudo apt-get -y install latexmk + + # Red Hat/Fedora. + sudo dnf -y install latexmk + Build commands ~~~~~~~~~~~~~~ diff -Nru dpdk-17.11.5/doc/guides/prog_guide/power_man.rst dpdk-17.11.6/doc/guides/prog_guide/power_man.rst --- dpdk-17.11.5/doc/guides/prog_guide/power_man.rst 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/doc/guides/prog_guide/power_man.rst 2019-05-21 19:15:57.000000000 +0000 @@ -128,6 +128,8 @@ References ---------- -* l3fwd-power: The sample application in DPDK that performs L3 forwarding with power management. +* The :doc:`../sample_app_ug/l3_forward_power_man` + chapter in the :doc:`../sample_app_ug/index` section. -* The "L3 Forwarding with Power Management Sample Application" chapter in the *DPDK Sample Application's User Guide*. +* The :doc:`../sample_app_ug/vm_power_management` + chapter in the :doc:`../sample_app_ug/index` section. diff -Nru dpdk-17.11.5/doc/guides/rel_notes/known_issues.rst dpdk-17.11.6/doc/guides/rel_notes/known_issues.rst --- dpdk-17.11.5/doc/guides/rel_notes/known_issues.rst 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/doc/guides/rel_notes/known_issues.rst 2019-05-21 19:15:57.000000000 +0000 @@ -742,3 +742,38 @@ **Driver/Module**: ``igb_uio`` module. + + +AVX-512 support disabled +------------------------ + +**Description**: + ``AVX-512`` support has been disabled on some conditions. + This shouldn't be confused with ``CONFIG_RTE_ENABLE_AVX512`` config option which is already + disabled by default. This config option defines if ``AVX-512`` specific implementations of + some file to be used or not. What has been disabled is compiler feature to produce ``AVX-512`` + instructions from any source code. + + On DPDK v18.11 ``AVX-512`` is disabled for all ``GCC`` builds which reported to cause a performance + drop. + + On DPDK v19.02 ``AVX-512`` disable scope is reduced to ``GCC`` and ``binutils version 2.30`` based + on information accured from the GCC community defect. + +**Reason**: + Generated ``AVX-512`` code cause crash: + https://bugs.dpdk.org/show_bug.cgi?id=97 + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88096 + +**Resolution/Workaround**: + * Update ``binutils`` to newer version than ``2.30``. + + OR + + * Use different compiler, like ``clang`` for this case. + +**Affected Environment/Platform**: + ``GCC`` and ``binutils version 2.30``. + +**Driver/Module**: + ALL. diff -Nru dpdk-17.11.5/doc/guides/rel_notes/release_17_11.rst dpdk-17.11.6/doc/guides/rel_notes/release_17_11.rst --- dpdk-17.11.5/doc/guides/rel_notes/release_17_11.rst 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/doc/guides/rel_notes/release_17_11.rst 2019-05-21 19:15:57.000000000 +0000 @@ -1686,3 +1686,91 @@ * vfio: do not needlessly setup device in secondary process * vhost: fix corner case for enqueue operation * vhost: remove unneeded null pointer check + +17.11.6 +~~~~~~~ + +* app/testpmd: expand RED queue thresholds to 64 bits +* app/testpmd: fix quit to stop all ports before close +* crypto/qat: fix block size error handling +* devtools: fix wrong headline lowercase for arm +* doc: add dependency for PDF in contributing guide +* doc: add missing loopback option in testpmd guide +* doc: fix a parameter name in testpmd guide +* doc: fix garbage text in generated HTML guides +* doc: fix references in power management guide +* drivers/crypto: fix PMDs memory leak +* drivers: fix sprintf with snprintf +* drivers/net: fix several Tx prepare functions +* eal: check string parameter lengths +* eal: fix core number validation +* eal: fix out of bound access when no CPU available +* efd: fix tail queue leak +* ethdev: clear ethdev data upon detach +* ethdev: fix errno to have positive value +* ethdev: fix typo in queue setup error log +* eventdev: fix xstats documentation typo +* examples/bond: fix crash when there is no active slave +* examples/flow_filtering: fix example documentation +* examples/ipsec-secgw: fix outbound codepath for single SA +* examples/ipsec-secgw: make local variables static +* examples/tep_term: remove unused constant +* examples/vhost: fix path allocation failure handling +* gro: check invalid TCP header length +* gso: fix VxLAN/GRE tunnel checks +* kni: fix build for dev_open in Linux 5.0 +* kni: fix build for igb_ndo_bridge_setlink in Linux 5.0 +* kni: fix build on RHEL 8 +* kni: fix build on RHEL8 for arm and Power9 +* mk: fix scope of disabling AVX512F support +* net/af_packet: fix setting MTU decrements sockaddr twice +* net/bnx2x: cleanup info logs +* net/bonding: fix possible null pointer reference +* net/dpaa2: fix device init for secondary process +* net/dpaa: fix secondary process +* net/ena: add supported RSS offloads types +* net/ena: fix dev init with multi-process +* net/ena: fix errno to positive value +* net/ena: update completion queue after cleanup +* net/enic: remove useless include +* net: fix underflow for checksum of invalid IPv4 packets +* net/fm10k: fix internal switch initial status +* net/i40e: fix get RSS conf +* net/i40e: fix getting RSS configuration +* net/i40e: fix queue region DCB configure +* net/i40e: fix statistics inconsistency +* net/i40e: fix using recovery mode firmware +* net/i40e: fix VF overwrite PF RSS LUT for X722 +* net/i40e: remove redundant reset of queue number +* net/i40e: revert fix offload not supported mask +* net/igb: fix LSC interrupt when using MSI-X +* net/ixgbe: fix over using multicast table for VF +* net/ixgbe: fix overwriting RSS RETA +* net/mlx5: fix validation of Rx queue number +* net/qede: fix performance bottleneck in Rx path +* net/qede: remove prefetch in Tx path +* net/sfc/base: fix Tx descriptor max number check +* net/sfc: discard last seen VLAN TCI if Tx packet is dropped +* net/sfc: fix datapath name references in logs +* net/sfc: fix port ID log +* net/sfc: fix Rx packets counter +* net/sfc: fix typo in preprocessor check +* net/sfc: fix VF error/missed stats mapping +* net/sfc: pass HW Tx queue index on creation +* net/tap: add buffer overflow checks before checksum +* net/tap: fix possible uninitialized variable access +* net/virtio: add barrier before reading the flags +* net/virtio: fix resuming port with Rx vector path +* net/virtio-user: fix used ring in cvq handling +* test/crypto: fix misleading trace message +* test/memzone: fix typo +* test/memzone: handle previously allocated memzones +* timer: fix race condition +* vfio: fix error message +* vhost: fix access for indirect descriptors +* vhost: fix crash after mmap failure +* vhost: fix error handling when mem table gets updated +* vhost: fix memory leak on realloc failure +* vhost: fix payload size of reply +* vhost: fix possible out of bound access in vector filling +* vhost: fix race condition when adding fd in the fdset diff -Nru dpdk-17.11.5/doc/guides/sample_app_ug/flow_filtering.rst dpdk-17.11.6/doc/guides/sample_app_ug/flow_filtering.rst --- dpdk-17.11.5/doc/guides/sample_app_ug/flow_filtering.rst 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/doc/guides/sample_app_ug/flow_filtering.rst 2019-05-21 19:15:57.000000000 +0000 @@ -81,7 +81,7 @@ Explanation ----------- -The example is build from 2 main files, +The example is built from 2 files, ``main.c`` which holds the example logic and ``flow_blocks.c`` that holds the implementation for building the flow rule. @@ -378,13 +378,9 @@ { struct rte_flow_attr attr; struct rte_flow_item pattern[MAX_PATTERN_NUM]; - struct rte_flow_action action[MAX_PATTERN_NUM]; + struct rte_flow_action action[MAX_ACTION_NUM]; struct rte_flow *flow = NULL; struct rte_flow_action_queue queue = { .index = rx_q }; - struct rte_flow_item_eth eth_spec; - struct rte_flow_item_eth eth_mask; - struct rte_flow_item_vlan vlan_spec; - struct rte_flow_item_vlan vlan_mask; struct rte_flow_item_ipv4 ip_spec; struct rte_flow_item_ipv4 ip_mask; @@ -402,37 +398,19 @@ * create the action sequence. * one action only, move packet to queue */ - action[0].type = RTE_FLOW_ACTION_TYPE_QUEUE; action[0].conf = &queue; action[1].type = RTE_FLOW_ACTION_TYPE_END; /* - * set the first level of the pattern (eth). + * set the first level of the pattern (ETH). * since in this example we just want to get the * ipv4 we set this level to allow all. */ - memset(ð_spec, 0, sizeof(struct rte_flow_item_eth)); - memset(ð_mask, 0, sizeof(struct rte_flow_item_eth)); - eth_spec.type = 0; - eth_mask.type = 0; pattern[0].type = RTE_FLOW_ITEM_TYPE_ETH; - pattern[0].spec = ð_spec; - pattern[0].mask = ð_mask; - - /* - * setting the second level of the pattern (vlan). - * since in this example we just want to get the - * ipv4 we also set this level to allow all. - */ - memset(&vlan_spec, 0, sizeof(struct rte_flow_item_vlan)); - memset(&vlan_mask, 0, sizeof(struct rte_flow_item_vlan)); - pattern[1].type = RTE_FLOW_ITEM_TYPE_VLAN; - pattern[1].spec = &vlan_spec; - pattern[1].mask = &vlan_mask; /* - * setting the third level of the pattern (ip). + * setting the second level of the pattern (IP). * in this example this is the level we care about * so we set it according to the parameters. */ @@ -442,12 +420,12 @@ ip_mask.hdr.dst_addr = dest_mask; ip_spec.hdr.src_addr = htonl(src_ip); ip_mask.hdr.src_addr = src_mask; - pattern[2].type = RTE_FLOW_ITEM_TYPE_IPV4; - pattern[2].spec = &ip_spec; - pattern[2].mask = &ip_mask; + pattern[1].type = RTE_FLOW_ITEM_TYPE_IPV4; + pattern[1].spec = &ip_spec; + pattern[1].mask = &ip_mask; /* the final level must be always type end */ - pattern[3].type = RTE_FLOW_ITEM_TYPE_END; + pattern[2].type = RTE_FLOW_ITEM_TYPE_END; int res = rte_flow_validate(port_id, &attr, pattern, action, error); if(!res) @@ -462,14 +440,10 @@ struct rte_flow_attr attr; struct rte_flow_item pattern[MAX_PATTERN_NUM]; - struct rte_flow_action action[MAX_PATTERN_NUM]; + struct rte_flow_action action[MAX_ACTION_NUM]; struct rte_flow *flow; struct rte_flow_error error; struct rte_flow_action_queue queue = { .index = rx_q }; - struct rte_flow_item_eth eth_spec; - struct rte_flow_item_eth eth_mask; - struct rte_flow_item_vlan vlan_spec; - struct rte_flow_item_vlan vlan_mask; struct rte_flow_item_ipv4 ip_spec; struct rte_flow_item_ipv4 ip_mask; @@ -489,33 +463,17 @@ action[0].conf = &queue; action[1].type = RTE_FLOW_ACTION_TYPE_END; -The forth part is responsible for creating the pattern and is build from -number of step. In each step we build one level of the pattern starting with +The fourth part is responsible for creating the pattern and is built from +number of steps. In each step we build one level of the pattern starting with the lowest one. Setting the first level of the pattern ETH: .. code-block:: c - memset(ð_spec, 0, sizeof(struct rte_flow_item_eth)); - memset(ð_mask, 0, sizeof(struct rte_flow_item_eth)); - eth_spec.type = 0; - eth_mask.type = 0; pattern[0].type = RTE_FLOW_ITEM_TYPE_ETH; - pattern[0].spec = ð_spec; - pattern[0].mask = ð_mask; - -Setting the second level of the pattern VLAN: - -.. code-block:: c - - memset(&vlan_spec, 0, sizeof(struct rte_flow_item_vlan)); - memset(&vlan_mask, 0, sizeof(struct rte_flow_item_vlan)); - pattern[1].type = RTE_FLOW_ITEM_TYPE_VLAN; - pattern[1].spec = &vlan_spec; - pattern[1].mask = &vlan_mask; -Setting the third level ip: +Setting the second level of the pattern IP: .. code-block:: c @@ -525,15 +483,15 @@ ip_mask.hdr.dst_addr = dest_mask; ip_spec.hdr.src_addr = htonl(src_ip); ip_mask.hdr.src_addr = src_mask; - pattern[2].type = RTE_FLOW_ITEM_TYPE_IPV4; - pattern[2].spec = &ip_spec; - pattern[2].mask = &ip_mask; + pattern[1].type = RTE_FLOW_ITEM_TYPE_IPV4; + pattern[1].spec = &ip_spec; + pattern[1].mask = &ip_mask; Closing the pattern part. .. code-block:: c - pattern[3].type = RTE_FLOW_ITEM_TYPE_END; + pattern[2].type = RTE_FLOW_ITEM_TYPE_END; The last part of the function is to validate the rule and create it. diff -Nru dpdk-17.11.5/doc/guides/testpmd_app_ug/run_app.rst dpdk-17.11.6/doc/guides/testpmd_app_ug/run_app.rst --- dpdk-17.11.5/doc/guides/testpmd_app_ug/run_app.rst 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/doc/guides/testpmd_app_ug/run_app.rst 2019-05-21 19:15:57.000000000 +0000 @@ -341,7 +341,7 @@ * ``--port-topology=mode`` - Set port topology, where mode is ``paired`` (the default) or ``chained``. + Set port topology, where mode is ``paired`` (the default), ``chained`` or ``loop``. In ``paired`` mode, the forwarding is between pairs of ports, for example: (0,1), (2,3), (4,5). @@ -349,6 +349,8 @@ The ordering of the ports can be changed using the portlist testpmd runtime function. + In ``loop`` mode, ingress traffic is simply transmitted back on the same interface. + * ``--forward-mode=mode`` Set the forwarding mode where ``mode`` is one of the following:: diff -Nru dpdk-17.11.5/doc/guides/testpmd_app_ug/testpmd_funcs.rst dpdk-17.11.6/doc/guides/testpmd_app_ug/testpmd_funcs.rst --- dpdk-17.11.5/doc/guides/testpmd_app_ug/testpmd_funcs.rst 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/doc/guides/testpmd_app_ug/testpmd_funcs.rst 2019-05-21 19:15:57.000000000 +0000 @@ -329,7 +329,7 @@ * ``mac``: Changes the source and the destination Ethernet addresses of packets before forwarding them. Default application behaviour is to set source Ethernet address to that of the transmitting interface, and destination address to a dummy value (set during init). The user may specify a target destination Ethernet address via the 'eth-peer' or - 'eth-peer-configfile' command-line options. It is not currently possible to specify a specific source Ethernet address. + 'eth-peers-configfile' command-line options. It is not currently possible to specify a specific source Ethernet address. * ``macswap``: MAC swap forwarding mode. Swaps the source and the destination Ethernet addresses of packets before forwarding them. diff -Nru dpdk-17.11.5/drivers/bus/fslmc/fslmc_bus.c dpdk-17.11.6/drivers/bus/fslmc/fslmc_bus.c --- dpdk-17.11.5/drivers/bus/fslmc/fslmc_bus.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/bus/fslmc/fslmc_bus.c 2019-05-21 19:15:57.000000000 +0000 @@ -216,8 +216,8 @@ goto scan_fail; /* Scan devices on the group */ - sprintf(fslmc_dirpath, "%s/%d/devices", VFIO_IOMMU_GROUP_PATH, - groupid); + snprintf(fslmc_dirpath, sizeof(fslmc_dirpath), "%s/%d/devices", + VFIO_IOMMU_GROUP_PATH, groupid); dir = opendir(fslmc_dirpath); if (!dir) { FSLMC_BUS_LOG(ERR, "Unable to open VFIO group dir."); diff -Nru dpdk-17.11.5/drivers/bus/pci/linux/pci_vfio.c dpdk-17.11.6/drivers/bus/pci/linux/pci_vfio.c --- dpdk-17.11.5/drivers/bus/pci/linux/pci_vfio.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/bus/pci/linux/pci_vfio.c 2019-05-21 19:15:57.000000000 +0000 @@ -473,7 +473,7 @@ vfio_res = rte_zmalloc("VFIO_RES", sizeof(*vfio_res), 0); if (vfio_res == NULL) { RTE_LOG(ERR, EAL, - "%s(): cannot store uio mmap details\n", __func__); + "%s(): cannot store vfio mmap details\n", __func__); goto err_vfio_dev_fd; } memcpy(&vfio_res->pci_addr, &dev->addr, sizeof(vfio_res->pci_addr)); diff -Nru dpdk-17.11.5/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c dpdk-17.11.6/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c --- dpdk-17.11.5/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c 2019-05-21 19:15:57.000000000 +0000 @@ -180,6 +180,11 @@ aesni_gcm_pmd_qp_release(struct rte_cryptodev *dev, uint16_t qp_id) { if (dev->data->queue_pairs[qp_id] != NULL) { + struct aesni_gcm_qp *qp = dev->data->queue_pairs[qp_id]; + + if (qp->processed_pkts) + rte_ring_free(qp->processed_pkts); + rte_free(dev->data->queue_pairs[qp_id]); dev->data->queue_pairs[qp_id] = NULL; } diff -Nru dpdk-17.11.5/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c dpdk-17.11.6/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c --- dpdk-17.11.5/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c 2019-05-21 19:15:57.000000000 +0000 @@ -2326,14 +2326,15 @@ retcode); goto init_error; } - sprintf(cryptodev->data->name, "dpsec-%u", hw_id); + snprintf(cryptodev->data->name, sizeof(cryptodev->data->name), + "dpsec-%u", hw_id); internals->max_nb_queue_pairs = attr.num_tx_queues; cryptodev->data->nb_queue_pairs = internals->max_nb_queue_pairs; internals->hw = dpseci; internals->token = token; - sprintf(str, "fle_pool_%d", cryptodev->data->dev_id); + snprintf(str, sizeof(str), "fle_pool_%d", cryptodev->data->dev_id); internals->fle_pool = rte_mempool_create((const char *)str, FLE_POOL_NUM_BUFS, FLE_POOL_BUF_SIZE, @@ -2364,7 +2365,8 @@ int retval; - sprintf(cryptodev_name, "dpsec-%d", dpaa2_dev->object_id); + snprintf(cryptodev_name, sizeof(cryptodev_name), "dpsec-%d", + dpaa2_dev->object_id); cryptodev = rte_cryptodev_pmd_allocate(cryptodev_name, rte_socket_id()); if (cryptodev == NULL) diff -Nru dpdk-17.11.5/drivers/crypto/dpaa_sec/dpaa_sec.c dpdk-17.11.6/drivers/crypto/dpaa_sec/dpaa_sec.c --- dpdk-17.11.5/drivers/crypto/dpaa_sec/dpaa_sec.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/crypto/dpaa_sec/dpaa_sec.c 2019-05-21 19:15:57.000000000 +0000 @@ -1460,7 +1460,8 @@ int retval; - sprintf(cryptodev_name, "dpaa_sec-%d", dpaa_dev->id.dev_id); + snprintf(cryptodev_name, sizeof(cryptodev_name), "dpaa_sec-%d", + dpaa_dev->id.dev_id); cryptodev = rte_cryptodev_pmd_allocate(cryptodev_name, rte_socket_id()); if (cryptodev == NULL) diff -Nru dpdk-17.11.5/drivers/crypto/null/null_crypto_pmd_ops.c dpdk-17.11.6/drivers/crypto/null/null_crypto_pmd_ops.c --- dpdk-17.11.5/drivers/crypto/null/null_crypto_pmd_ops.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/crypto/null/null_crypto_pmd_ops.c 2019-05-21 19:15:57.000000000 +0000 @@ -160,6 +160,11 @@ null_crypto_pmd_qp_release(struct rte_cryptodev *dev, uint16_t qp_id) { if (dev->data->queue_pairs[qp_id] != NULL) { + struct null_crypto_qp *qp = dev->data->queue_pairs[qp_id]; + + if (qp->processed_pkts) + rte_ring_free(qp->processed_pkts); + rte_free(dev->data->queue_pairs[qp_id]); dev->data->queue_pairs[qp_id] = NULL; } diff -Nru dpdk-17.11.5/drivers/crypto/openssl/rte_openssl_pmd_ops.c dpdk-17.11.6/drivers/crypto/openssl/rte_openssl_pmd_ops.c --- dpdk-17.11.5/drivers/crypto/openssl/rte_openssl_pmd_ops.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/crypto/openssl/rte_openssl_pmd_ops.c 2019-05-21 19:15:57.000000000 +0000 @@ -584,6 +584,11 @@ openssl_pmd_qp_release(struct rte_cryptodev *dev, uint16_t qp_id) { if (dev->data->queue_pairs[qp_id] != NULL) { + struct openssl_qp *qp = dev->data->queue_pairs[qp_id]; + + if (qp->processed_ops) + rte_ring_free(qp->processed_ops); + rte_free(dev->data->queue_pairs[qp_id]); dev->data->queue_pairs[qp_id] = NULL; } diff -Nru dpdk-17.11.5/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c dpdk-17.11.6/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c --- dpdk-17.11.5/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c 2019-05-21 19:15:57.000000000 +0000 @@ -413,8 +413,8 @@ } block_size = qat_hash_get_block_size(hash_alg); - if (block_size <= 0) - return -EFAULT; + if (block_size < 0) + return block_size; /* init ipad and opad from key and xor with fixed values */ memset(ipad, 0, block_size); memset(opad, 0, block_size); @@ -753,9 +753,13 @@ || cdesc->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_KASUMI_F9 || cdesc->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_ZUC_3G_128_EIA3) hash->auth_counter.counter = 0; - else - hash->auth_counter.counter = rte_bswap32( - qat_hash_get_block_size(cdesc->qat_hash_alg)); + else { + int block_size = qat_hash_get_block_size(cdesc->qat_hash_alg); + + if (block_size < 0) + return block_size; + hash->auth_counter.counter = rte_bswap32(block_size); + } cdesc->cd_cur_ptr += sizeof(struct icp_qat_hw_auth_setup); diff -Nru dpdk-17.11.5/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c dpdk-17.11.6/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c --- dpdk-17.11.5/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c 2019-05-21 19:15:57.000000000 +0000 @@ -169,6 +169,11 @@ snow3g_pmd_qp_release(struct rte_cryptodev *dev, uint16_t qp_id) { if (dev->data->queue_pairs[qp_id] != NULL) { + struct snow3g_qp *qp = dev->data->queue_pairs[qp_id]; + + if (qp->processed_ops) + rte_ring_free(qp->processed_ops); + rte_free(dev->data->queue_pairs[qp_id]); dev->data->queue_pairs[qp_id] = NULL; } diff -Nru dpdk-17.11.5/drivers/crypto/zuc/rte_zuc_pmd_ops.c dpdk-17.11.6/drivers/crypto/zuc/rte_zuc_pmd_ops.c --- dpdk-17.11.5/drivers/crypto/zuc/rte_zuc_pmd_ops.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/crypto/zuc/rte_zuc_pmd_ops.c 2019-05-21 19:15:57.000000000 +0000 @@ -169,6 +169,11 @@ zuc_pmd_qp_release(struct rte_cryptodev *dev, uint16_t qp_id) { if (dev->data->queue_pairs[qp_id] != NULL) { + struct zuc_qp *qp = dev->data->queue_pairs[qp_id]; + + if (qp->processed_ops) + rte_ring_free(qp->processed_ops); + rte_free(dev->data->queue_pairs[qp_id]); dev->data->queue_pairs[qp_id] = NULL; } diff -Nru dpdk-17.11.5/drivers/net/af_packet/rte_eth_af_packet.c dpdk-17.11.6/drivers/net/af_packet/rte_eth_af_packet.c --- dpdk-17.11.5/drivers/net/af_packet/rte_eth_af_packet.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/af_packet/rte_eth_af_packet.c 2019-05-21 19:15:57.000000000 +0000 @@ -457,8 +457,7 @@ int ret; int s; unsigned int data_size = internals->req.tp_frame_size - - TPACKET2_HDRLEN - - sizeof(struct sockaddr_ll); + TPACKET2_HDRLEN; if (mtu > data_size) return -EINVAL; diff -Nru dpdk-17.11.5/drivers/net/bnx2x/bnx2x.c dpdk-17.11.6/drivers/net/bnx2x/bnx2x.c --- dpdk-17.11.5/drivers/net/bnx2x/bnx2x.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/bnx2x/bnx2x.c 2019-05-21 19:15:57.000000000 +0000 @@ -5815,7 +5815,7 @@ /* If there is no power capability, silently succeed */ if (!(sc->devinfo.pcie_cap_flags & BNX2X_PM_CAPABLE_FLAG)) { - PMD_DRV_LOG(WARNING, sc, "No power capability"); + PMD_DRV_LOG(INFO, sc, "No power capability"); return 0; } @@ -6924,19 +6924,19 @@ return; } - PMD_DRV_LOG(INFO, sc, "Change in link status : cur_data = %lx, last_reported_link = %lx\n", - cur_data.link_report_flags, - sc->last_reported_link.link_report_flags); + ELINK_DEBUG_P2(sc, "Change in link status : cur_data = %lx, last_reported_link = %lx", + cur_data.link_report_flags, + sc->last_reported_link.link_report_flags); sc->link_cnt++; - PMD_DRV_LOG(INFO, sc, "link status change count = %x\n", sc->link_cnt); + ELINK_DEBUG_P1(sc, "link status change count = %x", sc->link_cnt); /* report new link params and remember the state for the next time */ rte_memcpy(&sc->last_reported_link, &cur_data, sizeof(cur_data)); if (bnx2x_test_bit(BNX2X_LINK_REPORT_LINK_DOWN, &cur_data.link_report_flags)) { - PMD_DRV_LOG(INFO, sc, "NIC Link is Down"); + ELINK_DEBUG_P0(sc, "NIC Link is Down"); } else { __rte_unused const char *duplex; __rte_unused const char *flow; @@ -6944,8 +6944,10 @@ if (bnx2x_test_and_clear_bit(BNX2X_LINK_REPORT_FULL_DUPLEX, &cur_data.link_report_flags)) { duplex = "full"; + ELINK_DEBUG_P0(sc, "link set to full duplex"); } else { duplex = "half"; + ELINK_DEBUG_P0(sc, "link set to half duplex"); } /* @@ -7129,7 +7131,7 @@ { if ((sc->state != BNX2X_STATE_OPEN) || (atomic_load_acq_long(&sc->periodic_flags) == PERIODIC_STOP)) { - PMD_DRV_LOG(INFO, sc, "periodic callout exit (state=0x%x)", + PMD_DRV_LOG(DEBUG, sc, "periodic callout exit (state=0x%x)", sc->state); return; } @@ -8325,7 +8327,7 @@ ((sc->devinfo.bc_ver >> 24) & 0xff), ((sc->devinfo.bc_ver >> 16) & 0xff), ((sc->devinfo.bc_ver >> 8) & 0xff)); - PMD_DRV_LOG(INFO, sc, "Bootcode version: %s", sc->devinfo.bc_ver_str); + PMD_DRV_LOG(DEBUG, sc, "Bootcode version: %s", sc->devinfo.bc_ver_str); /* get the bootcode shmem address */ sc->devinfo.mf_cfg_base = bnx2x_get_shmem_mf_cfg_base(sc); @@ -11753,42 +11755,36 @@ } #endif -/* - * Prints useful adapter info. - */ +/* Prints useful adapter info. */ void bnx2x_print_adapter_info(struct bnx2x_softc *sc) { int i = 0; - __rte_unused uint32_t ext_phy_type; - PMD_INIT_FUNC_TRACE(sc); - if (sc->link_vars.phy_flags & PHY_XGXS_FLAG) - ext_phy_type = ELINK_XGXS_EXT_PHY_TYPE(REG_RD(sc, - sc-> - devinfo.shmem_base - + offsetof(struct - shmem_region, - dev_info.port_hw_config - [0].external_phy_config))); - else - ext_phy_type = ELINK_SERDES_EXT_PHY_TYPE(REG_RD(sc, - sc-> - devinfo.shmem_base - + - offsetof(struct - shmem_region, - dev_info.port_hw_config - [0].external_phy_config))); - - PMD_DRV_LOG(INFO, sc, "\n\n===================================\n"); + PMD_DRV_LOG(INFO, sc, "========================================"); + /* DPDK and Driver versions */ + PMD_DRV_LOG(INFO, sc, "%12s : %s", "DPDK", + rte_version()); + PMD_DRV_LOG(INFO, sc, "%12s : %s", "Driver", + bnx2x_pmd_version()); + /* Firmware versions. */ + PMD_DRV_LOG(INFO, sc, "%12s : %d.%d.%d", + "Firmware", + BNX2X_5710_FW_MAJOR_VERSION, + BNX2X_5710_FW_MINOR_VERSION, + BNX2X_5710_FW_REVISION_VERSION); + PMD_DRV_LOG(INFO, sc, "%12s : %s", + "Bootcode", sc->devinfo.bc_ver_str); /* Hardware chip info. */ PMD_DRV_LOG(INFO, sc, "%12s : %#08x", "ASIC", sc->devinfo.chip_id); PMD_DRV_LOG(INFO, sc, "%12s : %c%d", "Rev", (CHIP_REV(sc) >> 12) + 'A', (CHIP_METAL(sc) >> 4)); - - /* Bus info. */ - PMD_DRV_LOG(INFO, sc, - "%12s : %d, ", "Bus PCIe", sc->devinfo.pcie_link_width); + /* Bus PCIe info. */ + PMD_DRV_LOG(INFO, sc, "%12s : 0x%x", "Vendor Id", + sc->devinfo.vendor_id); + PMD_DRV_LOG(INFO, sc, "%12s : 0x%x", "Device Id", + sc->devinfo.device_id); + PMD_DRV_LOG(INFO, sc, "%12s : width x%d, ", "Bus PCIe", + sc->devinfo.pcie_link_width); switch (sc->devinfo.pcie_link_speed) { case 1: PMD_DRV_LOG(INFO, sc, "%23s", "2.5 Gbps"); @@ -11802,62 +11798,45 @@ default: PMD_DRV_LOG(INFO, sc, "%33s", "Unknown link speed"); } - /* Device features. */ PMD_DRV_LOG(INFO, sc, "%12s : ", "Flags"); - /* Miscellaneous flags. */ if (sc->devinfo.pcie_cap_flags & BNX2X_MSI_CAPABLE_FLAG) { PMD_DRV_LOG(INFO, sc, "%18s", "MSI"); i++; } - if (sc->devinfo.pcie_cap_flags & BNX2X_MSIX_CAPABLE_FLAG) { if (i > 0) PMD_DRV_LOG(INFO, sc, "|"); PMD_DRV_LOG(INFO, sc, "%20s", "MSI-X"); i++; } + PMD_DRV_LOG(INFO, sc, "%12s : %s", "OVLAN", (OVLAN(sc) ? "YES" : "NO")); + PMD_DRV_LOG(INFO, sc, "%12s : %s", "MF", (IS_MF(sc) ? "YES" : "NO")); + PMD_DRV_LOG(INFO, sc, "========================================"); +} - if (IS_PF(sc)) { - PMD_DRV_LOG(INFO, sc, "%12s : ", "Queues"); - switch (sc->sp->rss_rdata.rss_mode) { - case ETH_RSS_MODE_DISABLED: - PMD_DRV_LOG(INFO, sc, "%19s", "None"); - break; - case ETH_RSS_MODE_REGULAR: - PMD_DRV_LOG(INFO, sc, - "%18s : %d", "RSS", sc->num_queues); - break; - default: - PMD_DRV_LOG(INFO, sc, "%22s", "Unknown"); - break; - } - } - - /* RTE and Driver versions */ - PMD_DRV_LOG(INFO, sc, "%12s : %s", "DPDK", - rte_version()); - PMD_DRV_LOG(INFO, sc, "%12s : %s", "Driver", - bnx2x_pmd_version()); +/* Prints useful device info. */ +void bnx2x_print_device_info(struct bnx2x_softc *sc) +{ + __rte_unused uint32_t ext_phy_type; + uint32_t offset, reg_val; - /* Firmware versions and device features. */ - PMD_DRV_LOG(INFO, sc, "%12s : %d.%d.%d", - "Firmware", - BNX2X_5710_FW_MAJOR_VERSION, - BNX2X_5710_FW_MINOR_VERSION, - BNX2X_5710_FW_REVISION_VERSION); - PMD_DRV_LOG(INFO, sc, "%12s : %s", - "Bootcode", sc->devinfo.bc_ver_str); + PMD_INIT_FUNC_TRACE(sc); + offset = offsetof(struct shmem_region, + dev_info.port_hw_config[0].external_phy_config); + reg_val = REG_RD(sc, sc->devinfo.shmem_base + offset); + if (sc->link_vars.phy_flags & PHY_XGXS_FLAG) + ext_phy_type = ELINK_XGXS_EXT_PHY_TYPE(reg_val); + else + ext_phy_type = ELINK_SERDES_EXT_PHY_TYPE(reg_val); - PMD_DRV_LOG(INFO, sc, "\n\n===================================\n"); + /* Device features. */ PMD_DRV_LOG(INFO, sc, "%12s : %u", "Bnx2x Func", sc->pcie_func); PMD_DRV_LOG(INFO, sc, "%12s : %s", "Bnx2x Flags", get_bnx2x_flags(sc->flags)); PMD_DRV_LOG(INFO, sc, "%12s : %s", "DMAE Is", (sc->dmae_ready ? "Ready" : "Not Ready")); - PMD_DRV_LOG(INFO, sc, "%12s : %s", "OVLAN", (OVLAN(sc) ? "YES" : "NO")); - PMD_DRV_LOG(INFO, sc, "%12s : %s", "MF", (IS_MF(sc) ? "YES" : "NO")); PMD_DRV_LOG(INFO, sc, "%12s : %u", "MTU", sc->mtu); PMD_DRV_LOG(INFO, sc, "%12s : %s", "PHY Type", get_ext_phy_type(ext_phy_type)); @@ -11873,9 +11852,30 @@ if (sc->recovery_state) PMD_DRV_LOG(INFO, sc, "%12s : %s", "Recovery", get_recovery_state(sc->recovery_state)); + /* Queue info. */ + if (IS_PF(sc)) { + switch (sc->sp->rss_rdata.rss_mode) { + case ETH_RSS_MODE_DISABLED: + PMD_DRV_LOG(INFO, sc, "%12s : %s", "Queues", "RSS mode - None"); + break; + case ETH_RSS_MODE_REGULAR: + PMD_DRV_LOG(INFO, sc, "%12s : %s,", "Queues", "RSS mode - Regular"); + PMD_DRV_LOG(INFO, sc, "%16d", sc->num_queues); + break; + default: + PMD_DRV_LOG(INFO, sc, "%12s : %s", "Queues", "RSS mode - Unknown"); + break; + } + } PMD_DRV_LOG(INFO, sc, "%12s : CQ = %lx, EQ = %lx", "SPQ Left", sc->cq_spq_left, sc->eq_spq_left); + PMD_DRV_LOG(INFO, sc, "%12s : %x", "Switch", sc->link_params.switch_cfg); - PMD_DRV_LOG(INFO, sc, "\n\n===================================\n"); + PMD_DRV_LOG(INFO, sc, "pcie_bus=%d, pcie_device=%d", + sc->pcie_bus, sc->pcie_device); + PMD_DRV_LOG(INFO, sc, "bar0.addr=%p, bar1.addr=%p", + sc->bar[BAR0].base_addr, sc->bar[BAR1].base_addr); + PMD_DRV_LOG(INFO, sc, "port=%d, path=%d, vnic=%d, func=%d", + PORT_ID(sc), PATH_ID(sc), VNIC_ID(sc), FUNC_ID(sc)); } diff -Nru dpdk-17.11.5/drivers/net/bnx2x/bnx2x_ethdev.c dpdk-17.11.6/drivers/net/bnx2x/bnx2x_ethdev.c --- dpdk-17.11.5/drivers/net/bnx2x/bnx2x_ethdev.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/bnx2x/bnx2x_ethdev.c 2019-05-21 19:15:57.000000000 +0000 @@ -332,8 +332,7 @@ return -3; } - /* Print important adapter info for the user. */ - bnx2x_print_adapter_info(sc); + bnx2x_print_device_info(sc); return ret; } @@ -639,6 +638,7 @@ struct rte_pci_device *pci_dev; struct rte_pci_addr pci_addr; struct bnx2x_softc *sc; + static bool adapter_info = true; /* Extract key data structures */ sc = eth_dev->data->dev_private; @@ -697,8 +697,15 @@ return ret; } + /* Print important adapter info for the user. */ + if (adapter_info) { + bnx2x_print_adapter_info(sc); + adapter_info = false; + } + /* schedule periodic poll for slowpath link events */ if (IS_PF(sc)) { + PMD_DRV_LOG(DEBUG, sc, "Scheduling periodic poll for slowpath link events"); ret = rte_eal_alarm_set(BNX2X_SP_TIMER_PERIOD, bnx2x_periodic_start, (void *)eth_dev); if (ret) { @@ -710,15 +717,6 @@ eth_dev->data->mac_addrs = (struct ether_addr *)sc->link_params.mac_addr; - PMD_DRV_LOG(INFO, sc, "pcie_bus=%d, pcie_device=%d", - sc->pcie_bus, sc->pcie_device); - PMD_DRV_LOG(INFO, sc, "bar0.addr=%p, bar1.addr=%p", - sc->bar[BAR0].base_addr, sc->bar[BAR1].base_addr); - PMD_DRV_LOG(INFO, sc, "port=%d, path=%d, vnic=%d, func=%d", - PORT_ID(sc), PATH_ID(sc), VNIC_ID(sc), FUNC_ID(sc)); - PMD_DRV_LOG(INFO, sc, "portID=%d vendorID=0x%x deviceID=0x%x", - eth_dev->data->port_id, pci_dev->id.vendor_id, pci_dev->id.device_id); - if (IS_VF(sc)) { rte_spinlock_init(&sc->vf2pf_lock); diff -Nru dpdk-17.11.5/drivers/net/bnx2x/bnx2x_ethdev.h dpdk-17.11.6/drivers/net/bnx2x/bnx2x_ethdev.h --- dpdk-17.11.5/drivers/net/bnx2x/bnx2x_ethdev.h 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/bnx2x/bnx2x_ethdev.h 2019-05-21 19:15:57.000000000 +0000 @@ -50,6 +50,7 @@ #define FALSE 0 #define TRUE 1 +typedef int bool; #define false 0 #define true 1 #define min(a,b) RTE_MIN(a,b) diff -Nru dpdk-17.11.5/drivers/net/bnx2x/bnx2x.h dpdk-17.11.6/drivers/net/bnx2x/bnx2x.h --- dpdk-17.11.5/drivers/net/bnx2x/bnx2x.h 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/bnx2x/bnx2x.h 2019-05-21 19:15:57.000000000 +0000 @@ -1936,6 +1936,7 @@ int bnx2x_tx_encap(struct bnx2x_tx_queue *txq, struct rte_mbuf *m0); uint8_t bnx2x_txeof(struct bnx2x_softc *sc, struct bnx2x_fastpath *fp); void bnx2x_print_adapter_info(struct bnx2x_softc *sc); +void bnx2x_print_device_info(struct bnx2x_softc *sc); int bnx2x_intr_legacy(struct bnx2x_softc *sc, int scan_fp); void bnx2x_link_status_update(struct bnx2x_softc *sc); int bnx2x_complete_sp(struct bnx2x_softc *sc); @@ -1983,7 +1984,7 @@ bnx2x_vf_set_rx_mode(sc); } } else { - PMD_DRV_LOG(NOTICE, sc, "Card is not ready to change mode"); + PMD_DRV_LOG(INFO, sc, "Card is not ready to change mode"); } } diff -Nru dpdk-17.11.5/drivers/net/bnx2x/ecore_sp.c dpdk-17.11.6/drivers/net/bnx2x/ecore_sp.c --- dpdk-17.11.5/drivers/net/bnx2x/ecore_sp.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/bnx2x/ecore_sp.c 2019-05-21 19:15:57.000000000 +0000 @@ -532,17 +532,15 @@ #endif } else { o->head_reader--; - PMD_DRV_LOG(INFO, sc, - "vlan_mac_lock - decreased readers to %d", - o->head_reader); + ECORE_MSG(sc, "vlan_mac_lock - decreased readers to %d", + o->head_reader); } /* It's possible a new pending execution was added, and that this reader * was last - if so we need to execute the command. */ if (!o->head_reader && o->head_exe_request) { - PMD_DRV_LOG(INFO, sc, - "vlan_mac_lock - reader release encountered a pending request"); + ECORE_MSG(sc, "vlan_mac_lock - reader release encountered a pending request"); /* Writer release will do the trick */ __ecore_vlan_mac_h_write_unlock(sc, o); diff -Nru dpdk-17.11.5/drivers/net/bonding/rte_eth_bond_api.c dpdk-17.11.6/drivers/net/bonding/rte_eth_bond_api.c --- dpdk-17.11.5/drivers/net/bonding/rte_eth_bond_api.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/bonding/rte_eth_bond_api.c 2019-05-21 19:15:57.000000000 +0000 @@ -48,7 +48,10 @@ check_for_bonded_ethdev(const struct rte_eth_dev *eth_dev) { /* Check valid pointer */ - if (eth_dev->device->driver->name == NULL) + if (eth_dev == NULL || + eth_dev->device == NULL || + eth_dev->device->driver == NULL || + eth_dev->device->driver->name == NULL) return -1; /* return 0 if driver name matches */ diff -Nru dpdk-17.11.5/drivers/net/dpaa/dpaa_ethdev.c dpdk-17.11.6/drivers/net/dpaa/dpaa_ethdev.c --- dpdk-17.11.5/drivers/net/dpaa/dpaa_ethdev.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/dpaa/dpaa_ethdev.c 2019-05-21 19:15:57.000000000 +0000 @@ -844,8 +844,12 @@ PMD_INIT_FUNC_TRACE(); /* For secondary processes, the primary has done all the work */ - if (rte_eal_process_type() != RTE_PROC_PRIMARY) + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { + eth_dev->dev_ops = &dpaa_devops; + /* Plugging of UCODE burst API not supported in Secondary */ + eth_dev->rx_pkt_burst = dpaa_eth_queue_rx; return 0; + } dpaa_device = DEV_TO_DPAA_DEVICE(eth_dev->device); dev_id = dpaa_device->id.dev_id; diff -Nru dpdk-17.11.5/drivers/net/dpaa2/dpaa2_ethdev.c dpdk-17.11.6/drivers/net/dpaa2/dpaa2_ethdev.c --- dpdk-17.11.5/drivers/net/dpaa2/dpaa2_ethdev.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/dpaa2/dpaa2_ethdev.c 2019-05-21 19:15:57.000000000 +0000 @@ -1762,8 +1762,15 @@ PMD_INIT_FUNC_TRACE(); /* For secondary processes, the primary has done all the work */ - if (rte_eal_process_type() != RTE_PROC_PRIMARY) + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { + /* In case of secondary, only burst and ops API need to be + * plugged. + */ + eth_dev->dev_ops = &dpaa2_ethdev_ops; + eth_dev->rx_pkt_burst = dpaa2_dev_prefetch_rx; + eth_dev->tx_pkt_burst = dpaa2_dev_tx; return 0; + } dpaa2_dev = container_of(dev, struct rte_dpaa2_device, device); diff -Nru dpdk-17.11.5/drivers/net/e1000/em_rxtx.c dpdk-17.11.6/drivers/net/e1000/em_rxtx.c --- dpdk-17.11.5/drivers/net/e1000/em_rxtx.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/e1000/em_rxtx.c 2019-05-21 19:15:57.000000000 +0000 @@ -79,6 +79,8 @@ #define E1000_RXDCTL_GRAN 0x01000000 /* RXDCTL Granularity */ #define E1000_TX_OFFLOAD_MASK ( \ + PKT_TX_IPV6 | \ + PKT_TX_IPV4 | \ PKT_TX_IP_CKSUM | \ PKT_TX_L4_MASK | \ PKT_TX_VLAN_PKT) diff -Nru dpdk-17.11.5/drivers/net/e1000/igb_ethdev.c dpdk-17.11.6/drivers/net/e1000/igb_ethdev.c --- dpdk-17.11.5/drivers/net/e1000/igb_ethdev.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/e1000/igb_ethdev.c 2019-05-21 19:15:57.000000000 +0000 @@ -100,6 +100,9 @@ #define E1000_VET_VET_EXT 0xFFFF0000 #define E1000_VET_VET_EXT_SHIFT 16 +/* MSI-X other interrupt vector */ +#define IGB_MSIX_OTHER_INTR_VEC 0 + static int eth_igb_configure(struct rte_eth_dev *dev); static int eth_igb_start(struct rte_eth_dev *dev); static void eth_igb_stop(struct rte_eth_dev *dev); @@ -169,7 +172,7 @@ static int eth_igb_led_on(struct rte_eth_dev *dev); static int eth_igb_led_off(struct rte_eth_dev *dev); -static void igb_intr_disable(struct e1000_hw *hw); +static void igb_intr_disable(struct rte_eth_dev *dev); static int igb_get_rx_buffer_size(struct e1000_hw *hw); static int eth_igb_rar_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr, @@ -610,14 +613,31 @@ E1000_DEV_PRIVATE_TO_INTR(dev->data->dev_private); struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); + struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); + struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; + + if (rte_intr_allow_others(intr_handle) && + dev->data->dev_conf.intr_conf.lsc != 0) { + E1000_WRITE_REG(hw, E1000_EIMS, 1 << IGB_MSIX_OTHER_INTR_VEC); + } E1000_WRITE_REG(hw, E1000_IMS, intr->mask); E1000_WRITE_FLUSH(hw); } static void -igb_intr_disable(struct e1000_hw *hw) +igb_intr_disable(struct rte_eth_dev *dev) { + struct e1000_hw *hw = + E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); + struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); + struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; + + if (rte_intr_allow_others(intr_handle) && + dev->data->dev_conf.intr_conf.lsc != 0) { + E1000_WRITE_REG(hw, E1000_EIMC, 1 << IGB_MSIX_OTHER_INTR_VEC); + } + E1000_WRITE_REG(hw, E1000_IMC, ~0); E1000_WRITE_FLUSH(hw); } @@ -1529,7 +1549,7 @@ struct rte_eth_link link; struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; - igb_intr_disable(hw); + igb_intr_disable(dev); /* disable intr eventfd mapping */ rte_intr_disable(intr_handle); @@ -2792,12 +2812,15 @@ uint32_t mask, regval; struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); + struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); + struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; + int misc_shift = rte_intr_allow_others(intr_handle) ? 1 : 0; struct rte_eth_dev_info dev_info; memset(&dev_info, 0, sizeof(dev_info)); eth_igb_infos_get(dev, &dev_info); - mask = 0xFFFFFFFF >> (32 - dev_info.max_rx_queues); + mask = (0xFFFFFFFF >> (32 - dev_info.max_rx_queues)) << misc_shift; regval = E1000_READ_REG(hw, E1000_EIMS); E1000_WRITE_REG(hw, E1000_EIMS, regval | mask); @@ -2824,7 +2847,7 @@ struct e1000_interrupt *intr = E1000_DEV_PRIVATE_TO_INTR(dev->data->dev_private); - igb_intr_disable(hw); + igb_intr_disable(dev); /* read-on-clear nic registers here */ icr = E1000_READ_REG(hw, E1000_ICR); @@ -5535,13 +5558,17 @@ E1000_GPIE_NSICR); intr_mask = RTE_LEN2MASK(intr_handle->nb_efd, uint32_t) << misc_shift; + + if (dev->data->dev_conf.intr_conf.lsc != 0) + intr_mask |= (1 << IGB_MSIX_OTHER_INTR_VEC); + regval = E1000_READ_REG(hw, E1000_EIAC); E1000_WRITE_REG(hw, E1000_EIAC, regval | intr_mask); /* enable msix_other interrupt */ regval = E1000_READ_REG(hw, E1000_EIMS); E1000_WRITE_REG(hw, E1000_EIMS, regval | intr_mask); - tmpval = (dev->data->nb_rx_queues | E1000_IVAR_VALID) << 8; + tmpval = (IGB_MSIX_OTHER_INTR_VEC | E1000_IVAR_VALID) << 8; E1000_WRITE_REG(hw, E1000_IVAR_MISC, tmpval); } @@ -5550,6 +5577,10 @@ */ intr_mask = RTE_LEN2MASK(intr_handle->nb_efd, uint32_t) << misc_shift; + + if (dev->data->dev_conf.intr_conf.lsc != 0) + intr_mask |= (1 << IGB_MSIX_OTHER_INTR_VEC); + regval = E1000_READ_REG(hw, E1000_EIAM); E1000_WRITE_REG(hw, E1000_EIAM, regval | intr_mask); diff -Nru dpdk-17.11.5/drivers/net/ena/ena_ethdev.c dpdk-17.11.6/drivers/net/ena/ena_ethdev.c --- dpdk-17.11.5/drivers/net/ena/ena_ethdev.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/ena/ena_ethdev.c 2019-05-21 19:15:57.000000000 +0000 @@ -172,6 +172,8 @@ #define ENA_TX_OFFLOAD_MASK (\ PKT_TX_L4_MASK | \ + PKT_TX_IPV6 | \ + PKT_TX_IPV4 | \ PKT_TX_IP_CKSUM | \ PKT_TX_TCP_SEG) @@ -1278,19 +1280,20 @@ static int adapters_found; - memset(adapter, 0, sizeof(struct ena_adapter)); - ena_dev = &adapter->ena_dev; - eth_dev->dev_ops = &ena_dev_ops; eth_dev->rx_pkt_burst = ð_ena_recv_pkts; eth_dev->tx_pkt_burst = ð_ena_xmit_pkts; eth_dev->tx_pkt_prepare = ð_ena_prep_pkts; - adapter->rte_eth_dev_data = eth_dev->data; - adapter->rte_dev = eth_dev; if (rte_eal_process_type() != RTE_PROC_PRIMARY) return 0; + memset(adapter, 0, sizeof(struct ena_adapter)); + ena_dev = &adapter->ena_dev; + + adapter->rte_eth_dev_data = eth_dev->data; + adapter->rte_dev = eth_dev; + pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); adapter->pdev = pci_dev; @@ -1493,6 +1496,9 @@ dev_info->rx_offload_capa = rx_feat; dev_info->tx_offload_capa = tx_feat; + dev_info->flow_type_rss_offloads = ETH_RSS_IP | ETH_RSS_TCP | + ETH_RSS_UDP; + dev_info->min_rx_bufsize = ENA_MIN_FRAME_LEN; dev_info->max_rx_pktlen = adapter->max_mtu; dev_info->max_mac_addrs = 1; @@ -1584,8 +1590,10 @@ 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)) + if (ring_size - desc_in_use > ENA_RING_DESCS_RATIO(ring_size)) { + ena_com_update_dev_comp_head(rx_ring->ena_com_io_cq); ena_populate_rx_queue(rx_ring, ring_size - desc_in_use); + } return recv_idx; } @@ -1632,14 +1640,14 @@ if ((ol_flags & ENA_TX_OFFLOAD_NOTSUP_MASK) != 0 || (ol_flags & PKT_TX_L4_MASK) == PKT_TX_SCTP_CKSUM) { - rte_errno = -ENOTSUP; + rte_errno = ENOTSUP; return i; } #ifdef RTE_LIBRTE_ETHDEV_DEBUG ret = rte_validate_tx_offload(m); if (ret != 0) { - rte_errno = ret; + rte_errno = -ret; return i; } #endif @@ -1652,7 +1660,7 @@ ret = rte_net_intel_cksum_flags_prepare(m, ol_flags & ~PKT_TX_TCP_SEG); if (ret != 0) { - rte_errno = ret; + rte_errno = -ret; return i; } } @@ -1787,8 +1795,9 @@ if (total_tx_descs > 0) { /* acknowledge completion of sent packets */ - ena_com_comp_ack(tx_ring->ena_com_io_sq, total_tx_descs); tx_ring->next_to_clean = next_to_clean; + ena_com_comp_ack(tx_ring->ena_com_io_sq, total_tx_descs); + ena_com_update_dev_comp_head(tx_ring->ena_com_io_cq); } return sent_idx; diff -Nru dpdk-17.11.5/drivers/net/enic/enic_clsf.c dpdk-17.11.6/drivers/net/enic/enic_clsf.c --- dpdk-17.11.5/drivers/net/enic/enic_clsf.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/enic/enic_clsf.c 2019-05-21 19:15:57.000000000 +0000 @@ -32,8 +32,6 @@ * */ -#include - #include #include #include diff -Nru dpdk-17.11.5/drivers/net/enic/enic_main.c dpdk-17.11.6/drivers/net/enic/enic_main.c --- dpdk-17.11.5/drivers/net/enic/enic_main.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/enic/enic_main.c 2019-05-21 19:15:57.000000000 +0000 @@ -37,7 +37,6 @@ #include #include #include -#include #include #include diff -Nru dpdk-17.11.5/drivers/net/fm10k/fm10k_ethdev.c dpdk-17.11.6/drivers/net/fm10k/fm10k_ethdev.c --- dpdk-17.11.5/drivers/net/fm10k/fm10k_ethdev.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/fm10k/fm10k_ethdev.c 2019-05-21 19:15:57.000000000 +0000 @@ -2987,6 +2987,7 @@ hw->bus.payload = fm10k_bus_payload_256; info->rx_vec_allowed = true; + info->sm_down = false; } static int diff -Nru dpdk-17.11.5/drivers/net/fm10k/fm10k_rxtx.c dpdk-17.11.6/drivers/net/fm10k/fm10k_rxtx.c --- dpdk-17.11.5/drivers/net/fm10k/fm10k_rxtx.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/fm10k/fm10k_rxtx.c 2019-05-21 19:15:57.000000000 +0000 @@ -68,6 +68,8 @@ #define FM10K_TX_OFFLOAD_MASK ( \ PKT_TX_VLAN_PKT | \ + PKT_TX_IPV6 | \ + PKT_TX_IPV4 | \ PKT_TX_IP_CKSUM | \ PKT_TX_L4_MASK | \ PKT_TX_TCP_SEG) diff -Nru dpdk-17.11.5/drivers/net/i40e/i40e_ethdev.c dpdk-17.11.6/drivers/net/i40e/i40e_ethdev.c --- dpdk-17.11.5/drivers/net/i40e/i40e_ethdev.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/i40e/i40e_ethdev.c 2019-05-21 19:15:57.000000000 +0000 @@ -1167,7 +1167,7 @@ struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct i40e_vsi *vsi; int ret; - uint32_t len; + uint32_t len, val; uint8_t aq_fail = 0; PMD_INIT_FUNC_TRACE(); @@ -1218,6 +1218,15 @@ */ hw->switch_tag = 0xffff; + val = I40E_READ_REG(hw, I40E_GL_FWSTS); + if (val & I40E_GL_FWSTS_FWS1B_MASK) { + PMD_INIT_LOG(ERR, "\nERROR: " + "Firmware recovery mode detected. Limiting functionality.\n" + "Refer to the Intel(R) Ethernet Adapters and Devices " + "User Guide for details on firmware recovery mode."); + return -EIO; + } + /* Check if need to support multi-driver */ i40e_support_multi_driver(dev); @@ -2998,20 +3007,20 @@ struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct i40e_hw_port_stats *ns = &pf->stats; /* new stats */ + struct i40e_vsi *vsi; unsigned i; /* call read registers - updates values, now write them to struct */ i40e_read_stats_registers(pf, hw); - stats->ipackets = ns->eth.rx_unicast + - ns->eth.rx_multicast + - ns->eth.rx_broadcast - - ns->eth.rx_discards - + stats->ipackets = pf->main_vsi->eth_stats.rx_unicast + + pf->main_vsi->eth_stats.rx_multicast + + pf->main_vsi->eth_stats.rx_broadcast - pf->main_vsi->eth_stats.rx_discards; stats->opackets = ns->eth.tx_unicast + ns->eth.tx_multicast + ns->eth.tx_broadcast; - stats->ibytes = ns->eth.rx_bytes; + stats->ibytes = pf->main_vsi->eth_stats.rx_bytes; stats->obytes = ns->eth.tx_bytes; stats->oerrors = ns->eth.tx_errors + pf->main_vsi->eth_stats.tx_errors; @@ -3023,6 +3032,21 @@ ns->rx_length_errors + ns->rx_undersize + ns->rx_oversize + ns->rx_fragments + ns->rx_jabber; + if (pf->vfs) { + for (i = 0; i < pf->vf_num; i++) { + vsi = pf->vfs[i].vsi; + i40e_update_vsi_stats(vsi); + + stats->ipackets += (vsi->eth_stats.rx_unicast + + vsi->eth_stats.rx_multicast + + vsi->eth_stats.rx_broadcast - + vsi->eth_stats.rx_discards); + stats->ibytes += vsi->eth_stats.rx_bytes; + stats->oerrors += vsi->eth_stats.tx_errors; + stats->imissed += vsi->eth_stats.rx_discards; + } + } + PMD_DRV_LOG(DEBUG, "***************** PF stats start *******************"); PMD_DRV_LOG(DEBUG, "rx_bytes: %"PRIu64"", ns->eth.rx_bytes); PMD_DRV_LOG(DEBUG, "rx_unicast: %"PRIu64"", ns->eth.rx_unicast); @@ -3947,7 +3971,8 @@ return -EINVAL; if (pf->flags & I40E_FLAG_RSS_AQ_CAPABLE) { - ret = i40e_aq_get_rss_lut(hw, vsi->vsi_id, TRUE, + ret = i40e_aq_get_rss_lut(hw, vsi->vsi_id, + vsi->type != I40E_VSI_SRIOV, lut, lut_size); if (ret) { PMD_DRV_LOG(ERR, "Failed to get RSS lookup table"); @@ -3978,7 +4003,8 @@ hw = I40E_VSI_TO_HW(vsi); if (pf->flags & I40E_FLAG_RSS_AQ_CAPABLE) { - ret = i40e_aq_set_rss_lut(hw, vsi->vsi_id, TRUE, + ret = i40e_aq_set_rss_lut(hw, vsi->vsi_id, + vsi->type != I40E_VSI_SRIOV, lut, lut_size); if (ret) { PMD_DRV_LOG(ERR, "Failed to set RSS lookup table"); @@ -7017,7 +7043,7 @@ int ret; if (!key || !key_len) - return -EINVAL; + return 0; if (pf->flags & I40E_FLAG_RSS_AQ_CAPABLE) { ret = i40e_aq_get_rss_key(hw, vsi->vsi_id, @@ -7089,9 +7115,15 @@ struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); uint64_t hena; + int ret; - i40e_get_rss_key(pf->main_vsi, rss_conf->rss_key, + if (!rss_conf) + return -EINVAL; + + ret = i40e_get_rss_key(pf->main_vsi, rss_conf->rss_key, &rss_conf->rss_key_len); + if (ret) + return ret; hena = (uint64_t)i40e_read_rx_ctl(hw, I40E_PFQF_HENA(0)); hena |= ((uint64_t)i40e_read_rx_ctl(hw, I40E_PFQF_HENA(1))) << 32; diff -Nru dpdk-17.11.5/drivers/net/i40e/i40e_rxtx.c dpdk-17.11.6/drivers/net/i40e/i40e_rxtx.c --- dpdk-17.11.5/drivers/net/i40e/i40e_rxtx.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/i40e/i40e_rxtx.c 2019-05-21 19:15:57.000000000 +0000 @@ -101,7 +101,7 @@ I40E_TX_IEEE1588_TMST) #define I40E_TX_OFFLOAD_NOTSUP_MASK \ - ~(PKT_TX_OFFLOAD_MASK & I40E_TX_OFFLOAD_MASK) + (PKT_TX_OFFLOAD_MASK ^ I40E_TX_OFFLOAD_MASK) static uint16_t i40e_xmit_pkts_simple(void *tx_queue, struct rte_mbuf **tx_pkts, @@ -2638,7 +2638,6 @@ i40e_dev_rx_queue_release(dev->data->rx_queues[i]); dev->data->rx_queues[i] = NULL; } - dev->data->nb_rx_queues = 0; for (i = 0; i < dev->data->nb_tx_queues; i++) { if (!dev->data->tx_queues[i]) @@ -2646,7 +2645,6 @@ i40e_dev_tx_queue_release(dev->data->tx_queues[i]); dev->data->tx_queues[i] = NULL; } - dev->data->nb_tx_queues = 0; } #define I40E_FDIR_NUM_TX_DESC I40E_MIN_RING_DESC diff -Nru dpdk-17.11.5/drivers/net/i40e/rte_pmd_i40e.c dpdk-17.11.6/drivers/net/i40e/rte_pmd_i40e.c --- dpdk-17.11.5/drivers/net/i40e/rte_pmd_i40e.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/i40e/rte_pmd_i40e.c 2019-05-21 19:15:57.000000000 +0000 @@ -2795,13 +2795,23 @@ struct i40e_dcbx_config *old_cfg = &hw->local_dcbx_config; int32_t ret = -EINVAL; uint16_t i, j, prio_index, region_index; - uint8_t tc_map, tc_bw, bw_lf; + uint8_t tc_map, tc_bw, bw_lf, dcb_flag = 0; if (!info->queue_region_number) { PMD_DRV_LOG(ERR, "No queue region been set before"); return ret; } + for (i = 0; i < info->queue_region_number; i++) { + if (info->region[i].user_priority_num) { + dcb_flag = 1; + break; + } + } + + if (dcb_flag == 0) + return 0; + dcb_cfg = &dcb_cfg_local; memset(dcb_cfg, 0, sizeof(struct i40e_dcbx_config)); diff -Nru dpdk-17.11.5/drivers/net/ixgbe/ixgbe_ethdev.c dpdk-17.11.6/drivers/net/ixgbe/ixgbe_ethdev.c --- dpdk-17.11.5/drivers/net/ixgbe/ixgbe_ethdev.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/ixgbe/ixgbe_ethdev.c 2019-05-21 19:15:57.000000000 +0000 @@ -2758,6 +2758,8 @@ ixgbe_dev_stop(struct rte_eth_dev *dev) { struct rte_eth_link link; + struct ixgbe_adapter *adapter = + (struct ixgbe_adapter *)dev->data->dev_private; struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct ixgbe_vf_info *vfinfo = @@ -2818,6 +2820,8 @@ /* reset hierarchy commit */ tm_conf->committed = false; + + adapter->rss_reta_updated = 0; } /* @@ -4794,6 +4798,8 @@ uint8_t j, mask; uint32_t reta, r; uint16_t idx, shift; + struct ixgbe_adapter *adapter = + (struct ixgbe_adapter *)dev->data->dev_private; struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); uint32_t reta_reg; @@ -4835,6 +4841,7 @@ } IXGBE_WRITE_REG(hw, reta_reg, reta); } + adapter->rss_reta_updated = 1; return 0; } @@ -5139,6 +5146,8 @@ ixgbevf_dev_stop(struct rte_eth_dev *dev) { struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); + struct ixgbe_adapter *adapter = + (struct ixgbe_adapter *)dev->data->dev_private; struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; @@ -5168,6 +5177,8 @@ rte_free(intr_handle->intr_vec); intr_handle->intr_vec = NULL; } + + adapter->rss_reta_updated = 0; } static void diff -Nru dpdk-17.11.5/drivers/net/ixgbe/ixgbe_ethdev.h dpdk-17.11.6/drivers/net/ixgbe/ixgbe_ethdev.h --- dpdk-17.11.5/drivers/net/ixgbe/ixgbe_ethdev.h 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/ixgbe/ixgbe_ethdev.h 2019-05-21 19:15:57.000000000 +0000 @@ -504,6 +504,9 @@ struct rte_timecounter rx_tstamp_tc; struct rte_timecounter tx_tstamp_tc; struct ixgbe_tm_conf tm_conf; + + /* For RSS reta table update */ + uint8_t rss_reta_updated; }; #define IXGBE_DEV_PRIVATE_TO_HW(adapter)\ diff -Nru dpdk-17.11.5/drivers/net/ixgbe/ixgbe_pf.c dpdk-17.11.6/drivers/net/ixgbe/ixgbe_pf.c --- dpdk-17.11.5/drivers/net/ixgbe/ixgbe_pf.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/ixgbe/ixgbe_pf.c 2019-05-21 19:15:57.000000000 +0000 @@ -374,7 +374,7 @@ int rar_entry = hw->mac.num_rar_entries - (vf + 1); uint32_t vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(vf)); - vmolr |= (IXGBE_VMOLR_ROPE | IXGBE_VMOLR_ROMPE | + vmolr |= (IXGBE_VMOLR_ROPE | IXGBE_VMOLR_BAM | IXGBE_VMOLR_AUPE); IXGBE_WRITE_REG(hw, IXGBE_VMOLR(vf), vmolr); @@ -526,6 +526,7 @@ const uint32_t IXGBE_MTA_BIT_MASK = (0x1 << IXGBE_MTA_BIT_SHIFT) - 1; uint32_t reg_val; int i; + u32 vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(vf)); /* Disable multicast promiscuous first */ ixgbe_disable_vf_mc_promisc(dev, vf); @@ -539,6 +540,12 @@ vfinfo->vf_mc_hashes[i] = hash_list[i]; } + if (nb_entries == 0) { + vmolr &= ~IXGBE_VMOLR_ROMPE; + IXGBE_WRITE_REG(hw, IXGBE_VMOLR(vf), vmolr); + return 0; + } + for (i = 0; i < vfinfo->num_vf_mc_hashes; i++) { mta_idx = (vfinfo->vf_mc_hashes[i] >> IXGBE_MTA_BIT_SHIFT) & IXGBE_MTA_INDEX_MASK; @@ -548,6 +555,9 @@ IXGBE_WRITE_REG(hw, IXGBE_MTA(mta_idx), reg_val); } + vmolr |= IXGBE_VMOLR_ROMPE; + IXGBE_WRITE_REG(hw, IXGBE_VMOLR(vf), vmolr); + return 0; } diff -Nru dpdk-17.11.5/drivers/net/ixgbe/ixgbe_rxtx.c dpdk-17.11.6/drivers/net/ixgbe/ixgbe_rxtx.c --- dpdk-17.11.5/drivers/net/ixgbe/ixgbe_rxtx.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/ixgbe/ixgbe_rxtx.c 2019-05-21 19:15:57.000000000 +0000 @@ -3325,6 +3325,7 @@ ixgbe_rss_configure(struct rte_eth_dev *dev) { struct rte_eth_rss_conf rss_conf; + struct ixgbe_adapter *adapter; struct ixgbe_hw *hw; uint32_t reta; uint16_t i; @@ -3333,6 +3334,7 @@ uint32_t reta_reg; PMD_INIT_FUNC_TRACE(); + adapter = (struct ixgbe_adapter *)dev->data->dev_private; hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); sp_reta_size = ixgbe_reta_size_get(hw->mac.type); @@ -3342,16 +3344,18 @@ * The byte-swap is needed because NIC registers are in * little-endian order. */ - reta = 0; - for (i = 0, j = 0; i < sp_reta_size; i++, j++) { - reta_reg = ixgbe_reta_reg_get(hw->mac.type, i); + if (adapter->rss_reta_updated == 0) { + reta = 0; + for (i = 0, j = 0; i < sp_reta_size; i++, j++) { + reta_reg = ixgbe_reta_reg_get(hw->mac.type, i); - if (j == dev->data->nb_rx_queues) - j = 0; - reta = (reta << 8) | j; - if ((i & 3) == 3) - IXGBE_WRITE_REG(hw, reta_reg, - rte_bswap32(reta)); + if (j == dev->data->nb_rx_queues) + j = 0; + reta = (reta << 8) | j; + if ((i & 3) == 3) + IXGBE_WRITE_REG(hw, reta_reg, + rte_bswap32(reta)); + } } /* diff -Nru dpdk-17.11.5/drivers/net/mlx5/mlx5_flow.c dpdk-17.11.6/drivers/net/mlx5/mlx5_flow.c --- dpdk-17.11.5/drivers/net/mlx5/mlx5_flow.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/mlx5/mlx5_flow.c 2019-05-21 19:15:57.000000000 +0000 @@ -2490,7 +2490,7 @@ } local; } action_rss; - if (!priv->reta_idx_n) { + if (!priv->reta_idx_n || !priv->rxqs_n) { rte_errno = EINVAL; return -rte_errno; } diff -Nru dpdk-17.11.5/drivers/net/qede/qede_rxtx.c dpdk-17.11.6/drivers/net/qede/qede_rxtx.c --- dpdk-17.11.5/drivers/net/qede/qede_rxtx.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/qede/qede_rxtx.c 2019-05-21 19:15:57.000000000 +0000 @@ -37,6 +37,52 @@ return 0; } +#define QEDE_MAX_BULK_ALLOC_COUNT 512 + +static inline int qede_alloc_rx_bulk_mbufs(struct qede_rx_queue *rxq, int count) +{ + void *obj_p[QEDE_MAX_BULK_ALLOC_COUNT] __rte_cache_aligned; + struct rte_mbuf *mbuf = NULL; + struct eth_rx_bd *rx_bd; + dma_addr_t mapping; + int i, ret = 0; + uint16_t idx; + + idx = rxq->sw_rx_prod & NUM_RX_BDS(rxq); + + if (count > QEDE_MAX_BULK_ALLOC_COUNT) + count = QEDE_MAX_BULK_ALLOC_COUNT; + + ret = rte_mempool_get_bulk(rxq->mb_pool, obj_p, count); + if (unlikely(ret)) { + PMD_RX_LOG(ERR, rxq, + "Failed to allocate %d rx buffers " + "sw_rx_prod %u sw_rx_cons %u mp entries %u free %u", + count, idx, rxq->sw_rx_cons & NUM_RX_BDS(rxq), + rte_mempool_avail_count(rxq->mb_pool), + rte_mempool_in_use_count(rxq->mb_pool)); + return -ENOMEM; + } + + for (i = 0; i < count; i++) { + mbuf = obj_p[i]; + if (likely(i < count - 1)) + rte_prefetch0(obj_p[i + 1]); + + idx = rxq->sw_rx_prod & NUM_RX_BDS(rxq); + rxq->sw_rx_ring[idx].mbuf = mbuf; + rxq->sw_rx_ring[idx].page_offset = 0; + mapping = rte_mbuf_data_iova_default(mbuf); + rx_bd = (struct eth_rx_bd *) + ecore_chain_produce(&rxq->rx_bd_ring); + rx_bd->addr.hi = rte_cpu_to_le_32(U64_HI(mapping)); + rx_bd->addr.lo = rte_cpu_to_le_32(U64_LO(mapping)); + rxq->sw_rx_prod++; + } + + return 0; +} + /* Criterias for calculating Rx buffer size - * 1) rx_buf_size should not exceed the size of mbuf * 2) In scattered_rx mode - minimum rx_buf_size should be @@ -1134,7 +1180,7 @@ struct qede_rx_queue *rxq, struct qede_rx_entry *curr_cons) { struct eth_rx_bd *rx_bd_prod = ecore_chain_produce(&rxq->rx_bd_ring); - uint16_t idx = rxq->sw_rx_cons & NUM_RX_BDS(rxq); + uint16_t idx = rxq->sw_rx_prod & NUM_RX_BDS(rxq); struct qede_rx_entry *curr_prod; dma_addr_t new_mapping; @@ -1367,7 +1413,6 @@ uint8_t bitfield_val; #endif uint8_t tunn_parse_flag; - uint8_t j; struct eth_fast_path_rx_tpa_start_cqe *cqe_start_tpa; uint64_t ol_flags; uint32_t packet_type; @@ -1376,6 +1421,27 @@ uint8_t offset, tpa_agg_idx, flags; struct qede_agg_info *tpa_info = NULL; uint32_t rss_hash; + int rx_alloc_count = 0; + + + /* Allocate buffers that we used in previous loop */ + if (rxq->rx_alloc_count) { + if (unlikely(qede_alloc_rx_bulk_mbufs(rxq, + rxq->rx_alloc_count))) { + struct rte_eth_dev *dev; + + PMD_RX_LOG(ERR, rxq, + "New buffer allocation failed," + "dropping incoming packetn"); + dev = &rte_eth_devices[rxq->port_id]; + dev->data->rx_mbuf_alloc_failed += + rxq->rx_alloc_count; + rxq->rx_alloc_errors += rxq->rx_alloc_count; + return 0; + } + qede_update_rx_prod(qdev, rxq); + rxq->rx_alloc_count = 0; + } hw_comp_cons = rte_le_to_cpu_16(*rxq->hw_cons_ptr); sw_comp_cons = ecore_chain_get_cons_idx(&rxq->rx_comp_ring); @@ -1556,16 +1622,7 @@ rx_mb->hash.rss = rss_hash; } - if (unlikely(qede_alloc_rx_buffer(rxq) != 0)) { - PMD_RX_LOG(ERR, rxq, - "New buffer allocation failed," - "dropping incoming packet\n"); - qede_recycle_rx_bd_ring(rxq, qdev, fp_cqe->bd_num); - rte_eth_devices[rxq->port_id]. - data->rx_mbuf_alloc_failed++; - rxq->rx_alloc_errors++; - break; - } + rx_alloc_count++; qede_rx_bd_ring_consume(rxq); if (!tpa_start_flg && fp_cqe->bd_num > 1) { @@ -1577,17 +1634,9 @@ if (qede_process_sg_pkts(p_rxq, seg1, num_segs, pkt_len - len)) goto next_cqe; - for (j = 0; j < num_segs; j++) { - if (qede_alloc_rx_buffer(rxq)) { - PMD_RX_LOG(ERR, rxq, - "Buffer allocation failed"); - rte_eth_devices[rxq->port_id]. - data->rx_mbuf_alloc_failed++; - rxq->rx_alloc_errors++; - break; - } - rxq->rx_segs++; - } + + rx_alloc_count += num_segs; + rxq->rx_segs += num_segs; } rxq->rx_segs++; /* for the first segment */ @@ -1629,7 +1678,8 @@ } } - qede_update_rx_prod(qdev, rxq); + /* Request number of bufferes to be allocated in next loop */ + rxq->rx_alloc_count = rx_alloc_count; rxq->rcv_pkts += rx_pkt; @@ -2133,7 +2183,6 @@ txq->nb_tx_avail -= bd1->data.nbds; txq->sw_tx_prod++; - rte_prefetch0(txq->sw_tx_ring[TX_PROD(txq)].mbuf); bd_prod = rte_cpu_to_le_16(ecore_chain_get_prod_idx(&txq->tx_pbl)); #ifdef RTE_LIBRTE_QEDE_DEBUG_TX diff -Nru dpdk-17.11.5/drivers/net/qede/qede_rxtx.h dpdk-17.11.6/drivers/net/qede/qede_rxtx.h --- dpdk-17.11.5/drivers/net/qede/qede_rxtx.h 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/qede/qede_rxtx.h 2019-05-21 19:15:57.000000000 +0000 @@ -196,6 +196,8 @@ uint16_t queue_id; uint16_t port_id; uint16_t rx_buf_size; + uint16_t rx_alloc_count; + uint16_t unused; uint64_t rcv_pkts; uint64_t rx_segs; uint64_t rx_hw_errors; diff -Nru dpdk-17.11.5/drivers/net/sfc/base/efx_tx.c dpdk-17.11.6/drivers/net/sfc/base/efx_tx.c --- dpdk-17.11.5/drivers/net/sfc/base/efx_tx.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/sfc/base/efx_tx.c 2019-05-21 19:15:57.000000000 +0000 @@ -910,7 +910,8 @@ EFSYS_ASSERT(ISP2(encp->enc_txq_max_ndescs)); EFX_STATIC_ASSERT(ISP2(EFX_TXQ_MINNDESCS)); - if (!ISP2(n) || (n < EFX_TXQ_MINNDESCS) || (n > EFX_EVQ_MAXNEVS)) { + if (!ISP2(n) || + (n < EFX_TXQ_MINNDESCS) || (n > encp->enc_txq_max_ndescs)) { rc = EINVAL; goto fail1; } diff -Nru dpdk-17.11.5/drivers/net/sfc/efsys.h dpdk-17.11.6/drivers/net/sfc/efsys.h --- dpdk-17.11.5/drivers/net/sfc/efsys.h 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/sfc/efsys.h 2019-05-21 19:15:57.000000000 +0000 @@ -109,7 +109,7 @@ #define P2ALIGN(_x, _a) ((_x) & -(_a)) #endif -#ifndef IS2P +#ifndef ISP2 #define ISP2(x) rte_is_power_of_2(x) #endif diff -Nru dpdk-17.11.5/drivers/net/sfc/sfc_ethdev.c dpdk-17.11.6/drivers/net/sfc/sfc_ethdev.c --- dpdk-17.11.5/drivers/net/sfc/sfc_ethdev.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/sfc/sfc_ethdev.c 2019-05-21 19:15:57.000000000 +0000 @@ -518,6 +518,29 @@ sfc_adapter_unlock(sa); } +/* + * Some statistics are computed as A - B where A and B each increase + * monotonically with some hardware counter(s) and the counters are read + * asynchronously. + * + * If packet X is counted in A, but not counted in B yet, computed value is + * greater than real. + * + * If packet X is not counted in A at the moment of reading the counter, + * but counted in B at the moment of reading the counter, computed value + * is less than real. + * + * However, counter which grows backward is worse evil than slightly wrong + * value. So, let's try to guarantee that it never happens except may be + * the case when the MAC stats are zeroed as a result of a NIC reset. + */ +static void +sfc_update_diff_stat(uint64_t *stat, uint64_t newval) +{ + if ((int64_t)(newval - *stat) > 0 || newval == 0) + *stat = newval; +} + static int sfc_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) { @@ -552,11 +575,9 @@ mac_stats[EFX_MAC_VADAPTER_TX_UNICAST_BYTES] + mac_stats[EFX_MAC_VADAPTER_TX_MULTICAST_BYTES] + mac_stats[EFX_MAC_VADAPTER_TX_BROADCAST_BYTES]; - stats->imissed = mac_stats[EFX_MAC_VADAPTER_RX_OVERFLOW]; - stats->ierrors = mac_stats[EFX_MAC_VADAPTER_RX_BAD_PACKETS]; + stats->imissed = mac_stats[EFX_MAC_VADAPTER_RX_BAD_PACKETS]; stats->oerrors = mac_stats[EFX_MAC_VADAPTER_TX_BAD_PACKETS]; } else { - stats->ipackets = mac_stats[EFX_MAC_RX_PKTS]; stats->opackets = mac_stats[EFX_MAC_TX_PKTS]; stats->ibytes = mac_stats[EFX_MAC_RX_OCTETS]; stats->obytes = mac_stats[EFX_MAC_TX_OCTETS]; @@ -582,6 +603,13 @@ mac_stats[EFX_MAC_RX_ALIGN_ERRORS] + mac_stats[EFX_MAC_RX_JABBER_PKTS]; /* no oerrors counters supported on EF10 */ + + /* Exclude missed, errors and pauses from Rx packets */ + sfc_update_diff_stat(&port->ipackets, + mac_stats[EFX_MAC_RX_PKTS] - + mac_stats[EFX_MAC_RX_PAUSE_PKTS] - + stats->imissed - stats->ierrors); + stats->ipackets = port->ipackets; } unlock: @@ -1713,13 +1741,13 @@ dp_rx = sfc_dp_find_rx_by_name(&sfc_dp_head, sa->dp_rx_name); if (dp_rx == NULL) { - sfc_err(sa, "cannot find %s Rx datapath", sa->dp_tx_name); + sfc_err(sa, "cannot find %s Rx datapath", sa->dp_rx_name); rc = ENOENT; goto fail_dp_rx; } if (~dp_rx->features & SFC_DP_RX_FEAT_MULTI_PROCESS) { sfc_err(sa, "%s Rx datapath does not support multi-process", - sa->dp_tx_name); + sa->dp_rx_name); rc = EINVAL; goto fail_dp_rx_multi_process; } diff -Nru dpdk-17.11.5/drivers/net/sfc/sfc.h dpdk-17.11.6/drivers/net/sfc/sfc.h --- dpdk-17.11.5/drivers/net/sfc/sfc.h 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/sfc/sfc.h 2019-05-21 19:15:57.000000000 +0000 @@ -175,6 +175,8 @@ uint64_t mac_stats_last_request_timestamp; uint32_t mac_stats_mask[EFX_MAC_STATS_MASK_NPAGES]; + + uint64_t ipackets; }; /* Adapter private data */ @@ -264,7 +266,7 @@ /* * Shared memory copy of the Tx datapath name to be used by - * the secondary process to find Rx datapath to be used. + * the secondary process to find Tx datapath to be used. */ char *dp_tx_name; const struct sfc_dp_tx *dp_tx; diff -Nru dpdk-17.11.5/drivers/net/sfc/sfc_log.h dpdk-17.11.6/drivers/net/sfc/sfc_log.h --- dpdk-17.11.5/drivers/net/sfc/sfc_log.h 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/sfc/sfc_log.h 2019-05-21 19:15:57.000000000 +0000 @@ -38,7 +38,8 @@ const struct sfc_adapter *__sa = (sa); \ \ RTE_LOG(level, PMD, \ - RTE_FMT("sfc_efx " PCI_PRI_FMT " #%" PRIu8 ": " \ + RTE_FMT("PMD: sfc_efx " \ + PCI_PRI_FMT " #%" PRIu16 \ RTE_FMT_HEAD(__VA_ARGS__,) "\n", \ __sa->pci_addr.domain, \ __sa->pci_addr.bus, \ diff -Nru dpdk-17.11.5/drivers/net/sfc/sfc_port.c dpdk-17.11.6/drivers/net/sfc/sfc_port.c --- dpdk-17.11.5/drivers/net/sfc/sfc_port.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/sfc/sfc_port.c 2019-05-21 19:15:57.000000000 +0000 @@ -109,6 +109,18 @@ return 0; } +static void +sfc_port_reset_sw_stats(struct sfc_adapter *sa) +{ + struct sfc_port *port = &sa->port; + + /* + * Reset diff stats explicitly since check which does not allow + * the statistics to grow backward could deny it. + */ + port->ipackets = 0; +} + int sfc_port_reset_mac_stats(struct sfc_adapter *sa) { @@ -117,6 +129,8 @@ rte_spinlock_lock(&port->mac_stats_lock); rc = efx_mac_stats_clear(sa->nic); + if (rc == 0) + sfc_port_reset_sw_stats(sa); rte_spinlock_unlock(&port->mac_stats_lock); return rc; diff -Nru dpdk-17.11.5/drivers/net/sfc/sfc_tx.c dpdk-17.11.6/drivers/net/sfc/sfc_tx.c --- dpdk-17.11.5/drivers/net/sfc/sfc_tx.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/sfc/sfc_tx.c 2019-05-21 19:15:57.000000000 +0000 @@ -449,7 +449,7 @@ flags |= EFX_TXQ_FATSOV2; } - rc = efx_tx_qcreate(sa->nic, sw_index, 0, &txq->mem, + rc = efx_tx_qcreate(sa->nic, txq->hw_index, 0, &txq->mem, txq_info->entries, 0 /* not used on EF10 */, flags, evq->common, &txq->common, &desc_index); @@ -709,6 +709,7 @@ for (pkts_sent = 0, pktp = &tx_pkts[0]; (pkts_sent < nb_pkts) && (fill_level <= soft_max_fill); pkts_sent++, pktp++) { + uint16_t hw_vlan_tci_prev = txq->hw_vlan_tci; struct rte_mbuf *m_seg = *pktp; size_t pkt_len = m_seg->pkt_len; unsigned int pkt_descs = 0; @@ -747,6 +748,7 @@ * mbuf shouldn't be orphaned */ pend -= pkt_descs; + txq->hw_vlan_tci = hw_vlan_tci_prev; rte_pktmbuf_free(*pktp); @@ -816,10 +818,12 @@ fill_level = added - txq->completed; if (fill_level > hard_max_fill) { pend -= pkt_descs; + txq->hw_vlan_tci = hw_vlan_tci_prev; break; } } else { pend -= pkt_descs; + txq->hw_vlan_tci = hw_vlan_tci_prev; break; } } diff -Nru dpdk-17.11.5/drivers/net/tap/rte_eth_tap.c dpdk-17.11.6/drivers/net/tap/rte_eth_tap.c --- dpdk-17.11.5/drivers/net/tap/rte_eth_tap.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/tap/rte_eth_tap.c 2019-05-21 19:15:57.000000000 +0000 @@ -255,13 +255,27 @@ l3_len = 4 * (iph->version_ihl & 0xf); if (unlikely(l2_len + l3_len > rte_pktmbuf_data_len(mbuf))) return; + /* check that the total length reported by header is not + * greater than the total received size + */ + if (l2_len + rte_be_to_cpu_16(iph->total_length) > + rte_pktmbuf_data_len(mbuf)) + return; cksum = ~rte_raw_cksum(iph, l3_len); mbuf->ol_flags |= cksum ? PKT_RX_IP_CKSUM_BAD : PKT_RX_IP_CKSUM_GOOD; } else if (l3 == RTE_PTYPE_L3_IPV6) { + struct ipv6_hdr *iph = l3_hdr; + l3_len = sizeof(struct ipv6_hdr); + /* check that the total length reported by header is not + * greater than the total received size + */ + if (l2_len + l3_len + rte_be_to_cpu_16(iph->payload_len) > + rte_pktmbuf_data_len(mbuf)) + return; } else { /* IPv6 extensions are not supported */ return; diff -Nru dpdk-17.11.5/drivers/net/tap/tap_tcmsgs.c dpdk-17.11.6/drivers/net/tap/tap_tcmsgs.c --- dpdk-17.11.5/drivers/net/tap/tap_tcmsgs.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/tap/tap_tcmsgs.c 2019-05-21 19:15:57.000000000 +0000 @@ -143,7 +143,7 @@ int qdisc_add_multiq(int nlsk_fd, uint16_t ifindex) { - struct tc_multiq_qopt opt; + struct tc_multiq_qopt opt = {0}; struct nlmsg msg; tc_init_msg(&msg, ifindex, RTM_NEWQDISC, diff -Nru dpdk-17.11.5/drivers/net/virtio/virtio_rxtx.c dpdk-17.11.6/drivers/net/virtio/virtio_rxtx.c --- dpdk-17.11.5/drivers/net/virtio/virtio_rxtx.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/virtio/virtio_rxtx.c 2019-05-21 19:15:57.000000000 +0000 @@ -59,6 +59,7 @@ #include "virtio_pci.h" #include "virtqueue.h" #include "virtio_rxtx.h" +#include "virtio_rxtx_simple.h" #ifdef RTE_LIBRTE_VIRTIO_DEBUG_DUMP #define VIRTIO_DUMP_PACKET(m, len) rte_pktmbuf_dump(stdout, m, len) @@ -465,6 +466,8 @@ vq->vq_ring.desc[desc_idx].flags = VRING_DESC_F_WRITE; } + + virtio_rxq_vec_setup(rxvq); } memset(&rxvq->fake_mbuf, 0, sizeof(rxvq->fake_mbuf)); @@ -474,30 +477,31 @@ &rxvq->fake_mbuf; } - while (!virtqueue_full(vq)) { - m = rte_mbuf_raw_alloc(rxvq->mpool); - if (m == NULL) - break; + if (hw->use_simple_rx) { + while (vq->vq_free_cnt >= RTE_VIRTIO_VPMD_RX_REARM_THRESH) { + virtio_rxq_rearm_vec(rxvq); + nbufs += RTE_VIRTIO_VPMD_RX_REARM_THRESH; + } + } else { + while (!virtqueue_full(vq)) { + m = rte_mbuf_raw_alloc(rxvq->mpool); + if (m == NULL) + break; - /* Enqueue allocated buffers */ - if (hw->use_simple_rx) - error = virtqueue_enqueue_recv_refill_simple(vq, m); - else + /* Enqueue allocated buffers */ error = virtqueue_enqueue_recv_refill(vq, m); - - if (error) { - rte_pktmbuf_free(m); - break; + if (error) { + rte_pktmbuf_free(m); + break; + } + nbufs++; } - nbufs++; - } - vq_update_avail_idx(vq); + vq_update_avail_idx(vq); + } PMD_INIT_LOG(DEBUG, "Allocated %d bufs", nbufs); - virtio_rxq_vec_setup(rxvq); - VIRTQUEUE_DUMP(vq); return 0; diff -Nru dpdk-17.11.5/drivers/net/virtio/virtio_rxtx.h dpdk-17.11.6/drivers/net/virtio/virtio_rxtx.h --- dpdk-17.11.5/drivers/net/virtio/virtio_rxtx.h 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/virtio/virtio_rxtx.h 2019-05-21 19:15:57.000000000 +0000 @@ -88,7 +88,4 @@ int virtio_rxq_vec_setup(struct virtnet_rx *rxvq); -int virtqueue_enqueue_recv_refill_simple(struct virtqueue *vq, - struct rte_mbuf *m); - #endif /* _VIRTIO_RXTX_H_ */ diff -Nru dpdk-17.11.5/drivers/net/virtio/virtio_rxtx_simple.c dpdk-17.11.6/drivers/net/virtio/virtio_rxtx_simple.c --- dpdk-17.11.5/drivers/net/virtio/virtio_rxtx_simple.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/virtio/virtio_rxtx_simple.c 2019-05-21 19:15:57.000000000 +0000 @@ -56,34 +56,6 @@ #pragma GCC diagnostic ignored "-Wcast-qual" #endif -int __attribute__((cold)) -virtqueue_enqueue_recv_refill_simple(struct virtqueue *vq, - struct rte_mbuf *cookie) -{ - struct vq_desc_extra *dxp; - struct vring_desc *start_dp; - uint16_t desc_idx; - - cookie->port = vq->rxq.port_id; - - desc_idx = vq->vq_avail_idx & (vq->vq_nentries - 1); - dxp = &vq->vq_descx[desc_idx]; - dxp->cookie = (void *)cookie; - vq->sw_ring[desc_idx] = cookie; - - start_dp = vq->vq_ring.desc; - start_dp[desc_idx].addr = - VIRTIO_MBUF_ADDR(cookie, vq) + - RTE_PKTMBUF_HEADROOM - vq->hw->vtnet_hdr_size; - start_dp[desc_idx].len = cookie->buf_len - - RTE_PKTMBUF_HEADROOM + vq->hw->vtnet_hdr_size; - - vq->vq_free_cnt--; - vq->vq_avail_idx++; - - return 0; -} - uint16_t virtio_xmit_pkts_simple(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) @@ -106,7 +78,7 @@ rte_compiler_barrier(); if (nb_used >= VIRTIO_TX_FREE_THRESH) - virtio_xmit_cleanup(vq); + virtio_xmit_cleanup_simple(vq); nb_commit = nb_pkts = RTE_MIN((vq->vq_free_cnt >> 1), nb_pkts); desc_idx = (uint16_t)(vq->vq_avail_idx & desc_idx_max); diff -Nru dpdk-17.11.5/drivers/net/virtio/virtio_rxtx_simple.h dpdk-17.11.6/drivers/net/virtio/virtio_rxtx_simple.h --- dpdk-17.11.5/drivers/net/virtio/virtio_rxtx_simple.h 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/virtio/virtio_rxtx_simple.h 2019-05-21 19:15:57.000000000 +0000 @@ -89,7 +89,7 @@ #define VIRTIO_TX_FREE_NR 32 /* TODO: vq->tx_free_cnt could mean num of free slots so we could avoid shift */ static inline void -virtio_xmit_cleanup(struct virtqueue *vq) +virtio_xmit_cleanup_simple(struct virtqueue *vq) { uint16_t i, desc_idx; uint32_t nb_free = 0; diff -Nru dpdk-17.11.5/drivers/net/virtio/virtio_user/virtio_user_dev.c dpdk-17.11.6/drivers/net/virtio/virtio_user/virtio_user_dev.c --- dpdk-17.11.5/drivers/net/virtio/virtio_user/virtio_user_dev.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/virtio/virtio_user/virtio_user_dev.c 2019-05-21 19:15:57.000000000 +0000 @@ -509,7 +509,7 @@ /* Update used ring */ uep = &vring->used->ring[avail_idx]; - uep->id = avail_idx; + uep->id = desc_idx; uep->len = n_descs; vring->used->idx++; diff -Nru dpdk-17.11.5/drivers/net/virtio/virtqueue.h dpdk-17.11.6/drivers/net/virtio/virtqueue.h --- dpdk-17.11.5/drivers/net/virtio/virtqueue.h 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/virtio/virtqueue.h 2019-05-21 19:15:57.000000000 +0000 @@ -354,6 +354,11 @@ static inline int virtqueue_kick_prepare(struct virtqueue *vq) { + /* + * Ensure updated avail->idx is visible to vhost before reading + * the used->flags. + */ + virtio_mb(); return !(vq->vq_ring.used->flags & VRING_USED_F_NO_NOTIFY); } diff -Nru dpdk-17.11.5/drivers/net/vmxnet3/vmxnet3_rxtx.c dpdk-17.11.6/drivers/net/vmxnet3/vmxnet3_rxtx.c --- dpdk-17.11.5/drivers/net/vmxnet3/vmxnet3_rxtx.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/drivers/net/vmxnet3/vmxnet3_rxtx.c 2019-05-21 19:15:57.000000000 +0000 @@ -79,6 +79,8 @@ #define VMXNET3_TX_OFFLOAD_MASK ( \ PKT_TX_VLAN_PKT | \ + PKT_TX_IPV6 | \ + PKT_TX_IPV4 | \ PKT_TX_L4_MASK | \ PKT_TX_TCP_SEG) diff -Nru dpdk-17.11.5/examples/bond/main.c dpdk-17.11.6/examples/bond/main.c --- dpdk-17.11.5/examples/bond/main.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/examples/bond/main.c 2019-05-21 19:15:57.000000000 +0000 @@ -225,6 +225,7 @@ uint8_t i; uint16_t nb_rxd = RTE_RX_DESC_DEFAULT; uint16_t nb_txd = RTE_TX_DESC_DEFAULT; + uint16_t wait_counter = 20; retval = rte_eth_bond_create("net_bonding0", BONDING_MODE_ALB, 0 /*SOCKET_ID_ANY*/); @@ -271,6 +272,21 @@ if (retval < 0) rte_exit(retval, "Start port %d failed (res=%d)", BOND_PORT, retval); + printf("Waiting for slaves to become active..."); + while (wait_counter) { + uint16_t act_slaves[16] = {0}; + if (rte_eth_bond_active_slaves_get(BOND_PORT, act_slaves, 16) == + slaves_count) { + printf("\n"); + break; + } + sleep(1); + printf("..."); + if (--wait_counter == 0) + rte_exit(-1, "\nFailed to activate slaves\n"); + } + + rte_eth_promiscuous_enable(BOND_PORT); struct ether_addr addr; diff -Nru dpdk-17.11.5/examples/flow_filtering/flow_blocks.c dpdk-17.11.6/examples/flow_filtering/flow_blocks.c --- dpdk-17.11.5/examples/flow_filtering/flow_blocks.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/examples/flow_filtering/flow_blocks.c 2019-05-21 19:15:57.000000000 +0000 @@ -30,7 +30,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define MAX_PATTERN_NUM 4 +#define MAX_PATTERN_NUM 3 +#define MAX_ACTION_NUM 2 struct rte_flow * generate_ipv4_flow(uint8_t port_id, uint16_t rx_q, @@ -69,11 +70,9 @@ { struct rte_flow_attr attr; struct rte_flow_item pattern[MAX_PATTERN_NUM]; - struct rte_flow_action action[MAX_PATTERN_NUM]; + struct rte_flow_action action[MAX_ACTION_NUM]; struct rte_flow *flow = NULL; struct rte_flow_action_queue queue = { .index = rx_q }; - struct rte_flow_item_eth eth_spec; - struct rte_flow_item_eth eth_mask; struct rte_flow_item_ipv4 ip_spec; struct rte_flow_item_ipv4 ip_mask; int res; @@ -92,26 +91,19 @@ * create the action sequence. * one action only, move packet to queue */ - action[0].type = RTE_FLOW_ACTION_TYPE_QUEUE; action[0].conf = &queue; action[1].type = RTE_FLOW_ACTION_TYPE_END; /* - * set the first level of the pattern (eth). + * set the first level of the pattern (ETH). * since in this example we just want to get the * ipv4 we set this level to allow all. */ - memset(ð_spec, 0, sizeof(struct rte_flow_item_eth)); - memset(ð_mask, 0, sizeof(struct rte_flow_item_eth)); - eth_spec.type = 0; - eth_mask.type = 0; pattern[0].type = RTE_FLOW_ITEM_TYPE_ETH; - pattern[0].spec = ð_spec; - pattern[0].mask = ð_mask; /* - * setting the third level of the pattern (ip). + * setting the second level of the pattern (IP). * in this example this is the level we care about * so we set it according to the parameters. */ diff -Nru dpdk-17.11.5/examples/ipsec-secgw/ipsec-secgw.c dpdk-17.11.6/examples/ipsec-secgw/ipsec-secgw.c --- dpdk-17.11.5/examples/ipsec-secgw/ipsec-secgw.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/examples/ipsec-secgw/ipsec-secgw.c 2019-05-21 19:15:57.000000000 +0000 @@ -561,32 +561,45 @@ struct ipsec_traffic *traffic) { struct rte_mbuf *m; - uint32_t nb_pkts_out, i; + uint32_t nb_pkts_out, i, n; struct ip *ip; /* Drop any IPsec traffic from protected ports */ for (i = 0; i < traffic->ipsec.num; i++) rte_pktmbuf_free(traffic->ipsec.pkts[i]); - traffic->ipsec.num = 0; + n = 0; - for (i = 0; i < traffic->ip4.num; i++) - traffic->ip4.res[i] = single_sa_idx; + for (i = 0; i < traffic->ip4.num; i++) { + traffic->ipsec.pkts[n] = traffic->ip4.pkts[i]; + traffic->ipsec.res[n++] = single_sa_idx; + } + + for (i = 0; i < traffic->ip6.num; i++) { + traffic->ipsec.pkts[n] = traffic->ip6.pkts[i]; + traffic->ipsec.res[n++] = single_sa_idx; + } + + traffic->ip4.num = 0; + traffic->ip6.num = 0; + traffic->ipsec.num = n; - for (i = 0; i < traffic->ip6.num; i++) - traffic->ip6.res[i] = single_sa_idx; - - nb_pkts_out = ipsec_outbound(ipsec_ctx, traffic->ip4.pkts, - traffic->ip4.res, traffic->ip4.num, + nb_pkts_out = ipsec_outbound(ipsec_ctx, traffic->ipsec.pkts, + traffic->ipsec.res, traffic->ipsec.num, MAX_PKT_BURST); /* They all sue the same SA (ip4 or ip6 tunnel) */ m = traffic->ipsec.pkts[i]; ip = rte_pktmbuf_mtod(m, struct ip *); - if (ip->ip_v == IPVERSION) + if (ip->ip_v == IPVERSION) { traffic->ip4.num = nb_pkts_out; - else + for (i = 0; i < nb_pkts_out; i++) + traffic->ip4.pkts[i] = traffic->ipsec.pkts[i]; + } else { traffic->ip6.num = nb_pkts_out; + for (i = 0; i < nb_pkts_out; i++) + traffic->ip6.pkts[i] = traffic->ipsec.pkts[i]; + } } static inline int32_t diff -Nru dpdk-17.11.5/examples/ipsec-secgw/sp4.c dpdk-17.11.6/examples/ipsec-secgw/sp4.c --- dpdk-17.11.5/examples/ipsec-secgw/sp4.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/examples/ipsec-secgw/sp4.c 2019-05-21 19:15:57.000000000 +0000 @@ -73,7 +73,7 @@ RTE_ACL_IPV4_NUM }; -struct rte_acl_field_def ip4_defs[NUM_FIELDS_IPV4] = { +static struct rte_acl_field_def ip4_defs[NUM_FIELDS_IPV4] = { { .type = RTE_ACL_FIELD_TYPE_BITMASK, .size = sizeof(uint8_t), @@ -114,11 +114,11 @@ RTE_ACL_RULE_DEF(acl4_rules, RTE_DIM(ip4_defs)); -struct acl4_rules acl4_rules_out[MAX_ACL_RULE_NUM]; -uint32_t nb_acl4_rules_out; +static struct acl4_rules acl4_rules_out[MAX_ACL_RULE_NUM]; +static uint32_t nb_acl4_rules_out; -struct acl4_rules acl4_rules_in[MAX_ACL_RULE_NUM]; -uint32_t nb_acl4_rules_in; +static struct acl4_rules acl4_rules_in[MAX_ACL_RULE_NUM]; +static uint32_t nb_acl4_rules_in; void parse_sp4_tokens(char **tokens, uint32_t n_tokens, diff -Nru dpdk-17.11.5/examples/ipsec-secgw/sp6.c dpdk-17.11.6/examples/ipsec-secgw/sp6.c --- dpdk-17.11.5/examples/ipsec-secgw/sp6.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/examples/ipsec-secgw/sp6.c 2019-05-21 19:15:57.000000000 +0000 @@ -63,7 +63,7 @@ #define IP6_ADDR_SIZE 16 -struct rte_acl_field_def ip6_defs[IP6_NUM] = { +static struct rte_acl_field_def ip6_defs[IP6_NUM] = { { .type = RTE_ACL_FIELD_TYPE_BITMASK, .size = sizeof(uint8_t), @@ -145,11 +145,11 @@ RTE_ACL_RULE_DEF(acl6_rules, RTE_DIM(ip6_defs)); -struct acl6_rules acl6_rules_out[MAX_ACL_RULE_NUM]; -uint32_t nb_acl6_rules_out; +static struct acl6_rules acl6_rules_out[MAX_ACL_RULE_NUM]; +static uint32_t nb_acl6_rules_out; -struct acl6_rules acl6_rules_in[MAX_ACL_RULE_NUM]; -uint32_t nb_acl6_rules_in; +static struct acl6_rules acl6_rules_in[MAX_ACL_RULE_NUM]; +static uint32_t nb_acl6_rules_in; void parse_sp6_tokens(char **tokens, uint32_t n_tokens, diff -Nru dpdk-17.11.5/examples/tep_termination/main.c dpdk-17.11.6/examples/tep_termination/main.c --- dpdk-17.11.5/examples/tep_termination/main.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/examples/tep_termination/main.c 2019-05-21 19:15:57.000000000 +0000 @@ -100,9 +100,6 @@ #define INVALID_PORT_ID 0xFFFF -/* Size of buffers used for snprintfs. */ -#define MAX_PRINT_BUFF 6072 - /* Maximum character device basename size. */ #define MAX_BASENAME_SZ 20 diff -Nru dpdk-17.11.5/examples/vhost/main.c dpdk-17.11.6/examples/vhost/main.c --- dpdk-17.11.5/examples/vhost/main.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/examples/vhost/main.c 2019-05-21 19:15:57.000000000 +0000 @@ -400,11 +400,19 @@ static int us_vhost_parse_socket_path(const char *q_arg) { + char *old; + /* parse number string */ if (strnlen(q_arg, PATH_MAX) == PATH_MAX) return -1; + old = socket_files; socket_files = realloc(socket_files, PATH_MAX * (nb_sockets + 1)); + if (socket_files == NULL) { + free(old); + return -1; + } + snprintf(socket_files + nb_sockets * PATH_MAX, PATH_MAX, "%s", q_arg); nb_sockets++; diff -Nru dpdk-17.11.5/lib/librte_eal/common/eal_common_options.c dpdk-17.11.6/lib/librte_eal/common/eal_common_options.c --- dpdk-17.11.5/lib/librte_eal/common/eal_common_options.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/lib/librte_eal/common/eal_common_options.c 2019-05-21 19:15:57.000000000 +0000 @@ -558,7 +558,9 @@ if (*corelist == '\0') return -1; errno = 0; - idx = strtoul(corelist, &end, 10); + idx = strtol(corelist, &end, 10); + if (idx < 0 || idx >= (int)cfg->lcore_count) + return -1; if (errno || end == NULL) return -1; while (isblank(*end)) @@ -1000,6 +1002,7 @@ { static int b_used; static int w_used; + struct rte_config *cfg = rte_eal_get_configuration(); switch (opt) { /* blacklist */ @@ -1033,7 +1036,9 @@ /* corelist */ case 'l': if (eal_parse_corelist(optarg) < 0) { - RTE_LOG(ERR, EAL, "invalid core list\n"); + RTE_LOG(ERR, EAL, + "invalid core list, please check core numbers are in [0, %u] range\n", + cfg->lcore_count-1); return -1; } core_parsed = 1; @@ -1210,6 +1215,8 @@ /* default master lcore is the first one */ if (!master_lcore_parsed) { cfg->master_lcore = rte_get_next_lcore(-1, 0, 0); + if (cfg->master_lcore >= RTE_MAX_LCORE) + return -1; lcore_config[cfg->master_lcore].core_role = ROLE_RTE; } @@ -1235,6 +1242,16 @@ RTE_LOG(ERR, EAL, "Invalid process type specified\n"); return -1; } + if (internal_cfg->hugefile_prefix != NULL && + strlen(internal_cfg->hugefile_prefix) < 1) { + RTE_LOG(ERR, EAL, "Invalid length of --" OPT_FILE_PREFIX " option\n"); + return -1; + } + if (internal_cfg->hugepage_dir != NULL && + strlen(internal_cfg->hugepage_dir) < 1) { + RTE_LOG(ERR, EAL, "Invalid length of --" OPT_HUGE_DIR" option\n"); + return -1; + } if (index(internal_cfg->hugefile_prefix, '%') != NULL) { RTE_LOG(ERR, EAL, "Invalid char, '%%', in --"OPT_FILE_PREFIX" " "option\n"); diff -Nru dpdk-17.11.5/lib/librte_eal/common/include/rte_version.h dpdk-17.11.6/lib/librte_eal/common/include/rte_version.h --- dpdk-17.11.5/lib/librte_eal/common/include/rte_version.h 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/lib/librte_eal/common/include/rte_version.h 2019-05-21 19:15:57.000000000 +0000 @@ -66,7 +66,7 @@ /** * Patch level number i.e. the z in yy.mm.z */ -#define RTE_VER_MINOR 5 +#define RTE_VER_MINOR 6 /** * Extra string to be appended to version number diff -Nru dpdk-17.11.5/lib/librte_eal/linuxapp/kni/compat.h dpdk-17.11.6/lib/librte_eal/linuxapp/kni/compat.h --- dpdk-17.11.5/lib/librte_eal/linuxapp/kni/compat.h 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/lib/librte_eal/linuxapp/kni/compat.h 2019-05-21 19:15:57.000000000 +0000 @@ -101,8 +101,15 @@ #undef NET_NAME_UNKNOWN #endif +/* + * RHEL has two different version with different kernel version: + * 3.10 is for AMD, Intel, IBM POWER7 and POWER8; + * 4.14 is for ARM and IBM POWER9 + */ #if (defined(RHEL_RELEASE_CODE) && \ - (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7, 5))) + (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7, 5)) && \ + (RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(8, 0)) && \ + (LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0))) #define ndo_change_mtu ndo_change_mtu_rh74 #endif diff -Nru dpdk-17.11.5/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c dpdk-17.11.6/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c --- dpdk-17.11.5/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c 2019-05-21 19:15:57.000000000 +0000 @@ -2222,7 +2222,12 @@ #ifdef HAVE_NDO_BRIDGE_SET_DEL_LINK_FLAGS static int igb_ndo_bridge_setlink(struct net_device *dev, struct nlmsghdr *nlh, +#ifdef HAVE_NDO_BRIDGE_SETLINK_EXTACK + u16 flags, struct netlink_ext_ack *extack) +#else u16 flags) +#endif + #else static int igb_ndo_bridge_setlink(struct net_device *dev, struct nlmsghdr *nlh) diff -Nru dpdk-17.11.5/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h dpdk-17.11.6/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h --- dpdk-17.11.5/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h 2019-05-21 19:15:57.000000000 +0000 @@ -3945,7 +3945,9 @@ #endif #if (defined(RHEL_RELEASE_CODE) && \ - (RHEL_RELEASE_VERSION(7, 5) <= RHEL_RELEASE_CODE)) + (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7, 5)) && \ + (RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(8, 0)) && \ + (LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0))) #define ndo_change_mtu ndo_change_mtu_rh74 #endif @@ -3953,6 +3955,11 @@ #define HAVE_PCI_ENABLE_MSIX #endif +#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) ) +#define dev_open(x) dev_open(x, NULL) +#define HAVE_NDO_BRIDGE_SETLINK_EXTACK +#endif /* >= 5.0.0 */ + #if defined(timer_setup) && defined(from_timer) #define HAVE_TIMER_SETUP #endif diff -Nru dpdk-17.11.5/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h dpdk-17.11.6/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h --- dpdk-17.11.5/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h 2019-05-21 19:15:57.000000000 +0000 @@ -3140,6 +3140,10 @@ #define SET_ETHTOOL_OPS(netdev, ops) ((netdev)->ethtool_ops = (ops)) #endif /* >= 3.16.0 */ +#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) ) +#define dev_open(x) dev_open(x, NULL) +#endif /* >= 5.0.0 */ + /* * vlan_tx_tag_* macros renamed to skb_vlan_tag_* (Linux commit: df8a39defad4) * For older kernels backported this commit, need to use renamed functions. diff -Nru dpdk-17.11.5/lib/librte_efd/rte_efd.c dpdk-17.11.6/lib/librte_efd/rte_efd.c --- dpdk-17.11.5/lib/librte_efd/rte_efd.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/lib/librte_efd/rte_efd.c 2019-05-21 19:15:57.000000000 +0000 @@ -769,6 +769,8 @@ rte_efd_free(struct rte_efd_table *table) { uint8_t socket_id; + struct rte_efd_list *efd_list; + struct rte_tailq_entry *te, *temp; if (table == NULL) return; @@ -776,6 +778,18 @@ for (socket_id = 0; socket_id < RTE_MAX_NUMA_NODES; socket_id++) rte_free(table->chunks[socket_id]); + efd_list = RTE_TAILQ_CAST(rte_efd_tailq.head, rte_efd_list); + rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK); + + TAILQ_FOREACH_SAFE(te, efd_list, next, temp) { + if (te->data == (void *) table) { + TAILQ_REMOVE(efd_list, te, next); + rte_free(te); + break; + } + } + + rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); rte_ring_free(table->free_slots); rte_free(table->offline_chunks); rte_free(table->keys); diff -Nru dpdk-17.11.5/lib/librte_ether/rte_ethdev.c dpdk-17.11.6/lib/librte_ether/rte_ethdev.c --- dpdk-17.11.5/lib/librte_ether/rte_ethdev.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/lib/librte_ether/rte_ethdev.c 2019-05-21 19:15:57.000000000 +0000 @@ -443,6 +443,7 @@ goto err; rte_eth_devices[port_id].state = RTE_ETH_DEV_UNUSED; + memset(&rte_eth_dev_data[port_id], 0, sizeof(struct rte_eth_dev_data)); return 0; err: @@ -1198,7 +1199,7 @@ nb_rx_desc % dev_info.rx_desc_lim.nb_align != 0) { RTE_PMD_DEBUG_TRACE("Invalid value for nb_rx_desc(=%hu), " - "should be: <= %hu, = %hu, and a product of %hu\n", + "should be: <= %hu, >= %hu, and a product of %hu\n", nb_rx_desc, dev_info.rx_desc_lim.nb_max, dev_info.rx_desc_lim.nb_min, @@ -1320,7 +1321,7 @@ nb_tx_desc < dev_info.tx_desc_lim.nb_min || nb_tx_desc % dev_info.tx_desc_lim.nb_align != 0) { RTE_PMD_DEBUG_TRACE("Invalid value for nb_tx_desc(=%hu), " - "should be: <= %hu, = %hu, and a product of %hu\n", + "should be: <= %hu, >= %hu, and a product of %hu\n", nb_tx_desc, dev_info.tx_desc_lim.nb_max, dev_info.tx_desc_lim.nb_min, diff -Nru dpdk-17.11.5/lib/librte_ether/rte_ethdev.h dpdk-17.11.6/lib/librte_ether/rte_ethdev.h --- dpdk-17.11.5/lib/librte_ether/rte_ethdev.h 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/lib/librte_ether/rte_ethdev.h 2019-05-21 19:15:57.000000000 +0000 @@ -3244,7 +3244,7 @@ #ifdef RTE_LIBRTE_ETHDEV_DEBUG if (!rte_eth_dev_is_valid_port(port_id)) { RTE_PMD_DEBUG_TRACE("Invalid TX port_id=%d\n", port_id); - rte_errno = -EINVAL; + rte_errno = EINVAL; return 0; } #endif @@ -3254,7 +3254,7 @@ #ifdef RTE_LIBRTE_ETHDEV_DEBUG if (queue_id >= dev->data->nb_tx_queues) { RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id); - rte_errno = -EINVAL; + rte_errno = EINVAL; return 0; } #endif diff -Nru dpdk-17.11.5/lib/librte_eventdev/rte_eventdev.h dpdk-17.11.6/lib/librte_eventdev/rte_eventdev.h --- dpdk-17.11.5/lib/librte_eventdev/rte_eventdev.h 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/lib/librte_eventdev/rte_eventdev.h 2019-05-21 19:15:57.000000000 +0000 @@ -1705,7 +1705,7 @@ * @param ids * The id numbers of the stats to get. The ids can be got from the stat * position in the stat list from rte_event_dev_get_xstats_names(), or - * by using rte_eventdev_get_xstats_by_name() + * by using rte_event_dev_xstats_by_name_get(). * @param[out] values * The values for each stats request by ID. * @param n @@ -1733,7 +1733,7 @@ * The stat name to retrieve * @param[out] id * If non-NULL, the numerical id of the stat will be returned, so that further - * requests for the stat can be got using rte_eventdev_xstats_get, which will + * requests for the stat can be got using rte_event_dev_xstats_get, which will * be faster as it doesn't need to scan a list of names for the stat. * If the stat cannot be found, the id returned will be (unsigned)-1. * @return diff -Nru dpdk-17.11.5/lib/librte_gro/gro_tcp4.c dpdk-17.11.6/lib/librte_gro/gro_tcp4.c --- dpdk-17.11.5/lib/librte_gro/gro_tcp4.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/lib/librte_gro/gro_tcp4.c 2019-05-21 19:15:57.000000000 +0000 @@ -351,6 +351,13 @@ uint32_t i, max_key_num; int cmp; + /* + * Don't process the packet whose TCP header length is greater + * than 60 bytes or less than 20 bytes. + */ + if (unlikely(INVALID_TCP_HDRLEN(pkt->l4_len))) + return -1; + eth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *); ipv4_hdr = (struct ipv4_hdr *)((char *)eth_hdr + pkt->l2_len); tcp_hdr = (struct tcp_hdr *)((char *)ipv4_hdr + pkt->l3_len); diff -Nru dpdk-17.11.5/lib/librte_gro/gro_tcp4.h dpdk-17.11.6/lib/librte_gro/gro_tcp4.h --- dpdk-17.11.5/lib/librte_gro/gro_tcp4.h 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/lib/librte_gro/gro_tcp4.h 2019-05-21 19:15:57.000000000 +0000 @@ -42,6 +42,11 @@ */ #define TCP4_MAX_L3_LENGTH UINT16_MAX +/* The maximum TCP header length */ +#define MAX_TCP_HLEN 60 +#define INVALID_TCP_HDRLEN(len) \ + (((len) < sizeof(struct tcp_hdr)) || ((len) > MAX_TCP_HLEN)) + /* criteria of mergeing packets */ struct tcp4_key { struct ether_addr eth_saddr; diff -Nru dpdk-17.11.5/lib/librte_gso/gso_common.h dpdk-17.11.6/lib/librte_gso/gso_common.h --- dpdk-17.11.5/lib/librte_gso/gso_common.h 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/lib/librte_gso/gso_common.h 2019-05-21 19:15:57.000000000 +0000 @@ -51,12 +51,12 @@ (PKT_TX_TCP_SEG | PKT_TX_IPV4)) #define IS_IPV4_VXLAN_TCP4(flag) (((flag) & (PKT_TX_TCP_SEG | PKT_TX_IPV4 | \ - PKT_TX_OUTER_IPV4 | PKT_TX_TUNNEL_VXLAN)) == \ + PKT_TX_OUTER_IPV4 | PKT_TX_TUNNEL_MASK)) == \ (PKT_TX_TCP_SEG | PKT_TX_IPV4 | PKT_TX_OUTER_IPV4 | \ PKT_TX_TUNNEL_VXLAN)) #define IS_IPV4_GRE_TCP4(flag) (((flag) & (PKT_TX_TCP_SEG | PKT_TX_IPV4 | \ - PKT_TX_OUTER_IPV4 | PKT_TX_TUNNEL_GRE)) == \ + PKT_TX_OUTER_IPV4 | PKT_TX_TUNNEL_MASK)) == \ (PKT_TX_TCP_SEG | PKT_TX_IPV4 | PKT_TX_OUTER_IPV4 | \ PKT_TX_TUNNEL_GRE)) diff -Nru dpdk-17.11.5/lib/librte_net/rte_ip.h dpdk-17.11.6/lib/librte_net/rte_ip.h --- dpdk-17.11.5/lib/librte_net/rte_ip.h 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/lib/librte_net/rte_ip.h 2019-05-21 19:15:57.000000000 +0000 @@ -372,16 +372,20 @@ * @param l4_hdr * The pointer to the beginning of the L4 header. * @return - * The complemented checksum to set in the IP packet. + * The complemented checksum to set in the IP packet + * or 0 on error */ static inline uint16_t rte_ipv4_udptcp_cksum(const struct ipv4_hdr *ipv4_hdr, const void *l4_hdr) { uint32_t cksum; - uint32_t l4_len; + uint32_t l3_len, l4_len; - l4_len = (uint32_t)(rte_be_to_cpu_16(ipv4_hdr->total_length) - - sizeof(struct ipv4_hdr)); + l3_len = rte_be_to_cpu_16(ipv4_hdr->total_length); + if (l3_len < sizeof(struct ipv4_hdr)) + return 0; + + l4_len = l3_len - sizeof(struct ipv4_hdr); cksum = rte_raw_cksum(l4_hdr, l4_len); cksum += rte_ipv4_phdr_cksum(ipv4_hdr, 0); diff -Nru dpdk-17.11.5/lib/librte_timer/rte_timer.c dpdk-17.11.6/lib/librte_timer/rte_timer.c --- dpdk-17.11.5/lib/librte_timer/rte_timer.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/lib/librte_timer/rte_timer.c 2019-05-21 19:15:57.000000000 +0000 @@ -270,24 +270,17 @@ } } -/* - * add in list, lock if needed +/* call with lock held as necessary + * add in list * timer must be in config state * timer must not be in a list */ static void -timer_add(struct rte_timer *tim, unsigned tim_lcore, int local_is_locked) +timer_add(struct rte_timer *tim, unsigned int tim_lcore) { - unsigned lcore_id = rte_lcore_id(); unsigned lvl; struct rte_timer *prev[MAX_SKIPLIST_DEPTH+1]; - /* if timer needs to be scheduled on another core, we need to - * lock the list; if it is on local core, we need to lock if - * we are not called from rte_timer_manage() */ - if (tim_lcore != lcore_id || !local_is_locked) - rte_spinlock_lock(&priv_timer[tim_lcore].list_lock); - /* find where exactly this element goes in the list of elements * for each depth. */ timer_get_prev_entries(tim->expire, tim_lcore, prev); @@ -311,9 +304,6 @@ * NOTE: this is not atomic on 32-bit*/ priv_timer[tim_lcore].pending_head.expire = priv_timer[tim_lcore].\ pending_head.sl_next[0]->expire; - - if (tim_lcore != lcore_id || !local_is_locked) - rte_spinlock_unlock(&priv_timer[tim_lcore].list_lock); } /* @@ -408,8 +398,15 @@ tim->f = fct; tim->arg = arg; + /* if timer needs to be scheduled on another core, we need to + * lock the destination list; if it is on local core, we need to lock if + * we are not called from rte_timer_manage() + */ + if (tim_lcore != lcore_id || !local_is_locked) + rte_spinlock_lock(&priv_timer[tim_lcore].list_lock); + __TIMER_STAT_ADD(pending, 1); - timer_add(tim, tim_lcore, local_is_locked); + timer_add(tim, tim_lcore); /* update state: as we are in CONFIG state, only us can modify * the state so we don't need to use cmpset() here */ @@ -418,6 +415,9 @@ status.owner = (int16_t)tim_lcore; tim->status.u32 = status.u32; + if (tim_lcore != lcore_id || !local_is_locked) + rte_spinlock_unlock(&priv_timer[tim_lcore].list_lock); + return 0; } diff -Nru dpdk-17.11.5/lib/librte_vhost/fd_man.c dpdk-17.11.6/lib/librte_vhost/fd_man.c --- dpdk-17.11.5/lib/librte_vhost/fd_man.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/lib/librte_vhost/fd_man.c 2019-05-21 19:15:57.000000000 +0000 @@ -155,7 +155,9 @@ pthread_mutex_lock(&pfdset->fd_mutex); i = pfdset->num < MAX_FDS ? pfdset->num++ : -1; if (i == -1) { + pthread_mutex_lock(&pfdset->fd_pooling_mutex); fdset_shrink_nolock(pfdset); + pthread_mutex_unlock(&pfdset->fd_pooling_mutex); i = pfdset->num < MAX_FDS ? pfdset->num++ : -1; if (i == -1) { pthread_mutex_unlock(&pfdset->fd_mutex); @@ -272,7 +274,9 @@ numfds = pfdset->num; pthread_mutex_unlock(&pfdset->fd_mutex); + pthread_mutex_lock(&pfdset->fd_pooling_mutex); val = poll(pfdset->rwfds, numfds, 1000 /* millisecs */); + pthread_mutex_unlock(&pfdset->fd_pooling_mutex); if (val < 0) continue; diff -Nru dpdk-17.11.5/lib/librte_vhost/fd_man.h dpdk-17.11.6/lib/librte_vhost/fd_man.h --- dpdk-17.11.5/lib/librte_vhost/fd_man.h 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/lib/librte_vhost/fd_man.h 2019-05-21 19:15:57.000000000 +0000 @@ -53,6 +53,7 @@ struct pollfd rwfds[MAX_FDS]; struct fdentry fd[MAX_FDS]; pthread_mutex_t fd_mutex; + pthread_mutex_t fd_pooling_mutex; int num; /* current fd number of this fdset */ }; diff -Nru dpdk-17.11.5/lib/librte_vhost/socket.c dpdk-17.11.6/lib/librte_vhost/socket.c --- dpdk-17.11.5/lib/librte_vhost/socket.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/lib/librte_vhost/socket.c 2019-05-21 19:15:57.000000000 +0000 @@ -110,6 +110,7 @@ .fdset = { .fd = { [0 ... MAX_FDS - 1] = {-1, NULL, NULL, NULL, 0} }, .fd_mutex = PTHREAD_MUTEX_INITIALIZER, + .fd_pooling_mutex = PTHREAD_MUTEX_INITIALIZER, .num = 0 }, .vsocket_cnt = 0, diff -Nru dpdk-17.11.5/lib/librte_vhost/vhost_user.c dpdk-17.11.6/lib/librte_vhost/vhost_user.c --- dpdk-17.11.5/lib/librte_vhost/vhost_user.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/lib/librte_vhost/vhost_user.c 2019-05-21 19:15:57.000000000 +0000 @@ -334,6 +334,9 @@ struct rte_vhost_mem_region *r; uint32_t i; + if (unlikely(!dev || !dev->mem)) + goto out_error; + /* Find the region where the address lives. */ for (i = 0; i < dev->mem->nregions; i++) { r = &dev->mem->regions[i]; @@ -348,6 +351,7 @@ r->host_user_addr; } } +out_error: *len = 0; return 0; @@ -506,13 +510,16 @@ uint64_t host_phys_addr, uint64_t size) { struct guest_page *page, *last_page; + struct guest_page *old_pages; if (dev->nr_guest_pages == dev->max_guest_pages) { dev->max_guest_pages *= 2; + old_pages = dev->guest_pages; dev->guest_pages = realloc(dev->guest_pages, dev->max_guest_pages * sizeof(*page)); if (!dev->guest_pages) { RTE_LOG(ERR, VHOST_CONFIG, "cannot realloc guest_pages\n"); + free(old_pages); return -1; } } @@ -761,8 +768,10 @@ vring_invalidate(dev, vq); dev = translate_ring_addresses(dev, i); - if (!dev) - return -1; + if (!dev) { + dev = *pdev; + goto err_mmap; + } *pdev = dev; } @@ -1435,8 +1444,11 @@ case VHOST_USER_SET_LOG_BASE: vhost_user_set_log_base(dev, &msg); - /* it needs a reply */ - msg.size = sizeof(msg.payload.u64); + /* + * The spec is not clear about it (yet), but QEMU doesn't + * expect any payload in the reply. + */ + msg.size = 0; send_vhost_reply(fd, &msg); break; case VHOST_USER_SET_LOG_FD: diff -Nru dpdk-17.11.5/lib/librte_vhost/virtio_net.c dpdk-17.11.6/lib/librte_vhost/virtio_net.c --- dpdk-17.11.5/lib/librte_vhost/virtio_net.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/lib/librte_vhost/virtio_net.c 2019-05-21 19:15:57.000000000 +0000 @@ -565,14 +565,19 @@ uint16_t idx = vq->avail->ring[avail_idx & (vq->size - 1)]; uint32_t vec_id = *vec_idx; uint32_t len = 0; + uint32_t nr_descs = vq->size; uint64_t dlen; struct vring_desc *descs = vq->desc; struct vring_desc *idesc = NULL; + if (unlikely(idx >= vq->size)) + return -1; + *desc_chain_head = idx; if (vq->desc[idx].flags & VRING_DESC_F_INDIRECT) { dlen = vq->desc[idx].len; + nr_descs = dlen / sizeof(struct vring_desc); descs = (struct vring_desc *)(uintptr_t) vhost_iova_to_vva(dev, vq, vq->desc[idx].addr, &dlen, @@ -596,7 +601,7 @@ } while (1) { - if (unlikely(vec_id >= BUF_VECTOR_MAX || idx >= vq->size)) { + if (unlikely(vec_id >= BUF_VECTOR_MAX || idx >= nr_descs)) { free_ind_table(idesc); return -1; } diff -Nru dpdk-17.11.5/mk/rte.cpuflags.mk dpdk-17.11.6/mk/rte.cpuflags.mk --- dpdk-17.11.5/mk/rte.cpuflags.mk 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/mk/rte.cpuflags.mk 2019-05-21 19:15:57.000000000 +0000 @@ -97,8 +97,8 @@ ifeq ($(CONFIG_RTE_ENABLE_AVX512),y) CPUFLAGS += AVX512F else -# disable AVX512F support of gcc as a workaround for Bug 97 -ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) +# disable AVX512F support for GCC & binutils 2.30 as a workaround for Bug 97 +ifeq ($(FORCE_DISABLE_AVX512),y) MACHINE_CFLAGS += -mno-avx512f endif endif diff -Nru dpdk-17.11.5/mk/toolchain/gcc/rte.toolchain-compat.mk dpdk-17.11.6/mk/toolchain/gcc/rte.toolchain-compat.mk --- dpdk-17.11.5/mk/toolchain/gcc/rte.toolchain-compat.mk 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/mk/toolchain/gcc/rte.toolchain-compat.mk 2019-05-21 19:15:57.000000000 +0000 @@ -47,6 +47,16 @@ HOST_GCC_PATCHLEVEL = $(shell echo __GNUC_PATCHLEVEL__ | $(HOSTCC) -E -x c - | tail -n 1) HOST_GCC_VERSION = $(HOST_GCC_MAJOR)$(HOST_GCC_MINOR) +LD_VERSION = $(shell $(LD) -v) +# disable AVX512F support for GCC & binutils 2.30 as a workaround for Bug 97 +ifneq ($(filter 2.30%,$(LD_VERSION)),) +FORCE_DISABLE_AVX512 := y +# print warning only once for librte_eal +ifneq ($(filter %librte_eal,$(CURDIR)),) +$(warning AVX512 support disabled because of ld 2.30. See Bug 97) +endif +endif + # if GCC is older than 4.x ifeq ($(shell test $(GCC_VERSION) -lt 40 && echo 1), 1) MACHINE_CFLAGS = diff -Nru dpdk-17.11.5/pkg/dpdk.spec dpdk-17.11.6/pkg/dpdk.spec --- dpdk-17.11.5/pkg/dpdk.spec 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/pkg/dpdk.spec 2019-05-21 19:15:57.000000000 +0000 @@ -30,7 +30,7 @@ # OF THE POSSIBILITY OF SUCH DAMAGE. Name: dpdk -Version: 17.11.5 +Version: 17.11.6 Release: 1 Packager: packaging@6wind.com URL: http://dpdk.org diff -Nru dpdk-17.11.5/test/test/test_cryptodev_blockcipher.c dpdk-17.11.6/test/test/test_cryptodev_blockcipher.c --- dpdk-17.11.5/test/test/test_cryptodev_blockcipher.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/test/test/test_cryptodev_blockcipher.c 2019-05-21 19:15:57.000000000 +0000 @@ -403,13 +403,14 @@ /* Verify results */ if (op->status != RTE_CRYPTO_OP_STATUS_SUCCESS) { - if (t->op_mask & BLOCKCIPHER_TEST_OP_AUTH_VERIFY) + if ((t->op_mask & BLOCKCIPHER_TEST_OP_AUTH_VERIFY) && + (op->status == RTE_CRYPTO_OP_STATUS_AUTH_FAILED)) snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "line %u " "FAILED: Digest verification failed " "(0x%X)", __LINE__, op->status); else snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "line %u " - "FAILED: Digest verification failed " + "FAILED: Operation failed " "(0x%X)", __LINE__, op->status); status = TEST_FAILED; goto error_exit; diff -Nru dpdk-17.11.5/test/test/test_eal_flags.c dpdk-17.11.6/test/test/test_eal_flags.c --- dpdk-17.11.5/test/test/test_eal_flags.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/test/test/test_eal_flags.c 2019-05-21 19:15:57.000000000 +0000 @@ -46,6 +46,7 @@ #include #include +#include #include #include @@ -529,40 +530,50 @@ "-n", "3", "-l", "1," }; const char *argv10[] = { prgname, prefix, mp_flag, "-n", "3", "-l", "1#2" }; + /* core number is negative value */ + const char * const argv11[] = { prgname, prefix, mp_flag, + "-n", "3", "-l", "-5" }; + const char * const argv12[] = { prgname, prefix, mp_flag, + "-n", "3", "-l", "-5-7" }; + /* core number is maximum value */ + const char * const argv13[] = { prgname, prefix, mp_flag, + "-n", "3", "-l", RTE_STR(RTE_MAX_LCORE) }; + const char * const argv14[] = { prgname, prefix, mp_flag, + "-n", "3", "-l", "1-"RTE_STR(RTE_MAX_LCORE) }; /* sanity check test - valid corelist value */ - const char *argv11[] = { prgname, prefix, mp_flag, + const char * const argv15[] = { prgname, prefix, mp_flag, "-n", "3", "-l", "1-2,3" }; /* --lcores flag but no lcores value */ - const char *argv12[] = { prgname, prefix, mp_flag, + const char * const argv16[] = { prgname, prefix, mp_flag, "-n", "3", "--lcores" }; - const char *argv13[] = { prgname, prefix, mp_flag, + const char * const argv17[] = { prgname, prefix, mp_flag, "-n", "3", "--lcores", " " }; /* bad lcores value */ - const char *argv14[] = { prgname, prefix, mp_flag, + const char * const argv18[] = { prgname, prefix, mp_flag, "-n", "3", "--lcores", "1-3-5" }; - const char *argv15[] = { prgname, prefix, mp_flag, + const char * const argv19[] = { prgname, prefix, mp_flag, "-n", "3", "--lcores", "0-1,,2" }; - const char *argv16[] = { prgname, prefix, mp_flag, + const char * const argv20[] = { prgname, prefix, mp_flag, "-n", "3", "--lcores", "0-,1" }; - const char *argv17[] = { prgname, prefix, mp_flag, + const char * const argv21[] = { prgname, prefix, mp_flag, "-n", "3", "--lcores", "(0-,2-4)" }; - const char *argv18[] = { prgname, prefix, mp_flag, + const char * const argv22[] = { prgname, prefix, mp_flag, "-n", "3", "--lcores", "(-1,2)" }; - const char *argv19[] = { prgname, prefix, mp_flag, + const char * const argv23[] = { prgname, prefix, mp_flag, "-n", "3", "--lcores", "(2-4)@(2-4-6)" }; - const char *argv20[] = { prgname, prefix, mp_flag, + const char * const argv24[] = { prgname, prefix, mp_flag, "-n", "3", "--lcores", "(a,2)" }; - const char *argv21[] = { prgname, prefix, mp_flag, + const char * const argv25[] = { prgname, prefix, mp_flag, "-n", "3", "--lcores", "1-3@(1,3)" }; - const char *argv22[] = { prgname, prefix, mp_flag, + const char * const argv26[] = { prgname, prefix, mp_flag, "-n", "3", "--lcores", "3@((1,3)" }; - const char *argv23[] = { prgname, prefix, mp_flag, + const char * const argv27[] = { prgname, prefix, mp_flag, "-n", "3", "--lcores", "(4-7)=(1,3)" }; - const char *argv24[] = { prgname, prefix, mp_flag, + const char * const argv28[] = { prgname, prefix, mp_flag, "-n", "3", "--lcores", "[4-7]@(1,3)" }; /* sanity check of tests - valid lcores value */ - const char *argv25[] = { prgname, prefix, mp_flag, + const char * const argv29[] = { prgname, prefix, mp_flag, "-n", "3", "--lcores", "0-1,2@(5-7),(3-5)@(0,2),(0,6),7"}; @@ -590,31 +601,35 @@ || launch_proc(argv7) == 0 || launch_proc(argv8) == 0 || launch_proc(argv9) == 0 - || launch_proc(argv10) == 0) { + || launch_proc(argv10) == 0 + || launch_proc(argv11) == 0 + || launch_proc(argv12) == 0 + || launch_proc(argv13) == 0 + || launch_proc(argv14) == 0) { printf("Error - " "process ran without error with invalid -l flag\n"); return -1; } - if (launch_proc(argv11) != 0) { + if (launch_proc(argv15) != 0) { printf("Error - " "process did not run ok with valid corelist value\n"); return -1; } /* start --lcores tests */ - if (launch_proc(argv12) == 0 || launch_proc(argv13) == 0 || - launch_proc(argv14) == 0 || launch_proc(argv15) == 0 || - launch_proc(argv16) == 0 || launch_proc(argv17) == 0 || + if (launch_proc(argv16) == 0 || launch_proc(argv17) == 0 || launch_proc(argv18) == 0 || launch_proc(argv19) == 0 || launch_proc(argv20) == 0 || launch_proc(argv21) == 0 || - launch_proc(argv21) == 0 || launch_proc(argv22) == 0 || - launch_proc(argv23) == 0 || launch_proc(argv24) == 0) { + launch_proc(argv22) == 0 || launch_proc(argv23) == 0 || + launch_proc(argv24) == 0 || launch_proc(argv25) == 0 || + launch_proc(argv26) == 0 || launch_proc(argv27) == 0 || + launch_proc(argv28) == 0) { printf("Error - " "process ran without error with invalid --lcore flag\n"); return -1; } - if (launch_proc(argv25) != 0) { + if (launch_proc(argv29) != 0) { printf("Error - " "process did not run ok with valid corelist value\n"); return -1; diff -Nru dpdk-17.11.5/test/test/test_memzone.c dpdk-17.11.6/test/test/test_memzone.c --- dpdk-17.11.5/test/test/test_memzone.c 2019-02-19 22:48:55.000000000 +0000 +++ dpdk-17.11.6/test/test/test_memzone.c 2019-05-21 19:15:57.000000000 +0000 @@ -33,6 +33,7 @@ #include #include +#include #include #include @@ -76,6 +77,8 @@ * - Check flags for specific huge page size reservation */ +#define TEST_MEMZONE_NAME(suffix) "MZ_TEST_" suffix + /* Test if memory overlaps: return 1 if true, or 0 if false. */ static int is_memory_overlap(rte_iova_t ptr1, size_t len1, rte_iova_t ptr2, size_t len2) @@ -92,14 +95,14 @@ { const struct rte_memzone * mz; - mz = rte_memzone_lookup("invalid_alignment"); + mz = rte_memzone_lookup(TEST_MEMZONE_NAME("invalid_alignment")); if (mz != NULL) { printf("Zone with invalid alignment has been reserved\n"); return -1; } - mz = rte_memzone_reserve_aligned("invalid_alignment", 100, - SOCKET_ID_ANY, 0, 100); + mz = rte_memzone_reserve_aligned(TEST_MEMZONE_NAME("invalid_alignment"), + 100, SOCKET_ID_ANY, 0, 100); if (mz != NULL) { printf("Zone with invalid alignment has been reserved\n"); return -1; @@ -112,14 +115,16 @@ { const struct rte_memzone * mz; - mz = rte_memzone_lookup("zone_size_bigger_than_the_maximum"); + mz = rte_memzone_lookup( + TEST_MEMZONE_NAME("zone_size_bigger_than_the_maximum")); if (mz != NULL) { printf("zone_size_bigger_than_the_maximum has been reserved\n"); return -1; } - mz = rte_memzone_reserve("zone_size_bigger_than_the_maximum", (size_t)-1, - SOCKET_ID_ANY, 0); + mz = rte_memzone_reserve( + TEST_MEMZONE_NAME("zone_size_bigger_than_the_maximum"), + (size_t)-1, SOCKET_ID_ANY, 0); if (mz != NULL) { printf("It is impossible to reserve such big a memzone\n"); return -1; @@ -166,8 +171,8 @@ * available page size (i.e 1GB ) when 2MB pages are unavailable. */ if (hugepage_2MB_avail) { - mz = rte_memzone_reserve("flag_zone_2M", size, SOCKET_ID_ANY, - RTE_MEMZONE_2MB); + mz = rte_memzone_reserve(TEST_MEMZONE_NAME("flag_zone_2M"), + size, SOCKET_ID_ANY, RTE_MEMZONE_2MB); if (mz == NULL) { printf("MEMZONE FLAG 2MB\n"); return -1; @@ -181,7 +186,8 @@ return -1; } - mz = rte_memzone_reserve("flag_zone_2M_HINT", size, SOCKET_ID_ANY, + mz = rte_memzone_reserve(TEST_MEMZONE_NAME("flag_zone_2M_HINT"), + size, SOCKET_ID_ANY, RTE_MEMZONE_2MB|RTE_MEMZONE_SIZE_HINT_ONLY); if (mz == NULL) { printf("MEMZONE FLAG 2MB\n"); @@ -200,7 +206,9 @@ * HINT flag is indicated */ if (!hugepage_1GB_avail) { - mz = rte_memzone_reserve("flag_zone_1G_HINT", size, SOCKET_ID_ANY, + mz = rte_memzone_reserve( + TEST_MEMZONE_NAME("flag_zone_1G_HINT"), + size, SOCKET_ID_ANY, RTE_MEMZONE_1GB|RTE_MEMZONE_SIZE_HINT_ONLY); if (mz == NULL) { printf("MEMZONE FLAG 1GB & HINT\n"); @@ -215,8 +223,9 @@ return -1; } - mz = rte_memzone_reserve("flag_zone_1G", size, SOCKET_ID_ANY, - RTE_MEMZONE_1GB); + mz = rte_memzone_reserve( + TEST_MEMZONE_NAME("flag_zone_1G"), size, + SOCKET_ID_ANY, RTE_MEMZONE_1GB); if (mz != NULL) { printf("MEMZONE FLAG 1GB\n"); return -1; @@ -226,8 +235,8 @@ /*As with 2MB tests above for 1GB huge page requests*/ if (hugepage_1GB_avail) { - mz = rte_memzone_reserve("flag_zone_1G", size, SOCKET_ID_ANY, - RTE_MEMZONE_1GB); + mz = rte_memzone_reserve(TEST_MEMZONE_NAME("flag_zone_1G"), + size, SOCKET_ID_ANY, RTE_MEMZONE_1GB); if (mz == NULL) { printf("MEMZONE FLAG 1GB\n"); return -1; @@ -241,7 +250,8 @@ return -1; } - mz = rte_memzone_reserve("flag_zone_1G_HINT", size, SOCKET_ID_ANY, + mz = rte_memzone_reserve(TEST_MEMZONE_NAME("flag_zone_1G_HINT"), + size, SOCKET_ID_ANY, RTE_MEMZONE_1GB|RTE_MEMZONE_SIZE_HINT_ONLY); if (mz == NULL) { printf("MEMZONE FLAG 1GB\n"); @@ -260,7 +270,9 @@ * HINT flag is indicated */ if (!hugepage_2MB_avail) { - mz = rte_memzone_reserve("flag_zone_2M_HINT", size, SOCKET_ID_ANY, + mz = rte_memzone_reserve( + TEST_MEMZONE_NAME("flag_zone_2M_HINT"), + size, SOCKET_ID_ANY, RTE_MEMZONE_2MB|RTE_MEMZONE_SIZE_HINT_ONLY); if (mz == NULL){ printf("MEMZONE FLAG 2MB & HINT\n"); @@ -274,8 +286,9 @@ printf("Fail memzone free\n"); return -1; } - mz = rte_memzone_reserve("flag_zone_2M", size, SOCKET_ID_ANY, - RTE_MEMZONE_2MB); + mz = rte_memzone_reserve( + TEST_MEMZONE_NAME("flag_zone_2M"), size, + SOCKET_ID_ANY, RTE_MEMZONE_2MB); if (mz != NULL) { printf("MEMZONE FLAG 2MB\n"); return -1; @@ -283,8 +296,10 @@ } if (hugepage_2MB_avail && hugepage_1GB_avail) { - mz = rte_memzone_reserve("flag_zone_2M_HINT", size, SOCKET_ID_ANY, - RTE_MEMZONE_2MB|RTE_MEMZONE_1GB); + mz = rte_memzone_reserve( + TEST_MEMZONE_NAME("flag_zone_2M_HINT"), + size, SOCKET_ID_ANY, + RTE_MEMZONE_2MB|RTE_MEMZONE_1GB); if (mz == NULL) { printf("BOTH SIZES SET\n"); return -1; @@ -308,8 +323,8 @@ * page size (i.e 16GB ) when 16MB pages are unavailable. */ if (hugepage_16MB_avail) { - mz = rte_memzone_reserve("flag_zone_16M", size, SOCKET_ID_ANY, - RTE_MEMZONE_16MB); + mz = rte_memzone_reserve(TEST_MEMZONE_NAME("flag_zone_16M"), + size, SOCKET_ID_ANY, RTE_MEMZONE_16MB); if (mz == NULL) { printf("MEMZONE FLAG 16MB\n"); return -1; @@ -323,8 +338,10 @@ return -1; } - mz = rte_memzone_reserve("flag_zone_16M_HINT", size, - SOCKET_ID_ANY, RTE_MEMZONE_16MB|RTE_MEMZONE_SIZE_HINT_ONLY); + mz = rte_memzone_reserve( + TEST_MEMZONE_NAME("flag_zone_16M_HINT"), size, + SOCKET_ID_ANY, + RTE_MEMZONE_16MB|RTE_MEMZONE_SIZE_HINT_ONLY); if (mz == NULL) { printf("MEMZONE FLAG 2MB\n"); return -1; @@ -342,9 +359,11 @@ * unless HINT flag is indicated */ if (!hugepage_16GB_avail) { - mz = rte_memzone_reserve("flag_zone_16G_HINT", size, - SOCKET_ID_ANY, - RTE_MEMZONE_16GB|RTE_MEMZONE_SIZE_HINT_ONLY); + mz = rte_memzone_reserve( + TEST_MEMZONE_NAME("flag_zone_16G_HINT"), + size, SOCKET_ID_ANY, + RTE_MEMZONE_16GB | + RTE_MEMZONE_SIZE_HINT_ONLY); if (mz == NULL) { printf("MEMZONE FLAG 16GB & HINT\n"); return -1; @@ -358,8 +377,10 @@ return -1; } - mz = rte_memzone_reserve("flag_zone_16G", size, - SOCKET_ID_ANY, RTE_MEMZONE_16GB); + mz = rte_memzone_reserve( + TEST_MEMZONE_NAME("flag_zone_16G"), + size, + SOCKET_ID_ANY, RTE_MEMZONE_16GB); if (mz != NULL) { printf("MEMZONE FLAG 16GB\n"); return -1; @@ -368,8 +389,8 @@ } /*As with 16MB tests above for 16GB huge page requests*/ if (hugepage_16GB_avail) { - mz = rte_memzone_reserve("flag_zone_16G", size, SOCKET_ID_ANY, - RTE_MEMZONE_16GB); + mz = rte_memzone_reserve(TEST_MEMZONE_NAME("flag_zone_16G"), + size, SOCKET_ID_ANY, RTE_MEMZONE_16GB); if (mz == NULL) { printf("MEMZONE FLAG 16GB\n"); return -1; @@ -383,8 +404,10 @@ return -1; } - mz = rte_memzone_reserve("flag_zone_16G_HINT", size, - SOCKET_ID_ANY, RTE_MEMZONE_16GB|RTE_MEMZONE_SIZE_HINT_ONLY); + mz = rte_memzone_reserve( + TEST_MEMZONE_NAME("flag_zone_16G_HINT"), size, + SOCKET_ID_ANY, + RTE_MEMZONE_16GB|RTE_MEMZONE_SIZE_HINT_ONLY); if (mz == NULL) { printf("MEMZONE FLAG 16GB\n"); return -1; @@ -402,9 +425,11 @@ * unless HINT flag is indicated */ if (!hugepage_16MB_avail) { - mz = rte_memzone_reserve("flag_zone_16M_HINT", size, - SOCKET_ID_ANY, - RTE_MEMZONE_16MB|RTE_MEMZONE_SIZE_HINT_ONLY); + mz = rte_memzone_reserve( + TEST_MEMZONE_NAME("flag_zone_16M_HINT"), + size, SOCKET_ID_ANY, + RTE_MEMZONE_16MB | + RTE_MEMZONE_SIZE_HINT_ONLY); if (mz == NULL) { printf("MEMZONE FLAG 16MB & HINT\n"); return -1; @@ -417,8 +442,9 @@ printf("Fail memzone free\n"); return -1; } - mz = rte_memzone_reserve("flag_zone_16M", size, - SOCKET_ID_ANY, RTE_MEMZONE_16MB); + mz = rte_memzone_reserve( + TEST_MEMZONE_NAME("flag_zone_16M"), + size, SOCKET_ID_ANY, RTE_MEMZONE_16MB); if (mz != NULL) { printf("MEMZONE FLAG 16MB\n"); return -1; @@ -426,9 +452,10 @@ } if (hugepage_16MB_avail && hugepage_16GB_avail) { - mz = rte_memzone_reserve("flag_zone_16M_HINT", size, - SOCKET_ID_ANY, - RTE_MEMZONE_16MB|RTE_MEMZONE_16GB); + mz = rte_memzone_reserve( + TEST_MEMZONE_NAME("flag_zone_16M_HINT"), + size, SOCKET_ID_ANY, + RTE_MEMZONE_16MB|RTE_MEMZONE_16GB); if (mz == NULL) { printf("BOTH SIZES SET\n"); return -1; @@ -484,7 +511,8 @@ return 0; } - mz = rte_memzone_reserve("max_zone", 0, SOCKET_ID_ANY, 0); + mz = rte_memzone_reserve(TEST_MEMZONE_NAME("max_zone"), 0, + SOCKET_ID_ANY, 0); if (mz == NULL){ printf("Failed to reserve a big chunk of memory - %s\n", rte_strerror(rte_errno)); @@ -526,8 +554,8 @@ return 0; } - mz = rte_memzone_reserve_aligned("max_zone_aligned", 0, - SOCKET_ID_ANY, 0, align); + mz = rte_memzone_reserve_aligned(TEST_MEMZONE_NAME("max_zone_aligned"), + 0, SOCKET_ID_ANY, 0, align); if (mz == NULL){ printf("Failed to reserve a big chunk of memory - %s\n", rte_strerror(rte_errno)); @@ -564,24 +592,29 @@ const struct rte_memzone *memzone_aligned_1024; /* memzone that should automatically be adjusted to align on 64 bytes */ - memzone_aligned_32 = rte_memzone_reserve_aligned("aligned_32", 100, - SOCKET_ID_ANY, 0, 32); + memzone_aligned_32 = rte_memzone_reserve_aligned( + TEST_MEMZONE_NAME("aligned_32"), 100, SOCKET_ID_ANY, 0, + 32); /* memzone that is supposed to be aligned on a 128 byte boundary */ - memzone_aligned_128 = rte_memzone_reserve_aligned("aligned_128", 100, - SOCKET_ID_ANY, 0, 128); + memzone_aligned_128 = rte_memzone_reserve_aligned( + TEST_MEMZONE_NAME("aligned_128"), 100, SOCKET_ID_ANY, 0, + 128); /* memzone that is supposed to be aligned on a 256 byte boundary */ - memzone_aligned_256 = rte_memzone_reserve_aligned("aligned_256", 100, - SOCKET_ID_ANY, 0, 256); + memzone_aligned_256 = rte_memzone_reserve_aligned( + TEST_MEMZONE_NAME("aligned_256"), 100, SOCKET_ID_ANY, 0, + 256); /* memzone that is supposed to be aligned on a 512 byte boundary */ - memzone_aligned_512 = rte_memzone_reserve_aligned("aligned_512", 100, - SOCKET_ID_ANY, 0, 512); + memzone_aligned_512 = rte_memzone_reserve_aligned( + TEST_MEMZONE_NAME("aligned_512"), 100, SOCKET_ID_ANY, 0, + 512); /* memzone that is supposed to be aligned on a 1024 byte boundary */ - memzone_aligned_1024 = rte_memzone_reserve_aligned("aligned_1024", 100, - SOCKET_ID_ANY, 0, 1024); + memzone_aligned_1024 = rte_memzone_reserve_aligned( + TEST_MEMZONE_NAME("aligned_1024"), 100, SOCKET_ID_ANY, + 0, 1024); printf("check alignments and lengths\n"); if (memzone_aligned_32 == NULL) { @@ -750,37 +783,46 @@ test_memzone_bounded(void) { const struct rte_memzone *memzone_err; - const char *name; int rc; /* should fail as boundary is not power of two */ - name = "bounded_error_31"; - if ((memzone_err = rte_memzone_reserve_bounded(name, - 100, SOCKET_ID_ANY, 0, 32, UINT32_MAX)) != NULL) { + memzone_err = rte_memzone_reserve_bounded( + TEST_MEMZONE_NAME("bounded_error_31"), 100, + SOCKET_ID_ANY, 0, 32, UINT32_MAX); + if (memzone_err != NULL) { printf("%s(%s)created a memzone with invalid boundary " "conditions\n", __func__, memzone_err->name); return -1; } /* should fail as len is greater then boundary */ - name = "bounded_error_32"; - if ((memzone_err = rte_memzone_reserve_bounded(name, - 100, SOCKET_ID_ANY, 0, 32, 32)) != NULL) { + memzone_err = rte_memzone_reserve_bounded( + TEST_MEMZONE_NAME("bounded_error_32"), 100, + SOCKET_ID_ANY, 0, 32, 32); + if (memzone_err != NULL) { printf("%s(%s)created a memzone with invalid boundary " "conditions\n", __func__, memzone_err->name); return -1; } - if ((rc = check_memzone_bounded("bounded_128", 100, 128, 128)) != 0) + rc = check_memzone_bounded(TEST_MEMZONE_NAME("bounded_128"), 100, 128, + 128); + if (rc != 0) return rc; - if ((rc = check_memzone_bounded("bounded_256", 100, 256, 128)) != 0) + rc = check_memzone_bounded(TEST_MEMZONE_NAME("bounded_256"), 100, 256, + 128); + if (rc != 0) return rc; - if ((rc = check_memzone_bounded("bounded_1K", 100, 64, 1024)) != 0) + rc = check_memzone_bounded(TEST_MEMZONE_NAME("bounded_1K"), 100, 64, + 1024); + if (rc != 0) return rc; - if ((rc = check_memzone_bounded("bounded_1K_MAX", 0, 64, 1024)) != 0) + rc = check_memzone_bounded(TEST_MEMZONE_NAME("bounded_1K_MAX"), 0, 64, + 1024); + if (rc != 0) return rc; return 0; @@ -793,25 +835,28 @@ int i; char name[20]; - mz[0] = rte_memzone_reserve("tempzone0", 2000, SOCKET_ID_ANY, 0); - mz[1] = rte_memzone_reserve("tempzone1", 4000, SOCKET_ID_ANY, 0); + mz[0] = rte_memzone_reserve(TEST_MEMZONE_NAME("tempzone0"), 2000, + SOCKET_ID_ANY, 0); + mz[1] = rte_memzone_reserve(TEST_MEMZONE_NAME("tempzone1"), 4000, + SOCKET_ID_ANY, 0); if (mz[0] > mz[1]) return -1; - if (!rte_memzone_lookup("tempzone0")) + if (!rte_memzone_lookup(TEST_MEMZONE_NAME("tempzone0"))) return -1; - if (!rte_memzone_lookup("tempzone1")) + if (!rte_memzone_lookup(TEST_MEMZONE_NAME("tempzone1"))) return -1; if (rte_memzone_free(mz[0])) { printf("Fail memzone free - tempzone0\n"); return -1; } - if (rte_memzone_lookup("tempzone0")) { + if (rte_memzone_lookup(TEST_MEMZONE_NAME("tempzone0"))) { printf("Found previously free memzone - tempzone0\n"); return -1; } - mz[2] = rte_memzone_reserve("tempzone2", 2000, SOCKET_ID_ANY, 0); + mz[2] = rte_memzone_reserve(TEST_MEMZONE_NAME("tempzone2"), 2000, + SOCKET_ID_ANY, 0); if (mz[2] > mz[1]) { printf("tempzone2 should have gotten the free entry from tempzone0\n"); @@ -821,7 +866,7 @@ printf("Fail memzone free - tempzone2\n"); return -1; } - if (rte_memzone_lookup("tempzone2")) { + if (rte_memzone_lookup(TEST_MEMZONE_NAME("tempzone2"))) { printf("Found previously free memzone - tempzone2\n"); return -1; } @@ -829,14 +874,15 @@ printf("Fail memzone free - tempzone1\n"); return -1; } - if (rte_memzone_lookup("tempzone1")) { + if (rte_memzone_lookup(TEST_MEMZONE_NAME("tempzone1"))) { printf("Found previously free memzone - tempzone1\n"); return -1; } i = 0; do { - snprintf(name, sizeof(name), "tempzone%u", i); + snprintf(name, sizeof(name), TEST_MEMZONE_NAME("tempzone%u"), + i); mz[i] = rte_memzone_reserve(name, 1, SOCKET_ID_ANY, 0); } while (mz[i++] != NULL); @@ -844,7 +890,8 @@ printf("Fail memzone free - tempzone0\n"); return -1; } - mz[0] = rte_memzone_reserve("tempzone0new", 0, SOCKET_ID_ANY, 0); + mz[0] = rte_memzone_reserve(TEST_MEMZONE_NAME("tempzone0new"), 0, + SOCKET_ID_ANY, 0); if (mz[0] == NULL) { printf("Fail to create memzone - tempzone0new - when MAX memzones were " @@ -871,16 +918,16 @@ const struct rte_memzone *memzone4; const struct rte_memzone *mz; - memzone1 = rte_memzone_reserve("testzone1", 100, + memzone1 = rte_memzone_reserve(TEST_MEMZONE_NAME("testzone1"), 100, SOCKET_ID_ANY, 0); - memzone2 = rte_memzone_reserve("testzone2", 1000, + memzone2 = rte_memzone_reserve(TEST_MEMZONE_NAME("testzone2"), 1000, 0, 0); - memzone3 = rte_memzone_reserve("testzone3", 1000, + memzone3 = rte_memzone_reserve(TEST_MEMZONE_NAME("testzone3"), 1000, 1, 0); - memzone4 = rte_memzone_reserve("testzone4", 1024, + memzone4 = rte_memzone_reserve(TEST_MEMZONE_NAME("testzone4"), 1024, SOCKET_ID_ANY, 0); /* memzone3 may be NULL if we don't have NUMA */ @@ -932,12 +979,12 @@ return -1; printf("test zone lookup\n"); - mz = rte_memzone_lookup("testzone1"); + mz = rte_memzone_lookup(TEST_MEMZONE_NAME("testzone1")); if (mz != memzone1) return -1; printf("test duplcate zone name\n"); - mz = rte_memzone_reserve("testzone1", 100, + mz = rte_memzone_reserve(TEST_MEMZONE_NAME("testzone1"), 100, SOCKET_ID_ANY, 0); if (mz != NULL) return -1; @@ -962,16 +1009,22 @@ return 0; } -static int memzone_calk_called; -static void memzone_walk_clb(const struct rte_memzone *mz __rte_unused, +static int test_memzones_left; +static int memzone_walk_cnt; +static void memzone_walk_clb(const struct rte_memzone *mz, void *arg __rte_unused) { - memzone_calk_called = 1; + memzone_walk_cnt++; + if (!strncmp(TEST_MEMZONE_NAME(""), mz->name, RTE_MEMZONE_NAMESIZE)) + test_memzones_left++; } static int test_memzone(void) { + /* take note of how many memzones were allocated before running */ + int memzone_cnt = rte_eal_get_configuration()->mem_config->memzone_cnt; + printf("test basic memzone API\n"); if (test_memzone_basic() < 0) return -1; @@ -1009,8 +1062,10 @@ return -1; printf("check memzone cleanup\n"); + memzone_walk_cnt = 0; + test_memzones_left = 0; rte_memzone_walk(memzone_walk_clb, NULL); - if (memzone_calk_called) { + if (memzone_walk_cnt != memzone_cnt || test_memzones_left > 0) { printf("there are some memzones left after test\n"); rte_memzone_dump(stdout); return -1;