summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Remove duplicate include fileYi Li2020-09-222-1/+1
| | | | | | | Found by checkincludes.pl Signed-off-by: Yi Li <yili@winhong.com> Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
* ovs-lib: Handle daemon segfaults during exit.Gurucharan Shetty2020-09-211-1/+17
| | | | | | | | | | | | | | | | | | | | | | Currently, we terminate a daemon by trying "ovs-appctl exit", "SIGTERM" and finally "SIGKILL". But the logic fails if during "ovs-appctl exit", the daemon crashes (segfaults). The monitor will automatically restart the daemon with a new pid. The current logic of checking the non-existance of old pid succeeds and we proceed with the assumption that the daemon is dead. This is a problem during OVS upgrades as we will continue to run the older version of OVS. With this commit, we take care of this situation. If there is a segfault, the pidfile is not deleted. So, we wait a little to give time for the monitor to restart the daemon (which is usually instantaneous) and then re-read the pidfile. VMware-BZ: #2633995 Signed-off-by: Gurucharan Shetty <guru@ovn.org> Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>
* AUTHORS: Add Boleslaw Tokarski.Ilya Maximets2020-09-161-0/+1
| | | | Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* ipsec: Fix Strongswan configuration syntax.Boleslaw Tokarski2020-09-161-4/+12
| | | | | | | | | | | | | | | | | | | | Strongswan seems to have .opt files in the source tree with the dotted option syntax. It seems that up until version 5.6, the syntax was also accepted by Strongswan. However, the .opt files are converted to .conf files during Strongswan build, and the dotted syntax is no longer accepted by Strongswan (tested on 5.8.2). The effect was that the ovs ipsec monitor fails to start Strongswan, since that complains with: /etc/strongswan.d/ovs.conf:4: syntax error, unexpected ., expecting : or '{' or '=' [.] This commit fixes the configuration file provided to Strongswan to .conf syntax. Signed-off-by: Boleslaw Tokarski <boleslaw.tokarski@jollamobile.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* cirrus: Use FreeBSD 11.4.Ilya Maximets2020-09-161-1/+1
| | | | | | | | Support cycle of 11.3 ends in the end of September 2020, so we need to upgrade. Signed-off-by: Ilya Maximets <i.maximets@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com>
* selinux: Add missing permissions for ovs-kmod-ctl.Yi-Hung Wei2020-09-161-0/+2
| | | | | | | | | | | | | | | | | | | | | | | On RHEL 8, a SELinux policy is missing when ovs-kmod-ctl use modprobe to load kernel modules. This patch adds the missing permissions based on /var/log/audit/audit.log Example log of the AVC violations: type=AVC msg=audit(1599075387.136:65): avc: denied { read } for pid=1472 comm="modprobe" name="modules.alias.bin" dev="dm-0" ino=586629 scontext=system_u:system_r:openvswitch_load_module_t:s0 tcontext=system_u:object_r:modules_dep_t:s0 tclass=file permissive=0 type=AVC msg=audit(1599085253.148:45): avc: denied { open } for pid=1355 comm="modprobe" path="/usr/lib/modules/4.18.0-193.el8.x86_64/modules.dep.bin" dev="dm-0" ino=624258 scontext=system_u:system_r:openvswitch_load_module_t:s0 tcontext=unconfined_u:object_r:modules_dep_t:s0 tclass=file permissive=0 VMWare-BZ: #2633569 Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Acked-by: Greg Rose <gvrose8192@gmail.com> Acked-by: Ansis Atteka <aatteka@ovn.org> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* Remove manpages.mk from git.Timothy Redaelli2020-09-163-268/+4
| | | | | | | | | manpages.mk is generated at build-time using sodepends.py and so there is no need to keep it in git. Signed-off-by: Timothy Redaelli <tredaelli@redhat.com> Acked-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* ovsdb: Add unixctl command to show storage status.Dumitru Ceara2020-09-164-0/+53
| | | | | | | | | | | | | | | | | | | | | | | If a database enters an error state, e.g., in case of RAFT when reading the DB file contents if applying the RAFT records triggers constraint violations, there's no way to determine this unless a client generates a write transaction. Such write transactions would fail with "ovsdb-error: inconsistent data". This commit adds a new command to show the status of the storage that's backing a database. Example, on an inconsistent database: $ ovs-appctl -t /tmp/test.ctl ovsdb-server/get-db-storage-status DB status: ovsdb error: inconsistent data Example, on a consistent database: $ ovs-appctl -t /tmp/test.ctl ovsdb-server/get-db-storage-status DB status: ok Signed-off-by: Dumitru Ceara <dceara@redhat.com> Acked-by: Han Zhou <hzhou@ovn.org> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* ovsdb-tool: Add a db consistency check to the ovsdb-tool check-cluster command.Federico Paolinelli2020-09-161-0/+38
| | | | | | | | | | | | | | | | | | There are some occurrences where the database ends up in an inconsistent state. This happened in ovn-k8s and is described in [0]. Here we are adding a supported way to check that a given db is consistent, which is less error prone than checking the logs. Tested against both a valid db and a corrupted db attached to the above bug [1]. Also, tested with a fresh db that did not do a snapshot. [0]: https://bugzilla.redhat.com/show_bug.cgi?id=1837953#c23 [1]: https://bugzilla.redhat.com/attachment.cgi?id=1697595 Signed-off-by: Federico Paolinelli <fpaoline@redhat.com> Suggested-by: Dumitru Ceara <dceara@redhat.com> Acked-by: Dumitru Ceara <dceara@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* netdev-dpdk: Don't set rx mq mode for net_virtio.Jaime Caamaño Ruiz2020-09-151-1/+8
| | | | | | | | | | | Since DPDK 19.11 [1], it is not allowed to set any RX mq mode for virtio driver. [1] https://github.com/DPDK/dpdk/commit/13b3137f3b7c8f866947a9b34e06a8aec0d084f7 Signed-off-by: Jaime Caamaño Ruiz <jcaamano@suse.com> Acked-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* rhel: Fix reload of OVS_USER_ID on startup.Jaime Caamaño Ruiz2020-09-151-2/+8
| | | | | | | | | | | | | | | | | OVS_USER_ID was being picked up from a previously existing openvswitch.useropts rendering innefective any configuration change through sysconfig. There is no ordering between Exec* and Environment* stanzas of systemd, full Enviroment* is always loaded before each Exec*. We make sure that openvswitch.useropts is removed in a first Exec so that a fresh OVS_USER_ID can be picked up from config in successive Exec*. Fixes: 94e1e8b ("rhel: run ovn with the same user as ovs") Signed-off-by: Jaime Caamaño Ruiz <jcaamano@suse.com> Acked-by: Greg Rose <gvrose8192@gmail.com> Acked-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* classifier: Fix use of uninitialized value.William Tu2020-09-151-0/+1
| | | | | | | | | | Coverity reports use of uninitialized value of cursor. This happens in cls_cursor_start(), when rule is false, cursor.subtable is uninitialized. CID 279324. Signed-off-by: William Tu <u9012063@gmail.com> Reviewed-by: Greg Rose <gvrose8192@gmail.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* userspace-tso: Document the minimum kernel version.Flavio Leitner2020-09-151-0/+6
| | | | | | | | | | | The kernel needs to be at least 4.19-rc7 to include the commit 9d2f67e43b73 ("net/packet: fix packet drop as of virtio gso") otherwise the TSO packets are dropped when using raw sockets. Fixes: 29cf9c1b3b9c ("userspace: Add TCP Segmentation Offload support") Reported-by: Yi Yang <yangyi01@inspur.com> Signed-off-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* rhel: Fix logrotate group when dpdk is enabled.Jaime Caamaño Ruiz2020-09-151-9/+10
| | | | | | | | Otherwise logrotate will fail to generate the rotated log files. Signed-off-by: Jaime Caamaño Ruiz <jcaamano@suse.com> Acked-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* Documentation: Correct claims about Debian packaging.Ben Pfaff2020-09-151-2/+5
| | | | | | | | | | | The documentation reported the union of all possible Debian- and Debian-derived packaging. This isn't realistic: there are differences between OVS upstream, Debian downstream, and Ubuntu downstream. This commit distinguishes them. Reported-by: Ravi Kerur <rkerur@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* ovsdb-idl.at: Wait all servers to join the cluster.Flavio Leitner2020-09-091-21/+31
| | | | | | | | | | | | | | The test 'Check Python IDL reconnects to leader - Python3 (leader only)' fails sometimes when the first ovsdb-server gets killed before the others had joined the cluster. Fix the function ovsdb_cluster_start_idltest to wait them to join the cluster. Fixes: c39751e44539 ("python: Monitor Database table to manage lifecycle of IDL client.") Co-authored-by:: Ilya Maximets <i.maximets@ovn.org> Signed-off-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* AUTHORS: update email for Mark GrayMark Gray2020-09-082-1/+2
| | | | | | | Update email address for Mark Gray Signed-off-by: Mark Gray <mark.d.gray@redhat.com> Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
* travis: Merge matrix entries.Ilya Maximets2020-08-261-3/+0
| | | | | | | | | It's not possible to use 'matrix' twice. This makes travis to use the latest one dropping all the osx and arm64 jobs. Fixes: 00d3374d8d54 ("travis: Test build of debian packages.") Acked-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* ovs-dpctl-top: Skip "eth()" element.Timothy Redaelli2020-08-261-0/+2
| | | | | | | | | | | | | | With commit efde188622ae ("odp-util: Print eth() for Ethernet flows if packet_type is absent.") "eth()" is printed for Ethernet flows if packet_type is absent, but this broke "ovs-dpctl-top" since it expects that every element has a value. This commit skips the parsing of the empty "eth()" element. Fixes: efde188622ae ("odp-util: Print eth() for Ethernet flows if packet_type is absent.") Signed-off-by: Timothy Redaelli <tredaelli@redhat.com> Acked-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* meta-flow: fix a typo in "MPLS Bottom of Stack Field" paragraph.Timothy Redaelli2020-08-261-4/+4
| | | | | | | | | | | | | | | | | | | | In the ovs-fields.7 manual page, the "MPLS Bottom of Stack Field" paragraph says: * When mpls_bos is 1, there is another MPLS label following this one, so the Ethertype passed to pop_mpls should be an MPLS Ethertype. [...] * When mpls_bos is 0, this MPLS label is the last one, so the Ethertype passed to pop_mpls should be a non-MPLS Ethertype such as IPv4. [...] The values 0 and 1 have been swapped: when BOS is 1, then no more label stack entries follows. Fixes: 96fee5e0a2a0 ("ovs-fields: New manpage to document Open vSwitch and OpenFlow fields.") Reported-at: https://bugzilla.redhat.com/1842032 Reported-by: Guillaume Nault <gnault@redhat.com> Signed-off-by: Timothy Redaelli <tredaelli@redhat.com> Acked-by: Greg Rose <gvrose8192@gmail.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* python: Fixup python shebangs to python3.Greg Rose2020-08-2613-23/+52
| | | | | | | | | | | | | | | | | | Builds on RHEL 8.2 systems are failing due to this issue. See [1] as to why this is necessary. I used the following command to identify files that need this fix: find . -type f -executable | /usr/lib/rpm/redhat/brp-mangle-shebangs I also updated the copyright notices as needed. 1. https://fedoraproject.org/wiki/Changes/Make_ambiguous_python_shebangs_error Fixes: 1ca0323e7c29 ("Require Python 3 and remove support for Python 2.") Signed-off-by: Greg Rose <gvrose8192@gmail.com> Acked-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* test-conntrack: Fix conntrack benchmark by clearing conntrack metadata.Ilya Maximets2020-08-261-0/+4
| | | | | | | | | | | | | | | | | | | | | Packets in the benchmark must be treated as new packets, i.e. they should not have conntrack metadata set. Current code will set up 'pkt->md.conn' after the first run and all subsequent calls will hit the 'fast' processing that is intended for recirculated packets making a false impression that current conntrack implementation is lightning fast. Before the change: $ ./ovstest test-conntrack benchmark 4 33554432 32 1 conntrack: 1059 ms After (correct): $ ./ovstest test-conntrack benchmark 4 33554432 32 1 conntrack: 92785 ms Fixes: 594570ea1cde ("conntrack: Optimize recirculations.") Signed-off-by: Ilya Maximets <i.maximets@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com>
* travis: Test build of debian packages.Ilya Maximets2020-08-263-0/+29
| | | | | | | | | | | | | | | | | | | | | We had a lot of issues with debian packaging lately. This job will check build and installation of debian packages to avoid most of such issues in the future. Installing only minimal set of tools, most of dependencies will be installed according to package description, this way we will check if we have all required dependencies listed. Not trying to install openvswitch-ipsec package as there is an issue that python from the pyenv for some reason doesn't see ovs packages installed from python3-openvswitch, i.e. ipsec service is not able to start. Tests are skipped because they are tested in many other scenarios. No need to waste time. Signed-off-by: Ilya Maximets <i.maximets@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com>
* Set release date for 2.14.0.Ilya Maximets2020-08-172-2/+2
| | | | | | Acked-by: Ian Stokes <ian.stokes@intel.com> Acked-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* connmgr: Support changing openflow versions without restarting.Aaron Conole2020-08-172-8/+34
| | | | | | | | | | | | | | | | | | | | When commit a0baa7dfa4fe ("connmgr: Make treatment of active and passive connections more uniform") was applied, it did not take into account that a reconfiguration of the allowed_versions setting would require a reload of the ofservice object (only accomplished via a restart of OvS). For now, during the reconfigure cycle, we delete the ofservice object and then recreate it immediately. A new test is added to ensure we do not break this behavior again. Fixes: a0baa7dfa4fe ("connmgr: Make treatment of active and passive connections more uniform") Suggested-by: Ben Pfaff <blp@ovn.org> Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1782834 Signed-off-by: Aaron Conole <aconole@redhat.com> Acked-by: Flavio Leitner <fbl@sysclose.org> Acked-by: Numan Siddique <numans@ovn.org> Tested-by: Numan Siddique <numans@ovn.org> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* ovs-monitor-ipsec: Convert Python2 code to Python3.lzhecheng2020-08-172-11/+12
| | | | | | | | Submitted-at: https://github.com/openvswitch/ovs/pull/331 Reported-at: https://github.com/openvswitch/ovs-issues/issues/192 Fixes: 1ca0323e7c29 ("Require Python 3 and remove support for Python 2.") Signed-off-by: lzhecheng <lzhecheng@vmware.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* netdev-offload-dpdk: Fix for broken ethernet matching HWOL for XL710NIC.Emma Finn2020-08-171-3/+16
| | | | | | | | | | | | | This patch introduces a temporary work around to fix partial hardware offload for XL710 devices. Currently the incorrect ethernet pattern is being set. This patch will be removed once this issue is fixed within the i40e PMD. Signed-off-by: Emma Finn <emma.finn@intel.com> Signed-off-by: Eli Britstein <elibr@nvidia.com> Co-authored-by: Eli Britstein <elibr@nvidia.com> Tested-by: Ian Stokes <ian.stokes@intel.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* Revert "ovsdb-idl: Fix NULL deref reported by Coverity."Han Zhou2020-08-121-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 68bc6f88a3a36549fcd3b6248c25c5e2e6deb8f3. The commit causes a regression in OVN scale test. ovn-northd's CPU more than doubled for the test scenario: create and bind 12k ports. Below are some perf data of ovn-northd when running command: ovn-nbctl --wait=sb sync Before reverting this commit: - 92.42% 0.62% ovn-northd ovn-northd [.] main - 91.80% main + 68.93% ovn_db_run (inlined) + 22.45% ovsdb_idl_loop_commit_and_wait After reverting this commit: - 92.84% 0.60% ovn-northd ovn-northd [.] main - 92.24% main + 92.03% ovn_db_run (inlined) Reverting this commit avoided 22.45% of the CPU caused by ovsdb_idl_loop_commit_and_wait(). The commit changed the logic of ovsdb_idl_txn_write__() by adding the check "datum->keys && datum->values" before discarding unchanged data in a transaction. However, it is normal for OVSDB clients ( such as ovn-northd) to try to set columns with same empty data as it is before the transaction. IDL would discard these changes and avoid sending big transactions to server (which would end up as no-op on server side). In the ovn scale test scenario mentioned above, each iteration of ovn-northd would send a transaction to server that includes all rows of the huge Port_Binding table, which caused the significant CPU increase of ovn-northd (and also the OVN SB DB server), resulted in longer end to end latency of OVN configuration changes. For the original problem the commit 68bc6f88 was trying to fix, it doesn't seem to be a real problem. The NULL deref reported by Coverity may be addressed in a future patch using a different approach, if necessary. Signed-off-by: Han Zhou <hzhou@ovn.org> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* AUTHORS: Add Sivaprasad Tummala.Ian Stokes2020-08-121-0/+1
| | | | Signed-off-by: Ian Stokes <ian.stokes@intel.com>
* dpdk: Deprecate vhost-user dequeue zero-copy.Ian Stokes2020-08-123-0/+9
| | | | | | | | | | | | | | | | | | | Dequeue zero-copy is no longer supported for vhost-user client mode in DPDK due to commit [1]. In addition to this, zero-copy mode has been proposed to be marked deprecated in [2] with removal in the next DPDK LTS release. This commit deprecates support for vhost-user dequeue zero-copy in OVS with its removal expected in the next OVS release. [1] 715070ea10e6 ("vhost: prevent zero-copy with incompatible client mode") [2] http://mails.dpdk.org/archives/dev/2020-August/177236.html Signed-off-by: Ian Stokes <ian.stokes@intel.com> Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com> Acked-by: Ilya Maximets <i.maximets@ovn.org>
* netdev-dpdk: linear buffer check with zero-copySivaprasad Tummala2020-08-121-0/+6
| | | | | | | | | | | | | | | | | | | | As of DPDK 19.11, in order to use dequeue-zero-copy in DPDK Vhost library, the application has to disable the linear buffer option. Hence dequeue-zero-copy is not supported for vhost application that requires linear buffers. An alternative DPDK based approach to disable the linear buffers within the vhost library itself was proposed in [1], however the consensus was that application should be responsible for disabling linear buffers. As such this patch disables linear buffers when zero-copy is enabled. [1] https://patches.dpdk.org/patch/67200/ Fixes: 127b6a6eea02 ("dpdk: Update to use DPDK 19.11.") Signed-off-by: Sivaprasad Tummala <Sivaprasad.Tummala@intel.com> Acked-by: Ilya Maximets <i.maximets@ovn.org> Signed-off-by: Ian Stokes <ian.stokes@intel.com>
* acinclude: Fix build with kernels with prandom* moved to prandom.h.Ilya Maximets2020-08-121-0/+4
| | | | | | | | | | | | | | | | Recent commit c0842fbc1b18 ("random32: move the pseudo-random 32-bit definitions to prandom.h") in upstream kernel moved the definition of prandom_* functions from random.h to prandom.h. This change was also backported to stable kernels. Fixing our configure script to look for these functions in a new location and avoid build failures: datapath/linux/compat/include/linux/random.h:11:19: error: redefinition of 'prandom_u32_max' Acked-by: Greg Rose <gvrose8192@gmail.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* faq: Mention Linux kernel versions supported by 2.13.x.Ben Pfaff2020-08-121-0/+1
| | | | | | | | | | This is based on acinclude.m4 in branch-2.13, which rejects anything newer than 5.0. Reported-by: Han Zhou <hzhou@ovn.org> Acked-by: Greg Rose <gvrose8192@gmail.com> Acked-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Ben Pfaff <blp@ovn.org>
* releases: Add OVS 2.14 to DPDK mapping.Ian Stokes2020-08-121-0/+1
| | | | | | | Add an entry for OVS 2.14 to map to the validated DPDK release. Signed-off-by: Ian Stokes <ian.stokes@intel.com> Acked-by: Flavio Leitner <fbl@sysclose.org>
* ovsdb-server: Replace in-memory DB contents at raft install_snapshot.Dumitru Ceara2020-08-064-11/+52
| | | | | | | | | | | | | | Every time a follower has to install a snapshot received from the leader, it should also replace the data in memory. Right now this only happens when snapshots are installed that also change the schema. This can lead to inconsistent DB data on follower nodes and the snapshot may fail to get applied. Fixes: bda1f6b60588 ("ovsdb-server: Don't disconnect clients after raft install_snapshot.") Acked-by: Han Zhou <hzhou@ovn.org> Signed-off-by: Dumitru Ceara <dceara@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* tc: Use skip_hw flag when probing tc featuresRoi Dayan2020-08-063-7/+18
| | | | | | | | | | | There is no need to pass tc rules to hw when just probing for tc features. this will avoid redundant errors from hw drivers that may happen. Signed-off-by: Roi Dayan <roid@mellanox.com> Acked-By: Vlad Buslov <vladbu@mellanox.com> Reviewed-by: Tonghao Zhang <xiangxia.m.yue@gmail.com> Signed-off-by: Simon Horman <simon.horman@netronome.com>
* configure: explicitly disable avx512 if bintuils check failsHarry van Haaren2020-08-051-0/+4
| | | | | | | | | | | | | | This commit explicitly disables avx512f if the binutils assembler check fails to correctly assemble its input. Without this fix, there is a possibility that users can see undefined behaviour when compiling with -march=native on a CPU which supports avx512 and with a buggy binutils version (v2.30 and 2.31), without a backported fix, if the compiler's vectorizing optimizations convert scalar code to avx512 instructions. Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com> Signed-off-by: Ian Stokes <ian.stokes@intel.com>
* dpif-netdev/avx512: add -fPIC flag to enable shared buildsHarry van Haaren2020-08-051-0/+1
| | | | | | | | | | In certain scenarios with OVS built with --enable-shared and DPDK enabled as shared build too, Position Independant Code is required to link the avx512.a file into the relocatable .so that it must be linked into. Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com> Signed-off-by: Ian Stokes <ian.stokes@intel.com>
* dpif-netdev/avx512: avoid compiling avx512 code if binutils check failsHarry van Haaren2020-08-051-0/+2
| | | | | | | | | This commit avoids compiling and linking of avx512 code into the vswitch_la library if the binutils check fails. This avoids compiling code into OVS that will not be executed due to binutils issue. Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com> Signed-off-by: Ian Stokes <ian.stokes@intel.com>
* odp-util: Clear padding in the nd_extension.Peng He2020-08-041-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Silimar to the patch 67eb8110171f ("odp-util: Fix passing uninitialized bytes in OVS_KEY_ATTR_CT_ORIG_TUPLE_IPV*.") when change from flow into the netlink format, the tail padding of nd_extension should be cleared. this fixes the following warning logs: |ofproto_dpif_upcall(pmd-...)|WARN|Conflicting ukey for flows: ufid:763c7d3b-4d0c-4bff-aafc-fdfb6089c2ba <...>,eth(...),eth_type(0x86dd),ipv6(...),icmpv6(type=135,code=0),\ nd(target=fdbd:dc02:ff:1:1::1,sll=fa:16:3e:75:b3:a9,tll=00:00:00:00:00:00),\ nd_ext(nd_reserved=0x0,nd_options_type=1) ufid:763c7d3b-4d0c-4bff-aafc-fdfb6089c2ba <...>,eth(...),eth_type(0x86dd),ipv6(...),icmpv6(type=135,code=0),\ nd(target=fdbd:dc02:ff:1:1::1,sll=fa:16:3e:75:b3:a9,tll=00:00:00:00:00:00),\ nd_ext(nd_reserved=0x0,nd_options_type=1) |ofproto_dpif_upcall(pmd-...)|WARN|upcall_cb failure: ukey installation fails Fixes: 9b2b84973db7 ("Support for match & set ICMPv6 reserved and options type fields") Signed-off-by: Peng He <hepeng.0320@bytedance.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* odp-util: Fix clearing match mask if set action is partially unnecessary.Ilya Maximets2020-07-294-16/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While committing set() actions, commit() could wildcard all the fields that are same in match key and in the set action. This leads to situation where mask after commit could actually contain less bits than it was before. And if set action was partially committed, all the fields that were the same will be cleared out from the matching key resulting in the incorrect (too wide) flow. For example, for the flow that matches on both src and dst mac addresses, if the dst mac is the same and only src should be changed by the set() action, destination address will be wildcarded in the match key and will never be matched, i.e. flows with any destination mac will match, which is not correct. Setting OF rule: in_port=1,dl_src=50:54:00:00:00:09 actions=mod_dl_dst(50:54:00:00:00:0a),output(2) Sending following packets on port 1: 1. eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800) 2. eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0c),eth_type(0x0800) 3. eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800) Resulted datapath flows: eth(dst=50:54:00:00:00:0c),<...>, actions:set(eth(dst=50:54:00:00:00:0a)),2 eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),<...>, actions:2 The first flow doesn't have any match on source MAC address and the third packet successfully matched on it while it must be dropped. Fix that by updating the match mask with only the new bits set by commit(), but keeping those that were cleared (OR operation). With fix applied, resulted correct flows are: eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),<...>, actions:2 eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0c),<...>, actions:set(eth(dst=50:54:00:00:00:0a)),2 eth(src=50:54:00:00:00:0b),<...>, actions:drop The code before commit dbf4a92800d0 was not able to reduce the mask, it was only possible to expand it to exact match, so it was OK to update original matching mask with the new value in all cases. Fixes: dbf4a92800d0 ("odp-util: Do not rewrite fields with the same values as matched") Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1854376 Acked-by: Eli Britstein <elibr@mellanox.com> Tested-by: Adrián Moreno <amorenoz@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* datapath-windows: Update flow key in SET actionJinjun Gao2020-07-292-7/+27
| | | | | | | | | | The flow key is not updated when process OVS_ACTION_ATTR_SET action. It will impact follow-up actions, such as, conntrack module cannot find created conntrack entry if passing old flow key to it. Reported-by: Rui Cao <rcao@vmware.com> Signed-off-by: Jinjun Gao <jinjung@vmware.com> Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
* datapath-windows: Reset ct_mark/ct_label to support ALGJinjun Gao2020-07-281-32/+54
| | | | | | | | | | | The ct_mark/ct_label setting on related connection keep the same behavior with Linux datapath. If one CT entry has parent/master entry, its ct_mark and ct_label should inherit from the corresponding part of parent/master entry at initialization. Signed-off-by: Jinjun Gao <jinjung@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org> Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
* bfd: Support overlay BFDYifeng Sun2020-07-273-3/+52
| | | | | | | | | | | | | | | Current OVS intercepts and processes all BFD packets, thus VM-2-VM BFD packets get lost and the recipient VM never sees them. This patch fixes it by only intercepting and processing BFD packets destined to a configured BFD instance, and other BFD packets are made available to the OVS flow table for forwarding. This patch keeps BFD's backward compatibility. VMware-BZ: #2579326 Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com> Signed-off-by: William Tu <u9012063@gmail.com>
* tests: Refactor the iptables accept rule.William Tu2020-07-272-10/+9
| | | | | | | | | Certain Linux distributions, like CentOS, have default iptable rules to reject input traffic from br-underlay. Refactor by creating a macro 'IPTABLES_ACCEPT([bridge])' for adding the accept rule to the iptable input chain. Signed-off-by: William Tu <u9012063@gmail.com>
* Revert "dpif-netdev: includes microsecond delta in meter bucket calculation".Tonghao Zhang2020-07-271-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 5c41c31ebd64fda821fb733a5784a7a440a794f8. Use the pktgen-dpdk to test the commit 5c41c31ebd64 ("dpif-netdev: includes microsecond delta in meter bucket calculation"), it does't work as expected. And it broken the meter function (e.g. set rate 200Mbps, the rate watched was 400Mbps). To reproduce it: $ ovs-vsctl add-br br-int -- set bridge br-int datapath_type=netdev $ ovs-ofctl -O OpenFlow13 add-meter br-int \ "meter=100 kbps burst stats bands=type=drop rate=200000 burst_size=200000" $ ovs-ofctl -O OpenFlow13 add-flow br-int \ "in_port=dpdk0 action=meter:100,output:dpdk1" $ pktgen -l 1,3,5,7,9,11,13,15,17,19 -n 8 --socket-mem 4096 \ --file-prefix pg1 -w 0000:82:00.0 -w 0000:82:00.1 -- \ -T -P -m "[3/5/7/9/11/13/15].[0-1]" -f meter-test.pkt meter-test.pkt: | set 0 count 0 | set 0 size 1500 | set 0 rate 100 | set 0 burst 64 | set 0 sport 1234 | set 0 dport 5678 | set 0 prime 1 | set 0 type ipv4 | set 0 proto udp | set 0 dst ip 1.1.1.2 | set 0 src ip 1.1.1.1/24 | set 0 dst mac ec:0d:9a:ab:54:0a | set 0 src mac ec:0d:9a:bf:df:bb | set 0 vlanid 0 | start 0 Note that the issue that patch 5c41c31ebd64 was intended to fix was already fixed by commit: 42697ca7757b ("dpif-netdev: fix meter at high packet rate.") Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* debian: Fixed openvswitch-test package dependency.Toms Atteka2020-07-271-1/+1
| | | | | | | | | | Python3 does not have python3-twisted-web. Required codebase is inside python3-twisted. Fixes: 1ca0323e7c29 ("Require Python 3 and remove support for Python 2.") Signed-off-by: Toms Atteka <cpp.code.lv@gmail.com> Acked-by: Greg Rose <gvrose8192@gmail.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* dpif-netdev.at: Wait for miss upcall log.Ilya Maximets2020-07-231-4/+8
| | | | | | | | | | | | | Some tests checks for 'miss upcall' log in a log file immediately after sending the packet, this causes test failures while running them under valgrind or on the overloaded system. Fix that by waiting for appearance of the actual string in the log file. Some other tests uses 'sleep 1' to fix that, but it's better to wait for event than sleep for a specific amount of time. Signed-off-by: Ilya Maximets <i.maximets@ovn.org> Signed-off-by: William Tu <u9012063@gmail.com>
* dpctl: Fix memory leak in dpctl_dump_flows()Tonghao Zhang2020-07-211-1/+1
| | | | | | | | | | Goto label accurately to avoid memleak. Fixes: a692410af0f7 ("dpctl: Expand the flow dump type filter") Cc: Gavi Teitz <gavi@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com> Signed-off-by: William Tu <u9012063@gmail.com>
* docs: Remove duplicate word from vhost-user doc.Flavio Leitner2020-07-211-3/+3
| | | | | | | Fixes: 49df3c0fe779 ("docs: DPDK isn't a datapath, so don't use the term.") Acked-by: Greg Rose <gvrose8192@gmail.com> Signed-off-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: William Tu <u9012063@gmail.com>