]> git.proxmox.com Git - ovs.git/log
ovs.git
12 months agobump version to 2.15.0+ds1-2+deb11u3.1 proxmox/bullseye
Thomas Lamprecht [Fri, 7 Apr 2023 08:04:36 +0000 (10:04 +0200)]
bump version to 2.15.0+ds1-2+deb11u3.1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agobackport "ofproto-dpif-xlate: Always mask ip proto field"
Thomas Lamprecht [Fri, 7 Apr 2023 08:02:45 +0000 (10:02 +0200)]
backport "ofproto-dpif-xlate: Always mask ip proto field"

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agoMerge tag 'debian/2.15.0+ds1-2+deb11u3' into proxmox/bullseye
Thomas Lamprecht [Fri, 7 Apr 2023 08:00:51 +0000 (10:00 +0200)]
Merge tag 'debian/2.15.0+ds1-2+deb11u3' into proxmox/bullseye

Debian release 2.15.0+ds1-2+deb11u3

13 months agoReleasing to bullseye.
Thomas Goirand [Fri, 24 Mar 2023 08:54:32 +0000 (09:54 +0100)]
Releasing to bullseye.

14 months agobump version to 2.15.0+ds1-2+deb11u2.1
Thomas Lamprecht [Thu, 2 Feb 2023 08:12:11 +0000 (09:12 +0100)]
bump version to 2.15.0+ds1-2+deb11u2.1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
14 months agobackport "ovsdb-idl: Fix the database update signaling if it has never been connected"
Thomas Lamprecht [Thu, 2 Feb 2023 08:10:35 +0000 (09:10 +0100)]
backport "ovsdb-idl: Fix the database update signaling if it has never been connected"

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
14 months agoBlacklist flacky test on all arch: 526: tcp vconn - refuse connection.
Thomas Goirand [Tue, 31 Jan 2023 08:10:23 +0000 (09:10 +0100)]
Blacklist flacky test on all arch: 526: tcp vconn - refuse connection.

14 months ago * Fix "openvswitch-switch update leaves interfaces down" by applying upstream
Thomas Goirand [Tue, 31 Jan 2023 07:49:01 +0000 (08:49 +0100)]
  * Fix "openvswitch-switch update leaves interfaces down" by applying upstream
    fix: https://github.com/openvswitch/ovs/commit/bc0aa785a83c1
    (Closes: #1008684).

15 months agoReleasing to bullseye-security
Thomas Goirand [Fri, 13 Jan 2023 07:54:21 +0000 (08:54 +0100)]
Releasing to bullseye-security

15 months ago * CVE-2022-4337 & CVE-2022-4338: Out-of-Bounds Read and Integer Underflow in
Thomas Goirand [Tue, 3 Jan 2023 10:17:33 +0000 (11:17 +0100)]
  * CVE-2022-4337 & CVE-2022-4338: Out-of-Bounds Read and Integer Underflow in
    Organization Specific TLV. Added upstream patches (Closes: #1027273).

18 months agoFix ovs-dpctl-top by removing 3 wrong hunks in py3-compat.patch.
Thomas Goirand [Mon, 3 Oct 2022 11:00:59 +0000 (13:00 +0200)]
Fix ovs-dpctl-top by removing 3 wrong hunks in py3-compat.patch.

2 years ago [ Felix Moessbauer ]
Thomas Goirand [Mon, 3 Jan 2022 13:07:24 +0000 (14:07 +0100)]
  [ Felix Moessbauer ]
  * fix ABI incompatibility that crashes OVS when enabling LLDP
    (Closes: #992406).

2 years ago* CVE-2021-36980: use-after-free in decode_NXAST_RAW_ENCAPAdd. Add upstream patch...
Thomas Goirand [Mon, 3 Jan 2022 11:07:02 +0000 (12:07 +0100)]
* CVE-2021-36980: use-after-free in decode_NXAST_RAW_ENCAPAdd. Add upstream patch (Closes: #991308).

3 years ago * Mipsel64 and mipsel: blacklist more tests, as they are failing on these
Thomas Goirand [Sat, 20 Feb 2021 20:58:51 +0000 (21:58 +0100)]
  * Mipsel64 and mipsel: blacklist more tests, as they are failing on these
    arch, and then the package FTBFS.

3 years agoFix renaming: libopenvswitch-2.14.so.0.0.90 -> libopenvswitch-2.15.so.0.0.0
Thomas Goirand [Fri, 19 Feb 2021 16:46:13 +0000 (17:46 +0100)]
Fix renaming: libopenvswitch-2.14.so.0.0.90 -> libopenvswitch-2.15.so.0.0.0

3 years agoFixed diff with upstream tag.
Thomas Goirand [Fri, 19 Feb 2021 16:37:45 +0000 (17:37 +0100)]
Fixed diff with upstream tag.

3 years ago * Removed CVE patches applied upstream:
Thomas Goirand [Fri, 19 Feb 2021 16:37:18 +0000 (17:37 +0100)]
  * Removed CVE patches applied upstream:
    - CVE-2020-27827
    - CVE-2020-35498

3 years agoNow packaging 2.15.0+ds1
Thomas Goirand [Fri, 19 Feb 2021 16:35:32 +0000 (17:35 +0100)]
Now packaging 2.15.0+ds1

3 years agoMerge tag '2.15.0+ds1' into debian/victoria
Thomas Goirand [Fri, 19 Feb 2021 16:35:04 +0000 (17:35 +0100)]
Merge tag '2.15.0+ds1' into debian/victoria

3 years agoMerge tag 'v2.15.0' into master-dfsg
Thomas Goirand [Fri, 19 Feb 2021 16:32:10 +0000 (17:32 +0100)]
Merge tag 'v2.15.0' into master-dfsg

Open vSwitch version 2.15.0.

3 years agoSet release date for 2.15.0.
Ilya Maximets [Mon, 15 Feb 2021 16:38:34 +0000 (17:38 +0100)]
Set release date for 2.15.0.

Acked-by: Ian Stokes <ian.stokes@intel.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agodpif-netdev: auto load balance log state on user request.
Kevin Traynor [Fri, 5 Feb 2021 16:56:58 +0000 (16:56 +0000)]
dpif-netdev: auto load balance log state on user request.

At present the log displays the auto load balance state
everytime it is changed.

There are some cases where the user will try to enable
auto load balance, but it cannot be enabled because not
enough PMDs or RxQs. As the state does not change, there
is no new log of the state.

While the the last log report of state is still correct,
it is better to log the state again at this point so the
user can explicitly confirm the outcome of their request.

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
3 years agoAUTHORS: Add Hariprasad Govindharajan.
Ian Stokes [Fri, 12 Feb 2021 13:37:21 +0000 (13:37 +0000)]
AUTHORS: Add Hariprasad Govindharajan.

Signed-off-by: Ian Stokes <ian.stokes@intel.com>
3 years agofaq: Update OVS/DPDK version table for OVS 2.15.
Hariprasad Govindharajan [Fri, 12 Feb 2021 13:23:10 +0000 (13:23 +0000)]
faq: Update OVS/DPDK version table for OVS 2.15.

Indicate that OVS 2.15 uses DPDK 20.11.

Signed-off-by: Hariprasad Govindharajan <hariprasad.govindharajan@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
3 years agodocs: Update for auto load balance threshold parameters.
Kevin Traynor [Thu, 11 Feb 2021 19:31:50 +0000 (19:31 +0000)]
docs: Update for auto load balance threshold parameters.

Update the docs to remove the previously hardcoded values
and mention the load and improvement thresholds when
describing the operation of auto load balance.

Fixes: 62ab5594c20c ("dpif-netdev: Add parameters to configure PMD auto load balance.")
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Ilya Maximets <i.maximets@ovn.org>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
3 years ago * CVE-2020-35498: Packet parsing vulnerability. Applied upstream patch:
Thomas Goirand [Wed, 10 Feb 2021 22:00:39 +0000 (23:00 +0100)]
  * CVE-2020-35498: Packet parsing vulnerability. Applied upstream patch:
    flow: Support extra padding length.patch (Closes: #982493).

3 years agocirrus: Use FreeBSD 12.2.
Ilya Maximets [Wed, 10 Feb 2021 15:23:23 +0000 (16:23 +0100)]
cirrus: Use FreeBSD 12.2.

FreeBSD 12.1 reached EOL and our builds are failing on Cirrus CI.
Updating to 12.2 - current production release.

Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agoflow: Support extra padding length.
Flavio Leitner [Mon, 26 Oct 2020 19:03:19 +0000 (16:03 -0300)]
flow: Support extra padding length.

Although not required, padding can be optionally added until
the packet length is MTU bytes. A packet with extra padding
currently fails sanity checks.

Vulnerability: CVE-2020-35498
Fixes: fa8d9001a624 ("miniflow_extract: Properly handle small IP packets.")
Reported-by: Joakim Hindersson <joakim.hindersson@elastx.se>
Acked-by: Ilya Maximets <i.maximets@ovn.org>
Signed-off-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agorhel: Update build required dpdk.
Tonghao Zhang [Wed, 3 Feb 2021 15:10:49 +0000 (23:10 +0800)]
rhel: Update build required dpdk.

Now OvS supports building with dpdk 20.11, and uses
the '--with-dpdk=shared' option in fedora.spec. Then
change version of dpdk 17.05.1 to 20.11.

Note that dpdk-devel-20.11.x is not released in fedora
distro, but use '20.11' is fine.

Fixes: 252e1e576443 ("dpdk: Update to use DPDK v20.11.")
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agonetdev-offload-tc: Reject rules with unsupported ct_state flags.
wenxu [Thu, 4 Feb 2021 02:50:14 +0000 (10:50 +0800)]
netdev-offload-tc: Reject rules with unsupported ct_state flags.

TC flower doesn't support some ct state flags such as
INVALID/SNAT/DNAT/REPLY. So it is better to reject this rule.

Fixes: 576126a931cd ("netdev-offload-tc: Add conntrack support")
Signed-off-by: wenxu <wenxu@ucloud.cn>
Reviewed-by: Marcelo Ricardo Leitner <mleitner@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agodist-docs: Include manpages generated from rST.
Ilya Maximets [Fri, 29 Jan 2021 13:20:29 +0000 (14:20 +0100)]
dist-docs: Include manpages generated from rST.

Some manpages are generated from rST, but these are not included
in 'dist-docs' make target.

Fixes: fd0837a76f4c ("doc: Convert ovs-vlan-test to rST")
Acked-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agotc: Fix mpls bottom of stack bit mask reporting.
Eelco Chaudron [Wed, 25 Nov 2020 09:51:57 +0000 (10:51 +0100)]
tc: Fix mpls bottom of stack bit mask reporting.

Fix the reported back value of the bos mask used by the revalidator
threads.

Fixes: 34b1695506f8 ("lib/tc: add single mpls match offload support")
Reported-by: Marcelo Leitner <mleitner@redhat.com>
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agorhel: Update '--with-dpdk' argument for DPDK 20.11.
Timothy Redaelli [Fri, 22 Jan 2021 14:50:07 +0000 (15:50 +0100)]
rhel: Update '--with-dpdk' argument for DPDK 20.11.

With DPDK 20.11, meson and pkgconfig are used instead of the old
Makefile-based system and so --with-dpdk option is changed to only
accept shared or static instead of the directory.

This commit uses --with-dpdk=shared since Fedora and RHEL ship shared
libraries of DPDK.

Fixes: 252e1e576443 ("dpdk: Update to use DPDK v20.11.")
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agoovs-lib: Remove second parameter for stop_daemon.
Yunjian Wang [Mon, 1 Feb 2021 12:04:45 +0000 (20:04 +0800)]
ovs-lib: Remove second parameter for stop_daemon.

The stop_daemon no longer takes second argument after
commit f3e24610ea18 ("Remove OVN.").

Fixes: f3e24610ea18 ("Remove OVN.")
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agonetdev-dpdk: Fix incorrect shinfo initialization.
Yi Yang [Wed, 14 Oct 2020 07:22:48 +0000 (15:22 +0800)]
netdev-dpdk: Fix incorrect shinfo initialization.

shinfo is used to store reference counter and free callback
of an external buffer, but it is stored in mbuf if the mbuf
has tailroom for it.

This is wrong because the mbuf (and its data) can be freed
before the external buffer, for example:

  pkt2 = rte_pktmbuf_alloc(mp);
  rte_pktmbuf_attach(pkt2, pkt);
  rte_pktmbuf_free(pkt);

After this, pkt is freed, but it still contains shinfo, which
is referenced by pkt2.

This sequence of operations is possible inside DPDK e.g., while
performing TSO operations for 'net_tap' PMD.

Fix this by always storing shinfo at the tail of external buffer.

Fixes: 29cf9c1b3b9c ("userspace: Add TCP Segmentation Offload support")
Co-authored-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Yi Yang <yangyi01@inspur.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agogithub: Don't fail the job if 'apt update' failed.
Ilya Maximets [Mon, 1 Feb 2021 11:41:35 +0000 (12:41 +0100)]
github: Don't fail the job if 'apt update' failed.

Some repositories that are enabled in GHA are not stable and lead
to 'apt update' failures:

  E: The repository
     'https://apt.postgresql.org/pub/repos/apt bionic-pgdg Release'
     no longer has a Release file.

This causes the job failure.
In most cases we don't really need any packages from these failed
repositories, so we could try to continue the job.

Previously this kind of failures happened on older branches with
ubuntu 16.04 base image, so we have this workaround already there.
Now it started to fail on bionic images, so fixing there too.

Fixes: 02f76fb42ae9 ("github: Fix Ubuntu package installation.")
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agovswitchd.xml: Fix supported IPsec tunnels.
Mark Gray [Fri, 15 Jan 2021 14:29:09 +0000 (09:29 -0500)]
vswitchd.xml: Fix supported IPsec tunnels.

'ovs-monitor-ipsec' does not support 'ip6gre' tunnels.

Fixes: 22c5eafb6efa ("ipsec: reintroduce IPsec support for tunneling")
Signed-off-by: Mark Gray <mark.d.gray@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agoacinclude: Remove default library for DPDK.
Sunil Pai G [Thu, 28 Jan 2021 10:32:24 +0000 (10:32 +0000)]
acinclude: Remove default library for DPDK.

The default DPDK library used before this patch in case pkg-config
fails to find libdpdk is only valid for make based DPDK builds.
Hence remove them.

As a consequence, now this error message [1] is thrown when pkg-config
cannot find libdpdk instead of proceeding to check for a faulty
pkg-config and reporting incorrect error message [2].

Also, update the documentation to export PKG_CONFIG_PATH since on some
systems, the default install path for DPDK libraries is not present in
the default search path of pkg-config.
Ex: for Fedora 32 default pkg-config search path:
  /usr/lib64/pkgconfig:/usr/share/pkgconfig

while by default Meson installs DPDK libraries at:
  /usr/local/lib64/pkgconfig

[1] Package libdpdk was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libdpdk.pc'
    to the PKG_CONFIG_PATH environment variable
    Package 'libdpdk', required by 'virtual:world', not found

[2] checking for DPDK... no
    checking for faulty pkg-config version... yes
    configure: error: Please upgrade pkg-config

Also, update the build documentation for AVX512 optimization.

Fixes: 252e1e576443 ("dpdk: Update to use DPDK v20.11.")
Reported-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Sunil Pai G <sunil.pai.g@intel.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agoovsdb-doc: Add build dependency on dirs.py.
Ilya Maximets [Fri, 29 Jan 2021 12:44:36 +0000 (13:44 +0100)]
ovsdb-doc: Add build dependency on dirs.py.

ovsdb-doc includes python code that requires dirs.py to exist.
This change fixes broken 'make manpage-check' target:

  # make manpage-check
  Traceback (most recent call last):
  File "./ovsdb/ovsdb-doc", line 25, in <module>
    import ovs.db.schema
  File "/root/ovs/python/ovs/db/schema.py", line 19, in <module>
    import ovs.db.types
  File "/root/ovs/python/ovs/db/types.py", line 18, in <module>
    import ovs.db.data
  File "/root/ovs/python/ovs/db/data.py", line 22, in <module>
    import ovs.jsonrpc
  File "/root/ovs/python/ovs/jsonrpc.py", line 21, in <module>
    import ovs.poller
  File "/root/ovs/python/ovs/poller.py", line 23, in <module>
    import ovs.vlog
  File "/root/ovs/python/ovs/vlog.py", line 25, in <module>
    import ovs.dirs
  ModuleNotFoundError: No module named 'ovs.dirs'

Fixes: 943c4a325045 ("python: set ovs.dirs variables with build system values")
Acked-by: Mark Gray <mark.d.gray@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agosystem-dpdk: Fix 4th and 5th testcases of the system-dpdk testsuite.
Emma Finn [Tue, 19 Jan 2021 12:01:22 +0000 (12:01 +0000)]
system-dpdk: Fix 4th and 5th testcases of the system-dpdk testsuite.

Testpmd has been renamed to dpdk-testpmd as of DPDK 20.11.
This commit resolves this issue and fixes these tests.

Signed-off-by: Emma Finn <emma.finn@intel.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agodpctl: Fix dpctl process command parameter error.
Mao YingMing [Tue, 12 Jan 2021 05:22:57 +0000 (13:22 +0800)]
dpctl: Fix dpctl process command parameter error.

Fix the following error:

  $ ovs-appctl dpctl/dump-conntrack -m -s system@ovs-system zone=0
  "dpctl/dump-conntrack" command takes at most 2 arguments
  ovs-appctl: ovs-vswitchd: server returned an error

  $ ovs-appctl dpctl/dump-flows -m --names system@ovs-system filter=in_port\(2\) type=ovs
  "dpctl/dump-flows" command takes at most 4 arguments
  ovs-appctl: ovs-vswitchd: server returned an error

Signed-off-by: Mao YingMing <maoyingming@baidu.com>
Acked-by: Mark Gray <mark.d.gray@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agoconntrack: Fix the icmp conntrack new state.
Tonghao Zhang [Thu, 21 Jan 2021 09:12:47 +0000 (17:12 +0800)]
conntrack: Fix the icmp conntrack new state.

The same icmp packet may traverse conntrack module more than once.
Or same icmp packets traverse contranck module in orderly.

Don't change state to CS_ESTABLISHED before receiving reply or related packets.

Fixes: a867c010ee91 ("conntrack: Fix conntrack new state")
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agoovsdb-idl: Break into two layers.
Ben Pfaff [Sat, 21 Nov 2020 19:47:01 +0000 (11:47 -0800)]
ovsdb-idl: Break into two layers.

This change breaks the IDL into two layers: the IDL proper, whose
interface to its client is unchanged, and a low-level library called
the OVSDB "client synchronization" (CS) library.  There are two
reasons for this change.  First, the IDL is big and complicated and
I think that this change factors out some of that complication into
a simpler lower layer.  Second, the OVN northd implementation based
on DDlog can benefit from the client synchronization library even
though it would actually be made increasingly complicated by the IDL.

Signed-off-by: Ben Pfaff <blp@ovn.org>
3 years agoovsdb-cs: New module that factors out code from ovsdb-idl.
Ben Pfaff [Wed, 2 Dec 2020 02:15:11 +0000 (18:15 -0800)]
ovsdb-cs: New module that factors out code from ovsdb-idl.

This new module has a single direct user now.  In the future, it
will also be used by OVN.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Ilya Maximets <i.maximets@ovn.org>
3 years agotest-ovsdb: Log steps in idl test.
Ben Pfaff [Fri, 18 Dec 2020 00:01:48 +0000 (16:01 -0800)]
test-ovsdb: Log steps in idl test.

Until now, "test-ovsdb idl" has printed the steps that it goes through
to stdout.  This commit also makes it log the same information.  This
makes it easier to match up the steps with the rest of the log (in
particular with the jsonrpc logging).

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Ilya Maximets <i.maximets@ovn.org>
3 years agoodp-util: Fix abort while formatting nsh actions.
Ilya Maximets [Fri, 18 Dec 2020 13:34:55 +0000 (14:34 +0100)]
odp-util: Fix abort while formatting nsh actions.

OVS should not exit if it cannot format NSH actions for the user.
It should just report the error like the other formatting functions do.

Credit to OSS-Fuzz.

Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=21509
Fixes: 1fc11c5948cf ("Generic encap and decap support for NSH")
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Acked-by: Mark Gray <mark.d.gray@redhat.com>
3 years agoPrepare for 2.15.0.
Ilya Maximets [Fri, 15 Jan 2021 19:18:07 +0000 (20:18 +0100)]
Prepare for 2.15.0.

Acked-by: Flavio Leitner <fbl@sysclose.org>
Acked-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agoacinclude: Warn when --with-linux parameter is supplied.
Greg Rose [Tue, 12 Jan 2021 19:15:30 +0000 (11:15 -0800)]
acinclude: Warn when --with-linux parameter is supplied.

Building the Linux kernel module from the Open vSwitch source tree
is deprecated.  Emit a warning when the '--with-linux' configure
parameter is supplied to remind the user.

Signed-off-by: Greg Rose <gvrose8192@gmail.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agodoc: Deprecate building Linux kernel module from OVS source tree.
Greg Rose [Tue, 12 Jan 2021 19:15:29 +0000 (11:15 -0800)]
doc: Deprecate building Linux kernel module from OVS source tree.

It is decided (1) to deprecate building the Linux kernel module
from the Open vSwitch source tree.

Update the NEWS and FAQ to provide notice.

1. https://mail.openvswitch.org/pipermail/ovs-dev/2020-December/378831.html

Signed-off-by: Greg Rose <gvrose8192@gmail.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agoovsdb: Use column diffs for ovsdb and raft log entries.
Ilya Maximets [Fri, 11 Dec 2020 20:54:47 +0000 (21:54 +0100)]
ovsdb: Use column diffs for ovsdb and raft log entries.

Currently, ovsdb-server stores complete value for the column in a database
file and in a raft log in case this column changed.  This means that
transaction that adds, for example, one new acl to a port group creates
a log entry with all UUIDs of all existing acls + one new.  Same for
ports in logical switches and routers and more other columns with sets
in Northbound DB.

There could be thousands of acls in one port group or thousands of ports
in a single logical switch.  And the typical use case is to add one new
if we're starting a new service/VM/container or adding one new node in a
kubernetes or OpenStack cluster.  This generates huge amount of traffic
within ovsdb raft cluster, grows overall memory consumption and hurts
performance since all these UUIDs are parsed and formatted to/from json
several times and stored on disks.  And more values we have in a set -
more space a single log entry will occupy and more time it will take to
process by ovsdb-server cluster members.

Simple test:

1. Start OVN sandbox with clustered DBs:
   # make sandbox SANDBOXFLAGS='--nbdb-model=clustered --sbdb-model=clustered'

2. Run a script that creates one port group and adds 4000 acls into it:
   # cat ../memory-test.sh
   pg_name=my_port_group
   export OVN_NB_DAEMON=$(ovn-nbctl --pidfile --detach --log-file -vsocket_util:off)
   ovn-nbctl pg-add $pg_name
   for i in $(seq 1 4000); do
     echo "Iteration: $i"
     ovn-nbctl --log acl-add $pg_name from-lport $i udp drop
   done
   ovn-nbctl acl-del $pg_name
   ovn-nbctl pg-del $pg_name
   ovs-appctl -t $(pwd)/sandbox/nb1 memory/show
   ovn-appctl -t ovn-nbctl exit
   ---

4. Check the current memory consumption of ovsdb-server processes and
   space occupied by database files:
   # ls sandbox/[ns]b*.db -alh
   # ps -eo vsz,rss,comm,cmd | egrep '=[ns]b[123].pid'

Test results with current ovsdb log format:

   On-disk Nb DB size     :  ~369 MB
   RSS of Nb ovsdb-servers:  ~2.7 GB
   Time to finish the test:  ~2m

In order to mitigate memory consumption issues and reduce computational
load on ovsdb-servers let's store diff between old and new values
instead.  This will make size of each log entry that adds single acl to
port group (or port to logical switch or anything else like that) very
small and independent from the number of already existing acls (ports,
etc.).

Added a new marker '_is_diff' into a file transaction to specify that
this transaction contains diffs instead of replacements for the existing
data.

One side effect is that this change will actually increase the size of
file transaction that removes more than a half of entries from the set,
because diff will be larger than the resulted new value.  However, such
operations are rare.

Test results with change applied:

   On-disk Nb DB size     :  ~2.7 MB  ---> reduced by 99%
   RSS of Nb ovsdb-servers:  ~580 MB  ---> reduced by 78%
   Time to finish the test:  ~1m27s   ---> reduced by 27%

After this change new ovsdb-server is still able to read old databases,
but old ovsdb-server will not be able to read new ones.
Since new servers could join ovsdb cluster dynamically it's hard to
implement any runtime mechanism to handle cases where different
versions of ovsdb-server joins the cluster.  However we still need to
handle cluster upgrades.  For this case added special command line
argument to disable new functionality.  Documentation updated with the
recommended way to upgrade the ovsdb cluster.

Acked-by: Dumitru Ceara <dceara@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agoAUTHORS: Add Yalei Li.
Ilya Maximets [Fri, 15 Jan 2021 18:18:47 +0000 (19:18 +0100)]
AUTHORS: Add Yalei Li.

Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agonetdev-offload-dpdk: Implement flow flush.
Eli Britstein [Mon, 28 Dec 2020 10:19:03 +0000 (10:19 +0000)]
netdev-offload-dpdk: Implement flow flush.

Remove all the rules for the specified netdev.

Signed-off-by: Eli Britstein <elibr@nvidia.com>
Reviewed-by: Gaetan Rivet <gaetanr@nvidia.com>
Acked-by: Emma Finn <emma.finn@intel.com>
Tested-by: Emma Finn <emma.finn@intel.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agonetdev-offload-dpdk: Refactor disassociate and flow destroy.
Eli Britstein [Mon, 28 Dec 2020 10:19:02 +0000 (10:19 +0000)]
netdev-offload-dpdk: Refactor disassociate and flow destroy.

Refactor disassociation to be removed from flow destroy, and to use
already found object instead of re-searching it.

Signed-off-by: Eli Britstein <elibr@nvidia.com>
Reviewed-by: Gaetan Rivet <gaetanr@nvidia.com>
Acked-by: Emma Finn <emma.finn@intel.com>
Tested-by: Emma Finn <emma.finn@intel.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agonetdev-offload-dpdk: Keep netdev in offload object.
Eli Britstein [Mon, 28 Dec 2020 10:19:01 +0000 (10:19 +0000)]
netdev-offload-dpdk: Keep netdev in offload object.

Keep the netdev of the offload rule as a field in the offload object as
a pre-step towards support flushing of the offload rules.

Signed-off-by: Eli Britstein <elibr@nvidia.com>
Reviewed-by: Gaetan Rivet <gaetanr@nvidia.com>
Acked-by: Emma Finn <emma.finn@intel.com>
Tested-by: Emma Finn <emma.finn@intel.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agodpif-netdev: Flush offload rules upon port deletion.
Eli Britstein [Mon, 28 Dec 2020 10:19:00 +0000 (10:19 +0000)]
dpif-netdev: Flush offload rules upon port deletion.

When a port is deleted, flow deletion requests are posted, and the netdev
is removed from offload netdevs map. Following flow deletion handling may
be done after the netdev has already been removed from the offload
netdevs map, so the HW rule is not removed and the data object is not
freed (memory leak). Flush offload rules upon port deletion, and disable
pending handling of offloads to fix it.

Signed-off-by: Eli Britstein <elibr@nvidia.com>
Reviewed-by: Gaetan Rivet <gaetanr@nvidia.com>
Acked-by: Emma Finn <emma.finn@intel.com>
Tested-by: Emma Finn <emma.finn@intel.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agoAUTHORS: Add Christophe Fontaine.
Kevin Traynor [Mon, 21 Dec 2020 13:10:33 +0000 (13:10 +0000)]
AUTHORS: Add Christophe Fontaine.

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agodpif-netdev: Add PMD auto load balance status log.
Kevin Traynor [Mon, 21 Dec 2020 13:10:32 +0000 (13:10 +0000)]
dpif-netdev: Add PMD auto load balance status log.

When any PMD auto load balance parameters change, it is useful
to also log if the feature is enabled or disabled.

|dpif_netdev|INFO|PMD auto load balance load threshold changed to 70%
|dpif_netdev|INFO|PMD auto load balance is disabled

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ian Stokes <ian.stokes@intel.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agodpif-netdev: Add parameters to configure PMD auto load balance.
Christophe Fontaine [Mon, 21 Dec 2020 13:10:31 +0000 (13:10 +0000)]
dpif-netdev: Add parameters to configure PMD auto load balance.

Two important parts of how PMD auto load balance operates are how
loaded a core needs to be and how much improvement is estimated
before a PMD auto load balance can trigger.

Previously they were hardcoded to 95% loaded and 25% variance
improvement.

These default values may not be suitable for all use cases and
we may want to use a more (or less) aggressive rebalance, either
on the pmd load threshold or on the minimum variance improvement
threshold.

The defaults are not changed, but "pmd-auto-lb-load-threshold" and
"pmd-auto-lb-improvement-threshold" parameters are added to override
the defaults.

$ ovs-vsctl set open_vswitch . other_config:pmd-auto-lb-load-threshold="70"
$ ovs-vsctl set open_vswitch . other_config:pmd-auto-lb-improvement-threshold="20"

Signed-off-by: Christophe Fontaine <cfontain@redhat.com>
Co-Authored-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ian Stokes <ian.stokes@intel.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agodpif-netdev: Add log for PMD auto load balance interval parameter.
Kevin Traynor [Mon, 21 Dec 2020 13:10:30 +0000 (13:10 +0000)]
dpif-netdev: Add log for PMD auto load balance interval parameter.

Previously if the parameter for the PMD auto load balance minimum
interval was changed at runtime, it was not logged unless the
PMD auto load balance feature was also changed to enabled.

Log the parameter anytime it changes, and use minutes when it is
logged as that is the user input format.

Fixes: 5bf84282482a ("Adding support for PMD auto load balancing")
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ian Stokes <ian.stokes@intel.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agoacinclude: Strip out -mno-avx512f provided by DPDK.
Ilya Maximets [Fri, 8 Jan 2021 11:46:56 +0000 (12:46 +0100)]
acinclude: Strip out -mno-avx512f provided by DPDK.

DPDK forces '-mno-avx512f' flag for the application if the toolchain
used to build DPDK had broken AVX512 support.  But OVS could be built
with a completely different or fixed toolchain with correct avx512
support.  In this case OVS will detect that toolchain is good and will
try to build AVX512-optimized classifier.  However, '-mno-avx512f'
flag will be passed from the DPDK side breaking the build:

  In file included from /gcc/x86_64-linux-gnu/8/include/immintrin.h:55,
                 from /gcc/x86_64-linux-gnu/8/include/x86intrin.h:48,
                 from /dpdk/../x86_64-linux-gnu/dpdk/rte_vect.h:28,
                 from /dpdk/../x86_64-linux-gnu/dpdk/rte_memcpy.h:17,
                 from /dpdk/rte_mempool.h:51,
                 from /dpdk/rte_mbuf.h:38,
                 from ../lib/dp-packet.h:25,
                 from ../lib/dpif.h:380,
                 from ../lib/dpif-netdev.h:23,
                 from ../lib/dpif-netdev-lookup-avx512-gather.c:22:
  /usr/lib/gcc/x86_64-linux-gnu/8/include/avx512bwintrin.h:413:1: error:
     inlining failed in call to always_inline '_mm512_sad_epu8':
     target specific option mismatch
   _mm512_sad_epu8 (__m512i __A, __m512i __B)

Fix that by stripping out `-mno-avx512f` as we already do for '-march'.
This will allow the OVS to decide if the AVX512 can be used.

Reordering of CFLAGS (i.e. adding DPDK flags before OVS ones) is not an
option since autotools might reorder them back later and it's very
unpredictable.

Reported-at: https://github.com/openvswitch/ovs-issues/issues/201
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
3 years agoRevert "netdev-offload-dpdk: Fix for broken ethernet matching HWOL for XL710NIC."
Emma Finn [Mon, 7 Dec 2020 16:27:15 +0000 (16:27 +0000)]
Revert "netdev-offload-dpdk: Fix for broken ethernet matching HWOL for XL710NIC."

Removing temporary patch - 023f257 (netdev-offload-dpdk: Fix for broken
ethernet matching HWOL for XL710NIC).
Ethernet pattern is now being set correctly withtin the i40e PMD.

Signed-off-by: Emma Finn <emma.finn@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
3 years ago * CVE-2020-27827: denial of service attacks in which crafted LLDP packets
Thomas Goirand [Fri, 15 Jan 2021 07:13:36 +0000 (08:13 +0100)]
  * CVE-2020-27827: denial of service attacks in which crafted LLDP packets
    could cause memory to be lost when allocating data to handle specific
    optional TLVs. Applied upstream patch: lldp: do not leak memory on multiple
    instances of TLVs (Closes: #980132).

3 years agolldp: do not leak memory on multiple instances of TLVs
Aaron Conole [Wed, 13 Jan 2021 15:47:19 +0000 (10:47 -0500)]
lldp: do not leak memory on multiple instances of TLVs

Upstream commit:
    commit a8d3c90feca548fc0656d95b5d278713db86ff61
    Date: Tue, 17 Nov 2020 09:28:17 -0500

    lldp: avoid memory leak from bad packets

    A packet that contains multiple instances of certain TLVs will cause
    lldpd to continually allocate memory and leak the old memory.  As an
    example, multiple instances of system name TLV will cause old values
    to be dropped by the decoding routine.

    Reported-at: https://github.com/openvswitch/ovs/pull/337
Reported-by: Jonas Rudloff <jonas.t.rudloff@gmail.com>
Signed-off-by: Aaron Conole <aconole@redhat.com>
Vulnerability: CVE-2020-27827
Signed-off-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agoipf: Avoid accessing to a freed rp.
Peng He [Tue, 22 Dec 2020 02:47:35 +0000 (10:47 +0800)]
ipf: Avoid accessing to a freed rp.

if there are multiple pkts in the batch, the loop will access a
freed rp, which cause ovs crash.

Fixes: 4ea96698f667 ("Userspace datapath: Add fragmentation handling.")
Signed-off-by: Peng He <hepeng.0320@bytedance.com>
Acked-by: Mark Gray <mark.d.gray@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agorhel: Fix libunwind dev package.
Yalei Li [Tue, 12 Jan 2021 11:05:37 +0000 (19:05 +0800)]
rhel: Fix libunwind dev package.

There is no unwind-devel package, only libunwind-devel package is found.
No error is reported with libunwind-devel during compilation.

Fixes: 7e0c91eb0714 ("debian and rhel: Add libunwind dev package.")
Signed-off-by: Yalei Li <liyl43@chinatelecom.cn>
Acked-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agoCorrectly install systemd service.
Thomas Goirand [Mon, 11 Jan 2021 20:24:45 +0000 (21:24 +0100)]
Correctly install systemd service.

3 years ago * Reworked .service files to make them look like in Ubuntu (as I still want
Thomas Goirand [Mon, 11 Jan 2021 20:09:32 +0000 (21:09 +0100)]
  * Reworked .service files to make them look like in Ubuntu (as I still want
    our packages converge).

3 years agoBlacklist more tests for mipsel and mipsel64.
Thomas Goirand [Sun, 10 Jan 2021 23:21:12 +0000 (00:21 +0100)]
Blacklist more tests for mipsel and mipsel64.

3 years agoReleasing to unstable.
Thomas Goirand [Sun, 10 Jan 2021 13:56:38 +0000 (14:56 +0100)]
Releasing to unstable.

3 years agoBlacklist test 532 (because non-deterministic).
Thomas Goirand [Sun, 10 Jan 2021 13:23:12 +0000 (14:23 +0100)]
Blacklist test 532 (because non-deterministic).

3 years agoUpdate changelog for 2.15.0~git20210104.def6eb1ea+dfsg1-1 release
Luca Boccassi [Sat, 9 Jan 2021 15:21:30 +0000 (15:21 +0000)]
Update changelog for 2.15.0~git20210104.def6eb1ea+dfsg1-1 release

3 years agoRealign armhf test skip range due to upstream changes
Luca Boccassi [Sun, 10 Jan 2021 12:22:23 +0000 (12:22 +0000)]
Realign armhf test skip range due to upstream changes

3 years agoUse new --with-dpdk=shared configure flag value
Luca Boccassi [Sun, 10 Jan 2021 12:21:46 +0000 (12:21 +0000)]
Use new --with-dpdk=shared configure flag value

3 years agoBump libopenvswitch to 2.14
Luca Boccassi [Sat, 9 Jan 2021 15:39:24 +0000 (15:39 +0000)]
Bump libopenvswitch to 2.14

Gbp-Dch: ignore

3 years agoRefresh py3-compat.patch for v2.15
Luca Boccassi [Sat, 9 Jan 2021 15:19:46 +0000 (15:19 +0000)]
Refresh py3-compat.patch for v2.15

Update taken from 2.15.0~git20210104.def6eb1ea-0ubuntu3

3 years agoBump dependency on libbpdk-dev >= 20.11
Luca Boccassi [Sat, 9 Jan 2021 15:17:09 +0000 (15:17 +0000)]
Bump dependency on libbpdk-dev >= 20.11

3 years agoMerge branch 'master-dfsg' into 2.15
Luca Boccassi [Sat, 9 Jan 2021 15:13:32 +0000 (15:13 +0000)]
Merge branch 'master-dfsg' into 2.15

3 years agoMerge commit 'def6eb1ea' into master-dfsg
Luca Boccassi [Sat, 9 Jan 2021 15:11:21 +0000 (15:11 +0000)]
Merge commit 'def6eb1ea' into master-dfsg

Open vSwitch version 2.15.0~git20210104.def6eb1ea

3 years agoMerge tag '2.15.0_git20210104.def6eb1ea' into master-dfsg
Thomas Goirand [Fri, 8 Jan 2021 09:35:28 +0000 (10:35 +0100)]
Merge tag '2.15.0_git20210104.def6eb1ea' into master-dfsg

3 years agoDocumentation: Simplify the website main page.
Flavio Leitner [Mon, 28 Dec 2020 22:02:55 +0000 (19:02 -0300)]
Documentation: Simplify the website main page.

The initial website page is difficult to read because of
the large amount of links from different parts of the whole
documentation. Most of all those links come from their
index page referenced in the section 'Contents' on the side.

Another issue is that because the page is static, new links
might not get included.

This patch simplifies the main page by highlighting the project
level documentation. The static part is reduced to the main
level index pages.

All the links are available by clicking on 'Full Table of
Contents' at the end of Documentation section.

Signed-off-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
3 years agoreconnect: Add Python implementation of received_attempt(), and test.
Ben Pfaff [Tue, 22 Dec 2020 00:21:00 +0000 (16:21 -0800)]
reconnect: Add Python implementation of received_attempt(), and test.

This follows up on commit 4241d652e465 ("jsonrpc: Avoid disconnecting
prematurely due to long poll intervals."), which implemented the same
thing in C.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Requested-by: Ilya Maximets <i.maximets@ovn.org>
Acked-by: Ilya Maximets <i.maximets@ovn.org>
3 years agoGenerating postinst at build time to avoid using dpkg-architecture at runtime.
Thomas Goirand [Wed, 6 Jan 2021 21:15:13 +0000 (22:15 +0100)]
Generating postinst at build time to avoid using dpkg-architecture at runtime.

3 years agodpctl: Fix broken Windows build due to missing strndup.
Ilya Maximets [Wed, 6 Jan 2021 15:29:26 +0000 (16:29 +0100)]
dpctl: Fix broken Windows build due to missing strndup.

AppVeyor reports:

  lib/dpctl.c(1433): error C4013: 'strndup' undefined;
                                  assuming extern returning int
  make[2]: *** [lib/dpctl.lo] Error 1

Replacing missing 'strndup' with a portable pair of functions.

Fixes: bf8812cd7e20 ("dpctl: Add add/mod/del-flows command.")
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agoovs-monitor-ipsec: Add option to not restart IKE daemon.
Mark Gray [Tue, 5 Jan 2021 22:53:41 +0000 (17:53 -0500)]
ovs-monitor-ipsec: Add option to not restart IKE daemon.

Signed-off-by: Mark Gray <mark.d.gray@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agoovs-monitor-ipsec: Allow exit of ipsec daemon maintaining state.
Mark Gray [Tue, 5 Jan 2021 22:53:40 +0000 (17:53 -0500)]
ovs-monitor-ipsec: Allow exit of ipsec daemon maintaining state.

When 'ovs-monitor-ipsec' exits, it clears all persistent state (i.e.
active ipsec connections, /etc/ipsec.conf, certs/keys). In some
use-cases, we may want to exit and maintain state so that ipsec
connectivity is maintained. One example of this is during an
upgrade. This will require the caller to clear this persistent
state when appropriate (e.g. before 'ovs-monitor-ipsec') is restarted.

Signed-off-by: Mark Gray <mark.d.gray@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agoFix installing OVS alternatives on non-amd64 arch (Closes: #979366).
Thomas Goirand [Tue, 5 Jan 2021 21:29:41 +0000 (22:29 +0100)]
Fix installing OVS alternatives on non-amd64 arch (Closes: #979366).

3 years agoovs-ctl: Use 'stop_daemon' to stop ovs-monitor-ipsec.
Mark Gray [Mon, 4 Jan 2021 08:45:19 +0000 (03:45 -0500)]
ovs-ctl: Use 'stop_daemon' to stop ovs-monitor-ipsec.

Signed-off-by: Mark Gray <mark.d.gray@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agoovs-monitor-ipsec: Fix active connection regex.
Mark Gray [Mon, 4 Jan 2021 08:45:18 +0000 (03:45 -0500)]
ovs-monitor-ipsec: Fix active connection regex.

Connections are added to IPsec using a connection name
that is determined from the OVS port name and the tunnel
type.

GRE connections take the form:
  <iface>-<ver>
Other connections take the form:
  <iface>-in-<ver>
  <iface>-out-<ver>

The regex '|' operator parses strings left to right looking
for the first match that it can find. '.*' is also greedy. This
causes incorrect interface names to be parsed from active
connections as other tunnel types are parsed as type
GRE. This gives unexpected "is outdated" warnings and the
connection is torn down.

For example,

'ovn-424242-in-1' will produce an incorrect interface name of
'ovn-424242-in' instead of 'ovn-424242'.

There are a number of ways this could be resolved including
a cleverer regular expression, or re.findall(). However, this
approach was taken as it simplifies the code easing maintainability.

Fixes: 22c5eafb6efa ("ipsec: reintroduce IPsec support for tunneling")
Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1908789
Signed-off-by: Mark Gray <mark.d.gray@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agoovs-monitor-ipsec: set correct 'leftcert' and 'rightcert' name.
Mark Gray [Thu, 24 Dec 2020 12:59:38 +0000 (07:59 -0500)]
ovs-monitor-ipsec: set correct 'leftcert' and 'rightcert' name.

In Libreswan case, 'ovs-monitor-ipsec' incorrectly configures
'leftcert' and 'rightcert' names for self-signed certificates.
This patch resolves that.

Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1906280
Signed-off-by: Mark Gray <mark.d.gray@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agoovs-monitor-ipsec: Add support for tunnel 'local_ip'.
Mark Gray [Thu, 24 Dec 2020 12:57:01 +0000 (07:57 -0500)]
ovs-monitor-ipsec: Add support for tunnel 'local_ip'.

In the libreswan case, 'ovs-monitor-ipsec' sets
'left' to '%defaultroute' which will use the local address
of the default route interface as the source IP address. In
multihomed environments, this may not be correct if the user
wants to specify what the source IP address is. In OVS, this
can be set for tunnel ports using the 'local_ip' option. This
patch also uses that option to populate the 'ipsec.conf'
configuration. If the 'local_ip' option is not present, it
will default to the previous behaviour of using '%defaultroute'

Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1906280
Signed-off-by: Mark Gray <mark.d.gray@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agoovs-monitor-ipsec: Suppress "unknown %d argument" warning.
Mark Gray [Thu, 24 Dec 2020 10:06:20 +0000 (05:06 -0500)]
ovs-monitor-ipsec: Suppress "unknown %d argument" warning.

As 'ovs-vswitchd' does not understand IPsec tunnel options, it
gives a warning message. This can be safely suppressed.

Reported at: https://bugzilla.redhat.com/show_bug.cgi?id=1906701
Signed-off-by: Mark Gray <mark.d.gray@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agoovs-monitor-ipsec: Fix _nss_clear_database() parse error.
Mark Gray [Wed, 23 Dec 2020 16:01:33 +0000 (11:01 -0500)]
ovs-monitor-ipsec: Fix _nss_clear_database() parse error.

_nss_clear_database() runs `certutil` in order to get a list
of certificates currently loaded in NSS. This fails with error:

"ovs-monitor-ipsec | ERR | Failed to clear NSS database.
startswith first arg must be bytes or a tuple of bytes, not str"

Modify subprocess.Popen() to write in 'text' mode so that
'startwith' can correctly parse output.

Signed-off-by: Mark Gray <mark.d.gray@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agodpctl: Add add/mod/del-flows command.
Eelco Chaudron [Tue, 13 Oct 2020 08:36:48 +0000 (10:36 +0200)]
dpctl: Add add/mod/del-flows command.

When you would like to add, modify, or delete a lot of flows in the
datapath, for example when you want to measure performance, adding
one flow at the time won't scale. This as it takes a decent amount
of time to set up the datapath connection.

This new command is in-line with the same command available in
ovs-ofctl which allows the same thing, with the only difference that
we do not verify all lines before we start execution. This allows for
a continuous add/delete stream. For example with a command like this:

python3 -c 'while True:
  for i in range(0, 1000):
    print("add in_port(0),eth(),eth_type(0x800),ipv4(src=100.1.{}.{}) 1".format(int(i / 256), i % 256))
  for i in range(0, 1000):
    print("delete in_port(0),eth(),eth_type(0x800),ipv4(src=100.1.{}.{})".format(int(i / 256), i % 256))' \
|  sudo utilities/ovs-dpctl add-flows -

Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Paolo Valerio <pvalerio@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agoovs-ctl: Don't overwrite external-id hostname.
Daniel Alvarez [Mon, 25 May 2020 15:28:21 +0000 (17:28 +0200)]
ovs-ctl: Don't overwrite external-id hostname.

ovs-ctl started to add the hostname as external-id [0] at some point.

However, this can be problematic as if it's already set by an external
entity it will get overwritten. In RHEL systems, systemd will invoke
ovs-ctl to start OVS and that will overwrite it to the hostname of the
machine.

For OVN this can have a big impact because if, for whatever reason the
hostname changes and the host gets restarted, ovn-controller won't
claim the ports back leaving the workloads unaccessible.

Also, it makes sense to not overwrite it as 1) it's an external_id,
so it will actually let external entities to configure it (unlike now),
and 2) it's optional. In the case that some systems were relying on
ovs-ctl to set the external-id for the first time (e.g onboarding
of a new hypervisor), this patch is not changing such behavior.

For more details, see discussion at [1].

[0] https://mail.openvswitch.org/pipermail/ovs-dev/2016-March/312054.html
[1] https://mail.openvswitch.org/pipermail/ovs-dev/2020-May/370813.html

Signed-off-by: Daniel Alvarez <dalvarez@redhat.com>
Acked-by: Han Zhou <hzhou@ovn.org>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agoReleasing to unstable.
Thomas Goirand [Tue, 5 Jan 2021 12:49:36 +0000 (13:49 +0100)]
Releasing to unstable.

3 years agoACK removing Ben Pfaff from uploaders.
Thomas Goirand [Mon, 4 Jan 2021 08:26:15 +0000 (09:26 +0100)]
ACK removing Ben Pfaff from uploaders.

3 years agosecurity.rst: Add more information about the Downstream mailing list.
Justin Pettit [Thu, 24 Dec 2020 18:50:10 +0000 (10:50 -0800)]
security.rst: Add more information about the Downstream mailing list.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Flavio Leitner <fbl@sysclose.org>
3 years agoAUTHORS: Add Renat Nurgaliyev.
Ilya Maximets [Tue, 22 Dec 2020 23:34:18 +0000 (00:34 +0100)]
AUTHORS: Add Renat Nurgaliyev.

Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agotunnel: Bareudp Tunnel Support.
Martin Varghese [Thu, 17 Dec 2020 07:18:41 +0000 (12:48 +0530)]
tunnel: Bareudp Tunnel Support.

There are various L3 encapsulation standards using UDP being discussed to
leverage the UDP based load balancing capability of different networks.
MPLSoUDP (__ https://tools.ietf.org/html/rfc7510) is one among them.

The Bareudp tunnel provides a generic L3 encapsulation support for
tunnelling different L3 protocols like MPLS, IP, NSH etc. inside a UDP
tunnel.

An example to create bareudp device to tunnel MPLS traffic is
given

$ ovs-vsctl add-port br_mpls udp_port -- set interface udp_port \
             type=bareudp options:remote_ip=2.1.1.3
             options:local_ip=2.1.1.2 \
             options:payload_type=0x8847 options:dst_port=6635

The bareudp device supports special handling for MPLS & IP as
they can have multiple ethertypes. MPLS procotcol can have ethertypes
ETH_P_MPLS_UC (unicast) & ETH_P_MPLS_MC (multicast). IP protocol can have
ethertypes ETH_P_IP (v4) & ETH_P_IPV6 (v6).

The bareudp device to tunnel L3 traffic with multiple ethertypes
(MPLS & IP) can be created by passing the L3 protocol name as string in
the field payload_type. An example to create bareudp device to tunnel
MPLS unicast & multicast traffic is given below.::

$ ovs-vsctl add-port  br_mpls udp_port -- set interface
            udp_port \
            type=bareudp options:remote_ip=2.1.1.3
            options:local_ip=2.1.1.2 \
            options:payload_type=mpls options:dst_port=6635

Signed-off-by: Martin Varghese <martin.varghese@nokia.com>
Acked-By: Greg Rose <gvrose8192@gmail.com>
Tested-by: Greg Rose <gvrose8192@gmail.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
3 years agoodp-util: Fix netlink message overflow with userdata.
Ilya Maximets [Mon, 21 Dec 2020 15:01:04 +0000 (16:01 +0100)]
odp-util: Fix netlink message overflow with userdata.

Too big userdata could overflow netlink message leading to out-of-bound
memory accesses or assertion while formatting nested actions.

Fix that by checking the size and returning correct error code.

Credit to OSS-Fuzz.

Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=27640
Fixes: e995e3df57ea ("Allow OVS_USERSPACE_ATTR_USERDATA to be variable length.")
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Acked-by: Flavio Leitner <fbl@sysclose.org>