diff --git a/.cirrus.yml b/.cirrus.yml index eb6af0a719..c6ecd9fd58 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -2,21 +2,21 @@ freebsd_build_task: freebsd_instance: matrix: - image: freebsd-12-0-release-amd64 - image: freebsd-11-2-release-amd64 + image_family: freebsd-12-1-snap + image_family: freebsd-11-3-snap cpu: 4 memory: 8G env: DEPENDENCIES: automake libtool gmake gcc wget openssl - python py27-six py27-sphinx py27-openssl - python3 py36-six py36-openssl + python3 py37-six py37-sphinx py37-openssl matrix: COMPILER: gcc COMPILER: clang prepare_script: - sysctl -w kern.coredump=0 + - pkg update -f - pkg install -y ${DEPENDENCIES} configure_script: diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh index de8e76f192..ab0089d554 100755 --- a/.travis/linux-build.sh +++ b/.travis/linux-build.sh @@ -88,7 +88,7 @@ fi if [ "$DPDK" ] || [ "$DPDK_SHARED" ]; then if [ -z "$DPDK_VER" ]; then - DPDK_VER="18.11.2" + DPDK_VER="18.11.9" fi install_dpdk $DPDK_VER if [ "$CC" = "clang" ]; then diff --git a/AUTHORS.rst b/AUTHORS.rst index f3237e1828..4dc35cedeb 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -523,6 +523,7 @@ Krishna Miriyala miriyalak@vmware.com Krishna Mohan Elluru elluru.kri.mohan@hpe.com László Sürü laszlo.suru@ericsson.com Len Gao leng@vmware.com +Linhaifeng haifeng.lin@huawei.com Logan Rosen logatronico@gmail.com Luca Falavigna dktrkranz@debian.org Luiz Henrique Ozaki luiz.ozaki@gmail.com diff --git a/Documentation/faq/configuration.rst b/Documentation/faq/configuration.rst index cb2c6b4eca..ff3b71a5d4 100644 --- a/Documentation/faq/configuration.rst +++ b/Documentation/faq/configuration.rst @@ -212,6 +212,19 @@ Q: Does Open vSwitch support ERSPAN? options:erspan_ver=2 options:erspan_dir=1 \ options:erspan_hwid=4 +Q: Does Open vSwitch support IPv6 GRE? + + A: Yes. L2 tunnel interface GRE over IPv6 is supported. + L3 GRE tunnel over IPv6 is not supported. + + :: + + $ ovs-vsctl add-br br0 + $ ovs-vsctl add-port br0 at_gre0 -- \ + set int at_gre0 type=ip6gre \ + options:remote_ip=fc00:100::1 \ + options:packet_type=legacy_l2 + Q: How do I connect two bridges? A: First, why do you want to do this? Two connected bridges are not much diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst index eeb949d4a6..302da72fcd 100644 --- a/Documentation/faq/releases.rst +++ b/Documentation/faq/releases.rst @@ -164,9 +164,9 @@ Q: What DPDK version does each Open vSwitch release work with? A: The following table lists the DPDK version against which the given versions of Open vSwitch will successfully build. - ============ ======= + ============ ======== Open vSwitch DPDK - ============ ======= + ============ ======== 2.2.x 1.6 2.3.x 1.6 2.4.x 2.0 @@ -174,10 +174,10 @@ Q: What DPDK version does each Open vSwitch release work with? 2.6.x 16.07.2 2.7.x 16.11.9 2.8.x 17.05.2 - 2.9.x 17.11.4 - 2.10.x 17.11.4 - 2.11.x 18.11.2 - ============ ======= + 2.9.x 17.11.10 + 2.10.x 17.11.10 + 2.11.x 18.11.9 + ============ ======== Q: Are all the DPDK releases that OVS versions work with maintained? diff --git a/Documentation/internals/mailing-lists.rst b/Documentation/internals/mailing-lists.rst index 33f20277be..e8b3440943 100644 --- a/Documentation/internals/mailing-lists.rst +++ b/Documentation/internals/mailing-lists.rst @@ -93,4 +93,4 @@ security The `security`__ mailing list is for submitting security vulnerabilities to the security team. -__ security@ovs.org +__ security@openvswitch.org diff --git a/Documentation/intro/install/dpdk.rst b/Documentation/intro/install/dpdk.rst index 6e5f1ea60a..510923dcc8 100644 --- a/Documentation/intro/install/dpdk.rst +++ b/Documentation/intro/install/dpdk.rst @@ -42,7 +42,7 @@ Build requirements In addition to the requirements described in :doc:`general`, building Open vSwitch with DPDK will require the following: -- DPDK 18.11.2 +- DPDK 18.11.9 - A `DPDK supported NIC`_ @@ -71,9 +71,9 @@ Install DPDK #. Download the `DPDK sources`_, extract the file and set ``DPDK_DIR``:: $ cd /usr/src/ - $ wget http://fast.dpdk.org/rel/dpdk-18.11.2.tar.xz - $ tar xf dpdk-18.11.2.tar.xz - $ export DPDK_DIR=/usr/src/dpdk-stable-18.11.2 + $ wget http://fast.dpdk.org/rel/dpdk-18.11.9.tar.xz + $ tar xf dpdk-18.11.9.tar.xz + $ export DPDK_DIR=/usr/src/dpdk-stable-18.11.9 $ cd $DPDK_DIR #. (Optional) Configure DPDK as a shared library diff --git a/Documentation/topics/dpdk/bridge.rst b/Documentation/topics/dpdk/bridge.rst index a3ed926ca9..2fae9188a4 100644 --- a/Documentation/topics/dpdk/bridge.rst +++ b/Documentation/topics/dpdk/bridge.rst @@ -74,6 +74,12 @@ OpenFlow14`` option:: $ ovs-ofctl -O OpenFlow14 dump-ports br0 +There are custom statistics that OVS accumulates itself and these stats has +``ovs_`` as prefix. These custom stats are shown along with other stats +using the following command:: + + $ ovs-vsctl get Interface statistics + EMC Insertion Probability ------------------------- diff --git a/Documentation/topics/dpdk/vhost-user.rst b/Documentation/topics/dpdk/vhost-user.rst index 33361ec359..3bd2dc608a 100644 --- a/Documentation/topics/dpdk/vhost-user.rst +++ b/Documentation/topics/dpdk/vhost-user.rst @@ -303,6 +303,31 @@ The default value is false. .. _dpdk-testpmd: +vhost-user-client tx retries config +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +For vhost-user-client interfaces, the max amount of retries can be changed from +the default 8 by setting ``tx-retries-max``. + +The minimum is 0 which means there will be no retries and if any packets in +each batch cannot be sent immediately they will be dropped. The maximum is 32, +which would mean that after the first packet(s) in the batch was sent there +could be a maximum of 32 more retries. + +Retries can help with avoiding packet loss when temporarily unable to send to a +vhost interface because the virtqueue is full. However, spending more time +retrying to send to one interface, will reduce the time available for rx/tx and +processing packets on other interfaces, so some tuning may be required for best +performance. + +Tx retries max can be set for vhost-user-client ports:: + + $ ovs-vsctl set Interface vhost-client-1 options:tx-retries-max=0 + +.. note:: + + Configurable vhost tx retries are not supported with vhost-user ports. + DPDK in the Guest ----------------- @@ -320,9 +345,9 @@ To begin, instantiate a guest as described in :ref:`dpdk-vhost-user` or DPDK sources to VM and build DPDK:: $ cd /root/dpdk/ - $ wget http://fast.dpdk.org/rel/dpdk-18.11.2.tar.xz - $ tar xf dpdk-18.11.2.tar.xz - $ export DPDK_DIR=/root/dpdk/dpdk-stable-18.11.2 + $ wget http://fast.dpdk.org/rel/dpdk-18.11.9.tar.xz + $ tar xf dpdk-18.11.9.tar.xz + $ export DPDK_DIR=/root/dpdk/dpdk-stable-18.11.9 $ export DPDK_TARGET=x86_64-native-linuxapp-gcc $ export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET $ cd $DPDK_DIR @@ -437,6 +462,50 @@ Jumbo Frames DPDK vHost User ports can be configured to use Jumbo Frames. For more information, refer to :doc:`jumbo-frames`. +vhost tx retries +---------------- + +When sending a batch of packets to a vhost-user or vhost-user-client interface, +it may happen that some but not all of the packets in the batch are able to be +sent to the guest. This is often because there is not enough free descriptors +in the virtqueue for all the packets in the batch to be sent. In this case +there will be a retry, with a default maximum of 8 occurring. If at any time no +packets can be sent, it may mean the guest is not accepting packets, so there +are no (more) retries. + +For information about configuring the maximum amount of tx retries for +vhost-user-client interfaces see `vhost-user-client tx retries config`_. + +.. note:: + + Maximum vhost tx batch size is defined by NETDEV_MAX_BURST, and is currently + as 32. + +Tx Retries may be reduced or even avoided by some external configuration, such +as increasing the virtqueue size through the ``rx_queue_size`` parameter +introduced in QEMU 2.7.0 / libvirt 2.3.0:: + + + + + + +
+ + +The guest application will also need need to provide enough descriptors. For +example with ``testpmd`` the command line argument can be used:: + + --rxd=1024 --txd=1024 + +The guest should also have sufficient cores dedicated for consuming and +processing packets at the required rate. + +The amount of Tx retries on a vhost-user or vhost-user-client interface can be +shown with:: + + $ ovs-vsctl get Interface dpdkvhostclient0 statistics:ovs_tx_retries + vhost-user Dequeue Zero Copy (experimental) ------------------------------------------- diff --git a/NEWS b/NEWS index f177d7efc1..cd0c889c10 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,12 @@ +v2.11.4 - xx xxx xxxx +--------------------- + - DPDK + * OVS validated with DPDK 18.11.9. Due to this being the latest LTS to + be validated and coupled with the inclusion of fixes for + CVE-2019-14818, CVE-2020-10722, CVE-2020-10723 and CVE-2020-10724 + over the course of various LTS releases, this DPDK version is strongly + recommended to be used. + v2.11.3 - 06 Sep 2019 --------------------- - Fix compilation issue with Ubuntu kernel 4.15.60. diff --git a/acinclude.m4 b/acinclude.m4 index f15b1ff670..43c0e79262 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -172,16 +172,30 @@ AC_DEFUN([OVS_CHECK_LINUX], [ AM_CONDITIONAL(LINUX_ENABLED, test -n "$KBUILD") ]) +dnl OVS_CHECK_LINUX_NETLINK +dnl +dnl Configure Linux netlink compat. +AC_DEFUN([OVS_CHECK_LINUX_NETLINK], [ + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([#include ], [ + struct nla_bitfield32 x = { 0 }; + ])], + [AC_DEFINE([HAVE_NLA_BITFIELD32], [1], + [Define to 1 if struct nla_bitfield32 is available.])]) +]) + dnl OVS_CHECK_LINUX_TC dnl dnl Configure Linux tc compat. AC_DEFUN([OVS_CHECK_LINUX_TC], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([#include ], [ - int x = TCA_FLOWER_KEY_ENC_IP_TTL_MASK; + int x = TCA_ACT_FLAGS; ])], - [AC_DEFINE([HAVE_TCA_FLOWER_KEY_ENC_IP_TTL_MASK], [1], - [Define to 1 if TCA_FLOWER_KEY_ENC_IP_TTL_MASK is available.])]) + [AC_DEFINE([HAVE_TCA_ACT_FLAGS], [1], + [Define to 1 if TCA_ACT_FLAGS is available.])]) + + AC_CHECK_MEMBERS([struct tcf_t.firstuse], [], [], [#include ]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([#include ], [ @@ -967,6 +981,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ [OVS_DEFINE([HAVE_NF_CONNTRACK_IN_TAKES_NF_HOOK_STATE])]) OVS_GREP_IFELSE([$KSRC/include/net/ipv6_frag.h], [IP6_DEFRAG_CONNTRACK_IN], [OVS_DEFINE([HAVE_IPV6_FRAG_H])]) + OVS_GREP_IFELSE([$KSRC/include/net/dst_ops.h], [bool confirm_neigh], + [OVS_DEFINE([HAVE_DST_OPS_CONFIRM_NEIGH])]) if cmp -s datapath/linux/kcompat.h.new \ datapath/linux/kcompat.h >/dev/null 2>&1; then diff --git a/configure.ac b/configure.ac index 45ff8cb07e..e64c4ceb35 100644 --- a/configure.ac +++ b/configure.ac @@ -13,7 +13,7 @@ # limitations under the License. AC_PREREQ(2.63) -AC_INIT(openvswitch, 2.11.3, bugs@openvswitch.org) +AC_INIT(openvswitch, 2.11.4, bugs@openvswitch.org) AC_CONFIG_SRCDIR([datapath/datapath.c]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR([build-aux]) @@ -185,6 +185,7 @@ OVS_CTAGS_IDENTIFIERS AC_ARG_VAR(KARCH, [Kernel Architecture String]) AC_SUBST(KARCH) OVS_CHECK_LINUX +OVS_CHECK_LINUX_NETLINK OVS_CHECK_LINUX_TC OVS_CHECK_DPDK OVS_CHECK_PRAGMA_MESSAGE diff --git a/datapath/linux/compat/include/linux/openvswitch.h b/datapath/linux/compat/include/linux/openvswitch.h index 9b087f1b06..3369c8630d 100644 --- a/datapath/linux/compat/include/linux/openvswitch.h +++ b/datapath/linux/compat/include/linux/openvswitch.h @@ -404,6 +404,28 @@ enum ovs_tunnel_key_attr { #define OVS_TUNNEL_KEY_ATTR_MAX (__OVS_TUNNEL_KEY_ATTR_MAX - 1) +/** + * enum xlate_error - Different types of error during translation + */ + +#ifndef __KERNEL__ +enum xlate_error { + XLATE_OK = 0, + XLATE_BRIDGE_NOT_FOUND, + XLATE_RECURSION_TOO_DEEP, + XLATE_TOO_MANY_RESUBMITS, + XLATE_STACK_TOO_DEEP, + XLATE_NO_RECIRCULATION_CONTEXT, + XLATE_RECIRCULATION_CONFLICT, + XLATE_TOO_MANY_MPLS_LABELS, + XLATE_INVALID_TUNNEL_METADATA, + XLATE_UNSUPPORTED_PACKET_TYPE, + XLATE_CONGESTION_DROP, + XLATE_FORWARDING_DISABLED, + XLATE_MAX, +}; +#endif + /** * enum ovs_frag_type - IPv4 and IPv6 fragment type * @OVS_FRAG_TYPE_NONE: Packet is not a fragment. @@ -855,6 +877,24 @@ enum ovs_nat_attr { #define OVS_NAT_ATTR_MAX (__OVS_NAT_ATTR_MAX - 1) +/* + * enum ovs_check_pkt_len_attr - Attributes for %OVS_ACTION_ATTR_CHECK_PKT_LEN. + * + * @OVS_CHECK_PKT_LEN_ATTR_PKT_LEN: u16 Packet length to check for. + * @OVS_CHECK_PKT_LEN_ATTR_USERSPACE_COND: u8 comparison condition to send + * the packet to userspace. One of OVS_CHECK_PKT_LEN_COND_*. + * @OVS_CHECK_PKT_LEN_ATTR_USERPACE - Nested OVS_USERSPACE_ATTR_* actions. + */ +enum ovs_check_pkt_len_attr { + OVS_CHECK_PKT_LEN_ATTR_UNSPEC, + OVS_CHECK_PKT_LEN_ATTR_PKT_LEN, + OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_GREATER, + OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_LESS_EQUAL, + __OVS_CHECK_PKT_LEN_ATTR_MAX, +}; + +#define OVS_CHECK_PKT_LEN_ATTR_MAX (__OVS_CHECK_PKT_LEN_ATTR_MAX - 1) + /** * enum ovs_action_attr - Action types. * @@ -911,6 +951,10 @@ enum ovs_nat_attr { * packet, or modify the packet (e.g., change the DSCP field). * @OVS_ACTION_ATTR_CLONE: make a copy of the packet and execute a list of * actions without affecting the original packet and key. + * @OVS_ACTION_ATTR_CHECK_PKT_LEN: Check the packet length and execute a set + * of actions if greater than the specified packet length, else execute + * another set of actions. + * @OVS_ACTION_ATTR_DROP: Explicit drop action. */ enum ovs_action_attr { @@ -938,10 +982,12 @@ enum ovs_action_attr { OVS_ACTION_ATTR_POP_NSH, /* No argument. */ OVS_ACTION_ATTR_METER, /* u32 meter number. */ OVS_ACTION_ATTR_CLONE, /* Nested OVS_CLONE_ATTR_*. */ + OVS_ACTION_ATTR_CHECK_PKT_LEN, /* Nested OVS_CHECK_PKT_LEN_ATTR_*. */ #ifndef __KERNEL__ OVS_ACTION_ATTR_TUNNEL_PUSH, /* struct ovs_action_push_tnl*/ OVS_ACTION_ATTR_TUNNEL_POP, /* u32 port number. */ + OVS_ACTION_ATTR_DROP, /* u32 xlate_error. */ #endif __OVS_ACTION_ATTR_MAX, /* Nothing past this will be accepted * from userspace. */ diff --git a/datapath/linux/compat/ip6_gre.c b/datapath/linux/compat/ip6_gre.c index 2ffdda5e1d..aa6cf3e7fc 100644 --- a/datapath/linux/compat/ip6_gre.c +++ b/datapath/linux/compat/ip6_gre.c @@ -1196,7 +1196,11 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb, /* TooBig packet may have updated dst->dev's mtu */ if (!t->parms.collect_md && dst && dst_mtu(dst) > dst->dev->mtu) +#ifndef HAVE_DST_OPS_CONFIRM_NEIGH dst->ops->update_pmtu(dst, NULL, skb, dst->dev->mtu); +#else + dst->ops->update_pmtu(dst, NULL, skb, dst->dev->mtu, false); +#endif err = ip6_tnl_xmit(skb, dev, dsfield, &fl6, encap_limit, &mtu, NEXTHDR_GRE); @@ -2550,7 +2554,7 @@ static struct rtnl_link_ops ip6gre_link_ops __read_mostly = { }; static struct rtnl_link_ops ip6gre_tap_ops __read_mostly = { - .kind = "ip6gre", + .kind = "ip6gretap", .maxtype = RPL_IFLA_GRE_MAX, .policy = ip6gre_policy, .priv_size = sizeof(struct ip6_tnl), diff --git a/datapath/linux/compat/ip_tunnel.c b/datapath/linux/compat/ip_tunnel.c index d16e60fbfe..f1c8ba7cdc 100644 --- a/datapath/linux/compat/ip_tunnel.c +++ b/datapath/linux/compat/ip_tunnel.c @@ -266,7 +266,12 @@ static int rpl_tnl_update_pmtu(struct net_device *dev, struct sk_buff *skb, mtu = skb_dst(skb) ? dst_mtu(skb_dst(skb)) : dev->mtu; if (skb_dst(skb)) +#ifndef HAVE_DST_OPS_CONFIRM_NEIGH skb_dst(skb)->ops->update_pmtu(skb_dst(skb), NULL, skb, mtu); +#else + skb_dst(skb)->ops->update_pmtu(skb_dst(skb), + NULL, skb, mtu, false); +#endif if (skb->protocol == htons(ETH_P_IP)) { if (!skb_is_gso(skb) && diff --git a/debian/changelog b/debian/changelog index d08cfbfd91..56471d417a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +openvswitch (2.11.4-1) unstable; urgency=low + [ Open vSwitch team ] + * New upstream version + + -- Open vSwitch team Fri, 06 Sep 2019 14:31:36 -0700 + openvswitch (2.11.3-1) unstable; urgency=low [ Open vSwitch team ] * New upstream version diff --git a/dpdk/app/test-crypto-perf/main.c b/dpdk/app/test-crypto-perf/main.c index 921394799a..8affc5dc95 100644 --- a/dpdk/app/test-crypto-perf/main.c +++ b/dpdk/app/test-crypto-perf/main.c @@ -544,7 +544,8 @@ main(int argc, char **argv) goto err; } - if (!opts.silent) + if (!opts.silent && opts.test != CPERF_TEST_TYPE_THROUGHPUT && + opts.test != CPERF_TEST_TYPE_LATENCY) show_test_vector(t_vec); total_nb_qps = nb_cryptodevs * opts.nb_qps; diff --git a/dpdk/app/test-eventdev/test_pipeline_common.c b/dpdk/app/test-eventdev/test_pipeline_common.c index c988da28c9..b586804090 100644 --- a/dpdk/app/test-eventdev/test_pipeline_common.c +++ b/dpdk/app/test-eventdev/test_pipeline_common.c @@ -366,12 +366,16 @@ pipeline_event_tx_adapter_setup(struct evt_options *opt, if (!(cap & RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT)) { uint32_t service_id; - rte_event_eth_tx_adapter_service_id_get(consm, - &service_id); + ret = rte_event_eth_tx_adapter_service_id_get(consm, + &service_id); + if (ret != -ESRCH && ret != 0) { + evt_err("Failed to get Tx adptr service ID"); + return ret; + } ret = evt_service_setup(service_id); if (ret) { evt_err("Failed to setup service core" - " for Tx adapter\n"); + " for Tx adapter"); return ret; } } diff --git a/dpdk/app/test-pmd/Makefile b/dpdk/app/test-pmd/Makefile index d5258eae4a..f36137fd44 100644 --- a/dpdk/app/test-pmd/Makefile +++ b/dpdk/app/test-pmd/Makefile @@ -15,6 +15,12 @@ CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) CFLAGS += -Wno-deprecated-declarations +ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) +ifeq ($(shell test $(GCC_VERSION) -ge 100 && echo 1), 1) +CFLAGS += -fcommon +endif +endif + # # all source are stored in SRCS-y # diff --git a/dpdk/app/test-pmd/cmdline.c b/dpdk/app/test-pmd/cmdline.c index 26295130c5..abf803418c 100644 --- a/dpdk/app/test-pmd/cmdline.c +++ b/dpdk/app/test-pmd/cmdline.c @@ -101,7 +101,7 @@ static void cmd_help_brief_parsed(__attribute__((unused)) void *parsed_result, " help ports : Configuring ports.\n" " help registers : Reading and setting port registers.\n" " help filters : Filters configuration help.\n" - " help traffic_management : Traffic Management commmands.\n" + " help traffic_management : Traffic Management commands.\n" " help all : All of the above sections.\n\n" ); @@ -4932,7 +4932,7 @@ cmd_gso_size_parsed(void *parsed_result, if (test_done == 0) { printf("Before setting GSO segsz, please first" - " stop fowarding\n"); + " stop forwarding\n"); return; } @@ -16459,8 +16459,10 @@ cmd_ddp_get_list_parsed( #ifdef RTE_LIBRTE_I40E_PMD size = PROFILE_INFO_SIZE * MAX_PROFILE_NUM + 4; p_list = (struct rte_pmd_i40e_profile_list *)malloc(size); - if (!p_list) + if (!p_list) { printf("%s: Failed to malloc buffer\n", __func__); + return; + } if (ret == -ENOTSUP) ret = rte_pmd_i40e_get_ddp_list(res->port_id, diff --git a/dpdk/app/test-pmd/config.c b/dpdk/app/test-pmd/config.c index 6e9a2042c2..0e5d77159d 100644 --- a/dpdk/app/test-pmd/config.c +++ b/dpdk/app/test-pmd/config.c @@ -204,11 +204,26 @@ nic_stats_display(portid_t port_id) void nic_stats_clear(portid_t port_id) { + int ret; + if (port_id_is_invalid(port_id, ENABLED_WARN)) { print_valid_ports(); return; } - rte_eth_stats_reset(port_id); + + ret = rte_eth_stats_reset(port_id); + if (ret != 0) { + printf("%s: Error: failed to reset stats (port %u): %s", + __func__, port_id, strerror(ret)); + return; + } + + ret = rte_eth_stats_get(port_id, &ports[port_id].stats); + if (ret != 0) { + printf("%s: Error: failed to get stats (port %u): %s", + __func__, port_id, strerror(ret)); + return; + } printf("\n NIC statistics for port %d cleared\n", port_id); } @@ -278,11 +293,20 @@ nic_xstats_display(portid_t port_id) void nic_xstats_clear(portid_t port_id) { + int ret; + if (port_id_is_invalid(port_id, ENABLED_WARN)) { print_valid_ports(); return; } rte_eth_xstats_reset(port_id); + + ret = rte_eth_stats_get(port_id, &ports[port_id].stats); + if (ret != 0) { + printf("%s: Error: failed to get stats (port %u): %s", + __func__, port_id, strerror(ret)); + return; + } } void diff --git a/dpdk/app/test-pmd/csumonly.c b/dpdk/app/test-pmd/csumonly.c index 46eb52d5b8..b0d528d98c 100644 --- a/dpdk/app/test-pmd/csumonly.c +++ b/dpdk/app/test-pmd/csumonly.c @@ -138,21 +138,23 @@ parse_ipv6(struct ipv6_hdr *ipv6_hdr, struct testpmd_offload_info *info) /* * Parse an ethernet header to fill the ethertype, l2_len, l3_len and - * ipproto. This function is able to recognize IPv4/IPv6 with one optional vlan - * header. The l4_len argument is only set in case of TCP (useful for TSO). + * ipproto. This function is able to recognize IPv4/IPv6 with optional VLAN + * headers. The l4_len argument is only set in case of TCP (useful for TSO). */ static void parse_ethernet(struct ether_hdr *eth_hdr, struct testpmd_offload_info *info) { struct ipv4_hdr *ipv4_hdr; struct ipv6_hdr *ipv6_hdr; + struct vlan_hdr *vlan_hdr; info->l2_len = sizeof(struct ether_hdr); info->ethertype = eth_hdr->ether_type; - if (info->ethertype == _htons(ETHER_TYPE_VLAN)) { - struct vlan_hdr *vlan_hdr = (struct vlan_hdr *)(eth_hdr + 1); - + while (info->ethertype == _htons(ETHER_TYPE_VLAN) || + info->ethertype == _htons(ETHER_TYPE_QINQ)) { + vlan_hdr = (struct vlan_hdr *) + ((char *)eth_hdr + info->l2_len); info->l2_len += sizeof(struct vlan_hdr); info->ethertype = vlan_hdr->eth_proto; } diff --git a/dpdk/app/test-pmd/meson.build b/dpdk/app/test-pmd/meson.build index 6006c60f99..adeeeeedba 100644 --- a/dpdk/app/test-pmd/meson.build +++ b/dpdk/app/test-pmd/meson.build @@ -5,6 +5,11 @@ name = 'testpmd' allow_experimental_apis = true cflags += '-Wno-deprecated-declarations' + +if (toolchain == 'gcc' and cc.version().version_compare('>=10.0.0')) + cflags += '-fcommon' +endif + sources = files('cmdline.c', 'cmdline_flow.c', 'cmdline_mtr.c', diff --git a/dpdk/app/test-pmd/parameters.c b/dpdk/app/test-pmd/parameters.c index 4d5e28970c..57028c313f 100644 --- a/dpdk/app/test-pmd/parameters.c +++ b/dpdk/app/test-pmd/parameters.c @@ -52,7 +52,7 @@ static void usage(char* progname) { - printf("usage: %s " + printf("usage: %s [EAL options] -- " #ifdef RTE_LIBRTE_CMDLINE "[--interactive|-i] " "[--cmdline-file=FILENAME] " diff --git a/dpdk/app/test-pmd/testpmd.c b/dpdk/app/test-pmd/testpmd.c index a910c06dc2..a32eae750c 100644 --- a/dpdk/app/test-pmd/testpmd.c +++ b/dpdk/app/test-pmd/testpmd.c @@ -2500,7 +2500,7 @@ check_all_ports_link_status(uint32_t port_mask) "Port%d Link Up. speed %u Mbps- %s\n", portid, link.link_speed, (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? - ("full-duplex") : ("half-duplex\n")); + ("full-duplex") : ("half-duplex")); else printf("Port %d Link Down\n", portid); continue; @@ -2934,6 +2934,8 @@ get_eth_dcb_conf(portid_t pid, struct rte_eth_conf *eth_conf, struct rte_eth_dcb_tx_conf *tx_conf = ð_conf->tx_adv_conf.dcb_tx_conf; + memset(&rss_conf, 0, sizeof(struct rte_eth_rss_conf)); + rc = rte_eth_dev_rss_hash_conf_get(pid, &rss_conf); if (rc != 0) return rc; diff --git a/dpdk/config/meson.build b/dpdk/config/meson.build index 616af97466..88742ce9db 100644 --- a/dpdk/config/meson.build +++ b/dpdk/config/meson.build @@ -111,6 +111,10 @@ warning_flags = [ '-Wcast-qual', '-Wno-address-of-packed-member' ] +if cc.get_id() == 'gcc' and cc.version().version_compare('>=10.0') +# FIXME: Bugzilla 396 + warning_flags += '-Wno-zero-length-bounds' +endif if not dpdk_conf.get('RTE_ARCH_64') # for 32-bit, don't warn about casting a 32-bit pointer to 64-bit int - it's fine!! warning_flags += '-Wno-pointer-to-int-cast' diff --git a/dpdk/devtools/check-symbol-change.sh b/dpdk/devtools/check-symbol-change.sh index f6f79a883b..2d4f05fdd2 100755 --- a/dpdk/devtools/check-symbol-change.sh +++ b/dpdk/devtools/check-symbol-change.sh @@ -17,13 +17,11 @@ build_map_changes() # map files are altered, and all section/symbol names # appearing between a triggering of this rule and the # next trigger of this rule are associated with this file - /[-+] a\/.*\.map/ {map=$2; in_map=1} + /[-+] [ab]\/.*\.map/ {map=$2; in_map=1; next} - # Same pattern as above, only it matches on anything that - # does not end in 'map', indicating we have left the map chunk. - # When we hit this, turn off the in_map variable, which - # supresses the subordonate rules below - /[-+] a\/.*\.[^map]/ {in_map=0} + # The previous rule catches all .map files, anything else + # indicates we left the map chunk. + /[-+] [ab]\// {in_map=0} # Triggering this rule, which starts a line and ends it # with a { identifies a versioned section. The section name is diff --git a/dpdk/devtools/checkpatches.sh b/dpdk/devtools/checkpatches.sh index c471731d45..acff1843af 100755 --- a/dpdk/devtools/checkpatches.sh +++ b/dpdk/devtools/checkpatches.sh @@ -56,6 +56,14 @@ check_forbidden_additions() { # -f $(dirname $(readlink -e $0))/check-forbidden-tokens.awk \ "$1" || res=1 + # links must prefer https over http + awk -v FOLDERS='doc' \ + -v EXPRESSIONS='http://.*dpdk.org' \ + -v RET_ON_FAIL=1 \ + -v MESSAGE='Using non https link to dpdk.org' \ + -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ + "$1" || res=1 + return $res } diff --git a/dpdk/doc/api/doxy-api-index.md b/dpdk/doc/api/doxy-api-index.md index e27874c5ae..a380f44fbd 100644 --- a/dpdk/doc/api/doxy-api-index.md +++ b/dpdk/doc/api/doxy-api-index.md @@ -1,4 +1,4 @@ -API {#index} +API ===