Blob Blame History Raw
# Copyright (C) 2009, 2010, 2013, 2014 Nicira Networks, Inc.
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.  This file is offered as-is,
# without warranty of any kind.
#
# If tests have to be skipped while building, specify the '--without check'
# option. For example:
# rpmbuild -bb --without check rhel/openvswitch-fedora.spec

# This defines the base package name's version.

%define pkgname openvswitch3.1


%if 0%{?commit:1}
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%endif

# Enable PIE, bz#955181
%global _hardened_build 1

# RHEL-7 doesn't define _rundir macro yet
# Fedora 15 onwards uses /run as _rundir
%if 0%{!?_rundir:1}
%define _rundir /run
%endif

# FIXME remove when fast-datapath-rhel-8 buildroot is updated to new RHEL 8 zstream
# RHEL-8.0 doesn't define _smp_build_ncpus, but it uses the old _smp_mflags
%if 0%{!?_smp_build_ncpus:1}
%define _smp_build_ncpus %(c=%_smp_mflags; echo ${c:2})
%endif

# FIXME Test "STP - flush the fdb and mdb when topology changed" fails on s390x
# FIXME 2 tests fails on ppc64le. They will be hopefully fixed before official 2.11
%ifarch %{ix86} x86_64 aarch64
%bcond_without check
%else
%bcond_with check
%endif
# option to run kernel datapath tests, requires building as root!
%bcond_with check_datapath_kernel
# option to build with libcap-ng, needed for running OVS as regular user
%bcond_without libcapng
# option to build with ipsec support
%bcond_without ipsec

# Build python2 (that provides python) and python3 subpackages on Fedora
# Build only python3 (that provides python) subpackage on RHEL8
# Build only python subpackage on RHEL7
%if 0%{?rhel} > 7 || 0%{?fedora}
# On RHEL8 Sphinx is included in buildroot
%global external_sphinx 1
%else
# Don't use external sphinx (RHV doesn't have optional repositories enabled)
%global external_sphinx 0
%endif

Name: %{pkgname}
Summary: Open vSwitch
Group: System Environment/Daemons daemon/database/utilities
URL: http://www.openvswitch.org/
Version: 3.1.0
Release: 51%{?dist}

# Nearly all of openvswitch is ASL 2.0.  The bugtool is LGPLv2+, and the
# lib/sflow*.[ch] files are SISSL
# datapath/ is GPLv2 (although not built into any of the binary packages)
License: ASL 2.0 and LGPLv2+ and SISSL

%define dpdkver 22.11.1
%define dpdkdir dpdk
%define dpdksver %(echo %{dpdkver} | cut -d. -f-2)
# NOTE: DPDK does not currently build for s390x
# DPDK on aarch64 is not stable enough to be enabled in FDP
%if 0%{?rhel} > 7 || 0%{?fedora}
%define dpdkarches x86_64 ppc64le
%else
%define dpdkarches
%endif

%if 0%{?commit:1}
Source: https://github.com/openvswitch/ovs/archive/%{commit}.tar.gz#/openvswitch-%{commit}.tar.gz
%else
Source: https://github.com/openvswitch/ovs/archive/v%{version}.tar.gz#/openvswitch-%{version}.tar.gz
%endif
Source10: https://fast.dpdk.org/rel/dpdk-%{dpdkver}.tar.xz

%define docutilsver 0.12
%define pygmentsver 1.4
%define sphinxver   1.2.3
%define pyelftoolsver 0.27
Source100: https://pypi.io/packages/source/d/docutils/docutils-%{docutilsver}.tar.gz
Source101: https://pypi.io/packages/source/P/Pygments/Pygments-%{pygmentsver}.tar.gz
Source102: https://pypi.io/packages/source/S/Sphinx/Sphinx-%{sphinxver}.tar.gz
Source103: https://pypi.io/packages/source/p/pyelftools/pyelftools-%{pyelftoolsver}.tar.gz

Patch0:    openvswitch-%{version}.patch

# The DPDK is designed to optimize througput of network traffic using, among
# other techniques, carefully crafted assembly instructions.  As such it
# needs extensive work to port it to other architectures.
ExclusiveArch: x86_64 aarch64 ppc64le s390x

# Do not enable this otherwise YUM will break on any upgrade.
# Provides: openvswitch
Conflicts: openvswitch < 3.1
Conflicts: openvswitch-dpdk < 3.1
Conflicts: openvswitch2.10
Conflicts: openvswitch2.11
Conflicts: openvswitch2.12
Conflicts: openvswitch2.13
Conflicts: openvswitch2.14
Conflicts: openvswitch2.15
Conflicts: openvswitch2.16
Conflicts: openvswitch2.17
Conflicts: openvswitch3.0

# FIXME Sphinx is used to generate some manpages, unfortunately, on RHEL, it's
# in the -optional repository and so we can't require it directly since RHV
# doesn't have the -optional repository enabled and so TPS fails
%if %{external_sphinx}
BuildRequires: python3-sphinx
%else
# Sphinx dependencies
BuildRequires: python-devel
BuildRequires: python-setuptools
#BuildRequires: python2-docutils
BuildRequires: python-jinja2
BuildRequires: python-nose
#BuildRequires: python2-pygments
# docutils dependencies
BuildRequires: python-imaging
# pygments dependencies
BuildRequires: python-nose
%endif

BuildRequires: gcc gcc-c++ make
BuildRequires: autoconf automake libtool
BuildRequires: systemd-units openssl openssl-devel
BuildRequires: python3-devel python3-setuptools
BuildRequires: desktop-file-utils
BuildRequires: groff-base graphviz
BuildRequires: unbound-devel
BuildRequires: systemtap-sdt-devel
# make check dependencies
BuildRequires: procps-ng
%if %{with check_datapath_kernel}
BuildRequires: nmap-ncat
# would be useful but not available in RHEL or EPEL
#BuildRequires: pyftpdlib
%endif

%if %{with libcapng}
BuildRequires: libcap-ng libcap-ng-devel
%endif

%ifarch %{dpdkarches}
BuildRequires: meson
%if 0%{?rhel} > 8 || 0%{?fedora}
BuildRequires: python3-pyelftools
%endif
# DPDK driver dependencies
BuildRequires: zlib-devel numactl-devel libarchive-devel
%ifarch x86_64
BuildRequires: rdma-core-devel >= 15 libmnl-devel
%endif

# Required by packaging policy for the bundled DPDK
Provides: bundled(dpdk) = %{dpdkver}
%endif

Requires: openssl iproute module-init-tools
#Upstream kernel commit 4f647e0a3c37b8d5086214128614a136064110c3
#Requires: kernel >= 3.15.0-0
Requires: openvswitch-selinux-extra-policy

Requires(pre): shadow-utils
Requires(post): /bin/sed
Requires(post): /usr/sbin/usermod
Requires(post): /usr/sbin/groupadd
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
Obsoletes: openvswitch-controller <= 0:2.1.0-1

%if 0%{?rhel}
# sortedcontainers are not packaged on RHEL yet, but ovs includes it
%global __requires_exclude ^python%{python3_version}dist\\(sortedcontainers\\)$
%endif

%description
Open vSwitch provides standard network bridging functions and
support for the OpenFlow protocol for remote per-flow control of
traffic.

%package -n python3-%{pkgname}
Summary: Open vSwitch python3 bindings
License: ASL 2.0
Requires: %{pkgname} = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: python-%{pkgname} = %{?epoch:%{epoch}:}%{version}-%{release}

%description -n python3-%{pkgname}
Python bindings for the Open vSwitch database

%package test
Summary: Open vSwitch testing utilities
License: ASL 2.0
BuildArch: noarch
Requires: python3-%{pkgname} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: tcpdump

%description test
Utilities that are useful to diagnose performance and connectivity
issues in Open vSwitch setup.

%package devel
Summary: Open vSwitch OpenFlow development package (library, headers)
License: ASL 2.0
Requires: %{pkgname} = %{?epoch:%{epoch}:}%{version}-%{release}

%description devel
This provides shared library, libopenswitch.so and the openvswitch header
files needed to build an external application.

%if 0%{?rhel} == 8 || 0%{?fedora} > 28
%package -n network-scripts-%{name}
Summary: Open vSwitch legacy network service support
License: ASL 2.0
Requires: network-scripts
Supplements: (%{name} and network-scripts)

%description -n network-scripts-%{name}
This provides the ifup and ifdown scripts for use with the legacy network
service.
%endif

%if %{with ipsec}
%package ipsec
Summary: Open vSwitch IPsec tunneling support
License: ASL 2.0
Requires: python3-%{pkgname} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: libreswan

%description ipsec
This package provides IPsec tunneling support for OVS tunnels.
%endif

%prep
%if 0%{?commit:1}
%setup -q -n ovs-%{commit} -a 10
%else
%setup -q -n ovs-%{version} -a 10
%endif
%if ! %{external_sphinx}
%if 0%{?commit:1}
%setup -n ovs-%{commit} -q -D -T -a 100 -a 101 -a 102
%else
%setup -n ovs-%{version} -q -D -T -a 100 -a 101 -a 102
%endif
%endif
%if 0%{?rhel} && 0%{?rhel} < 9
%if 0%{?commit:1}
%setup -n ovs-%{commit} -q -D -T -a 103
%else
%setup -n ovs-%{version} -q -D -T -a 103
%endif
%endif

mv dpdk-*/ %{dpdkdir}/

%patch0 -p1

%build
%if 0%{?rhel} && 0%{?rhel} < 9
export PYTHONPATH="${PWD}/pyelftools-%{pyelftoolsver}"
%endif
# Build Sphinx on RHEL
%if ! %{external_sphinx}
export PYTHONPATH="${PYTHONPATH:+$PYTHONPATH:}%{_builddir}/pytmp/lib/python"
for x in docutils-%{docutilsver} Pygments-%{pygmentsver} Sphinx-%{sphinxver}; do
    pushd "$x"
    python2 setup.py install --home %{_builddir}/pytmp
    popd
done

export PATH="$PATH:%{_builddir}/pytmp/bin"
%endif

./boot.sh

%ifarch %{dpdkarches}    # build dpdk
# Lets build DPDK first
cd %{dpdkdir}

ENABLED_DRIVERS=(
    bus/pci
    bus/vdev
    mempool/ring
    net/failsafe
    net/i40e
    net/ring
    net/vhost
    net/virtio
    net/tap
)

%ifarch x86_64
ENABLED_DRIVERS+=(
    bus/auxiliary
    bus/vmbus
    common/iavf
    common/mlx5
    net/bnxt
    net/enic
    net/iavf
    net/ice
    net/mlx5
    net/netvsc
    net/nfp
    net/qede
    net/vdev_netvsc
)
%endif

%ifarch aarch64 x86_64
ENABLED_DRIVERS+=(
    net/e1000
    net/ixgbe
)
%endif

for driver in "${ENABLED_DRIVERS[@]}"; do
    enable_drivers="${enable_drivers:+$enable_drivers,}"$driver
done

# As of 21.11-rc3, following libraries can be disabled:
# optional_libs = [
#         'bitratestats',
#         'gpudev',
#         'gro',
#         'gso',
#         'kni',
#         'jobstats',
#         'latencystats',
#         'metrics',
#         'pdump',
#         'power',
#         'vhost',
# ]
# If doing any updates, this must be aligned with:
# https://access.redhat.com/articles/3538141
DISABLED_LIBS=(
    gpudev
    kni
    jobstats
    power
)

for lib in "${DISABLED_LIBS[@]}"; do
    disable_libs="${disable_libs:+$disable_libs,}"$lib
done

%set_build_flags
%__meson --prefix=%{_builddir}/dpdk-build \
         --buildtype=plain \
         -Ddisable_libs="$disable_libs" \
         -Ddisable_apps="*" \
         -Denable_drivers="$enable_drivers" \
         -Dplatform=generic \
         -Dmax_ethports=1024 \
         -Dmax_numa_nodes=8 \
         -Dtests=false \
         %{_vpath_builddir}
%meson_build
%__meson install -C %{_vpath_builddir} --no-rebuild

# FIXME currently with LTO enabled OVS tries to link with both static and shared libraries
rm -v %{_builddir}/dpdk-build/%{_lib}/*.so*

# Generate a list of supported drivers, its hard to tell otherwise.
cat << EOF > README.DPDK-PMDS
DPDK drivers included in this package:

EOF

for f in %{_builddir}/dpdk-build/%{_lib}/librte_net_*.a; do
    basename ${f} | cut -c12- | cut -d. -f1 | tr [:lower:] [:upper:]
done >> README.DPDK-PMDS

cat << EOF >> README.DPDK-PMDS

For further information about the drivers, see
http://dpdk.org/doc/guides-%{dpdksver}/nics/index.html
EOF

cd -
%endif    # build dpdk

# And now for OVS...
mkdir build-shared build-static
pushd build-shared
ln -s ../configure
%configure \
%if %{with libcapng}
        --enable-libcapng \
%else
        --disable-libcapng \
%endif
        --disable-static \
        --enable-shared \
        --enable-ssl \
        --with-pkidir=%{_sharedstatedir}/openvswitch/pki \
        --enable-usdt-probes \
        --disable-afxdp
make %{?_smp_mflags}
popd
pushd build-static
ln -s ../configure
%ifarch %{dpdkarches}
PKG_CONFIG_PATH=%{_builddir}/dpdk-build/%{_lib}/pkgconfig \
%endif
%configure \
%if %{with libcapng}
        --enable-libcapng \
%else
        --disable-libcapng \
%endif
        --enable-ssl \
%ifarch %{dpdkarches}
        --with-dpdk=static \
%endif
        --with-pkidir=%{_sharedstatedir}/openvswitch/pki \
        --enable-usdt-probes \
        --disable-afxdp
make %{?_smp_mflags}
popd

/usr/bin/python3 build-aux/dpdkstrip.py \
        --dpdk \
        < rhel/usr_lib_systemd_system_ovs-vswitchd.service.in \
        > rhel/usr_lib_systemd_system_ovs-vswitchd.service

%install
rm -rf $RPM_BUILD_ROOT
make -C build-shared install sbin_PROGRAMS=ovsdb/ovsdb-server DESTDIR=$RPM_BUILD_ROOT
make -C build-static install bin_PROGRAMS= sbin_PROGRAMS=vswitchd/ovs-vswitchd DESTDIR=$RPM_BUILD_ROOT

install -d -m 0755 $RPM_BUILD_ROOT%{_rundir}/openvswitch
install -d -m 0750 $RPM_BUILD_ROOT%{_localstatedir}/log/openvswitch
install -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch

install -p -D -m 0644 rhel/usr_lib_udev_rules.d_91-vfio.rules \
        $RPM_BUILD_ROOT%{_udevrulesdir}/91-vfio.rules

install -p -D -m 0644 \
        rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
        $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/openvswitch

for service in openvswitch ovsdb-server ovs-vswitchd \
               ovs-delete-transient-ports; do
        install -p -D -m 0644 \
                        rhel/usr_lib_systemd_system_${service}.service \
                        $RPM_BUILD_ROOT%{_unitdir}/${service}.service
done

%if %{with ipsec}
install -p -D -m 0644 rhel/usr_lib_systemd_system_openvswitch-ipsec.service \
                      $RPM_BUILD_ROOT%{_unitdir}/openvswitch-ipsec.service
%endif

install -m 0755 rhel/etc_init.d_openvswitch \
        $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/openvswitch.init

install -p -D -m 0644 rhel/etc_openvswitch_default.conf \
        $RPM_BUILD_ROOT/%{_sysconfdir}/openvswitch/default.conf

install -p -D -m 0644 rhel/etc_logrotate.d_openvswitch \
        $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/openvswitch

install -m 0644 vswitchd/vswitch.ovsschema \
        $RPM_BUILD_ROOT/%{_datadir}/openvswitch/vswitch.ovsschema

%if 0%{?rhel} < 9
install -d -m 0755 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/
install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifdown-ovs \
        $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifup-ovs \
        $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
%endif

install -d -m 0755 $RPM_BUILD_ROOT%{python3_sitelib}
cp -a $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/ovstest \
        $RPM_BUILD_ROOT%{python3_sitelib}

# Build the JSON C extension for the Python lib (#1417738)
pushd python
(
export CPPFLAGS="-I ../include -I ../build-shared/include"
export LDFLAGS="%{__global_ldflags} -L $RPM_BUILD_ROOT%{_libdir}"
%py3_build
%py3_install
[ -f "$RPM_BUILD_ROOT/%{python3_sitearch}/ovs/_json$(python3-config --extension-suffix)" ]
)
popd

rm -rf $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/

install -d -m 0755 $RPM_BUILD_ROOT/%{_sharedstatedir}/openvswitch

install -d -m 0755 $RPM_BUILD_ROOT%{_prefix}/lib/firewalld/services/

install -p -D -m 0755 \
        rhel/usr_share_openvswitch_scripts_ovs-systemd-reload \
        $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/ovs-systemd-reload

touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/conf.db
# The db needs special permission as IPsec Pre-shared keys are stored in it.
chmod 0640 $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/conf.db

touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/system-id.conf

# remove unpackaged files
rm -f $RPM_BUILD_ROOT/%{_bindir}/ovs-benchmark \
        $RPM_BUILD_ROOT/%{_bindir}/ovs-docker \
        $RPM_BUILD_ROOT/%{_bindir}/ovs-parse-backtrace \
        $RPM_BUILD_ROOT/%{_bindir}/ovs-testcontroller \
        $RPM_BUILD_ROOT/%{_sbindir}/ovs-vlan-bug-workaround \
        $RPM_BUILD_ROOT/%{_mandir}/man1/ovs-benchmark.1* \
        $RPM_BUILD_ROOT/%{_mandir}/man8/ovs-testcontroller.* \
        $RPM_BUILD_ROOT/%{_mandir}/man8/ovs-vlan-bug-workaround.8*

%if ! %{with ipsec}
rm -f $RPM_BUILD_ROOT/%{_datadir}/openvswitch/scripts/ovs-monitor-ipsec
%endif

# remove ovn unpackages files
rm -f $RPM_BUILD_ROOT%{_bindir}/ovn*
rm -f $RPM_BUILD_ROOT%{_mandir}/man1/ovn*
rm -f $RPM_BUILD_ROOT%{_mandir}/man5/ovn*
rm -f $RPM_BUILD_ROOT%{_mandir}/man7/ovn*
rm -f $RPM_BUILD_ROOT%{_mandir}/man8/ovn*
rm -f $RPM_BUILD_ROOT%{_datadir}/openvswitch/ovn*
rm -f $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/ovn*
rm -f $RPM_BUILD_ROOT%{_includedir}/ovn/*

%check
%if %{with check}
    pushd build-static
    touch resolv.conf
    export OVS_RESOLV_CONF=$(pwd)/resolv.conf
    if make check TESTSUITEFLAGS='%{_smp_mflags}' ||
       make check TESTSUITEFLAGS='--recheck'; then :;
    else
        cat tests/testsuite.log
        exit 1
    fi
    popd
%endif
%if %{with check_datapath_kernel}
    pushd build-static
    if make check-kernel RECHECK=yes; then :;
    else
        cat tests/system-kmod-testsuite.log
        exit 1
    fi
    popd
%endif

%clean
rm -rf $RPM_BUILD_ROOT

%preun
%if 0%{?systemd_preun:1}
    %systemd_preun openvswitch.service
%else
    if [ $1 -eq 0 ] ; then
    # Package removal, not upgrade
        /bin/systemctl --no-reload disable openvswitch.service >/dev/null 2>&1 || :
        /bin/systemctl stop openvswitch.service >/dev/null 2>&1 || :
    fi
%endif

%pre
getent group openvswitch >/dev/null || groupadd -r openvswitch
getent passwd openvswitch >/dev/null || \
    useradd -r -g openvswitch -d / -s /sbin/nologin \
    -c "Open vSwitch Daemons" openvswitch

%ifarch %{dpdkarches}
    getent group hugetlbfs >/dev/null || groupadd hugetlbfs
    usermod -a -G hugetlbfs openvswitch
%endif
exit 0

%post
if [ $1 -eq 1 ]; then
    sed -i 's:^#OVS_USER_ID=:OVS_USER_ID=:' /etc/sysconfig/openvswitch

%ifarch %{dpdkarches}
    sed -i \
        's@OVS_USER_ID="openvswitch:openvswitch"@OVS_USER_ID="openvswitch:hugetlbfs"@'\
        /etc/sysconfig/openvswitch
%endif
fi
chown -R openvswitch:openvswitch /etc/openvswitch

%if 0%{?systemd_post:1}
    %systemd_post openvswitch.service
%else
    # Package install, not upgrade
    if [ $1 -eq 1 ]; then
        /bin/systemctl daemon-reload >dev/null || :
    fi
%endif

%postun
%if 0%{?systemd_postun:1}
    %systemd_postun openvswitch.service
%else
    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
%endif

%triggerun -- openvswitch < 2.5.0-22.git20160727%{?dist}
# old rpm versions restart the service in postun, but
# due to systemd some preparation is needed.
if systemctl is-active openvswitch >/dev/null 2>&1 ; then
    /usr/share/openvswitch/scripts/ovs-ctl stop >/dev/null 2>&1 || :
    systemctl daemon-reload >/dev/null 2>&1 || :
    systemctl stop openvswitch ovsdb-server ovs-vswitchd >/dev/null 2>&1 || :
    systemctl start openvswitch >/dev/null 2>&1 || :
fi
exit 0

%files -n python3-%{pkgname}
%{python3_sitearch}/ovs
%{python3_sitearch}/ovs-*.egg-info
%doc LICENSE

%files test
%{_bindir}/ovs-pcap
%{_bindir}/ovs-tcpdump
%{_bindir}/ovs-tcpundump
%{_datadir}/openvswitch/scripts/usdt/*
%{_mandir}/man1/ovs-pcap.1*
%{_mandir}/man8/ovs-tcpdump.8*
%{_mandir}/man1/ovs-tcpundump.1*
%{_bindir}/ovs-test
%{_bindir}/ovs-vlan-test
%{_bindir}/ovs-l3ping
%{_mandir}/man8/ovs-test.8*
%{_mandir}/man8/ovs-vlan-test.8*
%{_mandir}/man8/ovs-l3ping.8*
%{python3_sitelib}/ovstest

%files devel
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%{_includedir}/openvswitch/*
%{_includedir}/openflow/*
%exclude %{_libdir}/*.a
%exclude %{_libdir}/*.la

%if 0%{?rhel} == 8 || 0%{?fedora} > 28
%files -n network-scripts-%{name}
%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
%{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
%endif

%files
%defattr(-,openvswitch,openvswitch)
%dir %{_sysconfdir}/openvswitch
%{_sysconfdir}/openvswitch/default.conf
%config %ghost %verify(not owner group md5 size mtime) %{_sysconfdir}/openvswitch/conf.db
%ghost %attr(0600,-,-) %verify(not owner group md5 size mtime) %{_sysconfdir}/openvswitch/.conf.db.~lock~
%config %ghost %{_sysconfdir}/openvswitch/system-id.conf
%defattr(-,root,root)
%config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/sysconfig/openvswitch
%{_sysconfdir}/bash_completion.d/ovs-appctl-bashcomp.bash
%{_sysconfdir}/bash_completion.d/ovs-vsctl-bashcomp.bash
%config(noreplace) %{_sysconfdir}/logrotate.d/openvswitch
%{_unitdir}/openvswitch.service
%{_unitdir}/ovsdb-server.service
%{_unitdir}/ovs-vswitchd.service
%{_unitdir}/ovs-delete-transient-ports.service
%{_datadir}/openvswitch/scripts/openvswitch.init
%{_datadir}/openvswitch/scripts/ovs-check-dead-ifs
%{_datadir}/openvswitch/scripts/ovs-lib
%{_datadir}/openvswitch/scripts/ovs-save
%{_datadir}/openvswitch/scripts/ovs-vtep
%{_datadir}/openvswitch/scripts/ovs-ctl
%{_datadir}/openvswitch/scripts/ovs-kmod-ctl
%{_datadir}/openvswitch/scripts/ovs-systemd-reload
%config %{_datadir}/openvswitch/local-config.ovsschema
%config %{_datadir}/openvswitch/vswitch.ovsschema
%config %{_datadir}/openvswitch/vtep.ovsschema
%{_bindir}/ovs-appctl
%{_bindir}/ovs-dpctl
%{_bindir}/ovs-ofctl
%{_bindir}/ovs-vsctl
%{_bindir}/ovsdb-client
%{_bindir}/ovsdb-tool
%{_bindir}/ovs-pki
%{_bindir}/vtep-ctl
%{_libdir}/*.so.*
%{_sbindir}/ovs-vswitchd
%{_sbindir}/ovsdb-server
%{_mandir}/man1/ovsdb-client.1*
%{_mandir}/man1/ovsdb-server.1*
%{_mandir}/man1/ovsdb-tool.1*
%{_mandir}/man5/ovsdb.5*
%{_mandir}/man5/ovsdb.local-config.5*
%{_mandir}/man5/ovsdb-server.5.*
%{_mandir}/man5/ovs-vswitchd.conf.db.5*
%{_mandir}/man5/vtep.5*
%{_mandir}/man7/ovsdb-server.7*
%{_mandir}/man7/ovsdb.7*
%{_mandir}/man7/ovs-actions.7*
%{_mandir}/man7/ovs-fields.7*
%{_mandir}/man8/vtep-ctl.8*
%{_mandir}/man8/ovs-appctl.8*
%{_mandir}/man8/ovs-ctl.8*
%{_mandir}/man8/ovs-dpctl.8*
%{_mandir}/man8/ovs-kmod-ctl.8.*
%{_mandir}/man8/ovs-ofctl.8*
%{_mandir}/man8/ovs-pki.8*
%{_mandir}/man8/ovs-vsctl.8*
%{_mandir}/man8/ovs-vswitchd.8*
%{_mandir}/man8/ovs-parse-backtrace.8*
%{_udevrulesdir}/91-vfio.rules
%doc LICENSE NOTICE README.rst NEWS rhel/README.RHEL.rst
%ifarch %{dpdkarches}
%doc %{dpdkdir}/README.DPDK-PMDS
%attr(750,openvswitch,hugetlbfs) %verify(not owner group) /var/log/openvswitch
%else
%attr(750,openvswitch,openvswitch) %verify(not owner group) /var/log/openvswitch
%endif
/var/lib/openvswitch
%ghost %attr(755,root,root) %verify(not owner group) %{_rundir}/openvswitch
%{_datadir}/openvswitch/bugtool-plugins/
%{_datadir}/openvswitch/scripts/ovs-bugtool-*
%{_bindir}/ovs-dpctl-top
%{_sbindir}/ovs-bugtool
%{_mandir}/man8/ovs-dpctl-top.8*
%{_mandir}/man8/ovs-bugtool.8*
%if (0%{?rhel} && 0%{?rhel} <= 7) || (0%{?fedora} && 0%{?fedora} < 29)
%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
%{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
%endif

%if %{with ipsec}
%files ipsec
%{_datadir}/openvswitch/scripts/ovs-monitor-ipsec
%{_unitdir}/openvswitch-ipsec.service
%endif

%changelog
* Tue Aug 15 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-51
- Merging upstream branch-3.1 [RH git: 7f523f24fb]
    Commit list:
    d653fd1986 connmgr: Count unsent async messages.


* Mon Aug 14 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-50
- Merging upstream branch-3.1 [RH git: 779079ec3f]
    Commit list:
    9c600710bf dpif-netdev: Fix dpif_netdev_flow_put.


* Wed Aug 09 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-49
- Merging upstream branch-3.1 [RH git: 229b8b4ef8]
    Commit list:
    4e6693b44f ofproto-dpif-xlate: Reduce stack usage in recursive xlate functions. (#2104779)


* Mon Aug 07 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-48
- Merging upstream branch-3.1 [RH git: 5ff1d9a4de]
    Commit list:
    70ce7a3cc6 cirrus: Update to FreeBSD 13.2.


* Fri Aug 04 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-47
- Merging upstream branch-3.1 [RH git: 06de042cba]
    Commit list:
    27296cf482 ci: Fix OPTS not being passed to OSX builds.


* Thu Aug 03 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-46
- Merging upstream branch-3.1 [RH git: ab94f613c7]
    Commit list:
    8b1795c69f ovsdb-tool: Fix json leak while showing clustered log.
    d4d068fef6 ovsdb-server: Fix excessive memory usage on DB open. (#2228464)
    369daff0d4 tests: Add ovsdb execution cases for set size constraints.
    eb33626b59 ovsdb: relay: Fix handling of XOR updates with size constraints.
    8d2c8c33e7 ovsdb: file: Fix diff application to a default column value.
    3797558158 ovsdb: file: Fix inability to read diffs that violate type size.
    96d02ee7a8 ovs-tcpdump: Clear auto-assigned ipv6 address of mirror port.


* Tue Aug 01 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-45
- Merging upstream branch-3.1 [RH git: 4224df5b41]
    Commit list:
    618d3bdbb5 ofproto-dpif: Fix removal of renamed datapath ports.


* Tue Jul 25 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-44
- Merging upstream branch-3.1 [RH git: 31fab0fb20]
    Commit list:
    11c542104e netdev-dpdk: Negotiate delivery of per-packet Rx metadata.


* Fri Jul 21 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-43
- Merging upstream branch-3.1 [RH git: da1afee4f8]
    Commit list:
    cad4759fa1 ofproto-dpif-upcall: Mirror packets that are modified. (#2155579)


* Wed Jul 19 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-42
- Merging upstream branch-3.1 [RH git: b1a11e2717]
    Commit list:
    17022ea063 vswitchd: Wait for a bridge exit before replying to exit unixctl.


* Tue Jun 27 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-41
- Merging upstream branch-3.1 [RH git: 66f8de8365]
    Commit list:
    4aba34b82b Prepare for 3.1.3.
    9167774475 Set release date for 3.1.2.


* Fri Jun 23 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-40
- Merging upstream branch-3.1 [RH git: 4ccf29c3a3]
    Commit list:
    aba1862d8b ofproto-dpif-upcall: Don't set statistics to 0 when they jump back.


* Mon Jun 12 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-39
- Merging upstream branch-3.1 [RH git: a8358be74b]
    Commit list:
    859071224c ovsdb: monitor: Destroy initial change set when new columns added.
    54e45e3fee ovsdb: Monitor: Keep and maintain the initial change set.


* Fri Jun 09 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-38
- Merging upstream branch-3.1 [RH git: 1b7d3d3a1f]
    Commit list:
    5fe322e169 fatal-signal: Don't share signal fds/handles with forked process.


* Wed Jun 07 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-37
- Merging upstream branch-3.1 [RH git: 31e7facba9]
    Commit list:
    3fcb817840 cpu: Fix cpuid check for some AMD processors. (#2211747)
    01f0668fdf tc: Fix crash on malformed reply from kernel.


* Wed Jun 07 2023 Timothy Redaelli <tredaelli@redhat.com> - 3.1.0-36
- redhat: Fix an unwanted change that prevent rh-fail-if-dirty to work [RH git: 1aa56d4216]


* Fri Jun 02 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-35
- Merging upstream branch-3.1 [RH git: 2eaadb8281]
    Commit list:
    45dba48f37 netdev-dpdk: Fix warning with gcc 13.


* Mon May 29 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-34
- Merging upstream branch-3.1 [RH git: c5a742a597]
    Commit list:
    faddfa21df utilities/bashcomp: Fix PS1 generation on new bash. (#2170344)
    33db42a34b netdev-offload-dpdk: Fix crash in debug log.


* Fri May 26 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-33
- Merging upstream branch-3.1 [RH git: ea7b9de7d1]
    Commit list:
    55535451bb stream-ssl: Disable alerts on unexpected EOF.


* Thu May 25 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-32
- Merging upstream branch-3.1 [RH git: 5cf043293a]
    Commit list:
    e3b84fd4ab tests: layer3-tunnels: Skip bareudp tests if not supported by kernel.
    e913394054 ovs-fields: Modify the width of tpa and spa.


* Thu May 25 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-31
- Merging upstream branch-3.1 [RH git: 03d17c9746]
    Commit list:
    23d77ba105 netdev-vport: RCU-fy tunnel config.
    0f303e4a7f smap: Make argument of smap_add_ipv6 constant.
    467b891f73 netdev-vport: Fix unsafe handling of GRE sequence number.


* Fri May 19 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-30
- Merging upstream branch-3.1 [RH git: 5999e438cc]
    Commit list:
    ea20146882 tests: dpdk: Pass `--no-pci` to tests that do not use physical ports.


* Thu May 11 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-29
- Merging upstream branch-3.1 [RH git: 21d461f54c]
    Commit list:
    f4cc9ca824 dpctl: Fix dereferencing null pointer in parse_ct_limit_zones().


* Wed May 10 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-28
- Merging upstream branch-3.1 [RH git: d7b0d724f2]
    Commit list:
    9e27e8fe81 netdev-offload: Fix deadlock/recursive use of the netdev_hmap_rwlock rwlock. (#2182541)
    087439e416 ofproto-dpif-xlate: Fix use-after-free when xlate_actions().


* Fri May 05 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-27
- Merging upstream branch-3.1 [RH git: a0b74d148b]
    Commit list:
    bf9c834e64 ci: Separate DPDK from OVS build.


* Thu May 04 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-26
- Merging upstream branch-3.1 [RH git: c0cd6bd2a3]
    Commit list:
    bf1b32e20e ovsdb-idl.at: Fix write-changed-only tests without change tracking.


* Fri Apr 28 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-25
- Merging upstream branch-3.1 [RH git: dd97c178a8]
    Commit list:
    c6cb828870 tc: Fix cleaning chains.


* Thu Apr 27 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-24
- Merging upstream branch-3.1 [RH git: a9adae047c]
    Commit list:
    29c61a4024 python-stream: Handle SSL error in do_handshake.


* Tue Apr 25 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-23
- Merging upstream branch-3.1 [RH git: 9f3dc364af]
    Commit list:
    615548e532 dpif-netlink: Fix memory leak dpif_netlink_open().
    42edc9a1d5 ofp-parse: Check ranges on string to uint32_t conversion.
    d3a479c4b4 learning-switch: Fix coredump of OpenFlow15 learning-switch.


* Mon Apr 24 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-22
- Merging upstream branch-3.1 [RH git: 7629025902]
    Commit list:
    9529e9aa96 ovsdb: Allow conversion records with no data in a clustered storage.
    7006bb112b ovsdb: Check for ephemeral columns before writing a new schema.
    27678b3a19 ovsdb-tool: Fix cluster-to-standalone for DB conversion records.


* Fri Apr 07 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-21
- Merging upstream branch-3.1 [RH git: 4890f6931a]
    Commit list:
    771c989a9a ovs-tcpdump: Stdout is shutdown before ovs-tcpdump exit.


* Thu Apr 06 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-20
- Merging upstream branch-3.1 [RH git: 56a5f0d564]
    Commit list:
    8ac6375cac Prepare for 3.1.2.
    0187eadfce Set release date for 3.1.1.


* Thu Apr 06 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-19
- Merging upstream branch-3.1 [RH git: 3069c68dd9]
    Commit list:
    61b39d8c47 ofproto-dpif-xlate: Always mask ip proto field. (#2134873)


* Wed Apr 05 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-18
- Merging upstream branch-3.1 [RH git: 3607c5dbe6]
    Commit list:
    8019b5896e conntrack-tp: Fix clang warning.


* Tue Apr 04 2023 Timothy Redaelli <tredaelli@redhat.com> - 3.1.0-17
- ofproto-dpif-xlate: Always mask ip proto field. [RH git: 4868ac0e85] (#2134873)
    The ofproto layer currently treats nw_proto field as overloaded to mean
    both that a proper nw layer exists, as well as the value contained in
    the header for the nw proto.  However, this is incorrect behavior as
    relevant standards permit that any value, including '0' should be treated
    as a valid value.
    
    Because of this overload, when the ofproto layer builds action list for
    a packet with nw_proto of 0, it won't build the complete action list that
    we expect to be built for the packet.  That will cause a bad behavior
    where all packets passing the datapath will fall into an incomplete
    action set.
    
    The fix here is to unwildcard nw_proto, allowing us to preserve setting
    actions for protocols which we know have support for the actions we
    program.  This means that a traffic which contains nw_proto == 0 cannot
    cause connectivity breakage with other traffic on the link.
    
    Reported-by: David Marchand <dmarchand@redhat.com>
    Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=2134873
    Acked-by: Ilya Maximets <i.maximets@ovn.org>
    Signed-off-by: Aaron Conole <aconole@redhat.com>


* Mon Apr 03 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-16
- Merging upstream branch-3.1 [RH git: a911cf94ce]
    Commit list:
    b184a68a20 netdev-offload-tc: Del ufid mapping if device not exist.


* Thu Mar 30 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-15
- Merging upstream branch-3.1 [RH git: e6b73e0565]
    Commit list:
    037e2d916 db-ctl-base: Partially revert b8bf410a5.


* Wed Mar 29 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-14
- Merging upstream branch-3.1 [RH git: 407a020d7a]
    Commit list:
    fee5ea720 netdev-tc-offloads: Fix misaligned 8 byte read.


* Wed Mar 29 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-13
- Merging dpdk submodule [RH git: 541c8eefbd]
    Commit list:
    3812e23f6b net/i40e: revert link status check on device start (#2173794)


* Mon Mar 27 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-12
- Merging upstream branch-3.1 [RH git: fbc56ee622]
    Commit list:
    fff04b838 ovs-thread: Fix cpus not read for the first 10s.
    b2b467b3a dpif-netlink: Always create at least 1 handler.


* Wed Mar 22 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-11
- Merging upstream branch-3.1 [RH git: 28d55c3fb3]
    Commit list:
    0f30961e0 netdev-offload-tc: Fix parse_tc_flower_to_actions() reporting errors.


* Wed Mar 15 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-10
- Merging upstream branch-3.1 [RH git: a9561af3dc]
    Commit list:
    3f50354a9 vswitch: Add missing documentation for "ct_flush" capability.
    504f8c859 dpctl: Fix flush-conntrack with datapath as argument.
    24b47072f ofproto-dpif-upcall: Wait for valid hw flow stats before applying min-revalidate-pps.


* Tue Mar 14 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-9
- Merging upstream branch-3.1 [RH git: 398009fd5f]
    Commit list:
    9f9b4de38 system-traffic: Fix conntrack test cases which are failing with af_xdp.


* Tue Mar 07 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-8
- Merging upstream branch-3.1 [RH git: d17880bde7]
    Commit list:
    dcdff1f42 netdev-windows: Add checking when creating netdev with system type on Windows
    39a7a18c3 ofproto-dpif-upcall: Include hardware offloaded flows in total flows.
    f7378bc7f ofproto-dpif-upcall: Reset ukey's last stats value if the datapath changed.


* Tue Feb 28 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-7
- Merging upstream branch-3.1 [RH git: 54a2eb1fda]
    Commit list:
    694c7b4e0 classifier: Fix missing masks on a final stage with ports trie.


* Mon Feb 27 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-6
- Merging upstream branch-3.1 [RH git: 29cb42e1cd]
    Commit list:
    87249e136 ofproto: Fix re-creation of tunnel backing interfaces on restart.


* Thu Feb 23 2023 Timothy Redaelli <tredaelli@redhat.com> - 3.1.0-5
- redhat: use git rev-parse instead of git name-rev [RH git: 1b47f9b3ae]
    Currenty, git name-rev --name-only HEAD is used in order to get the
    current branch, but it doesn't work correctly if a tag is created so use
    git rev-parse --symbolic-full-name --abbrev-ref instead.


* Tue Feb 21 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-4
- Merging upstream branch-3.1 [RH git: 7992626cb1]
    Commit list:
    cb4eecd01 conntrack: Fix conntrack_clean may access the same exp_list each time.
    372e1a835 ovs-actions: Correct typo in ovs-actions man page.


* Tue Feb 21 2023 Open vSwitch CI <ovs-ci@redhat.com> - 3.1.0-3
- Merging upstream branch-3.1 [RH git: 1cdfcbc3be]
    Commit list:
    9c34fc2f6 ofproto-ipfix: Use per-domain template timeouts.
    b72a7f925 Prepare for 3.1.1.


* Mon Feb 20 2023 Timothy Redaelli <tredaelli@redhat.com> - 3.1.0-2
- redhat: add a workaround for meson [RH git: 4b77c5096a]
    Currently, fast-datapath-rhel-8 is aligned to RHEL 8.0, with an
    exception to use a newer meson version.
    
    The problem is that, in the meanwhile, _smp_build_ncpus macros was added
    (and meson macros uses it).
    
    This commit just define, if needed, _smp_build_ncpus by stripping the first 2
    characters (-j) from _smp_mflags that was present in RHEL 8.0.
    
    Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>


* Fri Feb 17 2023 Timothy Redaelli <tredaelli@redhat.com> - 3.1.0-1
- redhat: Use official 3.1.0 tarball [RH git: 2cd8ef13fd]