Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# 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 openvswitch2.13
#%%global commit0 2a4f006c79c06628634490627ac72d8c76477e56
#%%global date 20200121
#%%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
# DPDK commit
#%%global commit1 ef8b7c505f10897621c0801d8ef3e961385246f8
#%%global shortcommit1 %(c=%{commit1}; echo ${c:0:7})
# 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 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: 2.13.0
Release: 132%{?commit0:.%{date}git%{shortcommit0}}%{?commit1:dpdk%{shortcommit1}}%{?dist}
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
# 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 %{?commit1}%{!?commit1:19.11}
%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
%define dpdkarches x86_64 ppc64le
%if 0%{?commit0:1}
Source: https://github.com/openvswitch/ovs/archive/%{commit0}.tar.gz#/openvswitch-%{shortcommit0}.tar.gz
%else
Source: https://github.com/openvswitch/ovs/archive/v%{version}.tar.gz#/openvswitch-%{version}.tar.gz
%endif
%if 0%{?commit1:1}
Source10: https://git.dpdk.org/dpdk/snapshot/dpdk-%{dpdkver}.tar.xz
%else
Source10: https://fast.dpdk.org/rel/dpdk-%{dpdkver}.tar.xz
%endif
%define docutilsver 0.12
%define pygmentsver 1.4
%define sphinxver 1.1.3
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
Source500: configlib.sh
Source502: set_config.sh
# Important: source503 is used as the actual copy file
# @TODO: this causes a warning - fix it?
Source504: arm64-armv8a-linuxapp-gcc-config
Source505: ppc_64-power8-linuxapp-gcc-config
Source506: x86_64-native-linuxapp-gcc-config
Patch: 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 < 2.13
Conflicts: openvswitch-dpdk < 2.13
Conflicts: openvswitch2.10
Conflicts: openvswitch2.11
Conflicts: openvswitch2.12
# dpdk_mach_arch maps between rpm and dpdk arch name, often same as _target_cpu
# dpdk_mach_tmpl is the config template dpdk_mach name, often "native"
# dpdk_mach is the actual dpdk_mach name used in the dpdk make system
%ifarch x86_64
%define dpdk_mach_arch x86_64
%define dpdk_mach_tmpl native
%define dpdk_mach default
%endif
%ifarch aarch64
%define dpdk_mach_arch arm64
%define dpdk_mach_tmpl armv8a
%define dpdk_mach armv8a
%endif
%ifarch ppc64le
%define dpdk_mach_arch ppc_64
%define dpdk_mach_tmpl power8
%define dpdk_mach power8
%endif
%define dpdktarget %{dpdk_mach_arch}-%{dpdk_mach_tmpl}-linuxapp-gcc
# 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
# make check dependencies
BuildRequires: procps-ng
%if 0%{?rhel} > 7 || 0%{?fedora}
BuildRequires: python3-pyOpenSSL
%endif
%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}
# DPDK driver dependencies
BuildRequires: zlib-devel numactl-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
%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} > 7 || 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%{?commit0:1}
%setup -q -n ovs-%{commit0} -a 10
%else
%setup -q -n ovs-%{version} -a 10
%endif
%if ! %{external_sphinx}
%if 0%{?commit0:1}
%setup -n ovs-%{commit0} -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
mv dpdk-*/ %{dpdkdir}/
%patch -p1
%build
# 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
%if 0%{?commit0:1}
# fix the snapshot unreleased version to be the released one.
sed -i.old -e "s/^AC_INIT(openvswitch,.*,/AC_INIT(openvswitch, %{version},/" configure.ac
%endif
./boot.sh
%ifarch %{dpdkarches} # build dpdk
# Lets build DPDK first
cd %{dpdkdir}
# In case dpdk-devel is installed
unset RTE_SDK RTE_INCLUDE RTE_TARGET
# Avoid appending second -Wall to everything, it breaks upstream warning
# disablers in makefiles. Strip explicit -march= from optflags since they
# will only guarantee build failures, DPDK is picky with that.
# Note: _hardening_ldflags has to go on the extra cflags line because dpdk is
# astoundingly convoluted in how it processes its linker flags. Fixing it in
# dpdk is the preferred solution, but adjusting to allow a gcc option in the
# ldflags, even when gcc is used as the linker, requires large tree-wide changes
touch obj.o
gcc -### obj.o 2>&1 | awk '/.*collect2.*/ { print $0}' | sed -e 's/\S*\.res\S*//g' -e 's/-z \S*//g' -e 's/[^ ]*\.o//g' -e 's/ /\n/g' | sort -u > ./noopts.txt
gcc -### $RPM_LD_FLAGS obj.o 2>&1 | awk '/.*collect2.*/ {print $0}' | sed -e 's/\S*\.res\S*//g' -e 's/-z \S*//g' -e 's/[^ ]*\.o//g' -e 's/ /\n/g' | sort -u > ./opts.txt
EXTRA_RPM_LDFLAGS=$(comm -13 ./noopts.txt ./opts.txt)
rm -f obj.o
export EXTRA_CFLAGS="$(echo %{optflags} | sed -e 's:-Wall::g' -e 's:-march=[[:alnum:]]* ::g') -Wformat -fPIC -fcommon %{_hardening_ldflags}"
export EXTRA_LDFLAGS=$(echo %{__global_ldflags} | sed -e's/-Wl,//g' -e's/-spec.*//')
export HOST_EXTRA_CFLAGS="$EXTRA_CFLAGS $EXTRA_RPM_LDFLAGS"
export EXTRA_HOST_LDFLAGS="$EXTRA_RPM_LDFLAGS $(echo %{__global_ldflags} | sed -e's/-spec.*//')"
# DPDK defaults to using builder-specific compiler flags. However,
# the config has been changed by specifying CONFIG_RTE_MACHINE=default
# in order to build for a more generic host. NOTE: It is possible that
# the compiler flags used still won't work for all Fedora-supported
# dpdk_machs, but runtime checks in DPDK will catch those situations.
make V=1 O=%{dpdktarget} T=%{dpdktarget} %{?_smp_mflags} config
cp -f %{SOURCE500} %{SOURCE502} "%{_sourcedir}/%{dpdktarget}-config" .
%{SOURCE502} %{dpdktarget}-config "%{dpdktarget}/.config"
# Currently RHEL8.3+ includes binutils 2.30 with the patch to fix AVX512 support backported (#1870039),
# but DPDK 19.11 blindly disables AVX512 support if ld version < 2.32
binutils_version=$(rpm -q --qf '%%{version}-%%{release}' binutils)
if [ "$binutils_version" "<" "2.30-79.el8" ]; then
make V=1 O=%{dpdktarget} %{?_smp_mflags}
else
make LD_VERSION=2.32 V=1 O=%{dpdktarget} %{?_smp_mflags}
fi
# 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 $(ls %{dpdk_mach_arch}-%{dpdk_mach_tmpl}-linuxapp-gcc/lib/lib*_pmd_*); 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
make %{?_smp_mflags}
popd
pushd build-static
ln -s ../configure
%configure \
%if %{with libcapng}
--enable-libcapng \
%else
--disable-libcapng \
%endif
--enable-ssl \
%ifarch %{dpdkarches}
--with-dpdk=$(pwd)/../%{dpdkdir}/%{dpdktarget} \
%endif
--with-pkidir=%{_sharedstatedir}/openvswitch/pki \
ac_cv_search_mlx5dv_create_wq=-lmlx5
# mlx5dv_create_wq was added in rdma-core 16 since it's the first
# officially released release that adds support for mlx offloading,
# but currently on RHEL 7.7 we still have rdma-core 15 (with the
# offloading commits backported) and so configure is not able to detect
# it.
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-libLTLIBRARIES DESTDIR=$RPM_BUILD_ROOT
make -C build-static install 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
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
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
%{_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} > 7 || 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/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-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
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
* Tue Oct 19 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.13.0-132
- Merging upstream branch-2.13 [RH git: 60a72ee3f6]
Commit list:
5c33e4db80 datapath-windows: add layers when adding the deferred actions
* Thu Oct 14 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.13.0-131
- Merging upstream branch-2.13 [RH git: 31c65d3e94]
Commit list:
6e2e180851 ofproto-dpif-xlate: Fix zone set from non-frozen-metadata fields.
* Wed Oct 13 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.13.0-130
- Merging upstream branch-2.13 [RH git: beb8cdaec6]
Commit list:
ceb395773d dpif-netdev: Fix use-after-free on PACKET_OUT of IP fragments.
fed4df9bb7 tunnel-push-pop.at: Mask source port in tunnel header.
* Tue Oct 12 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.13.0-129
- Merging upstream branch-2.13 [RH git: fc819dabd3]
Commit list:
ec44c50cf0 ipf: release unhandled packets from the batch
* Thu Sep 30 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.13.0-128
- Merging upstream branch-2.13 [RH git: 9d83aff7e3]
Commit list:
695d25f507 datapath-windows:adjust Offset when processing packet in POP_VLAN action
* Mon Sep 27 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.13.0-127
- Merging upstream branch-2.13 [RH git: a117849d24]
Commit list:
e33aaf8bda cirrus: Reduce memory requirements for FreeBSD VMs.
* Thu Sep 23 2021 Timothy Redaelli <tredaelli@redhat.com> - 2.13.0-126
- redhat: use hugetlbfs group for /var/log/openvswitch when dpdk is enabled [RH git: a32eb508f7] (#2007292)
Resolves: #2007292
* Thu Sep 16 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.13.0-125
- Merging upstream branch-2.13 [RH git: 215f08bbd8]
Commit list:
a56a8008eb netdev-linux: Fix a null pointer dereference in netdev_linux_notify_sock().
186ff2a5b2 pcap-file: Fix memory leak in ovs_pcap_open().
b9b144b8d8 odp-util: Fix a null pointer dereference in odp_flow_format().
fea883d3bd odp-util: Fix a null pointer dereference in odp_nsh_key_from_attr__().
ef6d151b04 ipf: Fix only nat the first fragment in the reass process.
* Wed Sep 08 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.13.0-124
- Merging upstream branch-2.13 [RH git: b3c7c50935]
Commit list:
38efd803dd dpif-netdev: Fix crash when PACKET_OUT is metered.
* Tue Aug 17 2021 Michael Santana <msantana@redhat.com> - 2.13.0-123
- Migrate openvswitch to gitlab [RH git: 081bad43fc]
Signed-off-by: Michael Santana <msantana@redhat.com>
* Mon Aug 16 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.13.0-122
- Merging upstream branch-2.13 [RH git: 775922244f]
Commit list:
f61f810fb3 tc: Set action flags for tunnel_key release.
0dc609a260 netlink-socket: Replace error with txn->error when logging nacked transactions.
d3776e354c dynamic-string: Fix a crash in ds_clone().
* Mon Aug 16 2021 Michael Santana <msantana@redhat.com> - 2.13.0-121
- pkgtool: Make changelog in spec file more informative [RH git: 42174a9bc1]
This is done by adding the body of the commit message to the changelong.
The body is indented and has extra spacing separating each entry in the
changelog to make each one more discernible since now they could be
longer.
Also, make sure the bugzilla ID is at the end of the line
Signed-off-by: Michael Santana <msantana@redhat.com>
* Mon Aug 02 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.13.0-120
- Merging upstream branch-2.13 [RH git: eda2f50cf9]
Commit list:
f7e3b47e09 dpif-netdev: Fix offloads of modified flows.
350507b163 dpif-netdev: Fix flow modification after failure.
* Mon Jul 26 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.13.0-119
- Merging upstream branch-2.13 [RH git: c2e53c3150]
Commit list:
f92ce92e53 daemon-unix: Fix leak of a fork error message.
- Merging upstream branch-2.13 [RH git: d613ce404a]
Commit list:
d794934d01 datapath-windows:Correct checksum for DNAT action
- Merging upstream branch-2.13 [RH git: 1dbd295283]
Commit list:
9b1c0df6ad dpif-netlink: Fix report_loss() message.
17e98772cb conntrack: Document all-zero IP SNAT behavior and add a test case.
305b944a2e ovsdb-server: Fix memleak when failing to read storage.
1aa1f59142 netdev-linux: Ignore TSO packets when TSO is not enabled for userspace.
d127fa6d2b conntrack: Handle already natted packets.
c8ebe4434c python: Fix Idl.run change_seqno update.
2762bf6895 Prepare for 2.13.5.
d72ccdfbda Set release date for 2.13.4.
76fdda2b34 netlink: removed incorrect optimization
9c386761f9 ovs-actions.xml: Add missing bracket.
be8c4af1ce netdev-offload-tc: Use nl_msg_put_flag for OVS_TUNNEL_KEY_ATTR_CSUM.
* Wed Jun 30 2021 Timothy Redaelli <tredaelli@redhat.com> - 2.13.0-116
- Merging 15251f0e1d datapath-windows: Specify external include .. [RH git: f9d10a495b]
Commit list:
15251f0e1d datapath-windows: Specify external include paths
9f05167b21 Remove Python 2 leftovers.
64c3133c01 ipf: Fix a use-after-free error, and remove the 'do_not_steal' flag.
fe7bd42d6c ofproto: Fix potential NULL dereference in ofproto_ct_*_zone_timeout_policy().
fc23134227 ofproto: Fix potential NULL dereference in ofproto_get_datapath_cap().
- Merging upstream branch-2.13 [RH git: 190762bf5c]
Commit list:
8be19f789b dpif-netlink: Fix send of uninitialized memory in ct limit requests.
25dd08492d ofproto-dpif: Fix use of uninitialized attributes of timeout policy.
95570b23c8 netdev-linux: Fix use of uninitialized LAG master name.
* Fri May 21 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.13.0-114
- Merging upstream branch-2.13 [RH git: 63656e47fb]
Commit list:
160bb80a32 ofp_actions: Fix set_mpls_tc formatting.
* Wed May 19 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.13.0-113
- Merging upstream branch-2.13 [RH git: 43b0d45790]
Commit list:
32a197f845 dpif-netdev: Remove meter rate from the bucket size calculation.
1b4d8fe1d9 ovsdb-idl: Consider all tables when computing expected cond seqno.
* Sat May 15 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.13.0-112
- Merging upstream branch-2.13 [RH git: 3f4fc768f0]
Commit list:
9acbf2cff7 ovs-ofctl: Fix coredump when using "add-groups" command.
* Fri May 14 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.13.0-111
- Merging upstream branch-2.13 [RH git: 5eca61ee5e]
Commit list:
058702e3dc raft: Transfer leadership before creating snapshots.
* Wed May 12 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.13.0-110
- Merging upstream branch-2.13 [RH git: 6022570f3f]
Commit list:
3bc41e2b6a dpdk: Use DPDK 19.11.8 release.
* Tue May 11 2021 Open vSwitch CI <ovs-ci@redhat.com> - 2.13.0-109
- Merging upstream branch-2.13 [RH git: 132c26ba20]
Commit list:
fbebe7377d github: Fix up malformed /etc/hosts.
2a3d1f4971 doc: automake: Add support for sphinx 4.0.
4ab5524dbb cirrus: Look up existing versions of python dependencies.
* Mon May 10 2021 Open vSwitch CI <ovs-team@redhat.com> - 2.13.0-108
- Merging upstream branch-2.13 [RH git: d2edacdddd]
Commit list:
ea98fe0743 ofp-group: Use big-enough buffer in ofputil_format_group().
* Wed Apr 21 2021 Open vSwitch CI <ovs-team@redhat.com> - 2.13.0-107
- Merging upstream branch-2.13 [RH git: 9a8a649301]
Commit list:
798a40ffb6 ofproto/ofproto-dpif-sflow: Check sflow agent in case of race
9984d61124 dpif: Fix use of uninitialized execute hash.
43c2a10922 odp-util: Fix use of uninitialized erspan metadata.
4f68040a5c dpif-netlink: Fix using uninitialized info.tc_modify_flow_deleted in out label.
1c2a5f170f netdev-offload-tc: Probe for support for any of the ct_state flags.
a4730043a4 compat: Add ct_state flags definitions.
bbd62d7a44 tc: Use skip_hw flag when probing tc features.
* Tue Apr 20 2021 Timothy Redaelli <tredaelli@redhat.com> - 2.13.0-106
- Fix typo in rh-mock-srpm [RH git: 5641bf9d72]
Thanks fbl for reporting
* Wed Apr 14 2021 Open vSwitch CI <ovs-team@redhat.com> - 2.13.0-105
- Merging upstream branch-2.13 [RH git: 0aaf7c02b7]
Commit list:
759da53f07 Add test cases for ingress_policing parameters
c901a563f4 netdev-linux: correct unit of burst parameter
* Fri Apr 09 2021 Open vSwitch CI <ovs-team@redhat.com> - 2.13.0-104
- Merging upstream branch-2.13 [RH git: 1334a398c9]
Commit list:
d47800bd66 ovsdb-idl: Mark arc sources as updated when destination is deleted.
6cf6f9d0d3 ovsdb-idl: Preserve references for deleted rows.
e7d451ab8a ovsdb-idl.at: Make test outputs more predictable.
7fca8a3c94 test-ovsdb: Log steps in idl test.
4ca9dd87f6 test-stream: Silence memory leak report.
* Tue Apr 06 2021 Timothy Redaelli <tredaelli@redhat.com> - 2.13.0-103
- Align DPDK config to 19.11.7 [RH git: 62cff1abf5]
* Tue Apr 06 2021 Timothy Redaelli <tredaelli@redhat.com> - 2.13.0-102
- Merge tag 'c765f42e31c1baa8f4e7a9e01080f5474596ea98' into fast-datapath-rhel-8 [RH git: 4ef8ee2e1a]
dpdk-19.11.7
* Fri Apr 02 2021 Open vSwitch CI <ovs-team@redhat.com> - 2.13.0-101
- Merging upstream branch-2.13 [RH git: 02b662f992]
Commit list:
68086371c8 ipsec: Fix IPv6 default route support for Libreswan.
* Thu Apr 01 2021 Open vSwitch CI <ovs-team@redhat.com> - 2.13.0-100
- Merging upstream branch-2.13 [RH git: 7323d4b8e4]
Commit list:
2cb952326e ovs-ofctl: Fix segfault due to bad meter n_bands.
* Tue Mar 30 2021 Open vSwitch CI <ovs-team@redhat.com> - 2.13.0-99
- Merging upstream branch-2.13 [RH git: 8e7dc3319c]
Commit list:
a112239ff5 dpif-netdev: Refactor and fix the buckets calculation.
d9d8ebfa00 dpif-netdev: Fix the meter buckets overflow.
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
- dpif-netdev: Allow PMD auto load balance with cross-numa. [RH git: edeaca020b] (#1938162)
commit ec68a877db5bbfba49ddeb9929479c033420ea6b
Author: Kevin Traynor <ktraynor@redhat.com>
Date: Thu Mar 18 11:34:04 2021 +0000
dpif-netdev: Allow PMD auto load balance with cross-numa.
Previously auto load balance did not trigger a reassignment when
there was any cross-numa polling as an rxq could be polled from a
different numa after reassign and it could impact estimates.
In the case where there is only one numa with pmds available, the
same numa will always poll before and after reassignment, so estimates
are valid. Allow PMD auto load balance to trigger a reassignment in
this case.
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: David Marchand <david.marchand@redhat.com>
Tested-by: Sunil Pai G <sunil.pai.g@intel.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1938162
Conflicts: Commit backported from upstream master branch. Commit not
present on upstream branch-2.13. Removed NEWS file update as could cause
future merge conflicts.
- redhat: Update docs for test builds [RH git: 0322f225d3]
* Tue Mar 16 2021 Open vSwitch CI <ovs-team@redhat.com> - 2.13.0-96
- Merging upstream branch-2.13 [RH git: bb107a7f7f]
Commit list:
fc8444fb1d python: Send notifications after the transaction ends.
712193ff1c ovs-ctl: Allow recording hostname separately.
3665d7f805 dpif-netdev: Fix crash when add dp flow without in_port field.
732e17d6b6 Documentation: Fix DPDK qos example.
1dee0a67e5 raft: Report disconnected in cluster/status if candidate retries election.
e78d6ffba7 raft: Reintroduce jsonrpc inactivity probes.