Skip to content

Commit

Permalink
bump ovn to v24.03 - part 1 (#4083)
Browse files Browse the repository at this point in the history
Signed-off-by: zhangzujian <[email protected]>
  • Loading branch information
zhangzujian authored Jun 5, 2024
1 parent 7acdbab commit 9650f03
Show file tree
Hide file tree
Showing 19 changed files with 205 additions and 96 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/build-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,25 +86,25 @@ jobs:
uses: actions/checkout@v4
with:
repository: openvswitch/ovs
ref: branch-3.1
ref: branch-3.3
path: ovs

- name: Check out OVN
uses: actions/checkout@v4
with:
repository: ovn-org/ovn
ref: branch-22.12
ref: branch-24.03
path: ovn

- name: Apply OVS patches
working-directory: ovs
run: |
# fix kernel crash
Invoke-WebRequest -Uri "https://github.com/kubeovn/ovs/commit/64383c14a9c25e9e0ca53c6758d9499c60132536.patch" -OutFile ..\ovs-01.patch
Invoke-WebRequest -Uri "https://github.com/kubeovn/ovs/commit/2e4109b122f09342479b7b00aafbabcb2c829169.patch" -OutFile ..\ovs-01.patch
# support for building in github actions
Invoke-WebRequest -Uri "https://github.com/kubeovn/ovs/commit/d170c6237cb6a7bbe16f916ab2286c3c942a852c.patch" -OutFile ..\ovs-02.patch
Invoke-WebRequest -Uri "https://github.com/kubeovn/ovs/commit/eb2e7251e515c50b1c8137b93a81cc74a1eca60c.patch" -OutFile ..\ovs-02.patch
# listen on tcp 127.0.0.1:6643 by default
Invoke-WebRequest -Uri "https://github.com/kubeovn/ovs/commit/680e77a190ae7df3086bc35bb6150238e97f9020.patch" -OutFile ..\ovs-03.patch
Invoke-WebRequest -Uri "https://github.com/kubeovn/ovs/commit/527f4338f42e774807b8461f11978b11b3fe8de3.patch" -OutFile ..\ovs-03.patch
git apply ..\ovs-01.patch
git apply ..\ovs-02.patch
git apply ..\ovs-03.patch
Expand All @@ -113,13 +113,13 @@ jobs:
working-directory: ovn
run: |
# change hash type from dp_hash to hash with field src_ip
Invoke-WebRequest -Uri "https://github.com/kubeovn/ovn/commit/75876f75203bbf06a8f5ffb5628eca98bef03407.patch" -OutFile ..\ovn-01.patch
Invoke-WebRequest -Uri "https://github.com/kubeovn/ovn/commit/fc7edfcfe070e0a4f824fa7ce21843102003d344.patch" -OutFile ..\ovn-01.patch
# add support for windows
Invoke-WebRequest -Uri "https://github.com/kubeovn/ovn/commit/e27cd770e5f5bffb884483546564ce6f286545c2.patch" -OutFile ..\ovn-02.patch
Invoke-WebRequest -Uri "https://github.com/kubeovn/ovn/commit/d497719c50c52ea8542afd31fe7c827854df6857.patch" -OutFile ..\ovn-02.patch
# set br-int controller to TCP 127.0.0.1:6653
Invoke-WebRequest -Uri "https://github.com/kubeovn/ovn/commit/24dcd9485ebb0f6c962250684fae512850cd9210.patch" -OutFile ..\ovn-03.patch
Invoke-WebRequest -Uri "https://github.com/kubeovn/ovn/commit/fd94df637cf32ffe21122a895463185857551a4f.patch" -OutFile ..\ovn-03.patch
# ovn-controller: do not send GARP on localnet for Kube-OVN ports
Invoke-WebRequest -Uri "https://github.com/kubeovn/ovn/commit/30ff0ba51745f5ea1b38ed63e8cd8e0479d0f916.patch" -OutFile ..\ovn-04.patch
Invoke-WebRequest -Uri "https://github.com/kubeovn/ovn/commit/97723a87ded4c35ea4f2465b34ef501e837b365b.patch" -OutFile ..\ovn-04.patch
git apply ..\ovn-01.patch
git apply ..\ovn-02.patch
git apply ..\ovn-03.patch
Expand Down
48 changes: 19 additions & 29 deletions dist/images/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -8,49 +8,39 @@ ENV SRC_DIR='/usr/src'
RUN apt update && apt install -y git curl

RUN cd /usr/src/ && \
git clone -b branch-3.1 --depth=1 https://github.com/openvswitch/ovs.git && \
git clone -b branch-3.3 --depth=1 https://github.com/openvswitch/ovs.git && \
cd ovs && \
# fix memory leak by ofport_usage and trim memory periodically
curl -s https://github.com/kubeovn/ovs/commit/25d71867370c9a44c66b973556338de7a4d9bad7.patch | git apply && \
curl -s https://github.com/kubeovn/ovs/commit/8ff6820a3db1087a6ea4a28a1f743e079ea87315.patch | git apply && \
# increase election timer
curl -s https://github.com/kubeovn/ovs/commit/31f736fb54cf00e893a23e396958883f54f4080f.patch | git apply && \
curl -s https://github.com/kubeovn/ovs/commit/98e1f9081f107205edc40478f61ae79a43c83061.patch | git apply && \
# add fdb update logging
curl -s https://github.com/kubeovn/ovs/commit/119ab5c7e104d25641cdf4506a359c5729acdd9a.patch | git apply && \
curl -s https://github.com/kubeovn/ovs/commit/f2ac94a5a1f382fc4b8e2d3d7725d98ebbef13e2.patch | git apply && \
# fdb: fix mac learning in environments with hairpin enabled
curl -s https://github.com/kubeovn/ovs/commit/40d5597a9a3a09015dda2202f6aa81791c5c03f3.patch | git apply && \
curl -s https://github.com/kubeovn/ovs/commit/321868c6897b9ebcaad9ce3c012e664f84c99ee9.patch | git apply && \
# ovsdb-tool: add optional server id parameter for "join-cluster" command
curl -s https://github.com/kubeovn/ovs/commit/ebf61515da71fa2e23125a92859fbdb96dcbffe7.patch | git apply && \
# Add jitter parameter patch for netem qos
curl -s https://github.com/kubeovn/ovs/commit/2eaaf89fbf3ee2172719ed10d045fd79900edc8e.patch | git apply && \
curl -s https://github.com/kubeovn/ovs/commit/968b4eb4140b2944d75767aa9ae0625bdcc61596.patch | git apply && \
# fix memory leak in qos
curl -s https://github.com/kubeovn/ovs/commit/6a4dd2f4b9311a227cc26fef7c398ae9b241311b.patch | git apply && \
curl -s https://github.com/kubeovn/ovs/commit/fd25c5273eed96e8bc9efab46eecbc815e0ce22b.patch | git apply && \
# ovsdb-tool: add command fix-cluster
curl -s https://github.com/kubeovn/ovs/commit/32f907ae9a1f8efe58dfb58107f02b1442b18edc.patch | git apply && \
# netdev: reduce cpu utilization for getting device addresses
curl -s https://github.com/kubeovn/ovs/commit/181680672eb74e150f8244361468e63167aaea46.patch | git apply && \
curl -s https://github.com/kubeovn/ovs/commit/28d41977a26606f324eadd8d907a8fb2e18505d9.patch | git apply && \
# ovs-router: skip getting source address for kube-ipvs0
curl -s https://github.com/kubeovn/ovs/commit/f9048a894c019cd4cf5587d40cc07054da60ec81.patch | git apply && \
# ovsdb-tool: add command fix-cluster
curl -s https://github.com/kubeovn/ovs/commit/f52c239f5ded40b503e4d217f916b46ca413da4c.patch | git apply
curl -s https://github.com/kubeovn/ovs/commit/b7129150cb763d1fd081ee3c6f669da90d46b965.patch | git apply

RUN cd /usr/src/ && git clone -b branch-22.12 --depth=1 https://github.com/ovn-org/ovn.git && \
RUN cd /usr/src/ && git clone -b branch-24.03 --depth=1 https://github.com/ovn-org/ovn.git && \
cd ovn && \
# change hash type from dp_hash to hash with field src_ip
curl -s https://github.com/kubeovn/ovn/commit/4ad8763f707ff4088ae61396c7931e8735f71f22.patch | git apply && \
# set ether dst addr for dnat on logical switch
curl -s https://github.com/kubeovn/ovn/commit/44875725ad6ce3cb38e4d471d540fe69ed204bff.patch | git apply && \
curl -s https://github.com/kubeovn/ovn/commit/4b2d0bffda64fcfca876fe62a02486d7927c1162.patch | git apply && \
# modify src route priority
curl -s https://github.com/kubeovn/ovn/commit/da1388ece89b27012d081c31310fd577b036b071.patch | git apply && \
curl -s https://github.com/kubeovn/ovn/commit/3dbceb75c5e23d8d5b555e5d87238d40cb557424.patch | git apply && \
# fix reaching resubmit limit in underlay
curl -s https://github.com/kubeovn/ovn/commit/6934f1a1eb5986a904eefb560c0d6d57811453d9.patch | git apply && \
curl -s https://github.com/kubeovn/ovn/commit/6bf6df6da5d6fefae742856e6f43dd672360e48d.patch | git apply && \
# ovn-controller: do not send GARP on localnet for Kube-OVN ports
curl -s https://github.com/kubeovn/ovn/commit/8af8751cdb55f582c675db921f2526b06fd3d8c0.patch | git apply && \
# fix lr-lb dnat with multiple distributed gateway ports
curl -s https://github.com/kubeovn/ovn/commit/80f37c2debbf9f5230403691f791d11cc2b2e277.patch | git apply && \
# lflow: do not send direct traffic between lports to conntrack
curl -s https://github.com/kubeovn/ovn/commit/54cbe0d1ba2051e640dd3e53498f373362547691.patch | git apply && \
curl -s https://github.com/kubeovn/ovn/commit/5fd40530728f98011d2cd852d09ee16d4907cc1d.patch | git apply && \
# northd: add nb option version_compatibility
curl -s https://github.com/kubeovn/ovn/commit/06f5a7c684a6030036e2663eecf934b37c3e666e.patch | git apply && \
# northd: skip conntrack when access node local dns ip
curl -s https://github.com/kubeovn/ovn/commit/1ea964886da774506962d6bf23f8f894d93a10eb.patch | git apply
curl -s https://github.com/kubeovn/ovn/commit/066e2e7da6791327b75110b32c1e47f2bb01fcf8.patch | git apply

RUN apt install -y build-essential fakeroot \
autoconf automake bzip2 debhelper-compat dh-exec dh-python dh-sequence-python3 dh-sequence-sphinxdoc \
Expand Down Expand Up @@ -83,8 +73,8 @@ FROM ubuntu:22.04

ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && apt upgrade -y && apt install ca-certificates python3 hostname libunwind8 netbase \
ethtool iproute2 ncat libunbound-dev procps libatomic1 kmod iptables python3-netifaces python3-sortedcontainers \
tcpdump ipset curl uuid-runtime openssl inetutils-ping arping ndisc6 conntrack iputils-tracepath \
ethtool iproute2 ncat libunbound8 procps libatomic1 kmod iptables python3-netifaces python3-sortedcontainers \
tcpdump ipvsadm ipset curl uuid-runtime openssl inetutils-ping arping ndisc6 conntrack iputils-tracepath \
logrotate dnsutils net-tools strongswan strongswan-pki libcharon-extra-plugins libmnl0 \
libcharon-extauth-plugins libstrongswan-extra-plugins libstrongswan-standard-plugins -y --no-install-recommends && \
rm -rf /var/lib/apt/lists/* && \
Expand Down
57 changes: 29 additions & 28 deletions dist/images/Dockerfile.base-dpdk
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
FROM ubuntu:23.04 AS ovs-builder

ARG ARCH
ARG DPDK_VERSION=23.11.1
ARG DEBIAN_FRONTEND=noninteractive
ENV SRC_DIR='/usr/src'
ENV PIP_BREAK_SYSTEM_PACKAGES=1
Expand All @@ -10,37 +11,37 @@ RUN apt update && apt install -y git curl

# The support for AVX-512 depends on your build machine's CPU. judge it support the avx512 use the command 'cat /proc/cpuinfo | grep avx512'
RUN cd /usr/src/ && \
git clone -b branch-3.1 --depth=1 https://github.com/openvswitch/ovs.git && \
git clone -b branch-3.3 --depth=1 https://github.com/openvswitch/ovs.git && \
cd ovs && \
# fix memory leak by ofport_usage and trim memory periodically
curl -s https://github.com/kubeovn/ovs/commit/25d71867370c9a44c66b973556338de7a4d9bad7.patch | git apply && \
curl -s https://github.com/kubeovn/ovs/commit/8ff6820a3db1087a6ea4a28a1f743e079ea87315.patch | git apply && \
# increase election timer
curl -s https://github.com/kubeovn/ovs/commit/31f736fb54cf00e893a23e396958883f54f4080f.patch | git apply && \
curl -s https://github.com/kubeovn/ovs/commit/98e1f9081f107205edc40478f61ae79a43c83061.patch | git apply && \
# add fdb update logging
curl -s https://github.com/kubeovn/ovs/commit/119ab5c7e104d25641cdf4506a359c5729acdd9a.patch | git apply && \
curl -s https://github.com/kubeovn/ovs/commit/f2ac94a5a1f382fc4b8e2d3d7725d98ebbef13e2.patch | git apply && \
# fdb: fix mac learning in environments with hairpin enabled
curl -s https://github.com/kubeovn/ovs/commit/40d5597a9a3a09015dda2202f6aa81791c5c03f3.patch | git apply && \
curl -s https://github.com/kubeovn/ovs/commit/321868c6897b9ebcaad9ce3c012e664f84c99ee9.patch | git apply && \
# ovsdb-tool: add optional server id parameter for "join-cluster" command
curl -s https://github.com/kubeovn/ovs/commit/ebf61515da71fa2e23125a92859fbdb96dcbffe7.patch | git apply && \
# Add jitter parameter patch for netem qos
curl -s https://github.com/kubeovn/ovs/commit/2eaaf89fbf3ee2172719ed10d045fd79900edc8e.patch | git apply && \
curl -s https://github.com/kubeovn/ovs/commit/968b4eb4140b2944d75767aa9ae0625bdcc61596.patch | git apply && \
# fix memory leak in qos
curl -s https://github.com/kubeovn/ovs/commit/6a4dd2f4b9311a227cc26fef7c398ae9b241311b.patch | git apply && \
curl -s https://github.com/kubeovn/ovs/commit/fd25c5273eed96e8bc9efab46eecbc815e0ce22b.patch | git apply && \
# ovsdb-tool: add command fix-cluster
curl -s https://github.com/kubeovn/ovs/commit/f52c239f5ded40b503e4d217f916b46ca413da4c.patch | git apply
curl -s https://github.com/kubeovn/ovs/commit/32f907ae9a1f8efe58dfb58107f02b1442b18edc.patch | git apply && \
# netdev: reduce cpu utilization for getting device addresses
curl -s https://github.com/kubeovn/ovs/commit/28d41977a26606f324eadd8d907a8fb2e18505d9.patch | git apply && \
# ovs-router: skip getting source address for kube-ipvs0
curl -s https://github.com/kubeovn/ovs/commit/b7129150cb763d1fd081ee3c6f669da90d46b965.patch | git apply

RUN cd /usr/src/ && git clone -b branch-22.12 --depth=1 https://github.com/ovn-org/ovn.git && \
RUN cd /usr/src/ && git clone -b branch-24.03 --depth=1 https://github.com/ovn-org/ovn.git && \
cd ovn && \
# change hash type from dp_hash to hash with field src_ip
curl -s https://github.com/kubeovn/ovn/commit/4ad8763f707ff4088ae61396c7931e8735f71f22.patch | git apply && \
# set ether dst addr for dnat on logical switch
curl -s https://github.com/kubeovn/ovn/commit/44875725ad6ce3cb38e4d471d540fe69ed204bff.patch | git apply && \
curl -s https://github.com/kubeovn/ovn/commit/4b2d0bffda64fcfca876fe62a02486d7927c1162.patch | git apply && \
# modify src route priority
curl -s https://github.com/kubeovn/ovn/commit/da1388ece89b27012d081c31310fd577b036b071.patch | git apply && \
curl -s https://github.com/kubeovn/ovn/commit/3dbceb75c5e23d8d5b555e5d87238d40cb557424.patch | git apply && \
# fix reaching resubmit limit in underlay
curl -s https://github.com/kubeovn/ovn/commit/6934f1a1eb5986a904eefb560c0d6d57811453d9.patch | git apply && \
curl -s https://github.com/kubeovn/ovn/commit/6bf6df6da5d6fefae742856e6f43dd672360e48d.patch | git apply && \
# ovn-controller: do not send GARP on localnet for Kube-OVN ports
curl -s https://github.com/kubeovn/ovn/commit/8af8751cdb55f582c675db921f2526b06fd3d8c0.patch | git apply
curl -s https://github.com/kubeovn/ovn/commit/5fd40530728f98011d2cd852d09ee16d4907cc1d.patch | git apply

RUN apt install -y build-essential fakeroot \
autoconf automake bzip2 debhelper-compat dh-exec dh-python dh-sequence-python3 dh-sequence-sphinxdoc \
Expand All @@ -51,9 +52,9 @@ RUN apt install -y build-essential fakeroot \
RUN pip3 install meson ninja pyelftools

RUN cd /usr/src/ && \
curl -o dpdk-22.11.1.tar.xz https://fast.dpdk.org/rel/dpdk-22.11.1.tar.xz && \
tar xf dpdk-22.11.1.tar.xz && \
export DPDK_DIR=/usr/src/dpdk-stable-22.11.1 && \
curl -o dpdk-${DPDK_VERSION}.tar.xz https://fast.dpdk.org/rel/dpdk-${DPDK_VERSION}.tar.xz && \
tar xf dpdk-${DPDK_VERSION}.tar.xz && \
export DPDK_DIR=/usr/src/dpdk-stable-${DPDK_VERSION} && \
export DPDK_BUILD=$DPDK_DIR/build && \
cd $DPDK_DIR && \
meson build && \
Expand All @@ -67,7 +68,7 @@ RUN cd /usr/src/ovs && \
rm -rf .git && \
echo override_dh_shlibdeps: >> /usr/src/ovs/debian/rules && \
echo "\tdh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info" >> /usr/src/ovs/debian/rules && \
export DPDK_DIR=/usr/src/dpdk-stable-22.11.1 && \
export DPDK_DIR=/usr/src/dpdk-stable-${DPDK_VERSION} && \
CONFIGURE_OPTS='CFLAGS="-fPIC"' && \
if [ "$ARCH" = "amd64" ]; then CONFIGURE_OPTS='CFLAGS="-O2 -g -msse4.2 -mpopcnt -fPIC"'; fi && \
DATAPATH_CONFIGURE_OPTS='--prefix=/usr' EXTRA_CONFIGURE_OPTS=$CONFIGURE_OPTS make debian-deb
Expand All @@ -92,8 +93,8 @@ ARG DEBIAN_FRONTEND=noninteractive
ENV PIP_BREAK_SYSTEM_PACKAGES=1

RUN apt update && apt upgrade -y && apt install ca-certificates python3 hostname libunwind8 netbase \
ethtool iproute2 ncat libunbound-dev procps libatomic1 kmod iptables python3-netifaces python3-sortedcontainers \
tcpdump ipset curl uuid-runtime openssl inetutils-ping arping ndisc6 \
ethtool iproute2 ncat libunbound8 procps libatomic1 kmod iptables python3-netifaces python3-sortedcontainers \
tcpdump ipvsadm ipset curl uuid-runtime openssl inetutils-ping arping ndisc6 conntrack iputils-tracepath \
logrotate dnsutils net-tools strongswan strongswan-pki libcharon-extra-plugins \
libcharon-extauth-plugins libstrongswan-extra-plugins libstrongswan-standard-plugins \
python3-pip build-essential libssl-dev libibverbs-dev libnuma-dev libpcap-dev -y --no-install-recommends && \
Expand All @@ -108,19 +109,19 @@ RUN mkdir -p /var/run/openvswitch && \
mkdir -p /opt/cni/bin

ARG ARCH
ENV CNI_VERSION=v1.4.1
ARG DPDK_VERSION=23.11.1
ARG CNI_VERSION=v1.4.1
RUN curl -sSf -L --retry 5 https://github.com/containernetworking/plugins/releases/download/${CNI_VERSION}/cni-plugins-linux-${ARCH}-${CNI_VERSION}.tgz | tar -xz -C . ./loopback ./portmap ./macvlan

COPY --from=ovs-builder /usr/src/dpdk-stable-22.11.1 /usr/src/dpdk-stable-22.11.1
COPY --from=ovs-builder /usr/src/dpdk-stable-${DPDK_VERSION} /usr/src/dpdk-stable-${DPDK_VERSION}

RUN cd /usr/src/dpdk-stable-22.11.1 && \
RUN cd /usr/src/dpdk-stable-${DPDK_VERSION} && \
rm -rf ./build && \
meson build && \
ninja -C build && \
ninja -C build install && \
ldconfig && \
rm -rf /usr/src/dpdk-stable-22.11.1

rm -rf /usr/src/dpdk-stable-${DPDK_VERSION}

RUN --mount=type=bind,target=/packages,from=ovs-builder,source=/packages \
dpkg -i --ignore-depends=dpdk /packages/*.deb
Expand Down
2 changes: 2 additions & 0 deletions pkg/ovsdb/ovnnb/acl.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/ovsdb/ovnnb/dns.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/ovsdb/ovnnb/logical_router_policy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/ovsdb/ovnnb/logical_router_port.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkg/ovsdb/ovnnb/mirror.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9650f03

Please sign in to comment.