Skip to content

Commit

Permalink
Update OVS to 2.17.0
Browse files Browse the repository at this point in the history
There is no update that significantly impacts Antrea, now that we no
longer rely on the userspace datapath.

We also apply a patch that is available in the 'master' branch, but
hasn't been released yet. The patch fixes antrea-io#2003.

Signed-off-by: Antonin Bas <abas@vmware.com>
  • Loading branch information
antoninbas committed Apr 6, 2022
1 parent 7be763e commit 7237044
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 24 deletions.
2 changes: 1 addition & 1 deletion build/images/deps/ovs-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.15.1
2.17.0
50 changes: 28 additions & 22 deletions build/images/ovs/apply-patches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,15 @@ function version_let() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" == "
# greater than or equal to
function version_get() { test "$(printf '%s\n' "$@" | sort -rV | head -n 1)" == "$1"; }

if version_lt "$OVS_VERSION" "2.13.0" || version_gt "$OVS_VERSION" "2.15.1"; then
echoerr "OVS_VERSION $OVS_VERSION is not supported (must be >= 2.13.0 and <= 2.15.1)"
function apply_patch() {
commit_sha="$1"
shift
curl -s "https://github.com/openvswitch/ovs/commit/$commit_sha.patch" | \
git apply "$@"
}

if version_lt "$OVS_VERSION" "2.13.0" || version_gt "$OVS_VERSION" "2.17.0"; then
echoerr "OVS_VERSION $OVS_VERSION is not supported (must be >= 2.13.0 and <= 2.17.0)"
exit 1
fi

Expand All @@ -46,52 +53,51 @@ fi

# This patch (post 2.13.0) ensures that ct_nw_src/ct_nw_dst supports IP Mask.
if version_let "$OVS_VERSION" "2.13.0"; then
curl https://github.com/openvswitch/ovs/commit/1740aaf49dad6f533705dc3dce8d955a1840052a.patch | \
git apply
apply_patch "1740aaf49dad6f533705dc3dce8d955a1840052a"
fi

if version_get "$OVS_VERSION" "2.13.0" && version_lt "$OVS_VERSION" "2.14.0" ; then
# These 2 patches (post 2.13.x) ensures that datapath flows are not deleted on
# ovs-vswitchd exit by default. Antrea relies on this to support hitless upgrade
# of the Agent DaemonSet.
# The second patch depends on the first one.
curl https://github.com/openvswitch/ovs/commit/586cd3101e7fda54d14fb5bf12d847f35d968627.patch | \
git apply
apply_patch "586cd3101e7fda54d14fb5bf12d847f35d968627"
# We exclude 2 files which are likely to cause conflicts.
curl https://github.com/openvswitch/ovs/commit/79eadafeb1b47a3871cb792aa972f6e4d89d1a0b.patch | \
git apply --exclude NEWS --exclude vswitchd/ovs-vswitchd.8.in
apply_patch "586cd3101e7fda54d14fb5bf12d847f35d968627" "--exclude NEWS" "--exclude vswitchd/ovs-vswitchd.8.in"

# This patch (post 2.13.x) ensures that ovs-vswitchd does not delete datapath
# ports on exit.
curl https://github.com/openvswitch/ovs/commit/7cc77b301f80a63cd4893198d82be0eef303f731.patch | \
git apply
apply_patch "7cc77b301f80a63cd4893198d82be0eef303f731"

# These patches (post 2.13.x) are needed to fix the debian build on Ubuntu 20.04.
curl https://github.com/openvswitch/ovs/commit/c101cd4171cfe04e214f858b4bbe089e56f13f9b.patch | \
git apply
curl https://github.com/openvswitch/ovs/commit/3c18bb0fe9f23308061217f72e2245f0e311b20b.patch | \
git apply
curl https://github.com/openvswitch/ovs/commit/fe175ac17352ceb2dbc9958112b4b1bc114d82f0.patch | \
git apply
apply_patch "c101cd4171cfe04e214f858b4bbe089e56f13f9b"
apply_patch "3c18bb0fe9f23308061217f72e2245f0e311b20b"
apply_patch "fe175ac17352ceb2dbc9958112b4b1bc114d82f0"

# The OVS ovs-monitor-ipsec script has a Python3 shebang but still includes some Python2-specific code.
# Until the patch which fixes the script is merged upstream, we apply it here, or Antrea IPsec support will be broken.
curl https://github.com/openvswitch/ovs/commit/8a09c2590ef2ea0edc250ec46e3d41bd5874b4ab.patch | \
git apply
apply_patch "8a09c2590ef2ea0edc250ec46e3d41bd5874b4ab"
fi

# Starting from version 5.7.0, strongSwan no longer supports specifying a configuration parameter
# with the path delimited by dots in a configuration file. This patch fixes the strongSwan
# configuration parameters that ovs-monitor-ipsec writes, to comply with the new strongSwan format.
if version_lt "$OVS_VERSION" "2.14.1" ; then
curl https://github.com/openvswitch/ovs/commit/b424becaac58d8cb08fb19ea839be6807d3ed57f.patch | \
git apply
apply_patch "b424becaac58d8cb08fb19ea839be6807d3ed57f"
fi

# This patch is necessary to ensure that ovs-monitor-ipsec generates a correct IPsec configuration
# for strongSwan when using IPv6.
curl https://github.com/openvswitch/ovs/commit/e59194b606078d90b73f86092f9b76385afa73f0.patch | \
git apply
if version_lt "$OVS_VERSION" "2.15.4" || (version_get "$OVS_VERSION" "2.16.0" && version_lt "$OVS_VERSION" "2.16.3") ; then
apply_patch "e59194b606078d90b73f86092f9b76385afa73f0"
fi

# This patch fixes a log file leak in OVS.
# See https://github.com/antrea-io/antrea/issues/2003
# It is fixed in the OVS master branch and will be included starting with OVS 2.18.
if version_lt "$OVS_VERSION" "2.18.0" ; then
apply_patch "78ff3961ca9fb012eaaca3d3af1e8186fe1827e7"
fi

# OVS hardcodes the installation path to /usr/lib/python3.7/dist-packages/ but this location
# does not seem to be in the Python path in Ubuntu 20.04. There may be a better way to do this,
Expand Down
2 changes: 1 addition & 1 deletion docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ f06768ee-17ec-4abb-a971-b3b76abc8cda
Port antrea-gw0
Interface antrea-gw0
type: internal
ovs_version: "2.15.1"
ovs_version: "2.17.0"
```

- `ovs-ofctl show br-int`: show OpenFlow information of the OVS bridge.
Expand Down

0 comments on commit 7237044

Please sign in to comment.