110336
# Copyright (C) 2009, 2010, 2013, 2014 Nicira Networks, Inc.
110336
#
110336
# Copying and distribution of this file, with or without modification,
110336
# are permitted in any medium without royalty provided the copyright
110336
# notice and this notice are preserved.  This file is offered as-is,
110336
# without warranty of any kind.
110336
#
110336
# If tests have to be skipped while building, specify the '--without check'
110336
# option. For example:
110336
# rpmbuild -bb --without check rhel/openvswitch-fedora.spec
110336
110336
# This defines the base package name's version.
110336
110336
%define pkgname openvswitch2.16
110336
110336
110336
%if 0%{?commit:1}
110336
%global shortcommit %(c=%{commit}; echo ${c:0:7})
110336
%endif
110336
110336
# Enable PIE, bz#955181
110336
%global _hardened_build 1
110336
110336
# RHEL-7 doesn't define _rundir macro yet
110336
# Fedora 15 onwards uses /run as _rundir
110336
%if 0%{!?_rundir:1}
110336
%define _rundir /run
110336
%endif
110336
110336
# FIXME Test "STP - flush the fdb and mdb when topology changed" fails on s390x
110336
# FIXME 2 tests fails on ppc64le. They will be hopefully fixed before official 2.11
110336
%ifarch %{ix86} x86_64 aarch64
110336
%bcond_without check
110336
%else
110336
%bcond_with check
110336
%endif
110336
# option to run kernel datapath tests, requires building as root!
110336
%bcond_with check_datapath_kernel
110336
# option to build with libcap-ng, needed for running OVS as regular user
110336
%bcond_without libcapng
110336
# option to build with ipsec support
110336
%bcond_without ipsec
110336
110336
# Build python2 (that provides python) and python3 subpackages on Fedora
110336
# Build only python3 (that provides python) subpackage on RHEL8
110336
# Build only python subpackage on RHEL7
110336
%if 0%{?rhel} > 7 || 0%{?fedora}
110336
# On RHEL8 Sphinx is included in buildroot
110336
%global external_sphinx 1
110336
%else
110336
# Don't use external sphinx (RHV doesn't have optional repositories enabled)
110336
%global external_sphinx 0
110336
%endif
110336
110336
Name: %{pkgname}
110336
Summary: Open vSwitch
110336
Group: System Environment/Daemons daemon/database/utilities
110336
URL: http://www.openvswitch.org/
110336
Version: 2.16.0
Open vSwitch CI 117739
Release: 28%{?dist}
110336
110336
# Nearly all of openvswitch is ASL 2.0.  The bugtool is LGPLv2+, and the
110336
# lib/sflow*.[ch] files are SISSL
110336
# datapath/ is GPLv2 (although not built into any of the binary packages)
110336
License: ASL 2.0 and LGPLv2+ and SISSL
110336
110336
%define dpdkver 20.11.1
110336
%define dpdkdir dpdk
110336
%define dpdksver %(echo %{dpdkver} | cut -d. -f-2)
110336
# NOTE: DPDK does not currently build for s390x
110336
# DPDK on aarch64 is not stable enough to be enabled in FDP
110336
%if 0%{?rhel} > 7 || 0%{?fedora}
110336
%define dpdkarches x86_64 ppc64le
110336
%else
110336
%define dpdkarches
110336
%endif
110336
110336
%if 0%{?commit:1}
110336
Source: https://github.com/openvswitch/ovs/archive/%{commit}.tar.gz#/openvswitch-%{commit}.tar.gz
110336
%else
110336
Source: https://github.com/openvswitch/ovs/archive/v%{version}.tar.gz#/openvswitch-%{version}.tar.gz
110336
%endif
110336
Source10: https://fast.dpdk.org/rel/dpdk-%{dpdkver}.tar.xz
110336
110336
%define docutilsver 0.12
110336
%define pygmentsver 1.4
110336
%define sphinxver   1.2.3
110336
Source100: https://pypi.io/packages/source/d/docutils/docutils-%{docutilsver}.tar.gz
110336
Source101: https://pypi.io/packages/source/P/Pygments/Pygments-%{pygmentsver}.tar.gz
110336
Source102: https://pypi.io/packages/source/S/Sphinx/Sphinx-%{sphinxver}.tar.gz
110336
110336
Patch:     openvswitch-%{version}.patch
110336
110336
# The DPDK is designed to optimize througput of network traffic using, among
110336
# other techniques, carefully crafted assembly instructions.  As such it
110336
# needs extensive work to port it to other architectures.
110336
ExclusiveArch: x86_64 aarch64 ppc64le s390x
110336
110336
# Do not enable this otherwise YUM will break on any upgrade.
110336
# Provides: openvswitch
110336
Conflicts: openvswitch < 2.16
110336
Conflicts: openvswitch-dpdk < 2.16
110336
Conflicts: openvswitch2.10
110336
Conflicts: openvswitch2.11
110336
Conflicts: openvswitch2.12
110336
Conflicts: openvswitch2.13
110336
Conflicts: openvswitch2.14
110336
Conflicts: openvswitch2.15
110336
110336
# FIXME Sphinx is used to generate some manpages, unfortunately, on RHEL, it's
110336
# in the -optional repository and so we can't require it directly since RHV
110336
# doesn't have the -optional repository enabled and so TPS fails
110336
%if %{external_sphinx}
110336
BuildRequires: python3-sphinx
110336
%else
110336
# Sphinx dependencies
110336
BuildRequires: python-devel
110336
BuildRequires: python-setuptools
110336
#BuildRequires: python2-docutils
110336
BuildRequires: python-jinja2
110336
BuildRequires: python-nose
110336
#BuildRequires: python2-pygments
110336
# docutils dependencies
110336
BuildRequires: python-imaging
110336
# pygments dependencies
110336
BuildRequires: python-nose
110336
%endif
110336
110336
BuildRequires: gcc gcc-c++ make
110336
BuildRequires: autoconf automake libtool
110336
BuildRequires: systemd-units openssl openssl-devel
110336
BuildRequires: python3-devel python3-setuptools
110336
BuildRequires: desktop-file-utils
110336
BuildRequires: groff-base graphviz
110336
BuildRequires: unbound-devel
110336
# make check dependencies
110336
BuildRequires: procps-ng
110336
%if 0%{?rhel} > 7 || 0%{?fedora}
110336
BuildRequires: python3-pyOpenSSL
110336
%endif
110336
%if %{with check_datapath_kernel}
110336
BuildRequires: nmap-ncat
110336
# would be useful but not available in RHEL or EPEL
110336
#BuildRequires: pyftpdlib
110336
%endif
110336
110336
%if %{with libcapng}
110336
BuildRequires: libcap-ng libcap-ng-devel
110336
%endif
110336
110336
%ifarch %{dpdkarches}
110336
BuildRequires: meson
110336
# DPDK driver dependencies
110336
BuildRequires: zlib-devel numactl-devel
110336
%ifarch x86_64
110336
BuildRequires: rdma-core-devel >= 15 libmnl-devel
110336
%endif
110336
110336
# Required by packaging policy for the bundled DPDK
110336
Provides: bundled(dpdk) = %{dpdkver}
110336
%endif
110336
110336
Requires: openssl iproute module-init-tools
110336
#Upstream kernel commit 4f647e0a3c37b8d5086214128614a136064110c3
110336
#Requires: kernel >= 3.15.0-0
110336
Requires: openvswitch-selinux-extra-policy
110336
110336
Requires(pre): shadow-utils
110336
Requires(post): /bin/sed
110336
Requires(post): /usr/sbin/usermod
110336
Requires(post): /usr/sbin/groupadd
110336
Requires(post): systemd-units
110336
Requires(preun): systemd-units
110336
Requires(postun): systemd-units
110336
Obsoletes: openvswitch-controller <= 0:2.1.0-1
110336
110336
%description
110336
Open vSwitch provides standard network bridging functions and
110336
support for the OpenFlow protocol for remote per-flow control of
110336
traffic.
110336
110336
%package -n python3-%{pkgname}
110336
Summary: Open vSwitch python3 bindings
110336
License: ASL 2.0
110336
Requires: %{pkgname} = %{?epoch:%{epoch}:}%{version}-%{release}
110336
Provides: python-%{pkgname} = %{?epoch:%{epoch}:}%{version}-%{release}
110336
110336
%description -n python3-%{pkgname}
110336
Python bindings for the Open vSwitch database
110336
110336
%package test
110336
Summary: Open vSwitch testing utilities
110336
License: ASL 2.0
110336
BuildArch: noarch
110336
Requires: python3-%{pkgname} = %{?epoch:%{epoch}:}%{version}-%{release}
110336
Requires: tcpdump
110336
110336
%description test
110336
Utilities that are useful to diagnose performance and connectivity
110336
issues in Open vSwitch setup.
110336
110336
%package devel
110336
Summary: Open vSwitch OpenFlow development package (library, headers)
110336
License: ASL 2.0
110336
Requires: %{pkgname} = %{?epoch:%{epoch}:}%{version}-%{release}
110336
110336
%description devel
110336
This provides shared library, libopenswitch.so and the openvswitch header
110336
files needed to build an external application.
110336
110336
%if 0%{?rhel} > 7 || 0%{?fedora} > 28
110336
%package -n network-scripts-%{name}
110336
Summary: Open vSwitch legacy network service support
110336
License: ASL 2.0
110336
Requires: network-scripts
110336
Supplements: (%{name} and network-scripts)
110336
110336
%description -n network-scripts-%{name}
110336
This provides the ifup and ifdown scripts for use with the legacy network
110336
service.
110336
%endif
110336
110336
%if %{with ipsec}
110336
%package ipsec
110336
Summary: Open vSwitch IPsec tunneling support
110336
License: ASL 2.0
110336
Requires: python3-%{pkgname} = %{?epoch:%{epoch}:}%{version}-%{release}
110336
Requires: libreswan
110336
110336
%description ipsec
110336
This package provides IPsec tunneling support for OVS tunnels.
110336
%endif
110336
110336
%prep
110336
%if 0%{?commit:1}
110336
%setup -q -n ovs-%{commit} -a 10
110336
%else
110336
%setup -q -n ovs-%{version} -a 10
110336
%endif
110336
%if ! %{external_sphinx}
110336
%if 0%{?commit:1}
110336
%setup -n ovs-%{commit} -q -D -T -a 100 -a 101 -a 102
110336
%else
110336
%setup -n ovs-%{version} -q -D -T -a 100 -a 101 -a 102
110336
%endif
110336
%endif
110336
110336
mv dpdk-*/ %{dpdkdir}/
110336
110336
# FIXME should we propose a way to do that upstream?
110336
sed -ri "/^subdir\('(usertools|app)'\)/d" %{dpdkdir}/meson.build
110336
110336
%patch -p1
110336
110336
%build
110336
# Build Sphinx on RHEL
110336
%if ! %{external_sphinx}
110336
export PYTHONPATH="${PYTHONPATH:+$PYTHONPATH:}%{_builddir}/pytmp/lib/python"
110336
for x in docutils-%{docutilsver} Pygments-%{pygmentsver} Sphinx-%{sphinxver}; do
110336
    pushd "$x"
110336
    python2 setup.py install --home %{_builddir}/pytmp
110336
    popd
110336
done
110336
110336
export PATH="$PATH:%{_builddir}/pytmp/bin"
110336
%endif
110336
110336
./boot.sh
110336
110336
%ifarch %{dpdkarches}    # build dpdk
110336
# Lets build DPDK first
110336
cd %{dpdkdir}
110336
110336
ENABLED_DRIVERS=(
110336
    bus/pci
110336
    bus/vdev
110336
    mempool/ring
110336
    net/failsafe
110336
    net/i40e
110336
    net/ring
110336
    net/vhost
110336
    net/virtio
110336
    net/tap
110336
)
110336
110336
%ifarch x86_64
110336
ENABLED_DRIVERS+=(
110336
    bus/vmbus
110336
    common/iavf
110336
    common/mlx5
110336
    net/bnxt
110336
    net/enic
110336
    net/iavf
110336
    net/ice
110336
    net/mlx5
110336
    net/netvsc
110336
    net/nfp
110336
    net/qede
110336
    net/vdev_netvsc
110336
)
110336
%endif
110336
110336
%ifarch aarch64 x86_64
110336
ENABLED_DRIVERS+=(
110336
    net/e1000
110336
    net/ixgbe
110336
)
110336
%endif
110336
110336
# Since upstream doesn't have a way
110336
for driver in drivers/*/*/; do
110336
    driver=${driver#drivers/}
110336
    driver=${driver%/}
110336
    [[ " ${ENABLED_DRIVERS[@]} " == *" $driver "* ]] || \
110336
        disable_drivers="${disable_drivers:+$disable_drivers,}"$driver
110336
done
110336
110336
#CFLAGS="$(echo %{optflags} | sed -e 's:-Wall::g' -e 's:-march=[[:alnum:]]* ::g') -Wformat -fPIC %{_hardening_ldflags}" \
110336
%set_build_flags
110336
%__meson --prefix=%{_builddir}/dpdk-build \
110336
         --buildtype=plain \
110336
         -Ddisable_drivers="$disable_drivers" \
110336
         -Dmachine=default \
110336
         -Dmax_ethports=128 \
110336
         -Dmax_numa_nodes=8 \
110336
         -Dtests=false \
110336
         %{_vpath_builddir}
110336
%meson_build
110336
%__meson install -C %{_vpath_builddir} --no-rebuild
110336
110336
# FIXME currently with LTO enabled OVS tries to link with both static and shared libraries
110336
rm -v %{_builddir}/dpdk-build/%{_lib}/*.so*
110336
110336
# Generate a list of supported drivers, its hard to tell otherwise.
110336
cat << EOF > README.DPDK-PMDS
110336
DPDK drivers included in this package:
110336
110336
EOF
110336
110336
for f in %{_builddir}/dpdk-build/%{_lib}/librte_net_*.a; do
110336
    basename ${f} | cut -c12- | cut -d. -f1 | tr [:lower:] [:upper:]
110336
done >> README.DPDK-PMDS
110336
110336
cat << EOF >> README.DPDK-PMDS
110336
110336
For further information about the drivers, see
110336
http://dpdk.org/doc/guides-%{dpdksver}/nics/index.html
110336
EOF
110336
110336
cd -
110336
%endif    # build dpdk
110336
110336
# And now for OVS...
110336
mkdir build-shared build-static
110336
pushd build-shared
110336
ln -s ../configure
110336
%configure \
110336
%if %{with libcapng}
110336
        --enable-libcapng \
110336
%else
110336
        --disable-libcapng \
110336
%endif
110336
        --disable-static \
110336
        --enable-shared \
110336
        --enable-ssl \
110336
        --with-pkidir=%{_sharedstatedir}/openvswitch/pki
110336
make %{?_smp_mflags}
110336
popd
110336
pushd build-static
110336
ln -s ../configure
110336
%ifarch %{dpdkarches}
110336
PKG_CONFIG_PATH=%{_builddir}/dpdk-build/%{_lib}/pkgconfig \
110336
%endif
110336
%configure \
110336
%if %{with libcapng}
110336
        --enable-libcapng \
110336
%else
110336
        --disable-libcapng \
110336
%endif
110336
        --enable-ssl \
110336
%ifarch %{dpdkarches}
110336
        --with-dpdk=static \
110336
%endif
110336
        --with-pkidir=%{_sharedstatedir}/openvswitch/pki
110336
make %{?_smp_mflags}
110336
popd
110336
110336
/usr/bin/python3 build-aux/dpdkstrip.py \
110336
        --dpdk \
110336
        < rhel/usr_lib_systemd_system_ovs-vswitchd.service.in \
110336
        > rhel/usr_lib_systemd_system_ovs-vswitchd.service
110336
110336
%install
110336
rm -rf $RPM_BUILD_ROOT
110336
make -C build-shared install-libLTLIBRARIES DESTDIR=$RPM_BUILD_ROOT
110336
make -C build-static install DESTDIR=$RPM_BUILD_ROOT
110336
110336
install -d -m 0755 $RPM_BUILD_ROOT%{_rundir}/openvswitch
110336
install -d -m 0750 $RPM_BUILD_ROOT%{_localstatedir}/log/openvswitch
110336
install -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch
110336
110336
install -p -D -m 0644 rhel/usr_lib_udev_rules.d_91-vfio.rules \
110336
        $RPM_BUILD_ROOT%{_udevrulesdir}/91-vfio.rules
110336
110336
install -p -D -m 0644 \
110336
        rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
110336
        $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/openvswitch
110336
110336
for service in openvswitch ovsdb-server ovs-vswitchd \
110336
               ovs-delete-transient-ports; do
110336
        install -p -D -m 0644 \
110336
                        rhel/usr_lib_systemd_system_${service}.service \
110336
                        $RPM_BUILD_ROOT%{_unitdir}/${service}.service
110336
done
110336
110336
%if %{with ipsec}
110336
install -p -D -m 0644 rhel/usr_lib_systemd_system_openvswitch-ipsec.service \
110336
                      $RPM_BUILD_ROOT%{_unitdir}/openvswitch-ipsec.service
110336
%endif
110336
110336
install -m 0755 rhel/etc_init.d_openvswitch \
110336
        $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/openvswitch.init
110336
110336
install -p -D -m 0644 rhel/etc_openvswitch_default.conf \
110336
        $RPM_BUILD_ROOT/%{_sysconfdir}/openvswitch/default.conf
110336
110336
install -p -D -m 0644 rhel/etc_logrotate.d_openvswitch \
110336
        $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/openvswitch
110336
110336
install -m 0644 vswitchd/vswitch.ovsschema \
110336
        $RPM_BUILD_ROOT/%{_datadir}/openvswitch/vswitch.ovsschema
110336
110336
install -d -m 0755 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/
110336
install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifdown-ovs \
110336
        $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
110336
install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifup-ovs \
110336
        $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
110336
110336
install -d -m 0755 $RPM_BUILD_ROOT%{python3_sitelib}
110336
cp -a $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/ovstest \
110336
        $RPM_BUILD_ROOT%{python3_sitelib}
110336
110336
# Build the JSON C extension for the Python lib (#1417738)
110336
pushd python
110336
(
110336
export CPPFLAGS="-I ../include -I ../build-shared/include"
110336
export LDFLAGS="%{__global_ldflags} -L $RPM_BUILD_ROOT%{_libdir}"
110336
%py3_build
110336
%py3_install
110336
[ -f "$RPM_BUILD_ROOT/%{python3_sitearch}/ovs/_json$(python3-config --extension-suffix)" ]
110336
)
110336
popd
110336
110336
rm -rf $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/
110336
110336
install -d -m 0755 $RPM_BUILD_ROOT/%{_sharedstatedir}/openvswitch
110336
110336
install -d -m 0755 $RPM_BUILD_ROOT%{_prefix}/lib/firewalld/services/
110336
110336
install -p -D -m 0755 \
110336
        rhel/usr_share_openvswitch_scripts_ovs-systemd-reload \
110336
        $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/ovs-systemd-reload
110336
110336
touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/conf.db
110336
# The db needs special permission as IPsec Pre-shared keys are stored in it.
110336
chmod 0640 $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/conf.db
110336
110336
touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/system-id.conf
110336
110336
# remove unpackaged files
110336
rm -f $RPM_BUILD_ROOT/%{_bindir}/ovs-benchmark \
110336
        $RPM_BUILD_ROOT/%{_bindir}/ovs-docker \
110336
        $RPM_BUILD_ROOT/%{_bindir}/ovs-parse-backtrace \
110336
        $RPM_BUILD_ROOT/%{_bindir}/ovs-testcontroller \
110336
        $RPM_BUILD_ROOT/%{_sbindir}/ovs-vlan-bug-workaround \
110336
        $RPM_BUILD_ROOT/%{_mandir}/man1/ovs-benchmark.1* \
110336
        $RPM_BUILD_ROOT/%{_mandir}/man8/ovs-testcontroller.* \
110336
        $RPM_BUILD_ROOT/%{_mandir}/man8/ovs-vlan-bug-workaround.8*
110336
110336
%if ! %{with ipsec}
110336
rm -f $RPM_BUILD_ROOT/%{_datadir}/openvswitch/scripts/ovs-monitor-ipsec
110336
%endif
110336
110336
# remove ovn unpackages files
110336
rm -f $RPM_BUILD_ROOT%{_bindir}/ovn*
110336
rm -f $RPM_BUILD_ROOT%{_mandir}/man1/ovn*
110336
rm -f $RPM_BUILD_ROOT%{_mandir}/man5/ovn*
110336
rm -f $RPM_BUILD_ROOT%{_mandir}/man7/ovn*
110336
rm -f $RPM_BUILD_ROOT%{_mandir}/man8/ovn*
110336
rm -f $RPM_BUILD_ROOT%{_datadir}/openvswitch/ovn*
110336
rm -f $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/ovn*
110336
rm -f $RPM_BUILD_ROOT%{_includedir}/ovn/*
110336
110336
%check
110336
%if %{with check}
110336
    pushd build-static
110336
    touch resolv.conf
110336
    export OVS_RESOLV_CONF=$(pwd)/resolv.conf
110336
    if make check TESTSUITEFLAGS='%{_smp_mflags}' ||
110336
       make check TESTSUITEFLAGS='--recheck'; then :;
110336
    else
110336
        cat tests/testsuite.log
110336
        exit 1
110336
    fi
110336
    popd
110336
%endif
110336
%if %{with check_datapath_kernel}
110336
    pushd build-static
110336
    if make check-kernel RECHECK=yes; then :;
110336
    else
110336
        cat tests/system-kmod-testsuite.log
110336
        exit 1
110336
    fi
110336
    popd
110336
%endif
110336
110336
%clean
110336
rm -rf $RPM_BUILD_ROOT
110336
110336
%preun
110336
%if 0%{?systemd_preun:1}
110336
    %systemd_preun openvswitch.service
110336
%else
110336
    if [ $1 -eq 0 ] ; then
110336
    # Package removal, not upgrade
110336
        /bin/systemctl --no-reload disable openvswitch.service >/dev/null 2>&1 || :
110336
        /bin/systemctl stop openvswitch.service >/dev/null 2>&1 || :
110336
    fi
110336
%endif
110336
110336
%pre
110336
getent group openvswitch >/dev/null || groupadd -r openvswitch
110336
getent passwd openvswitch >/dev/null || \
110336
    useradd -r -g openvswitch -d / -s /sbin/nologin \
110336
    -c "Open vSwitch Daemons" openvswitch
110336
110336
%ifarch %{dpdkarches}
110336
    getent group hugetlbfs >/dev/null || groupadd hugetlbfs
110336
    usermod -a -G hugetlbfs openvswitch
110336
%endif
110336
exit 0
110336
110336
%post
110336
if [ $1 -eq 1 ]; then
110336
    sed -i 's:^#OVS_USER_ID=:OVS_USER_ID=:' /etc/sysconfig/openvswitch
110336
110336
%ifarch %{dpdkarches}
110336
    sed -i \
110336
        's@OVS_USER_ID="openvswitch:openvswitch"@OVS_USER_ID="openvswitch:hugetlbfs"@'\
110336
        /etc/sysconfig/openvswitch
110336
%endif
110336
fi
110336
chown -R openvswitch:openvswitch /etc/openvswitch
110336
110336
%if 0%{?systemd_post:1}
110336
    %systemd_post openvswitch.service
110336
%else
110336
    # Package install, not upgrade
110336
    if [ $1 -eq 1 ]; then
110336
        /bin/systemctl daemon-reload >dev/null || :
110336
    fi
110336
%endif
110336
110336
%postun
110336
%if 0%{?systemd_postun:1}
110336
    %systemd_postun openvswitch.service
110336
%else
110336
    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
110336
%endif
110336
110336
%triggerun -- openvswitch < 2.5.0-22.git20160727%{?dist}
110336
# old rpm versions restart the service in postun, but
110336
# due to systemd some preparation is needed.
110336
if systemctl is-active openvswitch >/dev/null 2>&1 ; then
110336
    /usr/share/openvswitch/scripts/ovs-ctl stop >/dev/null 2>&1 || :
110336
    systemctl daemon-reload >/dev/null 2>&1 || :
110336
    systemctl stop openvswitch ovsdb-server ovs-vswitchd >/dev/null 2>&1 || :
110336
    systemctl start openvswitch >/dev/null 2>&1 || :
110336
fi
110336
exit 0
110336
110336
%files -n python3-%{pkgname}
110336
%{python3_sitearch}/ovs
110336
%{python3_sitearch}/ovs-*.egg-info
110336
%doc LICENSE
110336
110336
%files test
110336
%{_bindir}/ovs-pcap
110336
%{_bindir}/ovs-tcpdump
110336
%{_bindir}/ovs-tcpundump
110336
%{_mandir}/man1/ovs-pcap.1*
110336
%{_mandir}/man8/ovs-tcpdump.8*
110336
%{_mandir}/man1/ovs-tcpundump.1*
110336
%{_bindir}/ovs-test
110336
%{_bindir}/ovs-vlan-test
110336
%{_bindir}/ovs-l3ping
110336
%{_mandir}/man8/ovs-test.8*
110336
%{_mandir}/man8/ovs-vlan-test.8*
110336
%{_mandir}/man8/ovs-l3ping.8*
110336
%{python3_sitelib}/ovstest
110336
110336
%files devel
110336
%{_libdir}/*.so
110336
%{_libdir}/pkgconfig/*.pc
110336
%{_includedir}/openvswitch/*
110336
%{_includedir}/openflow/*
110336
%exclude %{_libdir}/*.a
110336
%exclude %{_libdir}/*.la
110336
110336
%if 0%{?rhel} > 7 || 0%{?fedora} > 28
110336
%files -n network-scripts-%{name}
110336
%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
110336
%{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
110336
%endif
110336
110336
%files
110336
%defattr(-,openvswitch,openvswitch)
110336
%dir %{_sysconfdir}/openvswitch
110336
%{_sysconfdir}/openvswitch/default.conf
110336
%config %ghost %verify(not owner group md5 size mtime) %{_sysconfdir}/openvswitch/conf.db
110336
%ghost %attr(0600,-,-) %verify(not owner group md5 size mtime) %{_sysconfdir}/openvswitch/.conf.db.~lock~
110336
%config %ghost %{_sysconfdir}/openvswitch/system-id.conf
110336
%defattr(-,root,root)
110336
%config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/sysconfig/openvswitch
110336
%{_sysconfdir}/bash_completion.d/ovs-appctl-bashcomp.bash
110336
%{_sysconfdir}/bash_completion.d/ovs-vsctl-bashcomp.bash
110336
%config(noreplace) %{_sysconfdir}/logrotate.d/openvswitch
110336
%{_unitdir}/openvswitch.service
110336
%{_unitdir}/ovsdb-server.service
110336
%{_unitdir}/ovs-vswitchd.service
110336
%{_unitdir}/ovs-delete-transient-ports.service
110336
%{_datadir}/openvswitch/scripts/openvswitch.init
110336
%{_datadir}/openvswitch/scripts/ovs-check-dead-ifs
110336
%{_datadir}/openvswitch/scripts/ovs-lib
110336
%{_datadir}/openvswitch/scripts/ovs-save
110336
%{_datadir}/openvswitch/scripts/ovs-vtep
110336
%{_datadir}/openvswitch/scripts/ovs-ctl
110336
%{_datadir}/openvswitch/scripts/ovs-kmod-ctl
110336
%{_datadir}/openvswitch/scripts/ovs-systemd-reload
110336
%config %{_datadir}/openvswitch/vswitch.ovsschema
110336
%config %{_datadir}/openvswitch/vtep.ovsschema
110336
%{_bindir}/ovs-appctl
110336
%{_bindir}/ovs-dpctl
110336
%{_bindir}/ovs-ofctl
110336
%{_bindir}/ovs-vsctl
110336
%{_bindir}/ovsdb-client
110336
%{_bindir}/ovsdb-tool
110336
%{_bindir}/ovs-pki
110336
%{_bindir}/vtep-ctl
110336
%{_libdir}/*.so.*
110336
%{_sbindir}/ovs-vswitchd
110336
%{_sbindir}/ovsdb-server
110336
%{_mandir}/man1/ovsdb-client.1*
110336
%{_mandir}/man1/ovsdb-server.1*
110336
%{_mandir}/man1/ovsdb-tool.1*
110336
%{_mandir}/man5/ovsdb.5*
110336
%{_mandir}/man5/ovsdb-server.5.*
110336
%{_mandir}/man5/ovs-vswitchd.conf.db.5*
110336
%{_mandir}/man5/vtep.5*
110336
%{_mandir}/man7/ovsdb-server.7*
110336
%{_mandir}/man7/ovsdb.7*
110336
%{_mandir}/man7/ovs-actions.7*
110336
%{_mandir}/man7/ovs-fields.7*
110336
%{_mandir}/man8/vtep-ctl.8*
110336
%{_mandir}/man8/ovs-appctl.8*
110336
%{_mandir}/man8/ovs-ctl.8*
110336
%{_mandir}/man8/ovs-dpctl.8*
110336
%{_mandir}/man8/ovs-kmod-ctl.8.*
110336
%{_mandir}/man8/ovs-ofctl.8*
110336
%{_mandir}/man8/ovs-pki.8*
110336
%{_mandir}/man8/ovs-vsctl.8*
110336
%{_mandir}/man8/ovs-vswitchd.8*
110336
%{_mandir}/man8/ovs-parse-backtrace.8*
110336
%{_udevrulesdir}/91-vfio.rules
110336
%doc LICENSE NOTICE README.rst NEWS rhel/README.RHEL.rst
110336
%ifarch %{dpdkarches}
110336
%doc %{dpdkdir}/README.DPDK-PMDS
Open vSwitch CI 3f9b5c
%attr(750,openvswitch,hugetlbfs) %verify(not owner group) /var/log/openvswitch
Open vSwitch CI 3f9b5c
%else
Open vSwitch CI 3f9b5c
%attr(750,openvswitch,openvswitch) %verify(not owner group) /var/log/openvswitch
110336
%endif
110336
/var/lib/openvswitch
110336
%ghost %attr(755,root,root) %verify(not owner group) %{_rundir}/openvswitch
110336
%{_datadir}/openvswitch/bugtool-plugins/
110336
%{_datadir}/openvswitch/scripts/ovs-bugtool-*
110336
%{_bindir}/ovs-dpctl-top
110336
%{_sbindir}/ovs-bugtool
110336
%{_mandir}/man8/ovs-dpctl-top.8*
110336
%{_mandir}/man8/ovs-bugtool.8*
110336
%if (0%{?rhel} && 0%{?rhel} <= 7) || (0%{?fedora} && 0%{?fedora} < 29)
110336
%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
110336
%{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
110336
%endif
110336
110336
%if %{with ipsec}
110336
%files ipsec
110336
%{_datadir}/openvswitch/scripts/ovs-monitor-ipsec
110336
%{_unitdir}/openvswitch-ipsec.service
110336
%endif
110336
110336
%changelog
Open vSwitch CI 117739
* Wed Nov 10 2021 Timothy Redaelli <tredaelli@redhat.com> - 2.16.0-28
Open vSwitch CI 117739
- redhat: remove mlx4 support [RH git: 4c846afd24] (#1998122)
Open vSwitch CI 117739
    Resolves: #1998122
Open vSwitch CI 117739
Open vSwitch CI 117739
Open vSwitch CI 483c2c
* Tue Nov 09 2021 Ilya Maximets <i.maximets@redhat.com> - 2.16.0-27
Open vSwitch CI 483c2c
- ovsdb: Don't let transaction history grow larger than the database. [RH git: 93d1fa0bdf] (#2012949)
Open vSwitch CI 483c2c
    commit 317b1bfd7dd315e241c158e6d4095002ff391ee3
Open vSwitch CI 483c2c
    Author: Ilya Maximets <i.maximets@ovn.org>
Open vSwitch CI 483c2c
    Date:   Tue Sep 28 13:17:21 2021 +0200
Open vSwitch CI 483c2c
    
Open vSwitch CI 483c2c
        ovsdb: Don't let transaction history grow larger than the database.
Open vSwitch CI 483c2c
    
Open vSwitch CI 483c2c
        If user frequently changes a lot of rows in a database, transaction
Open vSwitch CI 483c2c
        history could grow way larger than the database itself.  This wastes
Open vSwitch CI 483c2c
        a lot of memory and also makes monitor_cond_since slower than
Open vSwitch CI 483c2c
        usual monotor_cond if the transaction id is old enough, because
Open vSwitch CI 483c2c
        re-construction of the changes from a history is slower than just
Open vSwitch CI 483c2c
        creation of initial database snapshot.  This is also the case if
Open vSwitch CI 483c2c
        user deleted a lot of data, so transaction history still holds all of
Open vSwitch CI 483c2c
        it while the database itself doesn't.
Open vSwitch CI 483c2c
    
Open vSwitch CI 483c2c
        In case of current lb-per-service model in ovn-kubernetes, each
Open vSwitch CI 483c2c
        load-balancer is added to every logical switch/router.  Such a
Open vSwitch CI 483c2c
        transaction touches more than a half of a OVN_Northbound database.
Open vSwitch CI 483c2c
        And each of these transactions is added to the transaction history.
Open vSwitch CI 483c2c
        Since transaction history depth is 100, in worst case scenario,
Open vSwitch CI 483c2c
        it will hold 100 copies of a database increasing memory consumption
Open vSwitch CI 483c2c
        dramatically.  In tests with 3000 LBs and 120 LSs, memory goes up
Open vSwitch CI 483c2c
        to 3 GB, while holding at 30 MB if transaction history disabled in
Open vSwitch CI 483c2c
        the code.
Open vSwitch CI 483c2c
    
Open vSwitch CI 483c2c
        Fixing that by keeping count of the number of ovsdb_atom's in the
Open vSwitch CI 483c2c
        database and not allowing the total number of atoms in transaction
Open vSwitch CI 483c2c
        history to grow larger than this value.  Counting atoms is fairly
Open vSwitch CI 483c2c
        cheap because we don't need to iterate over them, so it doesn't have
Open vSwitch CI 483c2c
        significant performance impact.  It would be ideal to measure the
Open vSwitch CI 483c2c
        size of individual atoms, but that will hit the performance.
Open vSwitch CI 483c2c
        Counting cells instead of atoms is not sufficient, because OVN
Open vSwitch CI 483c2c
        users are adding hundreds or thousands of atoms to a single cell,
Open vSwitch CI 483c2c
        so they are largely different in size.
Open vSwitch CI 483c2c
    
Open vSwitch CI 483c2c
        Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Open vSwitch CI 483c2c
        Acked-by: Han Zhou <hzhou@ovn.org>
Open vSwitch CI 483c2c
        Acked-by: Dumitru Ceara <dceara@redhat.com>
Open vSwitch CI 483c2c
    
Open vSwitch CI 483c2c
    Reported-at: https://bugzilla.redhat.com/2012949
Open vSwitch CI 483c2c
    Signed-off-by: Ilya Maximets <i.maximets@redhat.com>
Open vSwitch CI 483c2c
Open vSwitch CI 483c2c
Open vSwitch CI 483c2c
* Tue Nov 09 2021 Ilya Maximets <i.maximets@redhat.com> - 2.16.0-26
Open vSwitch CI 483c2c
- ovsdb: transaction: Incremental reassessment of weak refs. [RH git: e8a363db49] (#2005958)
Open vSwitch CI 483c2c
    commit 4dbff9f0a68579241ac1a040726be3906afb8fe9
Open vSwitch CI 483c2c
    Author: Ilya Maximets <i.maximets@ovn.org>
Open vSwitch CI 483c2c
    Date:   Sat Oct 16 03:20:23 2021 +0200
Open vSwitch CI 483c2c
    
Open vSwitch CI 483c2c
        ovsdb: transaction: Incremental reassessment of weak refs.
Open vSwitch CI 483c2c
    
Open vSwitch CI 483c2c
        The main idea is to not store list of weak references in the source
Open vSwitch CI 483c2c
        row, so they all don't need to be re-checked/updated on every
Open vSwitch CI 483c2c
        modification of that source row.  The point is that source row already
Open vSwitch CI 483c2c
        knows UUIDs of all destination rows stored in the data, so there is no
Open vSwitch CI 483c2c
        much profit in storing this information somewhere else.  If needed,
Open vSwitch CI 483c2c
        destination row can be looked up and reference can be looked up in the
Open vSwitch CI 483c2c
        destination row.  For the fast lookup, destination row now stores
Open vSwitch CI 483c2c
        references in a hash map.
Open vSwitch CI 483c2c
    
Open vSwitch CI 483c2c
        Weak reference structure now contains the table and uuid of a source
Open vSwitch CI 483c2c
        row instead of a direct pointer.  This allows to replace/update the
Open vSwitch CI 483c2c
        source row without breaking any weak references stored in destination
Open vSwitch CI 483c2c
        rows.
Open vSwitch CI 483c2c
    
Open vSwitch CI 483c2c
        Structure also now contains the key-value pair of atoms that triggered
Open vSwitch CI 483c2c
        creation of this reference.  These atoms can be used to quickly
Open vSwitch CI 483c2c
        subtract removed references from a source row.  During reassessment,
Open vSwitch CI 483c2c
        ovsdb now only needs to care about new added or removed atoms, and
Open vSwitch CI 483c2c
        atoms that got removed due to removal of the destination rows, but
Open vSwitch CI 483c2c
        these are marked for reassessment by the destination row.
Open vSwitch CI 483c2c
    
Open vSwitch CI 483c2c
        ovsdb_datum_subtract() is used to remove atoms that points to removed
Open vSwitch CI 483c2c
        or incorrect rows, so there is no need to re-sort datum in the end.
Open vSwitch CI 483c2c
    
Open vSwitch CI 483c2c
        Results of an OVN load-balancer benchmark that adds 3K load-balancers
Open vSwitch CI 483c2c
        to each of 120 logical switches and 120 logical routers in the OVN
Open vSwitch CI 483c2c
        sandbox with clustered Northbound database and then removes them:
Open vSwitch CI 483c2c
    
Open vSwitch CI 483c2c
        Before:
Open vSwitch CI 483c2c
    
Open vSwitch CI 483c2c
          %CPU  CPU Time  CMD
Open vSwitch CI 483c2c
          86.8  00:16:05  ovsdb-server nb1.db
Open vSwitch CI 483c2c
          44.1  00:08:11  ovsdb-server nb2.db
Open vSwitch CI 483c2c
          43.2  00:08:00  ovsdb-server nb3.db
Open vSwitch CI 483c2c
    
Open vSwitch CI 483c2c
        After:
Open vSwitch CI 483c2c
    
Open vSwitch CI 483c2c
          %CPU  CPU Time  CMD
Open vSwitch CI 483c2c
          54.9  00:02:58  ovsdb-server nb1.db
Open vSwitch CI 483c2c
          33.3  00:01:48  ovsdb-server nb2.db
Open vSwitch CI 483c2c
          32.2  00:01:44  ovsdb-server nb3.db
Open vSwitch CI 483c2c
    
Open vSwitch CI 483c2c
        So, on a cluster leader the processing time dropped by 5.4x, on
Open vSwitch CI 483c2c
        followers - by 4.5x.  More load-balancers - larger the performance
Open vSwitch CI 483c2c
        difference.  There is a slight increase of memory usage, because new
Open vSwitch CI 483c2c
        reference structure is larger, but the difference is not significant.
Open vSwitch CI 483c2c
    
Open vSwitch CI 483c2c
        Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Open vSwitch CI 483c2c
        Acked-by: Dumitru Ceara <dceara@redhat.com>
Open vSwitch CI 483c2c
    
Open vSwitch CI 483c2c
    Reported-at: https://bugzilla.redhat.com/2005958
Open vSwitch CI 483c2c
    Signed-off-by: Ilya Maximets <i.maximets@redhat.com>
Open vSwitch CI 483c2c
Open vSwitch CI 483c2c
Open vSwitch CI 3f9b5c
* Thu Oct 28 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.16.0-25
Open vSwitch CI 3f9b5c
- Merging upstream branch-2.16 [RH git: f5366890c5]
Open vSwitch CI 3f9b5c
    Commit list:
Open vSwitch CI 3f9b5c
    c221c8e613 datapath-windows:Reset PseudoChecksum value only for TX direction offload case
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
* Wed Oct 27 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.16.0-24
Open vSwitch CI 3f9b5c
- Merging upstream branch-2.16 [RH git: 4682b76694]
Open vSwitch CI 3f9b5c
    Commit list:
Open vSwitch CI 3f9b5c
    b79f0369f2 ci: Make linux-prepare trust system installs.
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
* Mon Oct 25 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.16.0-23
Open vSwitch CI 3f9b5c
- Merging upstream branch-2.16 [RH git: cce913794e]
Open vSwitch CI 3f9b5c
    Commit list:
Open vSwitch CI 3f9b5c
    2a4c87f300 Prepare for 2.16.2.
Open vSwitch CI 3f9b5c
    aaa1439b8e Set release date for 2.16.1.
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
* Thu Oct 21 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.16.0-22
Open vSwitch CI 3f9b5c
- Merging upstream branch-2.16 [RH git: 29f01c4fdb]
Open vSwitch CI 3f9b5c
    Commit list:
Open vSwitch CI 3f9b5c
    108176ab5a github: Stick to python 3.9.
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
* Tue Oct 19 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.16.0-21
Open vSwitch CI 3f9b5c
- Merging upstream branch-2.16 [RH git: 2546fa9646]
Open vSwitch CI 3f9b5c
    Commit list:
Open vSwitch CI 3f9b5c
    5c5e34603b datapath-windows: add layers when adding the deferred actions
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
* Thu Oct 14 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.16.0-20
Open vSwitch CI 3f9b5c
- Merging upstream branch-2.16 [RH git: d572c95f69]
Open vSwitch CI 3f9b5c
    Commit list:
Open vSwitch CI 3f9b5c
    458a4f75f3 ofproto-dpif-xlate: Fix zone set from non-frozen-metadata fields.
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
* Wed Oct 13 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.16.0-19
Open vSwitch CI 3f9b5c
- Merging upstream branch-2.16 [RH git: 557ca689f7]
Open vSwitch CI 3f9b5c
    Commit list:
Open vSwitch CI 3f9b5c
    6d8190584a dpif-netdev: Fix use-after-free on PACKET_OUT of IP fragments.
Open vSwitch CI 3f9b5c
    44a66cc1d0 tunnel-push-pop.at: Mask source port in tunnel header.
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
* Tue Oct 12 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.16.0-18
Open vSwitch CI 3f9b5c
- Merging upstream branch-2.16 [RH git: a6c4770398]
Open vSwitch CI 3f9b5c
    Commit list:
Open vSwitch CI 3f9b5c
    27a5848a33 ovs-ctl: Add missing description for --ovs-vswitchd-options and --ovsdb-server-options to usage().
Open vSwitch CI 3f9b5c
    0300d0c0c2 dpdk-stub: Change the ERR log to DBG.
Open vSwitch CI 3f9b5c
    cdd6dd821d dpif-netlink: Fix feature negotiation for older kernels.
Open vSwitch CI 3f9b5c
    c2682c42cb dpif-netdev: Fix pmd thread comments to include SMC.
Open vSwitch CI 3f9b5c
    9377f4a465 python: idl: Avoid sending transactions when the DB is not synced up.
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
* Tue Oct 12 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.16.0-17
Open vSwitch CI 3f9b5c
- Merging upstream branch-2.16 [RH git: c1145b5236]
Open vSwitch CI 3f9b5c
    Commit list:
Open vSwitch CI 3f9b5c
    0fd17fbb09 ipf: release unhandled packets from the batch
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
* Thu Sep 30 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.16.0-16
Open vSwitch CI 3f9b5c
- Merging upstream branch-2.16 [RH git: 5c05133179]
Open vSwitch CI 3f9b5c
    Commit list:
Open vSwitch CI 3f9b5c
    3f692fba98 datapath-windows:adjust Offset when processing packet in POP_VLAN action
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
* Wed Sep 29 2021 Dumitru Ceara <dceara@redhat.com> - 2.16.0-15
Open vSwitch CI 3f9b5c
- ovsdb-data: Deduplicate string atoms. [RH git: 24e7d1140e] (#2006839)
Open vSwitch CI 3f9b5c
    commit 429b114c5aadee24ccfb16ad7d824f45cdcea75a
Open vSwitch CI 3f9b5c
    Author: Ilya Maximets <i.maximets@ovn.org>
Open vSwitch CI 3f9b5c
    Date:   Wed Sep 22 09:28:50 2021 +0200
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        ovsdb-server spends a lot of time cloning atoms for various reasons,
Open vSwitch CI 3f9b5c
        e.g. to create a diff of two rows or to clone a row to the transaction.
Open vSwitch CI 3f9b5c
        All atoms, except for strings, contains a simple value that could be
Open vSwitch CI 3f9b5c
        copied in efficient way, but duplicating strings every time has a
Open vSwitch CI 3f9b5c
        significant performance impact.
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        Introducing a new reference-counted structure 'ovsdb_atom_string'
Open vSwitch CI 3f9b5c
        that allows to not copy strings every time, but just increase a
Open vSwitch CI 3f9b5c
        reference counter.
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        This change allows to increase transaction throughput in benchmarks
Open vSwitch CI 3f9b5c
        up to 2x for standalone databases and 3x for clustered databases, i.e.
Open vSwitch CI 3f9b5c
        number of transactions that ovsdb-server can handle per second.
Open vSwitch CI 3f9b5c
        It also noticeably reduces memory consumption of ovsdb-server.
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        Next step will be to consolidate this structure with json strings,
Open vSwitch CI 3f9b5c
        so we will not need to duplicate strings while converting database
Open vSwitch CI 3f9b5c
        objects to json and back.
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Open vSwitch CI 3f9b5c
        Acked-by: Dumitru Ceara <dceara@redhat.com>
Open vSwitch CI 3f9b5c
        Acked-by: Mark D. Gray <mark.d.gray@redhat.com>
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
    Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=2006839
Open vSwitch CI 3f9b5c
    Signed-off-by: Dumitru Ceara <dceara@redhat.com>
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
* Wed Sep 29 2021 Dumitru Ceara <dceara@redhat.com> - 2.16.0-14
Open vSwitch CI 3f9b5c
- ovsdb-data: Add function to apply diff in-place. [RH git: df0e4bda98] (#2006851)
Open vSwitch CI 3f9b5c
    commit 32b51326ef9c307b4acd0bacafb0218dd1372f3d
Open vSwitch CI 3f9b5c
    Author: Ilya Maximets <i.maximets@ovn.org>
Open vSwitch CI 3f9b5c
    Date:   Thu Sep 23 01:47:24 2021 +0200
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        ovsdb_datum_apply_diff() is heavily used in ovsdb transactions, but
Open vSwitch CI 3f9b5c
        it's linear in terms of number of comparisons.  And it also clones
Open vSwitch CI 3f9b5c
        all the atoms along the way.  In most cases size of a diff is much
Open vSwitch CI 3f9b5c
        smaller than the size of the original datum, this allows to perform
Open vSwitch CI 3f9b5c
        the same operation in-place with only O(diff->n * log2(old->n))
Open vSwitch CI 3f9b5c
        comparisons and O(old->n + diff->n) memory copies with memcpy.
Open vSwitch CI 3f9b5c
        Using this function while applying diffs read from the storage gives
Open vSwitch CI 3f9b5c
        a significant performance boost and allows to execute much more
Open vSwitch CI 3f9b5c
        transactions per second.
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Open vSwitch CI 3f9b5c
        Acked-by: Mark D. Gray <mark.d.gray@redhat.com>
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
    Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=2006851
Open vSwitch CI 3f9b5c
    Signed-off-by: Dumitru Ceara <dceara@redhat.com>
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
* Wed Sep 29 2021 Dumitru Ceara <dceara@redhat.com> - 2.16.0-13
Open vSwitch CI 3f9b5c
- ovsdb-data: Optimize subtraction of sets. [RH git: 5bace82405] (#2005483)
Open vSwitch CI 3f9b5c
    commit bb12b63176389e516ddfefce20dfa165f24430fb
Open vSwitch CI 3f9b5c
    Author: Ilya Maximets <i.maximets@ovn.org>
Open vSwitch CI 3f9b5c
    Date:   Thu Sep 23 01:47:23 2021 +0200
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        Current algorithm for ovsdb_datum_subtract looks like this:
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
          for-each atom in a:
Open vSwitch CI 3f9b5c
              if atom in b:
Open vSwitch CI 3f9b5c
                  swap(atom, <last atom in 'a'>)
Open vSwitch CI 3f9b5c
                  destroy(atom)
Open vSwitch CI 3f9b5c
          quicksort(a)
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        Complexity:
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
          Na * log2(Nb)  +  (Na - Nb) * log2(Na - Nb)
Open vSwitch CI 3f9b5c
            Search          Comparisons for quicksort
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        It's not optimal, especially because Nb << Na in a vast majority of
Open vSwitch CI 3f9b5c
        cases.
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        Reversing the search phase to look up atoms from 'b' in 'a', and
Open vSwitch CI 3f9b5c
        closing gaps from deleted elements in 'a' by plain memory copy to
Open vSwitch CI 3f9b5c
        avoid quicksort.
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        Resulted complexity:
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
          Nb * log2(Na)  +    (Na - Nb)
Open vSwitch CI 3f9b5c
            Search          Memory copies
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        Subtraction is heavily used while executing database transactions.
Open vSwitch CI 3f9b5c
        For example, to remove one port from a logical switch in OVN.
Open vSwitch CI 3f9b5c
        Complexity of such operation if original logical switch had 100 ports
Open vSwitch CI 3f9b5c
        goes down from
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
         100 * log2(1)   = 100 comparisons for search and
Open vSwitch CI 3f9b5c
          99 * log2(99)  = 656 comparisons for quicksort
Open vSwitch CI 3f9b5c
                           ------------------------------
Open vSwitch CI 3f9b5c
                           756 comparisons in total
Open vSwitch CI 3f9b5c
        to only
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
           1 * log2(100) = 7 comparisons for search
Open vSwitch CI 3f9b5c
           + memory copy of 99 * sizeof (union ovsdb_atom) bytes.
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        We could use memmove to close the gaps after removing atoms, but
Open vSwitch CI 3f9b5c
        it will lead to 2 memory copies inside the call, while we can perform
Open vSwitch CI 3f9b5c
        only one to the temporary 'result' and swap pointers.
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        Performance in cases, where sizes of 'a' and 'b' are comparable,
Open vSwitch CI 3f9b5c
        should not change.  Cases with Nb >> Na should not happen in practice.
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        All in all, this change allows ovsdb-server to perform several times
Open vSwitch CI 3f9b5c
        more transactions, that removes elements from sets, per second.
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Open vSwitch CI 3f9b5c
        Acked-by: Han Zhou <hzhou@ovn.org>
Open vSwitch CI 3f9b5c
        Acked-by: Mark D. Gray <mark.d.gray@redhat.com>
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
    Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=2005483
Open vSwitch CI 3f9b5c
    Signed-off-by: Dumitru Ceara <dceara@redhat.com>
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
* Wed Sep 29 2021 Dumitru Ceara <dceara@redhat.com> - 2.16.0-12
Open vSwitch CI 3f9b5c
- ovsdb-data: Optimize union of sets. [RH git: e2a4c7d794] (#2005483)
Open vSwitch CI 3f9b5c
    commit 51946d22274cd591dc061358fb507056fbd91420
Open vSwitch CI 3f9b5c
    Author: Ilya Maximets <i.maximets@ovn.org>
Open vSwitch CI 3f9b5c
    Date:   Thu Sep 23 01:47:22 2021 +0200
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        Current algorithm of ovsdb_datum_union looks like this:
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
          for-each atom in b:
Open vSwitch CI 3f9b5c
              if not bin_search(a, atom):
Open vSwitch CI 3f9b5c
                  push(a, clone(atom))
Open vSwitch CI 3f9b5c
          quicksort(a)
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        So, the complexity looks like this:
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
           Nb * log2(Na)   +    Nb     +   (Na + Nb) * log2(Na + Nb)
Open vSwitch CI 3f9b5c
           Comparisons        clones       Comparisons for quicksort
Open vSwitch CI 3f9b5c
           for search
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        ovsdb_datum_union() is heavily used in database transactions while
Open vSwitch CI 3f9b5c
        new element is added to a set.  For example, if new logical switch
Open vSwitch CI 3f9b5c
        port is added to a logical switch in OVN.  This is a very common
Open vSwitch CI 3f9b5c
        use case where CMS adds one new port to an existing switch that
Open vSwitch CI 3f9b5c
        already has, let's say, 100 ports.  For this case ovsdb-server will
Open vSwitch CI 3f9b5c
        have to perform:
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
           1 * log2(100)  + 1 clone + 101 * log2(101)
Open vSwitch CI 3f9b5c
           Comparisons                Comparisons for
Open vSwitch CI 3f9b5c
           for search                   quicksort.
Open vSwitch CI 3f9b5c
               ~7           1            ~707
Open vSwitch CI 3f9b5c
           Roughly 714 comparisons of atoms and 1 clone.
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        Since binary search can give us position, where new atom should go
Open vSwitch CI 3f9b5c
        (it's the 'low' index after the search completion) for free, the
Open vSwitch CI 3f9b5c
        logic can be re-worked like this:
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
          copied = 0
Open vSwitch CI 3f9b5c
          for-each atom in b:
Open vSwitch CI 3f9b5c
              desired_position = bin_search(a, atom)
Open vSwitch CI 3f9b5c
              push(result, a[ copied : desired_position - 1 ])
Open vSwitch CI 3f9b5c
              copied = desired_position
Open vSwitch CI 3f9b5c
              push(result, clone(atom))
Open vSwitch CI 3f9b5c
          push(result, a[ copied : Na ])
Open vSwitch CI 3f9b5c
          swap(a, result)
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        Complexity of this schema:
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
           Nb * log2(Na)   +    Nb     +         Na
Open vSwitch CI 3f9b5c
           Comparisons        clones       memory copy on push
Open vSwitch CI 3f9b5c
           for search
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        'swap' is just a swap of a few pointers.  'push' is not a 'clone',
Open vSwitch CI 3f9b5c
        but a simple memory copy of 'union ovsdb_atom'.
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        In general, this schema substitutes complexity of a quicksort
Open vSwitch CI 3f9b5c
        with complexity of a memory copy of Na atom structures, where we're
Open vSwitch CI 3f9b5c
        not even copying strings that these atoms are pointing to.
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        Complexity in the example above goes down from 714 comparisons
Open vSwitch CI 3f9b5c
        to 7 comparisons and memcpy of 100 * sizeof (union ovsdb_atom) bytes.
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        General complexity of a memory copy should always be lower than
Open vSwitch CI 3f9b5c
        complexity of a quicksort, especially because these copies usually
Open vSwitch CI 3f9b5c
        performed in bulk, so this new schema should work faster for any input.
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        All in all, this change allows to execute several times more
Open vSwitch CI 3f9b5c
        transactions per second for transactions that adds new entries to sets.
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        Alternatively, union can be implemented as a linear merge of two
Open vSwitch CI 3f9b5c
        sorted arrays, but this will result in O(Na) comparisons, which
Open vSwitch CI 3f9b5c
        is more than Nb * log2(Na) in common case, since Na is usually
Open vSwitch CI 3f9b5c
        far bigger than Nb.  Linear merge will also mean per-atom memory
Open vSwitch CI 3f9b5c
        copies instead of copying in bulk.
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        'replace' functionality of ovsdb_datum_union() had no users, so it
Open vSwitch CI 3f9b5c
        just removed.  But it can easily be added back if needed in the future.
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Open vSwitch CI 3f9b5c
        Acked-by: Han Zhou <hzhou@ovn.org>
Open vSwitch CI 3f9b5c
        Acked-by: Mark D. Gray <mark.d.gray@redhat.com>
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
    Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=2005483
Open vSwitch CI 3f9b5c
    Signed-off-by: Dumitru Ceara <dceara@redhat.com>
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
* Wed Sep 29 2021 Dumitru Ceara <dceara@redhat.com> - 2.16.0-11
Open vSwitch CI 3f9b5c
- ovsdb: transaction: Use diffs for strong reference counting. [RH git: 85da133eaa] (#2003203)
Open vSwitch CI 3f9b5c
    commit b2712d026eae2d9a5150c2805310eaf506e1f162
Open vSwitch CI 3f9b5c
    Author: Ilya Maximets <i.maximets@ovn.org>
Open vSwitch CI 3f9b5c
    Date:   Tue Sep 14 00:19:57 2021 +0200
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        Currently, even if one reference added to the set of strong references
Open vSwitch CI 3f9b5c
        or removed from it, ovsdb-server will walk through the whole set and
Open vSwitch CI 3f9b5c
        re-count references to other rows.  These referenced rows will also be
Open vSwitch CI 3f9b5c
        added to the transaction in order to re-count their references.
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        For example, every time Logical Switch Port added to a Logical Switch,
Open vSwitch CI 3f9b5c
        OVN Northbound database server will walk through all ports of this
Open vSwitch CI 3f9b5c
        Logical Switch, clone their rows, and re-count references.  This is
Open vSwitch CI 3f9b5c
        not very efficient.  Instead, it can only increase reference counters
Open vSwitch CI 3f9b5c
        for added references and reduce for removed ones.  In many cases this
Open vSwitch CI 3f9b5c
        will be only one row affected in the Logical_Switch_Port table.
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        Introducing new function that generates a diff of two datum objects,
Open vSwitch CI 3f9b5c
        but stores added and removed atoms separately, so they can be used
Open vSwitch CI 3f9b5c
        to increase or decrease row reference counters accordingly.
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        This change allows to perform several times more transactions that
Open vSwitch CI 3f9b5c
        adds or removes strong references to/from sets per second, because
Open vSwitch CI 3f9b5c
        ovsdb-server no longer clones and re-counts rows that are irrelevant
Open vSwitch CI 3f9b5c
        to current transaction.
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
        Acked-by: Dumitru Ceara <dceara@redhat.com>
Open vSwitch CI 3f9b5c
        Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Open vSwitch CI 3f9b5c
    
Open vSwitch CI 3f9b5c
    Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=2003203
Open vSwitch CI 3f9b5c
    Signed-off-by: Dumitru Ceara <dceara@redhat.com>
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
* Mon Sep 27 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.16.0-10
Open vSwitch CI 3f9b5c
- Merging upstream branch-2.16 [RH git: 2114714012]
Open vSwitch CI 3f9b5c
    Commit list:
Open vSwitch CI 3f9b5c
    547371ecdb cirrus: Reduce memory requirements for FreeBSD VMs.
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
* Thu Sep 23 2021 Timothy Redaelli <tredaelli@redhat.com> - 2.16.0-9
Open vSwitch CI 3f9b5c
- redhat: use hugetlbfs group for /var/log/openvswitch when dpdk is enabled [RH git: 4e5928b671] (#2004543)
Open vSwitch CI 3f9b5c
    Resolves: #2004543
Open vSwitch CI 3f9b5c
Open vSwitch CI 3f9b5c
110336
* Thu Sep 16 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.16.0-8
110336
- Merging upstream branch-2.16 [RH git: 7332b410fc]
110336
    Commit list:
110336
    facaf5bc71 netdev-linux: Fix a null pointer dereference in netdev_linux_notify_sock().
110336
    6e203d4873 pcap-file: Fix memory leak in ovs_pcap_open().
110336
    f50da0b267 odp-util: Fix a null pointer dereference in odp_flow_format().
110336
    7da752e43f odp-util: Fix a null pointer dereference in odp_nsh_key_from_attr__().
110336
    bc22b01459 netdev-dpdk: Fix RSS configuration for virtio.
110336
    81706c5d43 ipf: Fix only nat the first fragment in the reass process.
110336
110336
110336
* Wed Sep 08 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.16.0-7
110336
- Merging upstream branch-2.16 [RH git: e71f31dfd6]
110336
    Commit list:
110336
    242c280f0e dpif-netdev: Fix crash when PACKET_OUT is metered.
110336
110336
110336
* Tue Aug 31 2021 Ilya Maximets <i.maximets@redhat.com> - 2.16.0-6
110336
- ovsdb: monitor: Store serialized json in a json cache. [RH git: bc20330c85] (#1996152)
110336
    commit 43e66fc27659af2a5c976bdd27fe747b442b5554
110336
    Author: Ilya Maximets <i.maximets@ovn.org>
110336
    Date:   Tue Aug 24 21:00:39 2021 +0200
110336
    
110336
        Same json from a json cache is typically sent to all the clients,
110336
        e.g., in case of OVN deployment with ovn-monitor-all=true.
110336
    
110336
        There could be hundreds or thousands connected clients and ovsdb
110336
        will serialize the same json object for each of them before sending.
110336
    
110336
        Serializing it once before storing into json cache to speed up
110336
        processing.
110336
    
110336
        This change allows to save a lot of CPU cycles and a bit of memory
110336
        since we need to store in memory only a string and not the full json
110336
        object.
110336
    
110336
        Testing with ovn-heater on 120 nodes using density-heavy scenario
110336
        shows reduction of the total CPU time used by Southbound DB processes
110336
        from 256 minutes to 147.  Duration of unreasonably long poll intervals
110336
        also reduced dramatically from 7 to 2 seconds:
110336
    
110336
                   Count   Min    Max   Median    Mean   95 percentile
110336
         -------------------------------------------------------------
110336
          Before   1934   1012   7480   4302.5   4875.3     7034.3
110336
          After    1909   1004   2730   1453.0   1532.5     2053.6
110336
    
110336
        Acked-by: Dumitru Ceara <dceara@redhat.com>
110336
        Acked-by: Han Zhou <hzhou@ovn.org>
110336
        Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
110336
    
110336
    Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1996152
110336
    Signed-off-by: Ilya Maximets <i.maximets@redhat.com>
110336
110336
110336
* Tue Aug 31 2021 Ilya Maximets <i.maximets@redhat.com> - 2.16.0-5
110336
- raft: Don't keep full json objects in memory if no longer needed. [RH git: 4606423e8b] (#1990058)
110336
    commit 0de882954032aa37dc943bafd72c33324aa0c95a
110336
    Author: Ilya Maximets <i.maximets@ovn.org>
110336
    Date:   Tue Aug 24 21:00:38 2021 +0200
110336
    
110336
        raft: Don't keep full json objects in memory if no longer needed.
110336
    
110336
        Raft log entries (and raft database snapshot) contains json objects
110336
        of the data.  Follower receives append requests with data that gets
110336
        parsed and added to the raft log.  Leader receives execution requests,
110336
        parses data out of them and adds to the log.  In both cases, later
110336
        ovsdb-server reads the log with ovsdb_storage_read(), constructs
110336
        transaction and updates the database.  On followers these json objects
110336
        in common case are never used again.  Leader may use them to send
110336
        append requests or snapshot installation requests to followers.
110336
        However, all these operations (except for ovsdb_storage_read()) are
110336
        just serializing the json in order to send it over the network.
110336
    
110336
        Json objects are significantly larger than their serialized string
110336
        representation.  For example, the snapshot of the database from one of
110336
        the ovn-heater scale tests takes 270 MB as a string, but 1.6 GB as
110336
        a json object from the total 3.8 GB consumed by ovsdb-server process.
110336
    
110336
        ovsdb_storage_read() for a given raft entry happens only once in a
110336
        lifetime, so after this call, we can serialize the json object, store
110336
        the string representation and free the actual json object that ovsdb
110336
        will never need again.  This can save a lot of memory and can also
110336
        save serialization time, because each raft entry for append requests
110336
        and snapshot installation requests serialized only once instead of
110336
        doing that every time such request needs to be sent.
110336
    
110336
        JSON_SERIALIZED_OBJECT can be used in order to seamlessly integrate
110336
        pre-serialized data into raft_header and similar json objects.
110336
    
110336
        One major special case is creation of a database snapshot.
110336
        Snapshot installation request received over the network will be parsed
110336
        and read by ovsdb-server just like any other raft log entry.  However,
110336
        snapshots created locally with raft_store_snapshot() will never be
110336
        read back, because they reflect the current state of the database,
110336
        hence already applied.  For this case we can free the json object
110336
        right after writing snapshot on disk.
110336
    
110336
        Tests performed with ovn-heater on 60 node density-light scenario,
110336
        where on-disk database goes up to 97 MB, shows average memory
110336
        consumption of ovsdb-server Southbound DB processes decreased by 58%
110336
        (from 602 MB to 256 MB per process) and peak memory consumption
110336
        decreased by 40% (from 1288 MB to 771 MB).
110336
    
110336
        Test with 120 nodes on density-heavy scenario with 270 MB on-disk
110336
        database shows 1.5 GB memory consumption decrease as expected.
110336
        Also, total CPU time consumed by the Southbound DB process reduced
110336
        from 296 to 256 minutes.  Number of unreasonably long poll intervals
110336
        reduced from 2896 down to 1934.
110336
    
110336
        Deserialization is also implemented just in case.  I didn't see this
110336
        function being invoked in practice.
110336
    
110336
        Acked-by: Dumitru Ceara <dceara@redhat.com>
110336
        Acked-by: Han Zhou <hzhou@ovn.org>
110336
        Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
110336
    
110336
    Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1990058
110336
    Signed-off-by: Ilya Maximets <i.maximets@redhat.com>
110336
110336
110336
* Tue Aug 31 2021 Ilya Maximets <i.maximets@redhat.com> - 2.16.0-4
110336
- json: Add support for partially serialized json objects. [RH git: 885e5ce1b5] (#1990058)
110336
    commit b0bca6f27aae845c3ca8b48d66a7dbd3d978162a
110336
    Author: Ilya Maximets <i.maximets@ovn.org>
110336
    Date:   Tue Aug 24 21:00:37 2021 +0200
110336
    
110336
        json: Add support for partially serialized json objects.
110336
    
110336
        Introducing a new json type JSON_SERIALIZED_OBJECT.  It's not an
110336
        actual type that can be seen in a json message on a wire, but
110336
        internal type that is intended to hold a serialized version of
110336
        some other json object.  For this reason it's defined after the
110336
        JSON_N_TYPES to not confuse parsers and other parts of the code
110336
        that relies on compliance with RFC 4627.
110336
    
110336
        With this JSON type internal users may construct large JSON objects,
110336
        parts of which are already serialized.  This way, while serializing
110336
        the larger object, data from JSON_SERIALIZED_OBJECT can be added
110336
        directly to the result, without additional processing.
110336
    
110336
        This will be used by next commits to add pre-serialized JSON data
110336
        to the raft_header structure, that can be converted to a JSON
110336
        before writing the file transaction on disk or sending to other
110336
        servers.  Same technique can also be used to pre-serialize json_cache
110336
        for ovsdb monitors, this should allow to not perform serialization
110336
        for every client and will save some more memory.
110336
    
110336
        Since serialized JSON is just a string, reusing the 'json->string'
110336
        pointer for it.
110336
    
110336
        Acked-by: Dumitru Ceara <dceara@redhat.com>
110336
        Acked-by: Han Zhou <hzhou@ovn.org>
110336
        Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
110336
    
110336
    Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1990058
110336
    Signed-off-by: Ilya Maximets <i.maximets@redhat.com>
110336
110336
110336
* Tue Aug 31 2021 Ilya Maximets <i.maximets@redhat.com> - 2.16.0-3
110336
- json: Optimize string serialization. [RH git: bb1654da63] (#1990069)
110336
    commit 748010ff304b7cd2c43f4eb98a554433f0df07f9
110336
    Author: Ilya Maximets <i.maximets@ovn.org>
110336
    Date:   Tue Aug 24 23:07:22 2021 +0200
110336
    
110336
        json: Optimize string serialization.
110336
    
110336
        Current string serialization code puts all characters one by one.
110336
        This is slow because dynamic string needs to perform length checks
110336
        on every ds_put_char() and it's also doesn't allow compiler to use
110336
        better memory copy operations, i.e. doesn't allow copying few bytes
110336
        at once.
110336
    
110336
        Special symbols are rare in a typical database.  Quotes are frequent,
110336
        but not too frequent.  In databases created by ovn-kubernetes, for
110336
        example, usually there are at least 10 to 50 chars between quotes.
110336
        So, it's better to count characters that doesn't require escaping
110336
        and use fast data copy for the whole sequential block.
110336
    
110336
        Testing with a synthetic benchmark (included) on my laptop shows
110336
        following performance improvement:
110336
    
110336
           Size      Q  S       Before       After       Diff
110336
         -----------------------------------------------------
110336
         100000      0  0 :    0.227 ms     0.142 ms   -37.4 %
110336
         100000      2  1 :    0.277 ms     0.186 ms   -32.8 %
110336
         100000      10 1 :    0.361 ms     0.309 ms   -14.4 %
110336
         10000000    0  0 :   22.720 ms    12.160 ms   -46.4 %
110336
         10000000    2  1 :   27.470 ms    19.300 ms   -29.7 %
110336
         10000000    10 1 :   37.950 ms    31.250 ms   -17.6 %
110336
         100000000   0  0 :  239.600 ms   126.700 ms   -47.1 %
110336
         100000000   2  1 :  292.400 ms   188.600 ms   -35.4 %
110336
         100000000   10 1 :  387.700 ms   321.200 ms   -17.1 %
110336
    
110336
        Here Q - probability (%) for a character to be a '\"' and
110336
        S - probability (%) to be a special character ( < 32).
110336
    
110336
        Testing with a closer to real world scenario shows overall decrease
110336
        of the time needed for database compaction by ~5-10 %.  And this
110336
        change also decreases CPU consumption in general, because string
110336
        serialization is used in many different places including ovsdb
110336
        monitors and raft.
110336
    
110336
        Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
110336
        Acked-by: Numan Siddique <numans@ovn.org>
110336
        Acked-by: Dumitru Ceara <dceara@redhat.com>
110336
    
110336
    Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1990069
110336
    Signed-off-by: Ilya Maximets <i.maximets@redhat.com>
110336
110336
110336
* Fri Aug 20 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.16.0-2
110336
- Merging upstream branch-2.16 [RH git: 7d7567e339]
110336
    Commit list:
110336
    0991ea8d19 Prepare for 2.16.1.
110336
110336
110336
* Wed Aug 18 2021 Flavio Leitner <fbl@redhat.com> - 2.16.0-1
110336
- redhat: First 2.16.0 release. [RH git: 0a1c4276cc]
110336
110336