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
62
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
diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
new file mode 100755
index 0000000000..b22ad95310
--- /dev/null
+++ b/.ci/linux-build.sh
@@ -0,0 +1,244 @@
+#!/bin/bash
+
+set -o errexit
+set -x
+
+CFLAGS_FOR_OVS="-g -O2"
+SPARSE_FLAGS=""
+EXTRA_OPTS="--enable-Werror"
+TARGET="x86_64-native-linuxapp-gcc"
+
+function install_kernel()
+{
+ if [[ "$1" =~ ^5.* ]]; then
+ PREFIX="v5.x"
+ elif [[ "$1" =~ ^4.* ]]; then
+ PREFIX="v4.x"
+ elif [[ "$1" =~ ^3.* ]]; then
+ PREFIX="v3.x"
+ else
+ PREFIX="v2.6/longterm/v2.6.32"
+ fi
+
+ base_url="https://cdn.kernel.org/pub/linux/kernel/${PREFIX}"
+ # Download page with list of all available kernel versions.
+ wget ${base_url}/
+ # Uncompress in case server returned gzipped page.
+ (file index* | grep ASCII) || (mv index* index.new.gz && gunzip index*)
+ # Get version of the latest stable release.
+ hi_ver=$(echo ${1} | sed 's/\./\\\./')
+ lo_ver=$(cat ./index* | grep -P -o "${hi_ver}\.[0-9]+" | \
+ sed 's/.*\..*\.\(.*\)/\1/' | sort -h | tail -1)
+ version="${1}.${lo_ver}"
+
+ rm -rf index* linux-*
+
+ url="${base_url}/linux-${version}.tar.xz"
+ # Download kernel sources. Try direct link on CDN failure.
+ wget ${url} ||
+ (rm -f linux-${version}.tar.xz && wget ${url}) ||
+ (rm -f linux-${version}.tar.xz && wget ${url/cdn/www})
+
+ tar xvf linux-${version}.tar.xz > /dev/null
+ pushd linux-${version}
+ make allmodconfig
+
+ # Cannot use CONFIG_KCOV: -fsanitize-coverage=trace-pc is not supported by compiler
+ sed -i 's/CONFIG_KCOV=y/CONFIG_KCOV=n/' .config
+
+ # stack validation depends on tools/objtool, but objtool does not compile on travis.
+ # It is giving following error.
+ # >>> GEN arch/x86/insn/inat-tables.c
+ # >>> Semantic error at 40: Unknown imm opnd: AL
+ # So for now disable stack-validation for the build.
+
+ sed -i 's/CONFIG_STACK_VALIDATION=y/CONFIG_STACK_VALIDATION=n/' .config
+ make oldconfig
+
+ # Older kernels do not include openvswitch
+ if [ -d "net/openvswitch" ]; then
+ make net/openvswitch/
+ else
+ make net/bridge/
+ fi
+
+ if [ "$AFXDP" ]; then
+ sudo make headers_install INSTALL_HDR_PATH=/usr
+ pushd tools/lib/bpf/
+ # Bulding with gcc because there are some issues in make files
+ # that breaks building libbpf with clang on Travis.
+ CC=gcc sudo make install
+ CC=gcc sudo make install_headers
+ sudo ldconfig
+ popd
+ # The Linux kernel defines __always_inline in stddef.h (283d7573), and
+ # sys/cdefs.h tries to re-define it. Older libc-dev package in xenial
+ # doesn't have a fix for this issue. Applying it manually.
+ sudo sed -i '/^# define __always_inline .*/i # undef __always_inline' \
+ /usr/include/x86_64-linux-gnu/sys/cdefs.h || true
+ EXTRA_OPTS="${EXTRA_OPTS} --enable-afxdp"
+ else
+ EXTRA_OPTS="${EXTRA_OPTS} --with-linux=$(pwd)"
+ echo "Installed kernel source in $(pwd)"
+ fi
+ popd
+}
+
+function install_dpdk()
+{
+ local DPDK_VER=$1
+ local VERSION_FILE="dpdk-dir/travis-dpdk-cache-version"
+
+ if [ "${DPDK_VER##refs/*/}" != "${DPDK_VER}" ]; then
+ # Avoid using cache for git tree build.
+ rm -rf dpdk-dir
+
+ DPDK_GIT=${DPDK_GIT:-https://dpdk.org/git/dpdk}
+ git clone --single-branch $DPDK_GIT dpdk-dir -b "${DPDK_VER##refs/*/}"
+ pushd dpdk-dir
+ git log -1 --oneline
+ else
+ if [ -f "${VERSION_FILE}" ]; then
+ VER=$(cat ${VERSION_FILE})
+ if [ "${VER}" = "${DPDK_VER}" ]; then
+ EXTRA_OPTS="${EXTRA_OPTS} --with-dpdk=$(pwd)/dpdk-dir/build"
+ echo "Found cached DPDK ${VER} build in $(pwd)/dpdk-dir"
+ return
+ fi
+ fi
+ # No cache or version mismatch.
+ rm -rf dpdk-dir
+ wget https://fast.dpdk.org/rel/dpdk-$1.tar.xz
+ tar xvf dpdk-$1.tar.xz > /dev/null
+ DIR_NAME=$(tar -tf dpdk-$1.tar.xz | head -1 | cut -f1 -d"/")
+ mv ${DIR_NAME} dpdk-dir
+ pushd dpdk-dir
+ fi
+
+ make config CC=gcc T=$TARGET
+
+ if [ "$DPDK_SHARED" ]; then
+ sed -i '/CONFIG_RTE_BUILD_SHARED_LIB=n/s/=n/=y/' build/.config
+ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/$TARGET/lib
+ fi
+
+ # Disable building DPDK kernel modules. Not needed for OVS build or tests.
+ sed -i '/CONFIG_RTE_EAL_IGB_UIO=y/s/=y/=n/' build/.config
+ sed -i '/CONFIG_RTE_KNI_KMOD=y/s/=y/=n/' build/.config
+
+ # Enable pdump support in DPDK.
+ sed -i '/CONFIG_RTE_LIBRTE_PMD_PCAP=n/s/=n/=y/' build/.config
+ sed -i '/CONFIG_RTE_LIBRTE_PDUMP=n/s/=n/=y/' build/.config
+
+ # Switching to 'default' machine to make dpdk-dir cache usable on different
+ # CPUs. We can't be sure that all CI machines are exactly same.
+ sed -i '/CONFIG_RTE_MACHINE="native"/s/="native"/="default"/' build/.config
+
+ make -j4 CC=gcc EXTRA_CFLAGS='-fPIC'
+ EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=$(pwd)/build"
+ echo "Installed DPDK source in $(pwd)"
+ popd
+ echo "${DPDK_VER}" > ${VERSION_FILE}
+}
+
+function configure_ovs()
+{
+ ./boot.sh
+ ./configure CFLAGS="${CFLAGS_FOR_OVS}" $* || { cat config.log; exit 1; }
+}
+
+function build_ovs()
+{
+ local KERNEL=$1
+
+ configure_ovs $OPTS
+ make selinux-policy
+
+ # Only build datapath if we are testing kernel w/o running testsuite and
+ # AF_XDP support.
+ if [ "${KERNEL}" ] && ! [ "$AFXDP" ]; then
+ pushd datapath
+ make -j4
+ popd
+ else
+ make -j4 || { cat config.log; exit 1; }
+ fi
+}
+
+if [ "$DEB_PACKAGE" ]; then
+ mk-build-deps --install --root-cmd sudo --remove debian/control
+ dpkg-checkbuilddeps
+ DEB_BUILD_OPTIONS='parallel=4 nocheck' fakeroot debian/rules binary
+ # Not trying to install ipsec package as there are issues with system-wide
+ # installed python3-openvswitch package and the pyenv used by Travis.
+ packages=$(ls $(pwd)/../*.deb | grep -v ipsec)
+ sudo apt install ${packages}
+ exit 0
+fi
+
+if [ "$KERNEL" ]; then
+ install_kernel $KERNEL
+fi
+
+if [ "$DPDK" ] || [ "$DPDK_SHARED" ]; then
+ if [ -z "$DPDK_VER" ]; then
+ DPDK_VER="19.11.8"
+ fi
+ install_dpdk $DPDK_VER
+ # Enable pdump support in OVS.
+ EXTRA_OPTS="${EXTRA_OPTS} --enable-dpdk-pdump"
+ if [ "$CC" = "clang" ]; then
+ # Disregard cast alignment errors until DPDK is fixed
+ CFLAGS_FOR_OVS="${CFLAGS_FOR_OVS} -Wno-cast-align"
+ fi
+fi
+
+if [ "$CC" = "clang" ]; then
+ CFLAGS_FOR_OVS="${CFLAGS_FOR_OVS} -Wno-error=unused-command-line-argument"
+elif [ "$M32" ]; then
+ # Not using sparse for 32bit builds on 64bit machine.
+ # Adding m32 flag directly to CC to avoid any posiible issues with API/ABI
+ # difference on 'configure' and 'make' stages.
+ export CC="$CC -m32"
+else
+ OPTS="--enable-sparse"
+ if [ "$AFXDP" ]; then
+ # netdev-afxdp uses memset for 64M for umem initialization.
+ SPARSE_FLAGS="${SPARSE_FLAGS} -Wno-memcpy-max-count"
+ fi
+ CFLAGS_FOR_OVS="${CFLAGS_FOR_OVS} ${SPARSE_FLAGS}"
+fi
+
+save_OPTS="${OPTS} $*"
+OPTS="${EXTRA_OPTS} ${save_OPTS}"
+
+if [ "$TESTSUITE" ]; then
+ # 'distcheck' will reconfigure with required options.
+ # Now we only need to prepare the Makefile without sparse-wrapped CC.
+ configure_ovs
+
+ export DISTCHECK_CONFIGURE_FLAGS="$OPTS"
+ if ! make distcheck -j4 CFLAGS="${CFLAGS_FOR_OVS}" \
+ TESTSUITEFLAGS=-j4 RECHECK=yes; then
+ # testsuite.log is necessary for debugging.
+ cat */_build/sub/tests/testsuite.log
+ exit 1
+ fi
+else
+ if [ -z "${KERNEL_LIST}" ]; then build_ovs ${KERNEL};
+ else
+ save_EXTRA_OPTS="${EXTRA_OPTS}"
+ for KERNEL in ${KERNEL_LIST}; do
+ echo "=============================="
+ echo "Building with kernel ${KERNEL}"
+ echo "=============================="
+ EXTRA_OPTS="${save_EXTRA_OPTS}"
+ install_kernel ${KERNEL}
+ OPTS="${EXTRA_OPTS} ${save_OPTS}"
+ build_ovs ${KERNEL}
+ make distclean
+ done
+ fi
+fi
+
+exit 0
diff --git a/.ci/linux-prepare.sh b/.ci/linux-prepare.sh
new file mode 100755
index 0000000000..fea905a830
--- /dev/null
+++ b/.ci/linux-prepare.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+set -ev
+
+if [ "$DEB_PACKAGE" ]; then
+ # We're not using sparse for debian packages, tests are skipped and
+ # all extra dependencies tracked by mk-build-deps.
+ exit 0
+fi
+
+# Build and install sparse.
+#
+# Explicitly disable sparse support for llvm because some travis
+# environments claim to have LLVM (llvm-config exists and works) but
+# linking against it fails.
+# Disabling sqlite support because sindex build fails and we don't
+# really need this utility being installed.
+git clone git://git.kernel.org/pub/scm/devel/sparse/sparse.git
+cd sparse
+make -j4 HAVE_LLVM= HAVE_SQLITE= install
+cd ..
+
+pip3 install --disable-pip-version-check --user flake8 hacking
+pip3 install --user --upgrade docutils
+
+if [ "$M32" ]; then
+ # Installing 32-bit libraries.
+ pkgs="gcc-multilib"
+ if [ -z "$GITHUB_WORKFLOW" ]; then
+ # 32-bit and 64-bit libunwind can not be installed at the same time.
+ # This will remove the 64-bit libunwind and install 32-bit version.
+ # GitHub Actions doesn't have 32-bit versions of these libs.
+ pkgs=$pkgs" libunwind-dev:i386 libunbound-dev:i386"
+ fi
+
+ sudo apt-get install -y $pkgs
+fi
+
+# IPv6 is supported by kernel but disabled in TravisCI images:
+# https://github.com/travis-ci/travis-ci/issues/8891
+# Enable it to avoid skipping of IPv6 related tests.
+sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0
diff --git a/.ci/osx-build.sh b/.ci/osx-build.sh
new file mode 100755
index 0000000000..bf2c13fa3c
--- /dev/null
+++ b/.ci/osx-build.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+set -o errexit
+
+CFLAGS="-Werror $CFLAGS"
+EXTRA_OPTS=""
+
+function configure_ovs()
+{
+ ./boot.sh && ./configure $*
+}
+
+configure_ovs $EXTRA_OPTS $*
+
+if [ "$CC" = "clang" ]; then
+ set make CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument"
+else
+ set make CFLAGS="$CFLAGS $BUILD_ENV"
+fi
+if ! "$@"; then
+ cat config.log
+ exit 1
+fi
+if [ "$TESTSUITE" ] && [ "$CC" != "clang" ]; then
+ if ! make distcheck RECHECK=yes; then
+ # testsuite.log is necessary for debugging.
+ cat */_build/sub/tests/testsuite.log
+ exit 1
+ fi
+fi
+
+exit 0
diff --git a/.ci/osx-prepare.sh b/.ci/osx-prepare.sh
new file mode 100755
index 0000000000..b6447aba1b
--- /dev/null
+++ b/.ci/osx-prepare.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -ev
+pip3 install --user --upgrade docutils
diff --git a/.cirrus.yml b/.cirrus.yml
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -2,21 +2,23 @@ freebsd_build_task:
freebsd_instance:
matrix:
- image_family: freebsd-12-1-snap
- image_family: freebsd-11-3-snap
+ image_family: freebsd-12-2-snap
+ image_family: freebsd-11-4-snap
cpu: 4
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
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
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
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
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
987
988
989
990
env:
- DEPENDENCIES: automake libtool gmake gcc wget openssl
- python3 py37-openssl py37-sphinx
+ DEPENDENCIES: automake libtool gmake gcc wget openssl python3
+ PY_DEPS: sphinx|openssl
matrix:
COMPILER: gcc
COMPILER: clang
prepare_script:
- sysctl -w kern.coredump=0
+ - pkg update -f
- pkg install -y ${DEPENDENCIES}
+ $(pkg search -xq "^py3[0-9]+-(${PY_DEPS})-[0-9]+" | xargs)
configure_script:
- ./boot.sh
diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
new file mode 100644
index 0000000000..c1b88264c2
--- /dev/null
+++ b/.github/workflows/build-and-test.yml
@@ -0,0 +1,211 @@
+name: Build and Test
+
+on: [push, pull_request]
+
+jobs:
+ build-linux:
+ env:
+ dependencies: |
+ automake libtool gcc bc libjemalloc1 libjemalloc-dev \
+ libssl-dev llvm-dev libelf-dev libnuma-dev libpcap-dev \
+ python3-openssl python3-pip python3-sphinx \
+ selinux-policy-dev
+ deb_dependencies: |
+ linux-headers-$(uname -r) build-essential fakeroot devscripts equivs
+ AFXDP: ${{ matrix.afxdp }}
+ CC: ${{ matrix.compiler }}
+ DEB_PACKAGE: ${{ matrix.deb_package }}
+ DPDK: ${{ matrix.dpdk }}
+ DPDK_SHARED: ${{ matrix.dpdk_shared }}
+ KERNEL: ${{ matrix.kernel }}
+ KERNEL_LIST: ${{ matrix.kernel_list }}
+ LIBS: ${{ matrix.libs }}
+ M32: ${{ matrix.m32 }}
+ OPTS: ${{ matrix.opts }}
+ TESTSUITE: ${{ matrix.testsuite }}
+
+ name: linux ${{ join(matrix.*, ' ') }}
+ runs-on: ubuntu-18.04
+ timeout-minutes: 30
+
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - compiler: gcc
+ opts: --disable-ssl
+ - compiler: clang
+ opts: --disable-ssl
+
+ - compiler: gcc
+ testsuite: test
+ kernel: 3.16
+ - compiler: clang
+ testsuite: test
+ kernel: 3.16
+
+ - compiler: gcc
+ testsuite: test
+ opts: --enable-shared
+ - compiler: clang
+ testsuite: test
+ opts: --enable-shared
+
+ - compiler: gcc
+ testsuite: test
+ dpdk: dpdk
+ - compiler: clang
+ testsuite: test
+ dpdk: dpdk
+
+ - compiler: gcc
+ testsuite: test
+ libs: -ljemalloc
+ - compiler: clang
+ testsuite: test
+ libs: -ljemalloc
+
+ - compiler: gcc
+ kernel_list: 5.0 4.20 4.19 4.18 4.17 4.16
+ - compiler: clang
+ kernel_list: 5.0 4.20 4.19 4.18 4.17 4.16
+
+ - compiler: gcc
+ kernel_list: 4.15 4.14 4.9 4.4 3.16
+ - compiler: clang
+ kernel_list: 4.15 4.14 4.9 4.4 3.16
+
+ - compiler: gcc
+ afxdp: afxdp
+ kernel: 5.3
+ - compiler: clang
+ afxdp: afxdp
+ kernel: 5.3
+
+ - compiler: gcc
+ dpdk: dpdk
+ opts: --enable-shared
+ - compiler: clang
+ dpdk: dpdk
+ opts: --enable-shared
+
+ - compiler: gcc
+ dpdk_shared: dpdk-shared
+ - compiler: clang
+ dpdk_shared: dpdk-shared
+
+ - compiler: gcc
+ dpdk_shared: dpdk-shared
+ opts: --enable-shared
+ - compiler: clang
+ dpdk_shared: dpdk-shared
+ opts: --enable-shared
+
+ - compiler: gcc
+ m32: m32
+ opts: --disable-ssl
+
+ - compiler: gcc
+ deb_package: deb
+
+ steps:
+ - name: checkout
+ uses: actions/checkout@v2
+
+ - name: fix up /etc/hosts
+ # https://github.com/actions/virtual-environments/issues/3353
+ run: |
+ cat /etc/hosts
+ sudo sed -i "/don't remove this line/d" /etc/hosts || true
+
+ - name: create ci signature file for the dpdk cache key
+ if: matrix.dpdk != '' || matrix.dpdk_shared != ''
+ # This will collect most of DPDK related lines, so hash will be different
+ # if something changed in a way we're building DPDK including DPDK_VER.
+ # This also allows us to use cache from any branch as long as version
+ # and a way we're building DPDK stays the same.
+ run: |
+ grep -irE 'RTE_|DPDK|meson|ninja' -r .ci/ > dpdk-ci-signature
+ cat dpdk-ci-signature
+
+ - name: cache
+ if: matrix.dpdk != '' || matrix.dpdk_shared != ''
+ uses: actions/cache@v2
+ env:
+ matrix_key: ${{ matrix.dpdk }}${{ matrix.dpdk_shared }}
+ ci_key: ${{ hashFiles('dpdk-ci-signature') }}
+ with:
+ path: dpdk-dir
+ key: ${{ env.matrix_key }}-${{ env.ci_key }}
+
+ - name: update APT cache
+ run: sudo apt update || true
+ - name: install common dependencies
+ if: matrix.deb_package == ''
+ run: sudo apt install -y ${{ env.dependencies }}
+ - name: install dependencies for debian packages
+ if: matrix.deb_package != ''
+ run: sudo apt install -y ${{ env.deb_dependencies }}
+ - name: install libunbound libunwind
+ if: matrix.m32 == ''
+ run: sudo apt install -y libunbound-dev libunwind-dev
+
+ - name: prepare
+ run: ./.ci/linux-prepare.sh
+
+ - name: build
+ run: PATH="$PATH:$HOME/bin" ./.ci/linux-build.sh
+
+ - name: upload deb packages
+ if: matrix.deb_package != ''
+ uses: actions/upload-artifact@v2
+ with:
+ name: deb-packages
+ path: '/home/runner/work/ovs/*.deb'
+
+ - name: copy logs on failure
+ if: failure() || cancelled()
+ run: |
+ # upload-artifact@v2 throws exceptions if it tries to upload socket
+ # files and we could have some socket files in testsuite.dir.
+ # Also, upload-artifact@v2 doesn't work well enough with wildcards.
+ # So, we're just archiving everything here to avoid any issues.
+ mkdir logs
+ cp config.log ./logs/
+ cp -r ./*/_build/sub/tests/testsuite.* ./logs/ || true
+ tar -czvf logs.tgz logs/
+
+ - name: upload logs on failure
+ if: failure() || cancelled()
+ uses: actions/upload-artifact@v2
+ with:
+ name: logs-linux-${{ join(matrix.*, '-') }}
+ path: logs.tgz
+
+ build-osx:
+ env:
+ CC: clang
+ OPTS: --disable-ssl
+
+ name: osx clang --disable-ssl
+ runs-on: macos-latest
+ timeout-minutes: 30
+
+ strategy:
+ fail-fast: false
+
+ steps:
+ - name: checkout
+ uses: actions/checkout@v2
+ - name: install dependencies
+ run: brew install automake libtool
+ - name: prepare
+ run: ./.ci/osx-prepare.sh
+ - name: build
+ run: PATH="$PATH:$HOME/bin" ./.ci/osx-build.sh
+ - name: upload logs on failure
+ if: failure()
+ uses: actions/upload-artifact@v2
+ with:
+ name: logs-osx-clang---disable-ssl
+ path: config.log
diff --git a/AUTHORS.rst b/AUTHORS.rst
index fe3935fca2..4c8772f63a 100644
--- a/AUTHORS.rst
+++ b/AUTHORS.rst
@@ -419,6 +419,7 @@ Zhenyu Gao sysugaozhenyu@gmail.com
ZhiPeng Lu luzhipeng@uniudc.com
Zhou Yangchao 1028519445@qq.com
aginwala amginwal@gmail.com
+lzhecheng lzhecheng@vmware.com
parameswaran krishnamurthy parkrish@gmail.com
solomon liwei.solomon@gmail.com
wenxu wenxu@ucloud.cn
@@ -496,6 +497,7 @@ Edwin Chiu echiu@vmware.com
Eivind Bulie Haanaes
Enas Ahmad enas.ahmad@kaust.edu.sa
Eric Lopez
+Frank Wang (王培辉) wangpeihui@inspur.com
Frido Roose fr.roose@gmail.com
Gaetano Catalli gaetano.catalli@gmail.com
Gavin Remaley gavin_remaley@selinc.com
@@ -558,6 +560,7 @@ Krishna Miriyala miriyalak@vmware.com
Krishna Mohan Elluru elluru.kri.mohan@hpe.com
László Sürü laszlo.suru@ericsson.com
Len Gao leng@vmware.com
+Linhaifeng haifeng.lin@huawei.com
Logan Rosen logatronico@gmail.com
Luca Falavigna dktrkranz@debian.org
Luiz Henrique Ozaki luiz.ozaki@gmail.com
@@ -655,6 +658,7 @@ Ying Chen yingchen@vmware.com
Yongqiang Liu liuyq7809@gmail.com
ZHANG Zhiming zhangzhiming@yunshan.net.cn
Zhangguanghui zhang.guanghui@h3c.com
+Zheng Jingzhou glovejmm@163.com
Ziyou Wang ziyouw@vmware.com
ankur dwivedi ankurengg2003@gmail.com
chen zhang 3zhangchen9211@gmail.com
diff --git a/Documentation/automake.mk b/Documentation/automake.mk
index 22976a3cd6..f46ec988a3 100644
--- a/Documentation/automake.mk
+++ b/Documentation/automake.mk
@@ -217,8 +217,13 @@ install-man-rst: docs-check
$(extract_stem_and_section); \
echo " $(MKDIR_P) '$(DESTDIR)'\"$$mandir\""; \
$(MKDIR_P) '$(DESTDIR)'"$$mandir"; \
- echo " $(INSTALL_DATA) $(SPHINXBUILDDIR)/man/$$stem.$$section '$(DESTDIR)'\"$$mandir/$$stem.$$section\""; \
- $(INSTALL_DATA) $(SPHINXBUILDDIR)/man/$$stem.$$section '$(DESTDIR)'"$$mandir/$$stem.$$section"; \
+ if test -f $(SPHINXBUILDDIR)/man/$$stem.$$section; then \
+ filepath=$(SPHINXBUILDDIR)/man/$$stem.$$section; \
+ else \
+ filepath=$(SPHINXBUILDDIR)/man/$$section/$$stem.$$section; \
+ fi; \
+ echo " $(INSTALL_DATA) $$filepath '$(DESTDIR)'\"$$mandir/$$stem.$$section\""; \
+ $(INSTALL_DATA) $$filepath '$(DESTDIR)'"$$mandir/$$stem.$$section"; \
done
else
install-man-rst:
diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index 6702c58a2b..70a0e9b221 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -67,9 +67,10 @@ Q: What Linux kernel versions does each Open vSwitch release work with?
2.7.x 3.10 to 4.9
2.8.x 3.10 to 4.12
2.9.x 3.10 to 4.13
- 2.10.x 3.10 to 4.17
- 2.11.x 3.10 to 4.18
- 2.12.x 3.10 to 5.0
+ 2.10.x 3.16 to 4.17
+ 2.11.x 3.16 to 4.18
+ 2.12.x 3.16 to 5.0
+ 2.13.x 3.16 to 5.0
============ ==============
Open vSwitch userspace should also work with the Linux kernel module built
@@ -78,6 +79,10 @@ Q: What Linux kernel versions does each Open vSwitch release work with?
Open vSwitch userspace is not sensitive to the Linux kernel version. It
should build against almost any kernel, certainly against 2.6.32 and later.
+ Open vSwitch branches 2.10 through 2.13 will still compile against the
+ RHEL and CentOS 7 3.10 based kernels since they have diverged from the
+ Linux kernel.org 3.10 kernels.
+
Q: Are all features available with all datapaths?
A: Open vSwitch supports different datapaths on different platforms. Each
@@ -173,9 +178,9 @@ Q: What DPDK version does each Open vSwitch release work with?
A: The following table lists the DPDK version against which the given
versions of Open vSwitch will successfully build.
- ============ =======
+ ============ ========
Open vSwitch DPDK
- ============ =======
+ ============ ========
2.2.x 1.6
2.3.x 1.6
2.4.x 2.0
@@ -183,11 +188,12 @@ Q: What DPDK version does each Open vSwitch release work with?
2.6.x 16.07.2
2.7.x 16.11.9
2.8.x 17.05.2
- 2.9.x 17.11.4
- 2.10.x 17.11.4
- 2.11.x 18.11.5
- 2.12.x 18.11.5
- ============ =======
+ 2.9.x 17.11.10
+ 2.10.x 17.11.10
+ 2.11.x 18.11.11
+ 2.12.x 18.11.11
+ 2.13.x 19.11.8
+ ============ ========
Q: Are all the DPDK releases that OVS versions work with maintained?
diff --git a/Documentation/internals/contributing/submitting-patches.rst b/Documentation/internals/contributing/submitting-patches.rst
index 5a314cc60a..f2039595e7 100644
--- a/Documentation/internals/contributing/submitting-patches.rst
+++ b/Documentation/internals/contributing/submitting-patches.rst
@@ -68,11 +68,9 @@ Testing is also important:
feature. A bug fix patch should preferably add a test that would
fail if the bug recurs.
-If you are using GitHub, then you may utilize the travis-ci.org CI build system
-by linking your GitHub repository to it. This will run some of the above tests
-automatically when you push changes to your repository. See the "Continuous
-Integration with Travis-CI" in :doc:`/topics/testing` for details on how to set
-it up.
+If you are using GitHub, then you may utilize the GitHub Actions CI build
+system. It will run some of the above tests automatically when you push
+changes to your repository.
Email Subject
-------------
diff --git a/Documentation/intro/install/dpdk.rst b/Documentation/intro/install/dpdk.rst
index dbf88ec43f..b603b6f0b0 100644
--- a/Documentation/intro/install/dpdk.rst
+++ b/Documentation/intro/install/dpdk.rst
@@ -42,7 +42,7 @@ Build requirements
In addition to the requirements described in :doc:`general`, building Open
vSwitch with DPDK will require the following:
-- DPDK 19.11
+- DPDK 19.11.8
- A `DPDK supported NIC`_
@@ -71,9 +71,9 @@ Install DPDK
#. Download the `DPDK sources`_, extract the file and set ``DPDK_DIR``::
$ cd /usr/src/
- $ wget https://fast.dpdk.org/rel/dpdk-19.11.tar.xz
- $ tar xf dpdk-19.11.tar.xz
- $ export DPDK_DIR=/usr/src/dpdk-19.11
+ $ wget https://fast.dpdk.org/rel/dpdk-19.11.8.tar.xz
+ $ tar xf dpdk-19.11.8.tar.xz
+ $ export DPDK_DIR=/usr/src/dpdk-stable-19.11.8
$ cd $DPDK_DIR
#. (Optional) Configure DPDK as a shared library
@@ -687,6 +687,15 @@ Limitations
around is temporary and is expected to be removed once a method is provided
by DPDK to query the upper bound MTU value for a given device.
+- Flow Control: When using i40e devices (Intel(R) 700 Series) it is recommended
+ to set Link State Change detection to interrupt mode. Otherwise it has been
+ observed that using the default polling mode, flow control changes may not be
+ applied, and flow control states will not be reflected correctly.
+ The issue is under investigation, this is a temporary work around.
+
+ For information about setting Link State Change detection, refer to
+ :ref:`lsc-detection`.
+
Reporting Bugs
--------------
diff --git a/Documentation/topics/dpdk/phy.rst b/Documentation/topics/dpdk/phy.rst
index 38e52c8deb..55a98e2b0e 100644
--- a/Documentation/topics/dpdk/phy.rst
+++ b/Documentation/topics/dpdk/phy.rst
@@ -385,6 +385,8 @@ Jumbo Frames
DPDK physical ports can be configured to use Jumbo Frames. For more
information, refer to :doc:`jumbo-frames`.
+.. _lsc-detection:
+
Link State Change (LSC) detection configuration
-----------------------------------------------
diff --git a/Documentation/topics/dpdk/pmd.rst b/Documentation/topics/dpdk/pmd.rst
index 6f1fdcbc6f..b017b84f6a 100644
--- a/Documentation/topics/dpdk/pmd.rst
+++ b/Documentation/topics/dpdk/pmd.rst
@@ -224,7 +224,9 @@ load then the actual reassignment will be performed.
PMD Auto Load Balancing doesn't currently work if queues are assigned
cross NUMA as actual processing load could get worse after assignment
- as compared to what dry run predicts.
+ as compared to what dry run predicts. The only exception is when all
+ PMD threads are running on cores from a single NUMA node. In this case
+ Auto Load Balancing is still possible.
The minimum time between 2 consecutive PMD auto load balancing iterations can
also be configured by::
diff --git a/Documentation/topics/dpdk/qos.rst b/Documentation/topics/dpdk/qos.rst
index 103495415a..a98ec672fc 100644
--- a/Documentation/topics/dpdk/qos.rst
+++ b/Documentation/topics/dpdk/qos.rst
@@ -69,22 +69,24 @@ to prioritize certain traffic over others at a port level.
For example, the following configuration will limit the traffic rate at a
port level to a maximum of 2000 packets a second (64 bytes IPv4 packets).
-100pps as CIR (Committed Information Rate) and 1000pps as EIR (Excess
-Information Rate). High priority traffic is routed to queue 10, which marks
+1000pps as CIR (Committed Information Rate) and 1000pps as EIR (Excess
+Information Rate). CIR and EIR are measured in bytes without Ethernet header.
+As a result, 1000pps means (64-byte - 14-byte) * 1000 = 50,000 in the
+configuration below. High priority traffic is routed to queue 10, which marks
all traffic as CIR, i.e. Green. All low priority traffic, queue 20, is
marked as EIR, i.e. Yellow::
$ ovs-vsctl --timeout=5 set port dpdk1 qos=@myqos -- \
--id=@myqos create qos type=trtcm-policer \
- other-config:cir=52000 other-config:cbs=2048 \
- other-config:eir=52000 other-config:ebs=2048 \
+ other-config:cir=50000 other-config:cbs=2048 \
+ other-config:eir=50000 other-config:ebs=2048 \
queues:10=@dpdk1Q10 queues:20=@dpdk1Q20 -- \
--id=@dpdk1Q10 create queue \
- other-config:cir=41600000 other-config:cbs=2048 \
+ other-config:cir=100000 other-config:cbs=2048 \
other-config:eir=0 other-config:ebs=0 -- \
--id=@dpdk1Q20 create queue \
other-config:cir=0 other-config:cbs=0 \
- other-config:eir=41600000 other-config:ebs=2048 \
+ other-config:eir=50000 other-config:ebs=2048
This configuration accomplishes that the high priority traffic has a
guaranteed bandwidth egressing the ports at CIR (1000pps), but it can also
diff --git a/Documentation/topics/dpdk/vhost-user.rst b/Documentation/topics/dpdk/vhost-user.rst
index c6c6fd8bde..b10daa53e3 100644
--- a/Documentation/topics/dpdk/vhost-user.rst
+++ b/Documentation/topics/dpdk/vhost-user.rst
@@ -392,9 +392,9 @@ To begin, instantiate a guest as described in :ref:`dpdk-vhost-user` or
DPDK sources to VM and build DPDK::
$ cd /root/dpdk/
- $ wget https://fast.dpdk.org/rel/dpdk-19.11.tar.xz
- $ tar xf dpdk-19.11.tar.xz
- $ export DPDK_DIR=/root/dpdk/dpdk-19.11
+ $ wget https://fast.dpdk.org/rel/dpdk-19.11.8.tar.xz
+ $ tar xf dpdk-19.11.8.tar.xz
+ $ export DPDK_DIR=/root/dpdk/dpdk-stable-19.11.8
$ export DPDK_TARGET=x86_64-native-linuxapp-gcc
$ export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET
$ cd $DPDK_DIR
diff --git a/Documentation/topics/testing.rst b/Documentation/topics/testing.rst
index 161e9d442e..fb1cbdf25e 100644
--- a/Documentation/topics/testing.rst
+++ b/Documentation/topics/testing.rst
@@ -405,45 +405,17 @@ You should invoke scan-view to view analysis results. The last line of output
from ``clang-analyze`` will list the command (containing results directory)
that you should invoke to view the results on a browser.
-Continuous Integration with Travis CI
--------------------------------------
+Continuous Integration with GitHub Actions
+------------------------------------------
-A .travis.yml file is provided to automatically build Open vSwitch with various
-build configurations and run the testsuite using Travis CI. Builds will be
-performed with gcc, sparse and clang with the -Werror compiler flag included,
-therefore the build will fail if a new warning has been introduced.
+A ``.github/workflows/*.yml`` files provided to automatically build
+Open vSwitch with various build configurations and run the testsuite using
+GitHub Actions. Builds will be performed with gcc, sparse and clang with the
+-Werror compiler flag included, therefore the build will fail if a new warning
+has been introduced.
The CI build is triggered via git push (regardless of the specific branch) or
-pull request against any Open vSwitch GitHub repository that is linked to
-travis-ci.
-
-Instructions to setup travis-ci for your GitHub repository:
-
-1. Go to https://travis-ci.org/ and sign in using your GitHub ID.
-2. Go to the "Repositories" tab and enable the ovs repository. You may disable
- builds for pushes or pull requests.
-3. In order to avoid forks sending build failures to the upstream mailing list,
- the notification email recipient is encrypted. If you want to receive email
- notification for build failures, replace the encrypted string:
-
- 1. Install the travis-ci CLI (Requires ruby >=2.0): gem install travis
- 2. In your Open vSwitch repository: travis encrypt mylist@mydomain.org
- 3. Add/replace the notifications section in .travis.yml and fill in the
- secure string as returned by travis encrypt::
-
- notifications:
- email:
- recipients:
- - secure: "....."
-
- .. note::
- You may remove/omit the notifications section to fall back to default
- notification behaviour which is to send an email directly to the author and
- committer of the failing commit. Note that the email is only sent if the
- author/committer have commit rights for the particular GitHub repository.
-
-4. Pushing a commit to the repository which breaks the build or the
- testsuite will now trigger a email sent to mylist@mydomain.org
+pull request against any Open vSwitch GitHub repository.
vsperf
------
diff --git a/Documentation/topics/userspace-tso.rst b/Documentation/topics/userspace-tso.rst
index 94eddc0b2f..f7b6b2639a 100644
--- a/Documentation/topics/userspace-tso.rst
+++ b/Documentation/topics/userspace-tso.rst
@@ -91,20 +91,24 @@ The current OvS userspace `TSO` implementation supports flat and VLAN networks
only (i.e. no support for `TSO` over tunneled connection [VxLAN, GRE, IPinIP,
etc.]).
+The NIC driver must support and advertise checksum offload for TCP and UDP.
+However, SCTP is not mandatory because very few drivers advertised support
+and it wasn't a widely used protocol at the moment this feature was introduced
+in Open vSwitch. Currently, if the NIC supports that, then the feature is
+enabled, otherwise TSO can still be enabled but SCTP packets sent to the NIC
+will be dropped.
+
There is no software implementation of TSO, so all ports attached to the
datapath must support TSO or packets using that feature will be dropped
on ports without TSO support. That also means guests using vhost-user
in client mode will receive TSO packet regardless of TSO being enabled
or disabled within the guest.
-When the NIC performing the segmentation is using the i40e DPDK PMD, a fix
-must be included in the DPDK build, otherwise TSO will not work. The fix can
-be found on `DPDK patchwork`__.
-
-__ https://patches.dpdk.org/patch/64136/
-
-This fix is expected to be included in the 19.11.1 release. When OVS migrates
-to this DPDK release, this limitation can be removed.
+All kernel devices that use the raw socket interface (veth, for example)
+require the kernel commit 9d2f67e43b73 ("net/packet: fix packet drop as of
+virtio gso") in order to work properly. This commit was merged in upstream
+kernel 4.19-rc7, so make sure your kernel is either newer or contains the
+backport.
~~~~~~~~~~~~~~~~~~
Performance Tuning
diff --git a/Documentation/tutorials/ipsec.rst b/Documentation/tutorials/ipsec.rst
index b4c3235132..d7c56d5fcf 100644
--- a/Documentation/tutorials/ipsec.rst
+++ b/Documentation/tutorials/ipsec.rst
@@ -298,6 +298,7 @@ For example::
Otherwise, error message will
be provided
Tunnel Type: gre
+ Local IP: %defaultroute
Remote IP: 2.2.2.2
SKB mark: None
Local cert: None
diff --git a/Makefile.am b/Makefile.am
index b279303d18..b3b56cd50e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -46,7 +46,7 @@ AM_CPPFLAGS += -DNDEBUG
AM_CFLAGS += -fomit-frame-pointer
endif
-AM_CTAGSFLAGS = $(OVS_CTAGS_IDENTIFIERS_LIST)
+AM_CTAGSFLAGS = -I "$(OVS_CTAGS_IDENTIFIERS_LIST)"
if WIN32
psep=";"
@@ -76,12 +76,12 @@ EXTRA_DIST = \
MAINTAINERS.rst \
README.rst \
NOTICE \
+ .ci/linux-build.sh \
+ .ci/linux-prepare.sh \
+ .ci/osx-build.sh \
+ .ci/osx-prepare.sh \
.cirrus.yml \
- .travis.yml \
- .travis/linux-build.sh \
- .travis/linux-prepare.sh \
- .travis/osx-build.sh \
- .travis/osx-prepare.sh \
+ .github/workflows/build-and-test.yml \
appveyor.yml \
boot.sh \
poc/builders/Vagrantfile \
diff --git a/NEWS b/NEWS