[ovs-dev] [PATCH V6 5/6] acinclude.m4: Remove support for building the OVS kernel module.

2022-07-14 Thread Greg Rose
Since the openvswitch project inception it has had support for building
a Linux kernel module to support the OVS kernel datapath.  Since Linux
kernel release 5.8 support for newer kernels has been deprecated.  Now
is the time to fully discontinue support for building the openvswitch
kernel driver. Since Linux 5.9 the Linux built-in openvswitch kernel
driver supports all necessary features and functions of the kernel
datapath and the need to support this additional "out of tree" kernel
module is gone.

Remove the --with-linux configuration support from the acinclude.m4
configuration and warn user it is not supported any longer.

Signed-off-by: Greg Rose 
---
 acinclude.m4 | 810 +--
 1 file changed, 1 insertion(+), 809 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index d15f11a4e..e20d61df4 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -119,133 +119,9 @@ dnl OVS_CHECK_LINUX
 dnl
 dnl Configure linux kernel source tree
 AC_DEFUN([OVS_CHECK_LINUX], [
-  AC_ARG_WITH([linux],
-  [AC_HELP_STRING([--with-linux=/path/to/linux],
-  [Specify the Linux kernel build directory])])
-  AC_ARG_WITH([linux-source],
-  [AC_HELP_STRING([--with-linux-source=/path/to/linux-source],
-  [Specify the Linux kernel source directory
-   (usually figured out automatically from build
-   directory)])])
-
-  # Deprecated equivalents to --with-linux, --with-linux-source.
-  AC_ARG_WITH([l26])
-  AC_ARG_WITH([l26-source])
-
   if test X"$with_linux" != X; then
-KBUILD=$with_linux
-AC_MSG_WARN([--with-linux is deprecated and kernel support is limited to 
5.8 and below])
-  elif test X"$with_l26" != X; then
-KBUILD=$with_l26
-AC_MSG_WARN([--with-l26 is deprecated, please use --with-linux instead])
-  else
-KBUILD=
-  fi
-
-  if test X"$KBUILD" != X; then
-if test X"$with_linux_source" != X; then
-  KSRC=$with_linux_source
-elif test X"$with_l26_source" != X; then
-  KSRC=$with_l26_source
-  AC_MSG_WARN([--with-l26-source is deprecated, please use 
--with-linux-source instead])
-else
-  KSRC=
-fi
-  elif test X"$with_linux_source" != X || test X"$with_l26_source" != X; then
-AC_MSG_ERROR([Linux source directory may not be specified without Linux 
build directory])
-  fi
-
-  if test -n "$KBUILD"; then
-KBUILD=`eval echo "$KBUILD"`
-case $KBUILD in
-/*) ;;
-*) KBUILD=`pwd`/$KBUILD ;;
-esac
-
-# The build directory is what the user provided.
-# Make sure that it exists.
-AC_MSG_CHECKING([for Linux build directory])
-if test -d "$KBUILD"; then
-AC_MSG_RESULT([$KBUILD])
-AC_SUBST(KBUILD)
-else
-AC_MSG_RESULT([no])
-AC_ERROR([source dir $KBUILD doesn't exist])
-fi
-
-# Debian breaks kernel headers into "source" header and "build" headers.
-# We want the source headers, but $KBUILD gives us the "build" headers.
-# Use heuristics to find the source headers.
-AC_MSG_CHECKING([for Linux source directory])
-if test -n "$KSRC"; then
-  KSRC=`eval echo "$KSRC"`
-  case $KSRC in
-  /*) ;;
-  *) KSRC=`pwd`/$KSRC ;;
-  esac
-  if test ! -e $KSRC/include/linux/kernel.h; then
-AC_MSG_ERROR([$KSRC is not a kernel source directory])
-  fi
-else
-  KSRC=$KBUILD
-  if test ! -e $KSRC/include/linux/kernel.h; then
-# Debian kernel build Makefiles tend to include a line of the form:
-# MAKEARGS := -C /usr/src/linux-headers-3.2.0-1-common 
O=/usr/src/linux-headers-3.2.0-1-486
-# First try to extract the source directory from this line.
-KSRC=`sed -n 's/.*-C \([[^ ]]*\).*/\1/p' "$KBUILD"/Makefile`
-if test ! -e "$KSRC"/include/linux/kernel.h; then
-  # Didn't work.  Fall back to name-based heuristics that used to work.
-  case `echo "$KBUILD" | sed 's,/*$,,'` in # (
-*/build)
-  KSRC=`echo "$KBUILD" | sed 's,/build/*$,/source,'`
-  ;; # (
-*)
-  KSRC=`(cd $KBUILD && pwd -P) | sed 's,-[[^-]]*$,-common,'`
-  ;;
-  esac
-fi
-  fi
-  if test ! -e "$KSRC"/include/linux/kernel.h; then
-AC_MSG_ERROR([cannot find source directory (please use 
--with-linux-source)])
-  fi
-fi
-AC_MSG_RESULT([$KSRC])
-
-AC_MSG_CHECKING([for kernel version])
-version=`sed -n 's/^VERSION = //p' "$KSRC/Makefile"`
-patchlevel=`sed -n 's/^PATCHLEVEL = //p' "$KSRC/Makefile"`
-sublevel=`sed -n 's/^SUBLEVEL = //p' "$KSRC/Makefile"`
-if test X"$version" = 

[ovs-dev] [PATCH V6 2/6] rhel: Stop packaging OVS kernel module.

2022-07-14 Thread Greg Rose
Remove the kernel driver specification for RHEL 6.x, 7.x, 8.x and Fedora.

Reviewed-by: David Marchand 
Signed-off-by: Greg Rose 
---
 Documentation/intro/install/rhel.rst  |  18 --
 Vagrantfile   |  12 +-
 poc/playbook-centos-builder.yml   |   8 -
 poc/playbook-fedora-builder.yml   |  16 --
 rhel/.gitignore   |   4 -
 rhel/automake.mk  |  23 --
 rhel/kmod-openvswitch-rhel6.spec.in   | 123 -
 rhel/openvswitch-dkms.spec.in | 103 
 rhel/openvswitch-fedora.spec.in   |   5 +-
 rhel/openvswitch-kmod-fedora.spec.in  | 152 ---
 rhel/openvswitch.spec.in  |   4 +-
 ...are_openvswitch_scripts_ovs-kmod-manage.sh | 237 --
 12 files changed, 3 insertions(+), 702 deletions(-)
 delete mode 100644 rhel/kmod-openvswitch-rhel6.spec.in
 delete mode 100644 rhel/openvswitch-dkms.spec.in
 delete mode 100644 rhel/openvswitch-kmod-fedora.spec.in
 delete mode 100644 rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh

diff --git a/Documentation/intro/install/rhel.rst 
b/Documentation/intro/install/rhel.rst
index b21b274b7..d1fc42021 100644
--- a/Documentation/intro/install/rhel.rst
+++ b/Documentation/intro/install/rhel.rst
@@ -194,24 +194,6 @@ the unit tests, run::
/lib/modules/2.6.32-279.el6.x86_64/build doesn't exist`` or similar, then
the kernel-devel package is missing or buggy.
 
-Kernel Module
-~
-
-On RHEL 6, to build the Open vSwitch kernel module run::
-
-$ rpmbuild -bb rhel/kmod-openvswitch-rhel6.spec
-
-You might have to specify a kernel version and/or variants, e.g.::
-
-$ rpmbuild -bb \
--D "kversion 2.6.32-131.6.1.el6.x86_64" \
--D "kflavors default debug kdump" \
-rhel/kmod-openvswitch-rhel6.spec
-
-This produces an "kmod-openvswitch" RPM for each kernel variant, in this
-example: "kmod-openvswitch", "kmod-openvswitch-debug", and
-"kmod-openvswitch-kdump".
-
 .. _rhel-script-integrations:
 
 Red Hat Network Scripts Integration
diff --git a/Vagrantfile b/Vagrantfile
index 2cd603932..cdca0cf71 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -54,7 +54,7 @@ cd /vagrant
 [ -f Makefile ] && ./configure && make distclean
 mkdir -p ~/build
 cd ~/build
-/vagrant/configure --with-linux=/lib/modules/`uname -r`/build 
--enable-silent-rules
+/vagrant/configure --enable-silent-rules
 SCRIPT
 
 $build_ovs = <

[ovs-dev] [PATCH V6 6/6] Documentation: Remove kernel module documentation.

2022-07-14 Thread Greg Rose
As of Open vSwitch release 2.18 the OVS kernel module is no longer
supported.  Pull the documentation references.

Reviewed-by: David Marchand 
Signed-off-by: Greg Rose 
---
 Documentation/faq/releases.rst|  4 +-
 .../contributing/backporting-patches.rst  |  7 +++
 Documentation/intro/install/fedora.rst| 24 ---
 Documentation/intro/install/general.rst   | 63 ---
 4 files changed, 10 insertions(+), 88 deletions(-)

diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index 8cfe2d392..bf2f3438c 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -75,6 +75,7 @@ Q: What Linux kernel versions does each Open vSwitch release 
work with?
 2.15.x   3.16 to 5.8
 2.16.x   3.16 to 5.8
 2.17.x   3.16 to 5.8
+2.18.x   N/A
  ==
 
 Open vSwitch userspace should also work with the Linux kernel module built
@@ -110,7 +111,8 @@ Q: Are all features available with all datapaths?
 Linux OVS tree
   The datapath implemented by the Linux kernel module distributed with
   the OVS source tree. This datapath is deprecated starting with OVS
-  2.15.x and support capped at Linux kernel version 5.8.
+  2.15.x and support capped at Linux kernel version 5.8. As of OVS 2.18.x
+  the Linux OVS tree is no longer supported.
 
 Userspace
   This datapath supports conventional system devices as well as
diff --git a/Documentation/internals/contributing/backporting-patches.rst 
b/Documentation/internals/contributing/backporting-patches.rst
index 162e9d209..d0a58f8de 100644
--- a/Documentation/internals/contributing/backporting-patches.rst
+++ b/Documentation/internals/contributing/backporting-patches.rst
@@ -119,6 +119,13 @@ userspace changes.
 How to backport kernel patches
 ~~
 
+These instructions only apply to Open vSwitch releases 2.17 and older.
+As of Open vSwitch branch 2.18 the Open vSwitch kernel module is no
+longer supported and only the Linux openvswitch kernel module is used.
+In the case of Open vSwitch releases 2.17 and older, kernel backports
+may be required for bux fixes and feature implementation so these
+instructions are preserved for that reason.
+
 First, the patch should be submitted upstream to `netdev`. When the patch has
 been applied to `net-next`, it is ready to be backported. Starting from the
 Linux tree, use ``git format-patch`` to format each patch that should be
diff --git a/Documentation/intro/install/fedora.rst 
b/Documentation/intro/install/fedora.rst
index 06a0bd3d5..02481597f 100644
--- a/Documentation/intro/install/fedora.rst
+++ b/Documentation/intro/install/fedora.rst
@@ -132,36 +132,12 @@ tests.  This can take several minutes.
 $ make rpm-fedora RPMBUILD_OPT="--with check"
 
 
-Kernel OVS Tree Datapath RPM
-
-
-To build the Open vSwitch kernel module for the currently running kernel
-version, run:
-
-::
-
-$ make rpm-fedora-kmod
-
-To build the Open vSwitch kernel module for another kernel version, the desired
-kernel version can be specified via the `kversion` macro.  For example:
-
-::
-
-$ make rpm-fedora-kmod \
- RPMBUILD_OPT='-D "kversion 4.3.4-300.fc23.x86_64"'
-
 Installing
 --
 
 RPM packages can be installed by using the command ``rpm -i``. Package
 installation requires superuser privileges.
 
-The `openvswitch-kmod` RPM should be installed first if the Linux OVS tree
-datapath module is to be used. The `openvswitch-kmod` RPM should not be
-installed if only the in-tree Linux datapath or user-space datapath is needed.
-Refer to the :doc:`/faq/index` for more information about the various Open
-vSwitch datapath options.
-
 In most cases only the `openvswitch` RPM will need to be installed. The
 `python3-openvswitch`, `openvswitch-test`, `openvswitch-devel`, and
 `openvswitch-debuginfo` RPMs are optional unless required for a specific
diff --git a/Documentation/intro/install/general.rst 
b/Documentation/intro/install/general.rst
index a297aadac..c2208bbed 100644
--- a/Documentation/intro/install/general.rst
+++ b/Documentation/intro/install/general.rst
@@ -302,24 +302,6 @@ example::
 
 $ ./configure CFLAGS="-g -O2 -fsanitize=address -fno-omit-frame-pointer 
-fno-common"
 
-To build the Linux kernel module, so that you can run the kernel-based switch,
-pass the location of the kernel build directory on ``--with-linux``. For
-example, to build for a running instance of Linux::
-
-$ ./configure --with-linux=/lib/modules/$(uname -r)/build
-
-.. note::
-  If ``--with-linux`` requests building for an unsupported version of Linux,
-  then ``configure`` will fail with an error message. Refer to the
-  :doc:`/faq/index` for advice in that case.
-
-If you wish to build the kernel module for an architecture other than the
-architecture of the machine used for the build, you may sp

[ovs-dev] [PATCH V6 0/6] Remove OVS kernel driver

2022-07-14 Thread Greg Rose
It is time to remove support for the ovs kernel driver and push
towards use of the upstream linux openvswitch kernel driver
in it's place [1].

1.  https://mail.openvswitch.org/pipermail/ovs-dev/2022-april/393292.html

Changes in V2:
* Removed the Linux datapath and fixed up various Makefiles to adjust
* Moved openvswitch.h from datapath/linux/compat/include to include/linux
  and fixed up the Makefiles to adjust
* Removed further instances in utilities and auxiliary files where the
  --with-linux configuration command was still being used.
* Changed order of patches to (hopefully) fix up some robot auto-test
  errors

Changes in V3:
* Squashed the two patches removing rhel specs due to interdependence
  between the two that caused build errors between application of each
  of the patches
* Moved the changes to acinclude.m4 towards the end of the series

Changes in V4:
* Changed up the order of the patches again to fix robot errors
* Added back most of the tests in .github/workflows/build-and-test.yml
* Removed xenserver and related documentation, test scripts and makefile
  dependencies

Changes in V5:
* Squashed two patches from previous series into a single patch. There
  was no good reason to separate changes to auxiliary and utilities
  from the removal of the Linux datapath and the two patches had a
  tricky dependency between them.  Best to combine them.
* Various cleanups, title changes and amended commit messages as
  suggested by David Marchand in his reviews.
* Drops the xenserver removal patch - this patch causes 'make  check'
  failures and there is no reason why it can't  be submitted separately.

Changes in V6:
* Applied Ilya's suggested patch to fix up the robot error caused by
  missing all-distfiles.  We'll see if that fixup stops the robot from
  complaining.
* With these changes the github workflows build and test work without
  errors:
https://github.com/gvrose8192/ovs-experimental/runs/7347904715?check_suite_focus=true

Still to do:
* Submit the patch to remove xenserver separately once I figure out why
  the removal causes 'make check' errors for a few interface reconfiguration
  tests.

Greg Rose (6):
  ci: Stop building OVS kernel module.
  rhel: Stop packaging OVS kernel module.
  tests: Remove support for check-kmod test.
  Make: Remove the Linux datapath.
  acinclude.m4: Remove support for building the OVS kernel module.
  Documentation: Remove kernel module documentation.

 .ci/linux-build.sh|   33 +-
 .github/workflows/build-and-test.yml  |   20 -
 .gitignore|1 -
 Documentation/faq/releases.rst|4 +-
 .../contributing/backporting-patches.rst  |7 +
 Documentation/intro/install/fedora.rst|   24 -
 Documentation/intro/install/general.rst   |   63 -
 Documentation/intro/install/rhel.rst  |   18 -
 Documentation/topics/testing.rst  |7 -
 Makefile.am   |   23 +-
 Vagrantfile   |   12 +-
 acinclude.m4  |  810 +---
 build-aux/initial-tab-allowed-files   |1 -
 configure.ac  |6 +-
 datapath-windows/include/automake.mk  |2 +-
 datapath/.gitignore   |7 -
 datapath/Makefile.am  |   60 -
 datapath/Modules.mk   |   58 -
 datapath/actions.c| 1587 
 datapath/compat.h |   92 -
 datapath/conntrack.c  | 2413 ---
 datapath/conntrack.h  |  113 -
 datapath/datapath.c   | 2707 -
 datapath/datapath.h   |  283 --
 datapath/dp_notify.c  |  102 -
 datapath/flow.c   |  972 -
 datapath/flow.h   |  297 --
 datapath/flow_netlink.c   | 3519 -
 datapath/flow_netlink.h   |   85 -
 datapath/flow_table.c |  988 -
 datapath/flow_table.h |  102 -
 datapath/linux/.gitignore |8 -
 datapath/linux/Kbuild.in  |   27 -
 datapath/linux/Makefile.in|9 -
 datapath/linux/Makefile.main.in   |  107 -
 datapath/linux/Modules.mk |  123 -
 .../compat/build-aux/export-check-allow-list  |1 -
 datapath/linux/compat/dev-openvswitch.c   |   83 -
 datapath/linux/compat/dst_cache.c |  173 -
 datapath/linux/compat/exthdrs_core.c  |  129 -
 datapath/linux/compat/genetlink-openvswitch.c |   55 -
 datapath/linux/compat/geneve.c| 1854 -
 datapath/linux/compat/gre.c   |  239 --
 datapath/linux/compat/gso.c   |  317 --
 datapath/linux

[ovs-dev] [PATCH V6 3/6] tests: Remove support for check-kmod test.

2022-07-14 Thread Greg Rose
The OVS kernel module is no longer supported as of OVS 2.18

Reviewed-by: David Marchand 
Signed-off-by: Greg Rose 
---
 Documentation/topics/testing.rst | 7 ---
 tests/automake.mk| 6 --
 2 files changed, 13 deletions(-)

diff --git a/Documentation/topics/testing.rst b/Documentation/topics/testing.rst
index c15d5b38f..d4df656d0 100644
--- a/Documentation/topics/testing.rst
+++ b/Documentation/topics/testing.rst
@@ -428,13 +428,6 @@ your system, run::
 
 $ make check-kernel
 
-To install the kernel module from the current build directory and run the
-testsuite against that kernel module::
-
-$ make check-kmod
-
-The results of the testsuite are in ``tests/system-kmod-testsuite.dir``.
-
 All the features documented under `Unit Tests`_ are available for the kernel
 datapath testsuite.
 
diff --git a/tests/automake.mk b/tests/automake.mk
index b29cb783e..3496f9002 100644
--- a/tests/automake.mk
+++ b/tests/automake.mk
@@ -343,12 +343,6 @@ check-kernel: all
set $(SHELL) '$(SYSTEM_KMOD_TESTSUITE)' -C tests  
AUTOTEST_PATH='$(AUTOTEST_PATH)'; \
"$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && "$$@" 
--recheck)
 
-# Testing the out of tree Kernel module
-check-kmod: all
-   $(MAKE) modules_install
-   modprobe -r -a vport-geneve vport-gre vport-lisp vport-stt vport-vxlan 
openvswitch
-   $(MAKE) check-kernel
-
 check-system-userspace: all
set $(SHELL) '$(SYSTEM_USERSPACE_TESTSUITE)' -C tests  
AUTOTEST_PATH='$(AUTOTEST_PATH)'; \
"$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && "$$@" 
--recheck)
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V6 1/6] ci: Stop building OVS kernel module.

2022-07-14 Thread Greg Rose
Remove kernel based github workflows since the OVS kernel driver is
no longer supported since Release 2.18

Co-authored-by: David Marchand 
Signed-off-by: David Marchand 
Signed-off-by: Greg Rose 
---
 .ci/linux-build.sh   | 33 +++-
 .github/workflows/build-and-test.yml | 20 -
 2 files changed, 3 insertions(+), 50 deletions(-)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index 9963fb810..7b659fede 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -91,9 +91,6 @@ function install_kernel()
 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
 }
@@ -187,20 +184,10 @@ function configure_ovs()
 
 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
-fi
+make -j4
 }
 
 if [ "$DEB_PACKAGE" ]; then
@@ -256,8 +243,7 @@ if [ "$UBSAN" ]; then
 CFLAGS_FOR_OVS="${CFLAGS_FOR_OVS} ${CFLAGS_UBSAN}"
 fi
 
-save_OPTS="${OPTS} $*"
-OPTS="${EXTRA_OPTS} ${save_OPTS}"
+OPTS="${EXTRA_OPTS} ${OPTS} $*"
 
 if [ "$TESTSUITE" ]; then
 # 'distcheck' will reconfigure with required options.
@@ -268,20 +254,7 @@ if [ "$TESTSUITE" ]; then
 make distcheck -j4 CFLAGS="${CFLAGS_FOR_OVS}" \
 TESTSUITEFLAGS=-j4 RECHECK=yes
 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
+build_ovs
 fi
 
 exit 0
diff --git a/.github/workflows/build-and-test.yml 
b/.github/workflows/build-and-test.yml
index 9e3583781..aecaafb39 100644
--- a/.github/workflows/build-and-test.yml
+++ b/.github/workflows/build-and-test.yml
@@ -9,17 +9,13 @@ jobs:
 automake libtool gcc bc libjemalloc1 libjemalloc-dev\
 libssl-dev llvm-dev libelf-dev libnuma-dev libpcap-dev  \
 ninja-build selinux-policy-dev
-  deb_dependencies: |
-linux-headers-$(uname -r) build-essential fakeroot devscripts equivs
   AFXDP:   ${{ matrix.afxdp }}
   ASAN:${{ matrix.asan }}
   UBSAN:   ${{ matrix.ubsan }}
   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 }}
@@ -40,14 +36,11 @@ jobs:
 
   - compiler: gcc
 testsuite:test
-kernel:   3.16
   - compiler: clang
 testsuite:test
-kernel:   3.16
 asan: asan
   - compiler: clang
 testsuite:test
-kernel:   3.16
 ubsan:ubsan
 
   - compiler: gcc
@@ -71,16 +64,6 @@ jobs:
 testsuite:test
 libs: -ljemalloc
 
-  - compiler: gcc
-kernel_list:  5.8 5.5 5.4 4.19
-  - compiler: clang
-kernel_list:  5.8 5.5 5.4 4.19
-
-  - compiler: gcc
-kernel_list:  4.14 4.9 4.4 3.16
-  - compiler: clang
-kernel_list:  4.14 4.9 4.4 3.16
-
   - compiler: gcc
 afxdp:afxdp
 kernel:   5.3
@@ -111,9 +94,6 @@ jobs:
 m32:  m32
 opts: --disable-ssl
 
-  - compiler: gcc
-deb_package:  deb
-
 steps:
 - name: checkout
   uses: actions/checkout@v2
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V5 5/6] acinclude.m4: Remove support for building the OVS kernel module.

2022-07-13 Thread Greg Rose
Since the openvswitch project inception it has had support for building
a Linux kernel module to support the OVS kernel datapath.  Since Linux
kernel release 5.8 support for newer kernels has been deprecated.  Now
is the time to fully discontinue support for building the openvswitch
kernel driver. Since Linux 5.9 the Linux built-in openvswitch kernel
driver supports all necessary features and functions of the kernel
datapath and the need to support this additional "out of tree" kernel
module is gone.

Remove the --with-linux configuration support from the acinclude.m4
configuration and warn user it is not supported any longer.

Signed-off-by: Greg Rose 
---
 acinclude.m4 | 810 +--
 1 file changed, 1 insertion(+), 809 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index d15f11a4e..e20d61df4 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -119,133 +119,9 @@ dnl OVS_CHECK_LINUX
 dnl
 dnl Configure linux kernel source tree
 AC_DEFUN([OVS_CHECK_LINUX], [
-  AC_ARG_WITH([linux],
-  [AC_HELP_STRING([--with-linux=/path/to/linux],
-  [Specify the Linux kernel build directory])])
-  AC_ARG_WITH([linux-source],
-  [AC_HELP_STRING([--with-linux-source=/path/to/linux-source],
-  [Specify the Linux kernel source directory
-   (usually figured out automatically from build
-   directory)])])
-
-  # Deprecated equivalents to --with-linux, --with-linux-source.
-  AC_ARG_WITH([l26])
-  AC_ARG_WITH([l26-source])
-
   if test X"$with_linux" != X; then
-KBUILD=$with_linux
-AC_MSG_WARN([--with-linux is deprecated and kernel support is limited to 
5.8 and below])
-  elif test X"$with_l26" != X; then
-KBUILD=$with_l26
-AC_MSG_WARN([--with-l26 is deprecated, please use --with-linux instead])
-  else
-KBUILD=
-  fi
-
-  if test X"$KBUILD" != X; then
-if test X"$with_linux_source" != X; then
-  KSRC=$with_linux_source
-elif test X"$with_l26_source" != X; then
-  KSRC=$with_l26_source
-  AC_MSG_WARN([--with-l26-source is deprecated, please use 
--with-linux-source instead])
-else
-  KSRC=
-fi
-  elif test X"$with_linux_source" != X || test X"$with_l26_source" != X; then
-AC_MSG_ERROR([Linux source directory may not be specified without Linux 
build directory])
-  fi
-
-  if test -n "$KBUILD"; then
-KBUILD=`eval echo "$KBUILD"`
-case $KBUILD in
-/*) ;;
-*) KBUILD=`pwd`/$KBUILD ;;
-esac
-
-# The build directory is what the user provided.
-# Make sure that it exists.
-AC_MSG_CHECKING([for Linux build directory])
-if test -d "$KBUILD"; then
-AC_MSG_RESULT([$KBUILD])
-AC_SUBST(KBUILD)
-else
-AC_MSG_RESULT([no])
-AC_ERROR([source dir $KBUILD doesn't exist])
-fi
-
-# Debian breaks kernel headers into "source" header and "build" headers.
-# We want the source headers, but $KBUILD gives us the "build" headers.
-# Use heuristics to find the source headers.
-AC_MSG_CHECKING([for Linux source directory])
-if test -n "$KSRC"; then
-  KSRC=`eval echo "$KSRC"`
-  case $KSRC in
-  /*) ;;
-  *) KSRC=`pwd`/$KSRC ;;
-  esac
-  if test ! -e $KSRC/include/linux/kernel.h; then
-AC_MSG_ERROR([$KSRC is not a kernel source directory])
-  fi
-else
-  KSRC=$KBUILD
-  if test ! -e $KSRC/include/linux/kernel.h; then
-# Debian kernel build Makefiles tend to include a line of the form:
-# MAKEARGS := -C /usr/src/linux-headers-3.2.0-1-common 
O=/usr/src/linux-headers-3.2.0-1-486
-# First try to extract the source directory from this line.
-KSRC=`sed -n 's/.*-C \([[^ ]]*\).*/\1/p' "$KBUILD"/Makefile`
-if test ! -e "$KSRC"/include/linux/kernel.h; then
-  # Didn't work.  Fall back to name-based heuristics that used to work.
-  case `echo "$KBUILD" | sed 's,/*$,,'` in # (
-*/build)
-  KSRC=`echo "$KBUILD" | sed 's,/build/*$,/source,'`
-  ;; # (
-*)
-  KSRC=`(cd $KBUILD && pwd -P) | sed 's,-[[^-]]*$,-common,'`
-  ;;
-  esac
-fi
-  fi
-  if test ! -e "$KSRC"/include/linux/kernel.h; then
-AC_MSG_ERROR([cannot find source directory (please use 
--with-linux-source)])
-  fi
-fi
-AC_MSG_RESULT([$KSRC])
-
-AC_MSG_CHECKING([for kernel version])
-version=`sed -n 's/^VERSION = //p' "$KSRC/Makefile"`
-patchlevel=`sed -n 's/^PATCHLEVEL = //p' "$KSRC/Makefile"`
-sublevel=`sed -n 's/^SUBLEVEL = //p' "$KSRC/Makefile"`
-if test X"$version" = 

[ovs-dev] [PATCH V5 2/6] rhel: Stop packaging OVS kernel module.

2022-07-13 Thread Greg Rose
Remove the kernel driver specification for RHEL 6.x, 7.x, 8.x and Fedora.

Reviewed-by: David Marchand 
Signed-off-by: Greg Rose 
---
 Documentation/intro/install/rhel.rst  |  18 --
 Vagrantfile   |  12 +-
 poc/playbook-centos-builder.yml   |   8 -
 poc/playbook-fedora-builder.yml   |  16 --
 rhel/.gitignore   |   4 -
 rhel/automake.mk  |  23 --
 rhel/kmod-openvswitch-rhel6.spec.in   | 123 -
 rhel/openvswitch-dkms.spec.in | 103 
 rhel/openvswitch-fedora.spec.in   |   5 +-
 rhel/openvswitch-kmod-fedora.spec.in  | 152 ---
 rhel/openvswitch.spec.in  |   4 +-
 ...are_openvswitch_scripts_ovs-kmod-manage.sh | 237 --
 12 files changed, 3 insertions(+), 702 deletions(-)
 delete mode 100644 rhel/kmod-openvswitch-rhel6.spec.in
 delete mode 100644 rhel/openvswitch-dkms.spec.in
 delete mode 100644 rhel/openvswitch-kmod-fedora.spec.in
 delete mode 100644 rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh

diff --git a/Documentation/intro/install/rhel.rst 
b/Documentation/intro/install/rhel.rst
index b21b274b7..d1fc42021 100644
--- a/Documentation/intro/install/rhel.rst
+++ b/Documentation/intro/install/rhel.rst
@@ -194,24 +194,6 @@ the unit tests, run::
/lib/modules/2.6.32-279.el6.x86_64/build doesn't exist`` or similar, then
the kernel-devel package is missing or buggy.
 
-Kernel Module
-~
-
-On RHEL 6, to build the Open vSwitch kernel module run::
-
-$ rpmbuild -bb rhel/kmod-openvswitch-rhel6.spec
-
-You might have to specify a kernel version and/or variants, e.g.::
-
-$ rpmbuild -bb \
--D "kversion 2.6.32-131.6.1.el6.x86_64" \
--D "kflavors default debug kdump" \
-rhel/kmod-openvswitch-rhel6.spec
-
-This produces an "kmod-openvswitch" RPM for each kernel variant, in this
-example: "kmod-openvswitch", "kmod-openvswitch-debug", and
-"kmod-openvswitch-kdump".
-
 .. _rhel-script-integrations:
 
 Red Hat Network Scripts Integration
diff --git a/Vagrantfile b/Vagrantfile
index 2cd603932..cdca0cf71 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -54,7 +54,7 @@ cd /vagrant
 [ -f Makefile ] && ./configure && make distclean
 mkdir -p ~/build
 cd ~/build
-/vagrant/configure --with-linux=/lib/modules/`uname -r`/build 
--enable-silent-rules
+/vagrant/configure --enable-silent-rules
 SCRIPT
 
 $build_ovs = <

[ovs-dev] [PATCH V5 6/6] Documentation: Remove kernel module documentation.

2022-07-13 Thread Greg Rose
As of Open vSwitch release 2.18 the OVS kernel module is no longer
supported.  Pull the documentation references.

Reviewed-by: David Marchand 
Signed-off-by: Greg Rose 
---
 Documentation/faq/releases.rst|  4 +-
 .../contributing/backporting-patches.rst  |  7 +++
 Documentation/intro/install/fedora.rst| 24 ---
 Documentation/intro/install/general.rst   | 63 ---
 4 files changed, 10 insertions(+), 88 deletions(-)

diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index 8cfe2d392..bf2f3438c 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -75,6 +75,7 @@ Q: What Linux kernel versions does each Open vSwitch release 
work with?
 2.15.x   3.16 to 5.8
 2.16.x   3.16 to 5.8
 2.17.x   3.16 to 5.8
+2.18.x   N/A
  ==
 
 Open vSwitch userspace should also work with the Linux kernel module built
@@ -110,7 +111,8 @@ Q: Are all features available with all datapaths?
 Linux OVS tree
   The datapath implemented by the Linux kernel module distributed with
   the OVS source tree. This datapath is deprecated starting with OVS
-  2.15.x and support capped at Linux kernel version 5.8.
+  2.15.x and support capped at Linux kernel version 5.8. As of OVS 2.18.x
+  the Linux OVS tree is no longer supported.
 
 Userspace
   This datapath supports conventional system devices as well as
diff --git a/Documentation/internals/contributing/backporting-patches.rst 
b/Documentation/internals/contributing/backporting-patches.rst
index 162e9d209..d0a58f8de 100644
--- a/Documentation/internals/contributing/backporting-patches.rst
+++ b/Documentation/internals/contributing/backporting-patches.rst
@@ -119,6 +119,13 @@ userspace changes.
 How to backport kernel patches
 ~~
 
+These instructions only apply to Open vSwitch releases 2.17 and older.
+As of Open vSwitch branch 2.18 the Open vSwitch kernel module is no
+longer supported and only the Linux openvswitch kernel module is used.
+In the case of Open vSwitch releases 2.17 and older, kernel backports
+may be required for bux fixes and feature implementation so these
+instructions are preserved for that reason.
+
 First, the patch should be submitted upstream to `netdev`. When the patch has
 been applied to `net-next`, it is ready to be backported. Starting from the
 Linux tree, use ``git format-patch`` to format each patch that should be
diff --git a/Documentation/intro/install/fedora.rst 
b/Documentation/intro/install/fedora.rst
index 06a0bd3d5..02481597f 100644
--- a/Documentation/intro/install/fedora.rst
+++ b/Documentation/intro/install/fedora.rst
@@ -132,36 +132,12 @@ tests.  This can take several minutes.
 $ make rpm-fedora RPMBUILD_OPT="--with check"
 
 
-Kernel OVS Tree Datapath RPM
-
-
-To build the Open vSwitch kernel module for the currently running kernel
-version, run:
-
-::
-
-$ make rpm-fedora-kmod
-
-To build the Open vSwitch kernel module for another kernel version, the desired
-kernel version can be specified via the `kversion` macro.  For example:
-
-::
-
-$ make rpm-fedora-kmod \
- RPMBUILD_OPT='-D "kversion 4.3.4-300.fc23.x86_64"'
-
 Installing
 --
 
 RPM packages can be installed by using the command ``rpm -i``. Package
 installation requires superuser privileges.
 
-The `openvswitch-kmod` RPM should be installed first if the Linux OVS tree
-datapath module is to be used. The `openvswitch-kmod` RPM should not be
-installed if only the in-tree Linux datapath or user-space datapath is needed.
-Refer to the :doc:`/faq/index` for more information about the various Open
-vSwitch datapath options.
-
 In most cases only the `openvswitch` RPM will need to be installed. The
 `python3-openvswitch`, `openvswitch-test`, `openvswitch-devel`, and
 `openvswitch-debuginfo` RPMs are optional unless required for a specific
diff --git a/Documentation/intro/install/general.rst 
b/Documentation/intro/install/general.rst
index a297aadac..c2208bbed 100644
--- a/Documentation/intro/install/general.rst
+++ b/Documentation/intro/install/general.rst
@@ -302,24 +302,6 @@ example::
 
 $ ./configure CFLAGS="-g -O2 -fsanitize=address -fno-omit-frame-pointer 
-fno-common"
 
-To build the Linux kernel module, so that you can run the kernel-based switch,
-pass the location of the kernel build directory on ``--with-linux``. For
-example, to build for a running instance of Linux::
-
-$ ./configure --with-linux=/lib/modules/$(uname -r)/build
-
-.. note::
-  If ``--with-linux`` requests building for an unsupported version of Linux,
-  then ``configure`` will fail with an error message. Refer to the
-  :doc:`/faq/index` for advice in that case.
-
-If you wish to build the kernel module for an architecture other than the
-architecture of the machine used for the build, you may sp

[ovs-dev] [PATCH V5 0/6] Remove OVS kernel driver

2022-07-13 Thread Greg Rose
It is time to remove support for the ovs kernel driver and push
towards use of the upstream linux openvswitch kernel driver
in it's place [1].

1.  https://mail.openvswitch.org/pipermail/ovs-dev/2022-april/393292.html

Changes in V2:
* Removed the Linux datapath and fixed up various Makefiles to adjust
* Moved openvswitch.h from datapath/linux/compat/include to include/linux
  and fixed up the Makefiles to adjust
* Removed further instances in utilities and auxiliary files where the
  --with-linux configuration command was still being used.
* Changed order of patches to (hopefully) fix up some robot auto-test
  errors

Changes in V3:
* Squashed the two patches removing rhel specs due to interdependence
  between the two that caused build errors between application of each
  of the patches
* Moved the changes to acinclude.m4 towards the end of the series

Changes in V4:
* Changed up the order of the patches again to fix robot errors
* Added back most of the tests in .github/workflows/build-and-test.yml
* Removed xenserver and related documentation, test scripts and makefile
  dependencies

Changes in V5:
* Squashed two patches from previous series into a single patch. There
  was no good reason to separate changes to auxiliary and utilities
  from the removal of the Linux datapath and the two patches had a
  tricky dependency between them.  Best to combine them.
* Various cleanups, title changes and amended commit messages as
  suggested by David Marchand in his reviews.
* Drops the xenserver removal patch - this patch causes 'make  check'
  failures and there is no reason why it can't  be submitted separately.
* With these changes the github workflows build and test work without
  errors:
https://github.com/gvrose8192/ovs-experimental/runs/7330169845?check_suite_focus=true

Still to do:
* Submit the patch to remove xenserver separately once I figure out why
  the removal causes 'make check' errors for a few interface reconfiguration
  tests.

Greg Rose (6):
  ci: Stop building OVS kernel module.
  rhel: Stop packaging OVS kernel module.
  tests: Remove support for check-kmod test.
  Make: Remove the Linux datapath.
  acinclude.m4: Remove support for building the OVS kernel module.
  Documentation: Remove kernel module documentation.

 .ci/linux-build.sh|   33 +-
 .github/workflows/build-and-test.yml  |   20 -
 Documentation/faq/releases.rst|4 +-
 .../contributing/backporting-patches.rst  |7 +
 Documentation/intro/install/fedora.rst|   24 -
 Documentation/intro/install/general.rst   |   63 -
 Documentation/intro/install/rhel.rst  |   18 -
 Documentation/topics/testing.rst  |7 -
 Makefile.am   |   17 +-
 Vagrantfile   |   12 +-
 acinclude.m4  |  810 +---
 build-aux/initial-tab-allowed-files   |1 -
 configure.ac  |6 +-
 datapath-windows/include/automake.mk  |2 +-
 datapath/.gitignore   |7 -
 datapath/Makefile.am  |   60 -
 datapath/Modules.mk   |   58 -
 datapath/actions.c| 1587 
 datapath/compat.h |   92 -
 datapath/conntrack.c  | 2413 ---
 datapath/conntrack.h  |  113 -
 datapath/datapath.c   | 2707 -
 datapath/datapath.h   |  283 --
 datapath/dp_notify.c  |  102 -
 datapath/flow.c   |  972 -
 datapath/flow.h   |  297 --
 datapath/flow_netlink.c   | 3519 -
 datapath/flow_netlink.h   |   85 -
 datapath/flow_table.c |  988 -
 datapath/flow_table.h |  102 -
 datapath/linux/.gitignore |8 -
 datapath/linux/Kbuild.in  |   27 -
 datapath/linux/Makefile.in|9 -
 datapath/linux/Makefile.main.in   |  107 -
 datapath/linux/Modules.mk |  123 -
 .../compat/build-aux/export-check-allow-list  |1 -
 datapath/linux/compat/dev-openvswitch.c   |   83 -
 datapath/linux/compat/dst_cache.c |  173 -
 datapath/linux/compat/exthdrs_core.c  |  129 -
 datapath/linux/compat/genetlink-openvswitch.c |   55 -
 datapath/linux/compat/geneve.c| 1854 -
 datapath/linux/compat/gre.c   |  239 --
 datapath/linux/compat/gso.c   |  317 --
 datapath/linux/compat/gso.h   |  214 -
 datapath/linux/compat/include/linux/bug.h |   13 -
 datapath/linux/compat/include/linux/cache.h   |   23 -
 .../linux/compat/include/linux/compiler-gcc.h |   20 -
 .../linux/compat

[ovs-dev] [PATCH V5 3/6] tests: Remove support for check-kmod test.

2022-07-13 Thread Greg Rose
The OVS kernel module is no longer supported as of OVS 2.18

Reviewed-by: David Marchand 
Signed-off-by: Greg Rose 
---
 Documentation/topics/testing.rst | 7 ---
 tests/automake.mk| 6 --
 2 files changed, 13 deletions(-)

diff --git a/Documentation/topics/testing.rst b/Documentation/topics/testing.rst
index c15d5b38f..d4df656d0 100644
--- a/Documentation/topics/testing.rst
+++ b/Documentation/topics/testing.rst
@@ -428,13 +428,6 @@ your system, run::
 
 $ make check-kernel
 
-To install the kernel module from the current build directory and run the
-testsuite against that kernel module::
-
-$ make check-kmod
-
-The results of the testsuite are in ``tests/system-kmod-testsuite.dir``.
-
 All the features documented under `Unit Tests`_ are available for the kernel
 datapath testsuite.
 
diff --git a/tests/automake.mk b/tests/automake.mk
index b29cb783e..3496f9002 100644
--- a/tests/automake.mk
+++ b/tests/automake.mk
@@ -343,12 +343,6 @@ check-kernel: all
set $(SHELL) '$(SYSTEM_KMOD_TESTSUITE)' -C tests  
AUTOTEST_PATH='$(AUTOTEST_PATH)'; \
"$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && "$$@" 
--recheck)
 
-# Testing the out of tree Kernel module
-check-kmod: all
-   $(MAKE) modules_install
-   modprobe -r -a vport-geneve vport-gre vport-lisp vport-stt vport-vxlan 
openvswitch
-   $(MAKE) check-kernel
-
 check-system-userspace: all
set $(SHELL) '$(SYSTEM_USERSPACE_TESTSUITE)' -C tests  
AUTOTEST_PATH='$(AUTOTEST_PATH)'; \
"$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && "$$@" 
--recheck)
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V5 1/6] ci: Stop building OVS kernel module.

2022-07-13 Thread Greg Rose
Remove kernel based github workflows since the OVS kernel driver is
no longer supported since Release 2.18

Co-authored-by: David Marchand 
Signed-off-by: David Marchand 
Signed-off-by: Greg Rose 
---
 .ci/linux-build.sh   | 33 +++-
 .github/workflows/build-and-test.yml | 20 -
 2 files changed, 3 insertions(+), 50 deletions(-)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index 9963fb810..7b659fede 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -91,9 +91,6 @@ function install_kernel()
 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
 }
@@ -187,20 +184,10 @@ function configure_ovs()
 
 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
-fi
+make -j4
 }
 
 if [ "$DEB_PACKAGE" ]; then
@@ -256,8 +243,7 @@ if [ "$UBSAN" ]; then
 CFLAGS_FOR_OVS="${CFLAGS_FOR_OVS} ${CFLAGS_UBSAN}"
 fi
 
-save_OPTS="${OPTS} $*"
-OPTS="${EXTRA_OPTS} ${save_OPTS}"
+OPTS="${EXTRA_OPTS} ${OPTS} $*"
 
 if [ "$TESTSUITE" ]; then
 # 'distcheck' will reconfigure with required options.
@@ -268,20 +254,7 @@ if [ "$TESTSUITE" ]; then
 make distcheck -j4 CFLAGS="${CFLAGS_FOR_OVS}" \
 TESTSUITEFLAGS=-j4 RECHECK=yes
 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
+build_ovs
 fi
 
 exit 0
diff --git a/.github/workflows/build-and-test.yml 
b/.github/workflows/build-and-test.yml
index 9e3583781..aecaafb39 100644
--- a/.github/workflows/build-and-test.yml
+++ b/.github/workflows/build-and-test.yml
@@ -9,17 +9,13 @@ jobs:
 automake libtool gcc bc libjemalloc1 libjemalloc-dev\
 libssl-dev llvm-dev libelf-dev libnuma-dev libpcap-dev  \
 ninja-build selinux-policy-dev
-  deb_dependencies: |
-linux-headers-$(uname -r) build-essential fakeroot devscripts equivs
   AFXDP:   ${{ matrix.afxdp }}
   ASAN:${{ matrix.asan }}
   UBSAN:   ${{ matrix.ubsan }}
   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 }}
@@ -40,14 +36,11 @@ jobs:
 
   - compiler: gcc
 testsuite:test
-kernel:   3.16
   - compiler: clang
 testsuite:test
-kernel:   3.16
 asan: asan
   - compiler: clang
 testsuite:test
-kernel:   3.16
 ubsan:ubsan
 
   - compiler: gcc
@@ -71,16 +64,6 @@ jobs:
 testsuite:test
 libs: -ljemalloc
 
-  - compiler: gcc
-kernel_list:  5.8 5.5 5.4 4.19
-  - compiler: clang
-kernel_list:  5.8 5.5 5.4 4.19
-
-  - compiler: gcc
-kernel_list:  4.14 4.9 4.4 3.16
-  - compiler: clang
-kernel_list:  4.14 4.9 4.4 3.16
-
   - compiler: gcc
 afxdp:afxdp
 kernel:   5.3
@@ -111,9 +94,6 @@ jobs:
 m32:  m32
 opts: --disable-ssl
 
-  - compiler: gcc
-deb_package:  deb
-
 steps:
 - name: checkout
   uses: actions/checkout@v2
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V4 6/8] acinclude.m4: Remove support for building the OVS kernel module

2022-07-12 Thread Greg Rose
Since the openvswitch project inception it has had support for building
a Linux kernel module to support the OVS kernel datapath.  Since Linux
kernel release 5.8 support for newer kernels has been deprecated.  Now
is the time to fully discontinue support for building the openvswitch
kernel driver. Since Linux 5.9 the Linux built-in openvswitch kernel
driver supports all necessary features and functions of the kernel
datapath and the need to support this additional "out of tree" kernel
module is gone.

Remove the --with-linux configuration support from the acinclude.m4
configuration and warn user it is not supported any longer.

Signed-off-by: Greg Rose 
---
 acinclude.m4 | 683 +--
 1 file changed, 1 insertion(+), 682 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index b518aa624..30ee143e4 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -115,132 +115,11 @@ dnl OVS_CHECK_LINUX
 dnl
 dnl Configure linux kernel source tree
 AC_DEFUN([OVS_CHECK_LINUX], [
-  AC_ARG_WITH([linux],
-  [AC_HELP_STRING([--with-linux=/path/to/linux],
-  [Specify the Linux kernel build directory])])
-  AC_ARG_WITH([linux-source],
-  [AC_HELP_STRING([--with-linux-source=/path/to/linux-source],
-  [Specify the Linux kernel source directory
-   (usually figured out automatically from build
-   directory)])])
-
-  # Deprecated equivalents to --with-linux, --with-linux-source.
-  AC_ARG_WITH([l26])
-  AC_ARG_WITH([l26-source])
-
   if test X"$with_linux" != X; then
-KBUILD=$with_linux
-AC_MSG_WARN([--with-linux is deprecated and kernel support is limited to 
5.8 and below])
-  elif test X"$with_l26" != X; then
-KBUILD=$with_l26
-AC_MSG_WARN([--with-l26 is deprecated, please use --with-linux instead])
-  else
+AC_MSG_WARN([--with-linux is no longer supported])
 KBUILD=
   fi
 
-  if test X"$KBUILD" != X; then
-if test X"$with_linux_source" != X; then
-  KSRC=$with_linux_source
-elif test X"$with_l26_source" != X; then
-  KSRC=$with_l26_source
-  AC_MSG_WARN([--with-l26-source is deprecated, please use 
--with-linux-source instead])
-else
-  KSRC=
-fi
-  elif test X"$with_linux_source" != X || test X"$with_l26_source" != X; then
-AC_MSG_ERROR([Linux source directory may not be specified without Linux 
build directory])
-  fi
-
-  if test -n "$KBUILD"; then
-KBUILD=`eval echo "$KBUILD"`
-case $KBUILD in
-/*) ;;
-*) KBUILD=`pwd`/$KBUILD ;;
-esac
-
-# The build directory is what the user provided.
-# Make sure that it exists.
-AC_MSG_CHECKING([for Linux build directory])
-if test -d "$KBUILD"; then
-AC_MSG_RESULT([$KBUILD])
-AC_SUBST(KBUILD)
-else
-AC_MSG_RESULT([no])
-AC_ERROR([source dir $KBUILD doesn't exist])
-fi
-
-# Debian breaks kernel headers into "source" header and "build" headers.
-# We want the source headers, but $KBUILD gives us the "build" headers.
-# Use heuristics to find the source headers.
-AC_MSG_CHECKING([for Linux source directory])
-if test -n "$KSRC"; then
-  KSRC=`eval echo "$KSRC"`
-  case $KSRC in
-  /*) ;;
-  *) KSRC=`pwd`/$KSRC ;;
-  esac
-  if test ! -e $KSRC/include/linux/kernel.h; then
-AC_MSG_ERROR([$KSRC is not a kernel source directory])
-  fi
-else
-  KSRC=$KBUILD
-  if test ! -e $KSRC/include/linux/kernel.h; then
-# Debian kernel build Makefiles tend to include a line of the form:
-# MAKEARGS := -C /usr/src/linux-headers-3.2.0-1-common 
O=/usr/src/linux-headers-3.2.0-1-486
-# First try to extract the source directory from this line.
-KSRC=`sed -n 's/.*-C \([[^ ]]*\).*/\1/p' "$KBUILD"/Makefile`
-if test ! -e "$KSRC"/include/linux/kernel.h; then
-  # Didn't work.  Fall back to name-based heuristics that used to work.
-  case `echo "$KBUILD" | sed 's,/*$,,'` in # (
-*/build)
-  KSRC=`echo "$KBUILD" | sed 's,/build/*$,/source,'`
-  ;; # (
-*)
-  KSRC=`(cd $KBUILD && pwd -P) | sed 's,-[[^-]]*$,-common,'`
-  ;;
-  esac
-fi
-  fi
-  if test ! -e "$KSRC"/include/linux/kernel.h; then
-AC_MSG_ERROR([cannot find source directory (please use 
--with-linux-source)])
-  fi
-fi
-AC_MSG_RESULT([$KSRC])
-
-AC_MSG_CHECKING([for kernel version])
-version=`sed -n 's/^VERSION = //p' "$KSRC/Makefile"`
-patchlevel=`sed -n 's/^PATCHLEVEL = //p' "$KSRC/Makefile"`
-sublevel=`sed -n 's/^SUBLEVEL = //p' "

[ovs-dev] [PATCH V4 7/8] Documentation: Remove kernel module documentation

2022-07-12 Thread Greg Rose
As of Open vSwitch release 2.18 the OVS kernel module is no longer
supported.  Pull the documentation references.

Signed-off-by: Greg Rose 
---
 Documentation/faq/releases.rst|  4 +-
 .../contributing/backporting-patches.rst  |  7 +++
 Documentation/intro/install/fedora.rst| 24 ---
 Documentation/intro/install/general.rst   | 63 ---
 4 files changed, 10 insertions(+), 88 deletions(-)

diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index 8cfe2d392..bf2f3438c 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -75,6 +75,7 @@ Q: What Linux kernel versions does each Open vSwitch release 
work with?
 2.15.x   3.16 to 5.8
 2.16.x   3.16 to 5.8
 2.17.x   3.16 to 5.8
+2.18.x   N/A
  ==
 
 Open vSwitch userspace should also work with the Linux kernel module built
@@ -110,7 +111,8 @@ Q: Are all features available with all datapaths?
 Linux OVS tree
   The datapath implemented by the Linux kernel module distributed with
   the OVS source tree. This datapath is deprecated starting with OVS
-  2.15.x and support capped at Linux kernel version 5.8.
+  2.15.x and support capped at Linux kernel version 5.8. As of OVS 2.18.x
+  the Linux OVS tree is no longer supported.
 
 Userspace
   This datapath supports conventional system devices as well as
diff --git a/Documentation/internals/contributing/backporting-patches.rst 
b/Documentation/internals/contributing/backporting-patches.rst
index 162e9d209..8370c954d 100644
--- a/Documentation/internals/contributing/backporting-patches.rst
+++ b/Documentation/internals/contributing/backporting-patches.rst
@@ -119,6 +119,13 @@ userspace changes.
 How to backport kernel patches
 ~~
 
+These instructions only apply to Open vSwitch releases 2.16 and older.
+As of Open vSwitch branch 2.17 the Open vSwitch kernel module is no
+longer supported and only the Linux openvswitch kernel module is used.
+In the case of Open vSwitch releases 2.16 and older kernel backports
+may be required for bux fixes and feature implementation so these
+instructions are preserved for that reason.
+
 First, the patch should be submitted upstream to `netdev`. When the patch has
 been applied to `net-next`, it is ready to be backported. Starting from the
 Linux tree, use ``git format-patch`` to format each patch that should be
diff --git a/Documentation/intro/install/fedora.rst 
b/Documentation/intro/install/fedora.rst
index 06a0bd3d5..02481597f 100644
--- a/Documentation/intro/install/fedora.rst
+++ b/Documentation/intro/install/fedora.rst
@@ -132,36 +132,12 @@ tests.  This can take several minutes.
 $ make rpm-fedora RPMBUILD_OPT="--with check"
 
 
-Kernel OVS Tree Datapath RPM
-
-
-To build the Open vSwitch kernel module for the currently running kernel
-version, run:
-
-::
-
-$ make rpm-fedora-kmod
-
-To build the Open vSwitch kernel module for another kernel version, the desired
-kernel version can be specified via the `kversion` macro.  For example:
-
-::
-
-$ make rpm-fedora-kmod \
- RPMBUILD_OPT='-D "kversion 4.3.4-300.fc23.x86_64"'
-
 Installing
 --
 
 RPM packages can be installed by using the command ``rpm -i``. Package
 installation requires superuser privileges.
 
-The `openvswitch-kmod` RPM should be installed first if the Linux OVS tree
-datapath module is to be used. The `openvswitch-kmod` RPM should not be
-installed if only the in-tree Linux datapath or user-space datapath is needed.
-Refer to the :doc:`/faq/index` for more information about the various Open
-vSwitch datapath options.
-
 In most cases only the `openvswitch` RPM will need to be installed. The
 `python3-openvswitch`, `openvswitch-test`, `openvswitch-devel`, and
 `openvswitch-debuginfo` RPMs are optional unless required for a specific
diff --git a/Documentation/intro/install/general.rst 
b/Documentation/intro/install/general.rst
index a297aadac..c2208bbed 100644
--- a/Documentation/intro/install/general.rst
+++ b/Documentation/intro/install/general.rst
@@ -302,24 +302,6 @@ example::
 
 $ ./configure CFLAGS="-g -O2 -fsanitize=address -fno-omit-frame-pointer 
-fno-common"
 
-To build the Linux kernel module, so that you can run the kernel-based switch,
-pass the location of the kernel build directory on ``--with-linux``. For
-example, to build for a running instance of Linux::
-
-$ ./configure --with-linux=/lib/modules/$(uname -r)/build
-
-.. note::
-  If ``--with-linux`` requests building for an unsupported version of Linux,
-  then ``configure`` will fail with an error message. Refer to the
-  :doc:`/faq/index` for advice in that case.
-
-If you wish to build the kernel module for an architecture other than the
-architecture of the machine used for the build, you may specify the kernel
-architecture s

[ovs-dev] [PATCH V4 5/8] aux:utilities: Remove references to the Linux datapath

2022-07-12 Thread Greg Rose
Remove references to the Linux datapath from auxiliary files and
utilities since it is no longer supported.

Signed-off-by: Greg Rose 
---
 build-aux/initial-tab-allowed-files   |  1 -
 .../docker/debian/build-kernel-modules.sh | 13 -
 utilities/ovs-dev.py  | 19 ---
 3 files changed, 8 insertions(+), 25 deletions(-)

diff --git a/build-aux/initial-tab-allowed-files 
b/build-aux/initial-tab-allowed-files
index 1e9573c69..8bd23698e 100644
--- a/build-aux/initial-tab-allowed-files
+++ b/build-aux/initial-tab-allowed-files
@@ -3,7 +3,6 @@
 \.mk$
 \.png$
 \.sln$
-^datapath/
 ^include/linux/
 ^include/sparse/rte_
 ^include/windows/
diff --git a/utilities/docker/debian/build-kernel-modules.sh 
b/utilities/docker/debian/build-kernel-modules.sh
index 872ba1eb8..aaee73ff7 100755
--- a/utilities/docker/debian/build-kernel-modules.sh
+++ b/utilities/docker/debian/build-kernel-modules.sh
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-KERNEL_VERSION=$1
+KERNEL_VERSION=host
 OVS_BRANCH=$2
 GITHUB_SRC=$3
 
@@ -39,18 +39,13 @@ cd ovs
 config="./configure --localstatedir="/var" --sysconfdir="/etc" --prefix="/usr"
 --enable-ssl"
 
-if [ $KERNEL_VERSION = "host" ]; then
-   eval $config
-else
-withlinux=" --with-linux=/lib/modules/$KERNEL_VERSION/build"
-eval $config$withlinux
-fi
+eval $config
 
-make -j8; make install; make modules_install
+make -j8; make install
 
 # remove deps to make the container light weight.
 apt-get remove --purge -y ${build_deps}
 apt-get autoremove -y --purge
 cd ..; rm -rf ovs
 basic_utils="vim kmod net-tools uuid-runtime iproute2"
-apt-get install -y ${basic_utils}
\ No newline at end of file
+apt-get install -y ${basic_utils}
diff --git a/utilities/ovs-dev.py b/utilities/ovs-dev.py
index 534c5e7f1..d64e464f4 100755
--- a/utilities/ovs-dev.py
+++ b/utilities/ovs-dev.py
@@ -106,7 +106,7 @@ def conf():
 pass  # Directory exists.
 
 os.chdir(BUILD_GCC)
-_sh(*(configure + ["--with-linux=/lib/modules/%s/build" % uname()]))
+_sh(*(configure))
 
 try:
 _sh("clang --version", check=True)
@@ -184,12 +184,9 @@ def tag():
 ctags = ['ctags', '-R', '-f', '.tags']
 
 try:
-_sh(*(ctags + ['--exclude="datapath/"']))
+_sh(*ctags)
 except:
-try:
-_sh(*ctags)  # Some versions of ctags don't have --exclude
-except:
-pass
+pass
 
 try:
 _sh('cscope', '-R', '-b')
@@ -351,7 +348,7 @@ Basic Configuration:
 
 # First install the basic requirements needed to build Open vSwitch.
 sudo apt-get install git build-essential libtool autoconf pkg-config \\
-libssl-dev gdb libcap-ng-dev linux-headers-`uname -r`
+libssl-dev gdb libcap-ng-dev
 
 # Next clone the Open vSwitch source.
 git clone https://github.com/openvswitch/ovs.git %(ovs)s
@@ -362,14 +359,6 @@ Basic Configuration:
 # Build the switch.
 %(v)s conf make
 
-# Install the kernel module
-sudo insmod %(ovs)s/datapath/linux/openvswitch.ko
-
-# If needed, manually load all required vport modules:
-sudo insmod %(ovs)s/datapath/linux/vport-vxlan.ko
-sudo insmod %(ovs)s/datapath/linux/vport-geneve.ko
-[...]
-
 # Run the switch.
 %(v)s run
 
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V4 2/8] rhel: Remove kernel mode spec

2022-07-12 Thread Greg Rose
Remove the kernel driver specification for RHEL 6.x, 7.x, 8.x and Fedora.

Signed-off-by: Greg Rose 
---
 Documentation/intro/install/rhel.rst |  18 
 Vagrantfile  |  12 +--
 poc/playbook-centos-builder.yml  |   8 --
 poc/playbook-fedora-builder.yml  |  16 ---
 rhel/.gitignore  |   4 -
 rhel/automake.mk |  22 
 rhel/kmod-openvswitch-rhel6.spec.in  | 123 --
 rhel/openvswitch-dkms.spec.in| 103 --
 rhel/openvswitch-kmod-fedora.spec.in | 152 ---
 9 files changed, 1 insertion(+), 457 deletions(-)
 delete mode 100644 rhel/kmod-openvswitch-rhel6.spec.in
 delete mode 100644 rhel/openvswitch-dkms.spec.in
 delete mode 100644 rhel/openvswitch-kmod-fedora.spec.in

diff --git a/Documentation/intro/install/rhel.rst 
b/Documentation/intro/install/rhel.rst
index b21b274b7..d1fc42021 100644
--- a/Documentation/intro/install/rhel.rst
+++ b/Documentation/intro/install/rhel.rst
@@ -194,24 +194,6 @@ the unit tests, run::
/lib/modules/2.6.32-279.el6.x86_64/build doesn't exist`` or similar, then
the kernel-devel package is missing or buggy.
 
-Kernel Module
-~
-
-On RHEL 6, to build the Open vSwitch kernel module run::
-
-$ rpmbuild -bb rhel/kmod-openvswitch-rhel6.spec
-
-You might have to specify a kernel version and/or variants, e.g.::
-
-$ rpmbuild -bb \
--D "kversion 2.6.32-131.6.1.el6.x86_64" \
--D "kflavors default debug kdump" \
-rhel/kmod-openvswitch-rhel6.spec
-
-This produces an "kmod-openvswitch" RPM for each kernel variant, in this
-example: "kmod-openvswitch", "kmod-openvswitch-debug", and
-"kmod-openvswitch-kdump".
-
 .. _rhel-script-integrations:
 
 Red Hat Network Scripts Integration
diff --git a/Vagrantfile b/Vagrantfile
index 2cd603932..cdca0cf71 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -54,7 +54,7 @@ cd /vagrant
 [ -f Makefile ] && ./configure && make distclean
 mkdir -p ~/build
 cd ~/build
-/vagrant/configure --with-linux=/lib/modules/`uname -r`/build 
--enable-silent-rules
+/vagrant/configure --enable-silent-rules
 SCRIPT
 
 $build_ovs = <

[ovs-dev] [PATCH V4 0/8] Remove OVS kernel driver

2022-07-12 Thread Greg Rose
It is time to remove support for the ovs kernel driver and push
towards use of the upstream linux openvswitch kernel driver
in it's place [1].

1.  https://mail.openvswitch.org/pipermail/ovs-dev/2022-april/393292.html

Changes in V2:
* Removed the Linux datapath and fixed up various Makefiles to adjust
* Moved openvswitch.h from datapath/linux/compat/include to include/linux
  and fixed up the Makefiles to adjust
* Removed further instances in utilities and auxiliary files where the
  --with-linux configuration command was still being used.
* Changed order of patches to (hopefully) fix up some robot auto-test
  errors

Changes in V3:
* Squashed the two patches removing rhel specs due to interdependence
  between the two that caused build errors between application of each
  of the patches
* Moved the changes to acinclude.m4 towards the end of the series

Changes in V4:
* Changed up the order of the patches again to fix robot errors
* Added back most of the tests in .github/workflows/build-and-test.yml
* Removed xenserver and related documentation, test scripts and makefile
  dependencies

Still to do:
* Figure out why a certain 4 tests always fail with 'make check' in the
  github workflows but do not fail on my own system.

Greg Rose (8):
  Disable unsupported kernel builds
  rhel: Remove kernel mode spec
  tests: Remove support for check-kmod test
  Make: Remove the Linux datapath
  aux:utilities: Remove references to the Linux datapath
  acinclude.m4: Remove support for building the OVS kernel module
  Documentation: Remove kernel module documentation
  xenserver: Remove xenserver

 .ci/linux-build.sh|   33 +-
 .github/workflows/build-and-test.yml  |   20 -
 Documentation/automake.mk |1 -
 Documentation/faq/releases.rst|4 +-
 .../contributing/backporting-patches.rst  |7 +
 Documentation/intro/install/fedora.rst|   24 -
 Documentation/intro/install/general.rst   |   63 -
 Documentation/intro/install/index.rst |1 -
 Documentation/intro/install/rhel.rst  |   18 -
 Documentation/intro/install/xenserver.rst |  229 --
 Documentation/topics/integration.rst  |   34 +-
 Documentation/topics/testing.rst  |7 -
 Makefile.am   |   18 +-
 Vagrantfile   |   12 +-
 acinclude.m4  |  683 +---
 build-aux/initial-tab-allowed-files   |1 -
 configure.ac  |6 +-
 datapath-windows/include/automake.mk  |2 +-
 datapath/.gitignore   |7 -
 datapath/Makefile.am  |   60 -
 datapath/Modules.mk   |   58 -
 datapath/actions.c| 1587 
 datapath/compat.h |   92 -
 datapath/conntrack.c  | 2413 ---
 datapath/conntrack.h  |  113 -
 datapath/datapath.c   | 2707 -
 datapath/datapath.h   |  283 --
 datapath/dp_notify.c  |  102 -
 datapath/flow.c   |  972 -
 datapath/flow.h   |  297 --
 datapath/flow_netlink.c   | 3519 -
 datapath/flow_netlink.h   |   85 -
 datapath/flow_table.c |  988 -
 datapath/flow_table.h |  102 -
 datapath/linux/.gitignore |8 -
 datapath/linux/Kbuild.in  |   27 -
 datapath/linux/Makefile.in|9 -
 datapath/linux/Makefile.main.in   |  107 -
 datapath/linux/Modules.mk |  123 -
 .../compat/build-aux/export-check-allow-list  |1 -
 datapath/linux/compat/dev-openvswitch.c   |   83 -
 datapath/linux/compat/dst_cache.c |  173 -
 datapath/linux/compat/exthdrs_core.c  |  129 -
 datapath/linux/compat/genetlink-openvswitch.c |   55 -
 datapath/linux/compat/geneve.c| 1854 -
 datapath/linux/compat/gre.c   |  239 --
 datapath/linux/compat/gso.c   |  317 --
 datapath/linux/compat/gso.h   |  214 -
 datapath/linux/compat/include/linux/bug.h |   13 -
 datapath/linux/compat/include/linux/cache.h   |   23 -
 .../linux/compat/include/linux/compiler-gcc.h |   20 -
 .../linux/compat/include/linux/compiler.h |   26 -
 datapath/linux/compat/include/linux/cpumask.h |   11 -
 datapath/linux/compat/include/linux/err.h |   37 -
 .../linux/compat/include/linux/etherdevice.h  |   62 -
 .../linux/compat/include/linux/genetlink.h|   16 -
 datapath/linux/compat/include/linux/if.h  |6 -
 .../linux/compat/include/linux/if_ether.h |   39 -
 datapath/linux/compat/include/linux/if_link.h |  171

[ovs-dev] [PATCH V4 3/8] tests: Remove support for check-kmod test

2022-07-12 Thread Greg Rose
The OVS kernel module is no longer supported as of OVS 2.18

Signed-off-by: Greg Rose 
---
 Documentation/topics/testing.rst | 7 ---
 tests/automake.mk| 6 --
 2 files changed, 13 deletions(-)

diff --git a/Documentation/topics/testing.rst b/Documentation/topics/testing.rst
index c15d5b38f..d4df656d0 100644
--- a/Documentation/topics/testing.rst
+++ b/Documentation/topics/testing.rst
@@ -428,13 +428,6 @@ your system, run::
 
 $ make check-kernel
 
-To install the kernel module from the current build directory and run the
-testsuite against that kernel module::
-
-$ make check-kmod
-
-The results of the testsuite are in ``tests/system-kmod-testsuite.dir``.
-
 All the features documented under `Unit Tests`_ are available for the kernel
 datapath testsuite.
 
diff --git a/tests/automake.mk b/tests/automake.mk
index b29cb783e..3496f9002 100644
--- a/tests/automake.mk
+++ b/tests/automake.mk
@@ -343,12 +343,6 @@ check-kernel: all
set $(SHELL) '$(SYSTEM_KMOD_TESTSUITE)' -C tests  
AUTOTEST_PATH='$(AUTOTEST_PATH)'; \
"$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && "$$@" 
--recheck)
 
-# Testing the out of tree Kernel module
-check-kmod: all
-   $(MAKE) modules_install
-   modprobe -r -a vport-geneve vport-gre vport-lisp vport-stt vport-vxlan 
openvswitch
-   $(MAKE) check-kernel
-
 check-system-userspace: all
set $(SHELL) '$(SYSTEM_USERSPACE_TESTSUITE)' -C tests  
AUTOTEST_PATH='$(AUTOTEST_PATH)'; \
"$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && "$$@" 
--recheck)
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V4 1/8] Disable unsupported kernel builds

2022-07-12 Thread Greg Rose
Remove kernel based github workflows since the OVS kernel driver is
no longer supported since Release 2.18

Signed-off-by: Greg Rose 
---
 .ci/linux-build.sh   | 33 +++-
 .github/workflows/build-and-test.yml | 20 -
 2 files changed, 3 insertions(+), 50 deletions(-)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index 9963fb810..7b659fede 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -91,9 +91,6 @@ function install_kernel()
 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
 }
@@ -187,20 +184,10 @@ function configure_ovs()
 
 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
-fi
+make -j4
 }
 
 if [ "$DEB_PACKAGE" ]; then
@@ -256,8 +243,7 @@ if [ "$UBSAN" ]; then
 CFLAGS_FOR_OVS="${CFLAGS_FOR_OVS} ${CFLAGS_UBSAN}"
 fi
 
-save_OPTS="${OPTS} $*"
-OPTS="${EXTRA_OPTS} ${save_OPTS}"
+OPTS="${EXTRA_OPTS} ${OPTS} $*"
 
 if [ "$TESTSUITE" ]; then
 # 'distcheck' will reconfigure with required options.
@@ -268,20 +254,7 @@ if [ "$TESTSUITE" ]; then
 make distcheck -j4 CFLAGS="${CFLAGS_FOR_OVS}" \
 TESTSUITEFLAGS=-j4 RECHECK=yes
 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
+build_ovs
 fi
 
 exit 0
diff --git a/.github/workflows/build-and-test.yml 
b/.github/workflows/build-and-test.yml
index 9e3583781..aecaafb39 100644
--- a/.github/workflows/build-and-test.yml
+++ b/.github/workflows/build-and-test.yml
@@ -9,17 +9,13 @@ jobs:
 automake libtool gcc bc libjemalloc1 libjemalloc-dev\
 libssl-dev llvm-dev libelf-dev libnuma-dev libpcap-dev  \
 ninja-build selinux-policy-dev
-  deb_dependencies: |
-linux-headers-$(uname -r) build-essential fakeroot devscripts equivs
   AFXDP:   ${{ matrix.afxdp }}
   ASAN:${{ matrix.asan }}
   UBSAN:   ${{ matrix.ubsan }}
   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 }}
@@ -40,14 +36,11 @@ jobs:
 
   - compiler: gcc
 testsuite:test
-kernel:   3.16
   - compiler: clang
 testsuite:test
-kernel:   3.16
 asan: asan
   - compiler: clang
 testsuite:test
-kernel:   3.16
 ubsan:ubsan
 
   - compiler: gcc
@@ -71,16 +64,6 @@ jobs:
 testsuite:test
 libs: -ljemalloc
 
-  - compiler: gcc
-kernel_list:  5.8 5.5 5.4 4.19
-  - compiler: clang
-kernel_list:  5.8 5.5 5.4 4.19
-
-  - compiler: gcc
-kernel_list:  4.14 4.9 4.4 3.16
-  - compiler: clang
-kernel_list:  4.14 4.9 4.4 3.16
-
   - compiler: gcc
 afxdp:afxdp
 kernel:   5.3
@@ -111,9 +94,6 @@ jobs:
 m32:  m32
 opts: --disable-ssl
 
-  - compiler: gcc
-deb_package:  deb
-
 steps:
 - name: checkout
   uses: actions/checkout@v2
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V3 6/7] acinclude.m4: Remove support for building the OVS kernel module

2022-07-08 Thread Greg Rose
Since the openvswitch project inception it has had support for building
a Linux kernel module to support the OVS kernel datapath.  Since Linux
kernel release 5.8 support for newer kernels has been deprecated.  Now
is the time to fully discontinue support for building the openvswitch
kernel driver. Since Linux 5.9 the Linux built-in openvswitch kernel
driver supports all necessary features and functions of the kernel
datapath and the need to support this additional "out of tree" kernel
module is gone.

Remove the --with-linux configuration support from the acinclude.m4
configuration and warn user it is not supported any longer.

Signed-off-by: Greg Rose 
---
 acinclude.m4 | 683 +--
 1 file changed, 1 insertion(+), 682 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index b518aa624..30ee143e4 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -115,132 +115,11 @@ dnl OVS_CHECK_LINUX
 dnl
 dnl Configure linux kernel source tree
 AC_DEFUN([OVS_CHECK_LINUX], [
-  AC_ARG_WITH([linux],
-  [AC_HELP_STRING([--with-linux=/path/to/linux],
-  [Specify the Linux kernel build directory])])
-  AC_ARG_WITH([linux-source],
-  [AC_HELP_STRING([--with-linux-source=/path/to/linux-source],
-  [Specify the Linux kernel source directory
-   (usually figured out automatically from build
-   directory)])])
-
-  # Deprecated equivalents to --with-linux, --with-linux-source.
-  AC_ARG_WITH([l26])
-  AC_ARG_WITH([l26-source])
-
   if test X"$with_linux" != X; then
-KBUILD=$with_linux
-AC_MSG_WARN([--with-linux is deprecated and kernel support is limited to 
5.8 and below])
-  elif test X"$with_l26" != X; then
-KBUILD=$with_l26
-AC_MSG_WARN([--with-l26 is deprecated, please use --with-linux instead])
-  else
+AC_MSG_WARN([--with-linux is no longer supported])
 KBUILD=
   fi
 
-  if test X"$KBUILD" != X; then
-if test X"$with_linux_source" != X; then
-  KSRC=$with_linux_source
-elif test X"$with_l26_source" != X; then
-  KSRC=$with_l26_source
-  AC_MSG_WARN([--with-l26-source is deprecated, please use 
--with-linux-source instead])
-else
-  KSRC=
-fi
-  elif test X"$with_linux_source" != X || test X"$with_l26_source" != X; then
-AC_MSG_ERROR([Linux source directory may not be specified without Linux 
build directory])
-  fi
-
-  if test -n "$KBUILD"; then
-KBUILD=`eval echo "$KBUILD"`
-case $KBUILD in
-/*) ;;
-*) KBUILD=`pwd`/$KBUILD ;;
-esac
-
-# The build directory is what the user provided.
-# Make sure that it exists.
-AC_MSG_CHECKING([for Linux build directory])
-if test -d "$KBUILD"; then
-AC_MSG_RESULT([$KBUILD])
-AC_SUBST(KBUILD)
-else
-AC_MSG_RESULT([no])
-AC_ERROR([source dir $KBUILD doesn't exist])
-fi
-
-# Debian breaks kernel headers into "source" header and "build" headers.
-# We want the source headers, but $KBUILD gives us the "build" headers.
-# Use heuristics to find the source headers.
-AC_MSG_CHECKING([for Linux source directory])
-if test -n "$KSRC"; then
-  KSRC=`eval echo "$KSRC"`
-  case $KSRC in
-  /*) ;;
-  *) KSRC=`pwd`/$KSRC ;;
-  esac
-  if test ! -e $KSRC/include/linux/kernel.h; then
-AC_MSG_ERROR([$KSRC is not a kernel source directory])
-  fi
-else
-  KSRC=$KBUILD
-  if test ! -e $KSRC/include/linux/kernel.h; then
-# Debian kernel build Makefiles tend to include a line of the form:
-# MAKEARGS := -C /usr/src/linux-headers-3.2.0-1-common 
O=/usr/src/linux-headers-3.2.0-1-486
-# First try to extract the source directory from this line.
-KSRC=`sed -n 's/.*-C \([[^ ]]*\).*/\1/p' "$KBUILD"/Makefile`
-if test ! -e "$KSRC"/include/linux/kernel.h; then
-  # Didn't work.  Fall back to name-based heuristics that used to work.
-  case `echo "$KBUILD" | sed 's,/*$,,'` in # (
-*/build)
-  KSRC=`echo "$KBUILD" | sed 's,/build/*$,/source,'`
-  ;; # (
-*)
-  KSRC=`(cd $KBUILD && pwd -P) | sed 's,-[[^-]]*$,-common,'`
-  ;;
-  esac
-fi
-  fi
-  if test ! -e "$KSRC"/include/linux/kernel.h; then
-AC_MSG_ERROR([cannot find source directory (please use 
--with-linux-source)])
-  fi
-fi
-AC_MSG_RESULT([$KSRC])
-
-AC_MSG_CHECKING([for kernel version])
-version=`sed -n 's/^VERSION = //p' "$KSRC/Makefile"`
-patchlevel=`sed -n 's/^PATCHLEVEL = //p' "$KSRC/Makefile"`
-sublevel=`sed -n 's/^SUBLEVEL = //p' "

[ovs-dev] [PATCH V3 7/7] Documentation: Remove kernel module documentation

2022-07-08 Thread Greg Rose
As of Open vSwitch release 2.18 the OVS kernel module is no longer
supported.  Pull the documentation references.

Signed-off-by: Greg Rose 
---
 Documentation/faq/releases.rst|  5 +-
 .../contributing/backporting-patches.rst  |  7 +++
 Documentation/intro/install/fedora.rst| 24 ---
 Documentation/intro/install/general.rst   | 63 ---
 4 files changed, 10 insertions(+), 89 deletions(-)

diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index 8cfe2d392..ab2925a62 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -74,7 +74,7 @@ Q: What Linux kernel versions does each Open vSwitch release 
work with?
 2.14.x   3.16 to 5.5
 2.15.x   3.16 to 5.8
 2.16.x   3.16 to 5.8
-2.17.x   3.16 to 5.8
+2.17.x   N/A
  ==
 
 Open vSwitch userspace should also work with the Linux kernel module built
@@ -110,7 +110,8 @@ Q: Are all features available with all datapaths?
 Linux OVS tree
   The datapath implemented by the Linux kernel module distributed with
   the OVS source tree. This datapath is deprecated starting with OVS
-  2.15.x and support capped at Linux kernel version 5.8.
+  2.15.x and support capped at Linux kernel version 5.8. As of OVS 2.17.x
+  the Linux OVS tree is no longer supported.
 
 Userspace
   This datapath supports conventional system devices as well as
diff --git a/Documentation/internals/contributing/backporting-patches.rst 
b/Documentation/internals/contributing/backporting-patches.rst
index 162e9d209..8370c954d 100644
--- a/Documentation/internals/contributing/backporting-patches.rst
+++ b/Documentation/internals/contributing/backporting-patches.rst
@@ -119,6 +119,13 @@ userspace changes.
 How to backport kernel patches
 ~~
 
+These instructions only apply to Open vSwitch releases 2.16 and older.
+As of Open vSwitch branch 2.17 the Open vSwitch kernel module is no
+longer supported and only the Linux openvswitch kernel module is used.
+In the case of Open vSwitch releases 2.16 and older kernel backports
+may be required for bux fixes and feature implementation so these
+instructions are preserved for that reason.
+
 First, the patch should be submitted upstream to `netdev`. When the patch has
 been applied to `net-next`, it is ready to be backported. Starting from the
 Linux tree, use ``git format-patch`` to format each patch that should be
diff --git a/Documentation/intro/install/fedora.rst 
b/Documentation/intro/install/fedora.rst
index 06a0bd3d5..02481597f 100644
--- a/Documentation/intro/install/fedora.rst
+++ b/Documentation/intro/install/fedora.rst
@@ -132,36 +132,12 @@ tests.  This can take several minutes.
 $ make rpm-fedora RPMBUILD_OPT="--with check"
 
 
-Kernel OVS Tree Datapath RPM
-
-
-To build the Open vSwitch kernel module for the currently running kernel
-version, run:
-
-::
-
-$ make rpm-fedora-kmod
-
-To build the Open vSwitch kernel module for another kernel version, the desired
-kernel version can be specified via the `kversion` macro.  For example:
-
-::
-
-$ make rpm-fedora-kmod \
- RPMBUILD_OPT='-D "kversion 4.3.4-300.fc23.x86_64"'
-
 Installing
 --
 
 RPM packages can be installed by using the command ``rpm -i``. Package
 installation requires superuser privileges.
 
-The `openvswitch-kmod` RPM should be installed first if the Linux OVS tree
-datapath module is to be used. The `openvswitch-kmod` RPM should not be
-installed if only the in-tree Linux datapath or user-space datapath is needed.
-Refer to the :doc:`/faq/index` for more information about the various Open
-vSwitch datapath options.
-
 In most cases only the `openvswitch` RPM will need to be installed. The
 `python3-openvswitch`, `openvswitch-test`, `openvswitch-devel`, and
 `openvswitch-debuginfo` RPMs are optional unless required for a specific
diff --git a/Documentation/intro/install/general.rst 
b/Documentation/intro/install/general.rst
index a297aadac..c2208bbed 100644
--- a/Documentation/intro/install/general.rst
+++ b/Documentation/intro/install/general.rst
@@ -302,24 +302,6 @@ example::
 
 $ ./configure CFLAGS="-g -O2 -fsanitize=address -fno-omit-frame-pointer 
-fno-common"
 
-To build the Linux kernel module, so that you can run the kernel-based switch,
-pass the location of the kernel build directory on ``--with-linux``. For
-example, to build for a running instance of Linux::
-
-$ ./configure --with-linux=/lib/modules/$(uname -r)/build
-
-.. note::
-  If ``--with-linux`` requests building for an unsupported version of Linux,
-  then ``configure`` will fail with an error message. Refer to the
-  :doc:`/faq/index` for advice in that case.
-
-If you wish to build the kernel module for an architecture other than the
-architecture of the machine used for the build, you may sp

[ovs-dev] [PATCH V3 5/7] tests: Remove support for check-kmod test

2022-07-08 Thread Greg Rose
The OVS kernel module is no longer supported as of OVS 2.18

Signed-off-by: Greg Rose 
---
 tests/automake.mk | 6 --
 1 file changed, 6 deletions(-)

diff --git a/tests/automake.mk b/tests/automake.mk
index b29cb783e..3496f9002 100644
--- a/tests/automake.mk
+++ b/tests/automake.mk
@@ -343,12 +343,6 @@ check-kernel: all
set $(SHELL) '$(SYSTEM_KMOD_TESTSUITE)' -C tests  
AUTOTEST_PATH='$(AUTOTEST_PATH)'; \
"$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && "$$@" 
--recheck)
 
-# Testing the out of tree Kernel module
-check-kmod: all
-   $(MAKE) modules_install
-   modprobe -r -a vport-geneve vport-gre vport-lisp vport-stt vport-vxlan 
openvswitch
-   $(MAKE) check-kernel
-
 check-system-userspace: all
set $(SHELL) '$(SYSTEM_USERSPACE_TESTSUITE)' -C tests  
AUTOTEST_PATH='$(AUTOTEST_PATH)'; \
"$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && "$$@" 
--recheck)
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V3 2/7] rhel: Remove kernel mode spec

2022-07-08 Thread Greg Rose
Remove the kernel driver specification for RHEL 6.x, 7.x, 8.x and Fedora.

Signed-off-by: Greg Rose 
---
 Documentation/intro/install/rhel.rst |  18 
 Vagrantfile  |   9 +-
 poc/playbook-centos-builder.yml  |   8 --
 poc/playbook-fedora-builder.yml  |  13 ---
 rhel/.gitignore  |   4 -
 rhel/automake.mk |  22 
 rhel/kmod-openvswitch-rhel6.spec.in  | 123 --
 rhel/openvswitch-dkms.spec.in| 103 --
 rhel/openvswitch-kmod-fedora.spec.in | 152 ---
 9 files changed, 1 insertion(+), 451 deletions(-)
 delete mode 100644 rhel/kmod-openvswitch-rhel6.spec.in
 delete mode 100644 rhel/openvswitch-dkms.spec.in
 delete mode 100644 rhel/openvswitch-kmod-fedora.spec.in

diff --git a/Documentation/intro/install/rhel.rst 
b/Documentation/intro/install/rhel.rst
index b21b274b7..d1fc42021 100644
--- a/Documentation/intro/install/rhel.rst
+++ b/Documentation/intro/install/rhel.rst
@@ -194,24 +194,6 @@ the unit tests, run::
/lib/modules/2.6.32-279.el6.x86_64/build doesn't exist`` or similar, then
the kernel-devel package is missing or buggy.
 
-Kernel Module
-~
-
-On RHEL 6, to build the Open vSwitch kernel module run::
-
-$ rpmbuild -bb rhel/kmod-openvswitch-rhel6.spec
-
-You might have to specify a kernel version and/or variants, e.g.::
-
-$ rpmbuild -bb \
--D "kversion 2.6.32-131.6.1.el6.x86_64" \
--D "kflavors default debug kdump" \
-rhel/kmod-openvswitch-rhel6.spec
-
-This produces an "kmod-openvswitch" RPM for each kernel variant, in this
-example: "kmod-openvswitch", "kmod-openvswitch-debug", and
-"kmod-openvswitch-kdump".
-
 .. _rhel-script-integrations:
 
 Red Hat Network Scripts Integration
diff --git a/Vagrantfile b/Vagrantfile
index 2cd603932..c2c59265d 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -54,7 +54,7 @@ cd /vagrant
 [ -f Makefile ] && ./configure && make distclean
 mkdir -p ~/build
 cd ~/build
-/vagrant/configure --with-linux=/lib/modules/`uname -r`/build 
--enable-silent-rules
+/vagrant/configure --enable-silent-rules
 SCRIPT
 
 $build_ovs = <

[ovs-dev] [PATCH V3 3/7] aux:utilities: Remove references to the Linux datapath

2022-07-08 Thread Greg Rose
Remove references to the Linux datapath from auxiliary files and
utilities since it is no longer supported.

Signed-off-by: Greg Rose 
---
 build-aux/initial-tab-allowed-files |  1 -
 utilities/docker/debian/build-kernel-modules.sh | 13 -
 utilities/ovs-dev.py| 17 +++--
 3 files changed, 7 insertions(+), 24 deletions(-)

diff --git a/build-aux/initial-tab-allowed-files 
b/build-aux/initial-tab-allowed-files
index 1e9573c69..8bd23698e 100644
--- a/build-aux/initial-tab-allowed-files
+++ b/build-aux/initial-tab-allowed-files
@@ -3,7 +3,6 @@
 \.mk$
 \.png$
 \.sln$
-^datapath/
 ^include/linux/
 ^include/sparse/rte_
 ^include/windows/
diff --git a/utilities/docker/debian/build-kernel-modules.sh 
b/utilities/docker/debian/build-kernel-modules.sh
index 872ba1eb8..aaee73ff7 100755
--- a/utilities/docker/debian/build-kernel-modules.sh
+++ b/utilities/docker/debian/build-kernel-modules.sh
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-KERNEL_VERSION=$1
+KERNEL_VERSION=host
 OVS_BRANCH=$2
 GITHUB_SRC=$3
 
@@ -39,18 +39,13 @@ cd ovs
 config="./configure --localstatedir="/var" --sysconfdir="/etc" --prefix="/usr"
 --enable-ssl"
 
-if [ $KERNEL_VERSION = "host" ]; then
-   eval $config
-else
-withlinux=" --with-linux=/lib/modules/$KERNEL_VERSION/build"
-eval $config$withlinux
-fi
+eval $config
 
-make -j8; make install; make modules_install
+make -j8; make install
 
 # remove deps to make the container light weight.
 apt-get remove --purge -y ${build_deps}
 apt-get autoremove -y --purge
 cd ..; rm -rf ovs
 basic_utils="vim kmod net-tools uuid-runtime iproute2"
-apt-get install -y ${basic_utils}
\ No newline at end of file
+apt-get install -y ${basic_utils}
diff --git a/utilities/ovs-dev.py b/utilities/ovs-dev.py
index 534c5e7f1..e85ad6746 100755
--- a/utilities/ovs-dev.py
+++ b/utilities/ovs-dev.py
@@ -184,12 +184,9 @@ def tag():
 ctags = ['ctags', '-R', '-f', '.tags']
 
 try:
-_sh(*(ctags + ['--exclude="datapath/"']))
+_sh(*ctags)
 except:
-try:
-_sh(*ctags)  # Some versions of ctags don't have --exclude
-except:
-pass
+pass
 
 try:
 _sh('cscope', '-R', '-b')
@@ -351,7 +348,7 @@ Basic Configuration:
 
 # First install the basic requirements needed to build Open vSwitch.
 sudo apt-get install git build-essential libtool autoconf pkg-config \\
-libssl-dev gdb libcap-ng-dev linux-headers-`uname -r`
+libssl-dev gdb libcap-ng-dev
 
 # Next clone the Open vSwitch source.
 git clone https://github.com/openvswitch/ovs.git %(ovs)s
@@ -362,14 +359,6 @@ Basic Configuration:
 # Build the switch.
 %(v)s conf make
 
-# Install the kernel module
-sudo insmod %(ovs)s/datapath/linux/openvswitch.ko
-
-# If needed, manually load all required vport modules:
-sudo insmod %(ovs)s/datapath/linux/vport-vxlan.ko
-sudo insmod %(ovs)s/datapath/linux/vport-geneve.ko
-[...]
-
 # Run the switch.
 %(v)s run
 
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V2 0/8] Remove OVS kernel driver

2022-07-08 Thread Greg Rose
It is time to remove support for the ovs kernel driver and push
towards use of the upstream linux openvswitch kernel driver
in it's place [1].

1.  https://mail.openvswitch.org/pipermail/ovs-dev/2022-april/393292.html

Changes in V2:
* Removed the Linux datapath and fixed up various Makefiles to adjust
* Moved openvswitch.h from datapath/linux/compat/include to include/linux
  and fixed up the Makefiles to adjust
* Removed further instances in utilities and auxiliary files where the
  --with-linux configuration command was still being used.
* Changed order of patches to (hopefully) fix up some robot auto-test
  errors

Changes in V3:
* Squashed the two patches removing rhel specs due to interdependence
  between the two that caused build errors between application of each
  of the patches
* Moved the changes to acinclude.m4 towards the end of the series

Still to do:
* Make changes suggested by Ilya to still support AFXDP auto-test
* Figure out what to do with Xenserver support


Greg Rose (7):
  Disable unsupported kernel builds
  rhel: Remove kernel mode spec
  aux:utilities: Remove references to the Linux datapath
  Make: Remove the Linux datapath
  tests: Remove support for check-kmod test
  acinclude.m4: Remove support for building the OVS kernel module
  Documentation: Remove kernel module documentation

 .github/workflows/build-and-test.yml  |   53 -
 Documentation/faq/releases.rst|5 +-
 .../contributing/backporting-patches.rst  |7 +
 Documentation/intro/install/fedora.rst|   24 -
 Documentation/intro/install/general.rst   |   63 -
 Documentation/intro/install/rhel.rst  |   18 -
 Makefile.am   |   17 +-
 Vagrantfile   |9 +-
 acinclude.m4  |  683 +---
 build-aux/initial-tab-allowed-files   |1 -
 configure.ac  |5 -
 datapath-windows/include/automake.mk  |2 +-
 datapath/.gitignore   |7 -
 datapath/Makefile.am  |   60 -
 datapath/Modules.mk   |   58 -
 datapath/actions.c| 1587 
 datapath/compat.h |   92 -
 datapath/conntrack.c  | 2413 ---
 datapath/conntrack.h  |  113 -
 datapath/datapath.c   | 2707 -
 datapath/datapath.h   |  283 --
 datapath/dp_notify.c  |  102 -
 datapath/flow.c   |  972 -
 datapath/flow.h   |  297 --
 datapath/flow_netlink.c   | 3519 -
 datapath/flow_netlink.h   |   85 -
 datapath/flow_table.c |  988 -
 datapath/flow_table.h |  102 -
 datapath/linux/.gitignore |8 -
 datapath/linux/Kbuild.in  |   27 -
 datapath/linux/Makefile.in|9 -
 datapath/linux/Makefile.main.in   |  107 -
 datapath/linux/Modules.mk |  123 -
 .../compat/build-aux/export-check-allow-list  |1 -
 datapath/linux/compat/dev-openvswitch.c   |   83 -
 datapath/linux/compat/dst_cache.c |  173 -
 datapath/linux/compat/exthdrs_core.c  |  129 -
 datapath/linux/compat/genetlink-openvswitch.c |   55 -
 datapath/linux/compat/geneve.c| 1854 -
 datapath/linux/compat/gre.c   |  239 --
 datapath/linux/compat/gso.c   |  317 --
 datapath/linux/compat/gso.h   |  214 -
 datapath/linux/compat/include/linux/bug.h |   13 -
 datapath/linux/compat/include/linux/cache.h   |   23 -
 .../linux/compat/include/linux/compiler-gcc.h |   20 -
 .../linux/compat/include/linux/compiler.h |   26 -
 datapath/linux/compat/include/linux/cpumask.h |   11 -
 datapath/linux/compat/include/linux/err.h |   37 -
 .../linux/compat/include/linux/etherdevice.h  |   62 -
 .../linux/compat/include/linux/genetlink.h|   16 -
 datapath/linux/compat/include/linux/if.h  |6 -
 .../linux/compat/include/linux/if_ether.h |   39 -
 datapath/linux/compat/include/linux/if_link.h |  171 -
 datapath/linux/compat/include/linux/if_vlan.h |  306 --
 datapath/linux/compat/include/linux/in.h  |   56 -
 datapath/linux/compat/include/linux/jiffies.h |   34 -
 datapath/linux/compat/include/linux/kconfig.h |   49 -
 datapath/linux/compat/include/linux/kernel.h  |   39 -
 datapath/linux/compat/include/linux/list.h|   31 -
 datapath/linux/compat/include/linux/mm.h  |   44 -
 datapath/linux/compat/include/linux/mpls.h|   40 -
 datapath/linux/compat/include/linux/net.h |   62 -
 .../compat/include/linux/netdev_features.h|   77 -
 .../linux/compat/include/linux/netdevice.h|  336

[ovs-dev] [PATCH V3 1/7] Disable unsupported kernel builds

2022-07-08 Thread Greg Rose
Remove kernel based github workflows since the OVS kernel driver is
no longer supported since Release 2.18

Signed-off-by: Greg Rose 
---
 .github/workflows/build-and-test.yml | 53 
 1 file changed, 53 deletions(-)

diff --git a/.github/workflows/build-and-test.yml 
b/.github/workflows/build-and-test.yml
index 9e3583781..64454c5ea 100644
--- a/.github/workflows/build-and-test.yml
+++ b/.github/workflows/build-and-test.yml
@@ -9,21 +9,14 @@ jobs:
 automake libtool gcc bc libjemalloc1 libjemalloc-dev\
 libssl-dev llvm-dev libelf-dev libnuma-dev libpcap-dev  \
 ninja-build selinux-policy-dev
-  deb_dependencies: |
-linux-headers-$(uname -r) build-essential fakeroot devscripts equivs
-  AFXDP:   ${{ matrix.afxdp }}
   ASAN:${{ matrix.asan }}
   UBSAN:   ${{ matrix.ubsan }}
   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
@@ -38,56 +31,13 @@ jobs:
   - compiler: clang
 opts: --disable-ssl
 
-  - compiler: gcc
-testsuite:test
-kernel:   3.16
   - compiler: clang
 testsuite:test
-kernel:   3.16
 asan: asan
   - compiler: clang
 testsuite:test
-kernel:   3.16
 ubsan:ubsan
 
-  - 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.8 5.5 5.4 4.19
-  - compiler: clang
-kernel_list:  5.8 5.5 5.4 4.19
-
-  - compiler: gcc
-kernel_list:  4.14 4.9 4.4 3.16
-  - compiler: clang
-kernel_list:  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
@@ -111,9 +61,6 @@ jobs:
 m32:  m32
 opts: --disable-ssl
 
-  - compiler: gcc
-deb_package:  deb
-
 steps:
 - name: checkout
   uses: actions/checkout@v2
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V2 7/8] tests: Remove support for check-kmod test

2022-07-08 Thread Greg Rose
The OVS kernel module is no longer supported as of OVS 2.18

Signed-off-by: Greg Rose 
---
 tests/automake.mk | 6 --
 1 file changed, 6 deletions(-)

diff --git a/tests/automake.mk b/tests/automake.mk
index b29cb783e..3496f9002 100644
--- a/tests/automake.mk
+++ b/tests/automake.mk
@@ -343,12 +343,6 @@ check-kernel: all
set $(SHELL) '$(SYSTEM_KMOD_TESTSUITE)' -C tests  
AUTOTEST_PATH='$(AUTOTEST_PATH)'; \
"$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && "$$@" 
--recheck)
 
-# Testing the out of tree Kernel module
-check-kmod: all
-   $(MAKE) modules_install
-   modprobe -r -a vport-geneve vport-gre vport-lisp vport-stt vport-vxlan 
openvswitch
-   $(MAKE) check-kernel
-
 check-system-userspace: all
set $(SHELL) '$(SYSTEM_USERSPACE_TESTSUITE)' -C tests  
AUTOTEST_PATH='$(AUTOTEST_PATH)'; \
"$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && "$$@" 
--recheck)
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V2 6/8] acinclude.m4: Remove support for building the OVS kernel module

2022-07-08 Thread Greg Rose
Since the openvswitch project inception it has had support for building
a Linux kernel module to support the OVS kernel datapath.  Since Linux
kernel release 5.8 support for newer kernels has been deprecated.  Now
is the time to fully discontinue support for building the openvswitch
kernel driver. Since Linux 5.9 the Linux built-in openvswitch kernel
driver supports all necessary features and functions of the kernel
datapath and the need to support this additional "out of tree" kernel
module is gone.

Remove the --with-linux configuration support from the acinclude.m4
configuration and warn user it is not supported any longer.

Signed-off-by: Greg Rose 
---
 acinclude.m4 | 683 +--
 1 file changed, 1 insertion(+), 682 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index b518aa624..30ee143e4 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -115,132 +115,11 @@ dnl OVS_CHECK_LINUX
 dnl
 dnl Configure linux kernel source tree
 AC_DEFUN([OVS_CHECK_LINUX], [
-  AC_ARG_WITH([linux],
-  [AC_HELP_STRING([--with-linux=/path/to/linux],
-  [Specify the Linux kernel build directory])])
-  AC_ARG_WITH([linux-source],
-  [AC_HELP_STRING([--with-linux-source=/path/to/linux-source],
-  [Specify the Linux kernel source directory
-   (usually figured out automatically from build
-   directory)])])
-
-  # Deprecated equivalents to --with-linux, --with-linux-source.
-  AC_ARG_WITH([l26])
-  AC_ARG_WITH([l26-source])
-
   if test X"$with_linux" != X; then
-KBUILD=$with_linux
-AC_MSG_WARN([--with-linux is deprecated and kernel support is limited to 
5.8 and below])
-  elif test X"$with_l26" != X; then
-KBUILD=$with_l26
-AC_MSG_WARN([--with-l26 is deprecated, please use --with-linux instead])
-  else
+AC_MSG_WARN([--with-linux is no longer supported])
 KBUILD=
   fi
 
-  if test X"$KBUILD" != X; then
-if test X"$with_linux_source" != X; then
-  KSRC=$with_linux_source
-elif test X"$with_l26_source" != X; then
-  KSRC=$with_l26_source
-  AC_MSG_WARN([--with-l26-source is deprecated, please use 
--with-linux-source instead])
-else
-  KSRC=
-fi
-  elif test X"$with_linux_source" != X || test X"$with_l26_source" != X; then
-AC_MSG_ERROR([Linux source directory may not be specified without Linux 
build directory])
-  fi
-
-  if test -n "$KBUILD"; then
-KBUILD=`eval echo "$KBUILD"`
-case $KBUILD in
-/*) ;;
-*) KBUILD=`pwd`/$KBUILD ;;
-esac
-
-# The build directory is what the user provided.
-# Make sure that it exists.
-AC_MSG_CHECKING([for Linux build directory])
-if test -d "$KBUILD"; then
-AC_MSG_RESULT([$KBUILD])
-AC_SUBST(KBUILD)
-else
-AC_MSG_RESULT([no])
-AC_ERROR([source dir $KBUILD doesn't exist])
-fi
-
-# Debian breaks kernel headers into "source" header and "build" headers.
-# We want the source headers, but $KBUILD gives us the "build" headers.
-# Use heuristics to find the source headers.
-AC_MSG_CHECKING([for Linux source directory])
-if test -n "$KSRC"; then
-  KSRC=`eval echo "$KSRC"`
-  case $KSRC in
-  /*) ;;
-  *) KSRC=`pwd`/$KSRC ;;
-  esac
-  if test ! -e $KSRC/include/linux/kernel.h; then
-AC_MSG_ERROR([$KSRC is not a kernel source directory])
-  fi
-else
-  KSRC=$KBUILD
-  if test ! -e $KSRC/include/linux/kernel.h; then
-# Debian kernel build Makefiles tend to include a line of the form:
-# MAKEARGS := -C /usr/src/linux-headers-3.2.0-1-common 
O=/usr/src/linux-headers-3.2.0-1-486
-# First try to extract the source directory from this line.
-KSRC=`sed -n 's/.*-C \([[^ ]]*\).*/\1/p' "$KBUILD"/Makefile`
-if test ! -e "$KSRC"/include/linux/kernel.h; then
-  # Didn't work.  Fall back to name-based heuristics that used to work.
-  case `echo "$KBUILD" | sed 's,/*$,,'` in # (
-*/build)
-  KSRC=`echo "$KBUILD" | sed 's,/build/*$,/source,'`
-  ;; # (
-*)
-  KSRC=`(cd $KBUILD && pwd -P) | sed 's,-[[^-]]*$,-common,'`
-  ;;
-  esac
-fi
-  fi
-  if test ! -e "$KSRC"/include/linux/kernel.h; then
-AC_MSG_ERROR([cannot find source directory (please use 
--with-linux-source)])
-  fi
-fi
-AC_MSG_RESULT([$KSRC])
-
-AC_MSG_CHECKING([for kernel version])
-version=`sed -n 's/^VERSION = //p' "$KSRC/Makefile"`
-patchlevel=`sed -n 's/^PATCHLEVEL = //p' "$KSRC/Makefile"`
-sublevel=`sed -n 's/^SUBLEVEL = //p' "

[ovs-dev] [PATCH V2 8/8] Documentation: Remove kernel module documentation

2022-07-08 Thread Greg Rose
As of Open vSwitch release 2.18 the OVS kernel module is no longer
supported.  Pull the documentation references.

Signed-off-by: Greg Rose 
---
 Documentation/faq/releases.rst|  5 +-
 .../contributing/backporting-patches.rst  |  7 +++
 Documentation/intro/install/fedora.rst| 24 ---
 Documentation/intro/install/general.rst   | 63 ---
 4 files changed, 10 insertions(+), 89 deletions(-)

diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index 8cfe2d392..ab2925a62 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -74,7 +74,7 @@ Q: What Linux kernel versions does each Open vSwitch release 
work with?
 2.14.x   3.16 to 5.5
 2.15.x   3.16 to 5.8
 2.16.x   3.16 to 5.8
-2.17.x   3.16 to 5.8
+2.17.x   N/A
  ==
 
 Open vSwitch userspace should also work with the Linux kernel module built
@@ -110,7 +110,8 @@ Q: Are all features available with all datapaths?
 Linux OVS tree
   The datapath implemented by the Linux kernel module distributed with
   the OVS source tree. This datapath is deprecated starting with OVS
-  2.15.x and support capped at Linux kernel version 5.8.
+  2.15.x and support capped at Linux kernel version 5.8. As of OVS 2.17.x
+  the Linux OVS tree is no longer supported.
 
 Userspace
   This datapath supports conventional system devices as well as
diff --git a/Documentation/internals/contributing/backporting-patches.rst 
b/Documentation/internals/contributing/backporting-patches.rst
index 162e9d209..8370c954d 100644
--- a/Documentation/internals/contributing/backporting-patches.rst
+++ b/Documentation/internals/contributing/backporting-patches.rst
@@ -119,6 +119,13 @@ userspace changes.
 How to backport kernel patches
 ~~
 
+These instructions only apply to Open vSwitch releases 2.16 and older.
+As of Open vSwitch branch 2.17 the Open vSwitch kernel module is no
+longer supported and only the Linux openvswitch kernel module is used.
+In the case of Open vSwitch releases 2.16 and older kernel backports
+may be required for bux fixes and feature implementation so these
+instructions are preserved for that reason.
+
 First, the patch should be submitted upstream to `netdev`. When the patch has
 been applied to `net-next`, it is ready to be backported. Starting from the
 Linux tree, use ``git format-patch`` to format each patch that should be
diff --git a/Documentation/intro/install/fedora.rst 
b/Documentation/intro/install/fedora.rst
index 06a0bd3d5..02481597f 100644
--- a/Documentation/intro/install/fedora.rst
+++ b/Documentation/intro/install/fedora.rst
@@ -132,36 +132,12 @@ tests.  This can take several minutes.
 $ make rpm-fedora RPMBUILD_OPT="--with check"
 
 
-Kernel OVS Tree Datapath RPM
-
-
-To build the Open vSwitch kernel module for the currently running kernel
-version, run:
-
-::
-
-$ make rpm-fedora-kmod
-
-To build the Open vSwitch kernel module for another kernel version, the desired
-kernel version can be specified via the `kversion` macro.  For example:
-
-::
-
-$ make rpm-fedora-kmod \
- RPMBUILD_OPT='-D "kversion 4.3.4-300.fc23.x86_64"'
-
 Installing
 --
 
 RPM packages can be installed by using the command ``rpm -i``. Package
 installation requires superuser privileges.
 
-The `openvswitch-kmod` RPM should be installed first if the Linux OVS tree
-datapath module is to be used. The `openvswitch-kmod` RPM should not be
-installed if only the in-tree Linux datapath or user-space datapath is needed.
-Refer to the :doc:`/faq/index` for more information about the various Open
-vSwitch datapath options.
-
 In most cases only the `openvswitch` RPM will need to be installed. The
 `python3-openvswitch`, `openvswitch-test`, `openvswitch-devel`, and
 `openvswitch-debuginfo` RPMs are optional unless required for a specific
diff --git a/Documentation/intro/install/general.rst 
b/Documentation/intro/install/general.rst
index a297aadac..c2208bbed 100644
--- a/Documentation/intro/install/general.rst
+++ b/Documentation/intro/install/general.rst
@@ -302,24 +302,6 @@ example::
 
 $ ./configure CFLAGS="-g -O2 -fsanitize=address -fno-omit-frame-pointer 
-fno-common"
 
-To build the Linux kernel module, so that you can run the kernel-based switch,
-pass the location of the kernel build directory on ``--with-linux``. For
-example, to build for a running instance of Linux::
-
-$ ./configure --with-linux=/lib/modules/$(uname -r)/build
-
-.. note::
-  If ``--with-linux`` requests building for an unsupported version of Linux,
-  then ``configure`` will fail with an error message. Refer to the
-  :doc:`/faq/index` for advice in that case.
-
-If you wish to build the kernel module for an architecture other than the
-architecture of the machine used for the build, you may sp

[ovs-dev] [PATCH V2 4/8] aux:utilities: Remove references to the Linux datapath

2022-07-08 Thread Greg Rose
Remove references to the Linux datapath from auxiliary files and
utilities since it is no longer supported.

Signed-off-by: Greg Rose 
---
 build-aux/initial-tab-allowed-files |  1 -
 utilities/docker/debian/build-kernel-modules.sh | 13 -
 utilities/ovs-dev.py| 17 +++--
 3 files changed, 7 insertions(+), 24 deletions(-)

diff --git a/build-aux/initial-tab-allowed-files 
b/build-aux/initial-tab-allowed-files
index 1e9573c69..8bd23698e 100644
--- a/build-aux/initial-tab-allowed-files
+++ b/build-aux/initial-tab-allowed-files
@@ -3,7 +3,6 @@
 \.mk$
 \.png$
 \.sln$
-^datapath/
 ^include/linux/
 ^include/sparse/rte_
 ^include/windows/
diff --git a/utilities/docker/debian/build-kernel-modules.sh 
b/utilities/docker/debian/build-kernel-modules.sh
index 872ba1eb8..aaee73ff7 100755
--- a/utilities/docker/debian/build-kernel-modules.sh
+++ b/utilities/docker/debian/build-kernel-modules.sh
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-KERNEL_VERSION=$1
+KERNEL_VERSION=host
 OVS_BRANCH=$2
 GITHUB_SRC=$3
 
@@ -39,18 +39,13 @@ cd ovs
 config="./configure --localstatedir="/var" --sysconfdir="/etc" --prefix="/usr"
 --enable-ssl"
 
-if [ $KERNEL_VERSION = "host" ]; then
-   eval $config
-else
-withlinux=" --with-linux=/lib/modules/$KERNEL_VERSION/build"
-eval $config$withlinux
-fi
+eval $config
 
-make -j8; make install; make modules_install
+make -j8; make install
 
 # remove deps to make the container light weight.
 apt-get remove --purge -y ${build_deps}
 apt-get autoremove -y --purge
 cd ..; rm -rf ovs
 basic_utils="vim kmod net-tools uuid-runtime iproute2"
-apt-get install -y ${basic_utils}
\ No newline at end of file
+apt-get install -y ${basic_utils}
diff --git a/utilities/ovs-dev.py b/utilities/ovs-dev.py
index 534c5e7f1..e85ad6746 100755
--- a/utilities/ovs-dev.py
+++ b/utilities/ovs-dev.py
@@ -184,12 +184,9 @@ def tag():
 ctags = ['ctags', '-R', '-f', '.tags']
 
 try:
-_sh(*(ctags + ['--exclude="datapath/"']))
+_sh(*ctags)
 except:
-try:
-_sh(*ctags)  # Some versions of ctags don't have --exclude
-except:
-pass
+pass
 
 try:
 _sh('cscope', '-R', '-b')
@@ -351,7 +348,7 @@ Basic Configuration:
 
 # First install the basic requirements needed to build Open vSwitch.
 sudo apt-get install git build-essential libtool autoconf pkg-config \\
-libssl-dev gdb libcap-ng-dev linux-headers-`uname -r`
+libssl-dev gdb libcap-ng-dev
 
 # Next clone the Open vSwitch source.
 git clone https://github.com/openvswitch/ovs.git %(ovs)s
@@ -362,14 +359,6 @@ Basic Configuration:
 # Build the switch.
 %(v)s conf make
 
-# Install the kernel module
-sudo insmod %(ovs)s/datapath/linux/openvswitch.ko
-
-# If needed, manually load all required vport modules:
-sudo insmod %(ovs)s/datapath/linux/vport-vxlan.ko
-sudo insmod %(ovs)s/datapath/linux/vport-geneve.ko
-[...]
-
 # Run the switch.
 %(v)s run
 
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V2 0/8] Remove OVS kernel driver

2022-07-08 Thread Greg Rose
It is time to remove support for the ovs kernel driver and push
towards use of the upstream linux openvswitch kernel driver
in it's place [1].

1.  https://mail.openvswitch.org/pipermail/ovs-dev/2022-april/393292.html

Changes in V2:
* Removed the Linux datapath and fixed up various Makefiles to adjust
* Moved openvswitch.h from datapath/linux/compat/include to include/linux
  and fixed up the Makefiles to adjust
* Removed further instances in utilities and auxiliary files where the
  --with-linux configuration command was still being used.
* Changed order of patches to (hopefully) fix up some robot auto-test
  errors

Still to do:
* Make changes suggested by Ilya to still support AFXDP auto-test
* Figure out what to do with Xenserver support

Greg Rose (8):
  Disable unsupported kernel builds
  rhel: Remove kernel mode spec
  rhel: Remove RHEL 6 kernel module spec
  aux:utilities: Remove references to the Linux datapath
  Make: Remove the Linux datapath
  acinclude.m4: Remove support for building the OVS kernel module
  tests: Remove support for check-kmod test
  Documentation: Remove kernel module documentation

 .github/workflows/build-and-test.yml  |   53 -
 Documentation/faq/releases.rst|5 +-
 .../contributing/backporting-patches.rst  |7 +
 Documentation/intro/install/fedora.rst|   24 -
 Documentation/intro/install/general.rst   |   63 -
 Documentation/intro/install/rhel.rst  |   18 -
 Makefile.am   |   17 +-
 Vagrantfile   |9 +-
 acinclude.m4  |  683 +---
 build-aux/initial-tab-allowed-files   |1 -
 configure.ac  |5 -
 datapath-windows/include/automake.mk  |2 +-
 datapath/.gitignore   |7 -
 datapath/Makefile.am  |   60 -
 datapath/Modules.mk   |   58 -
 datapath/actions.c| 1587 
 datapath/compat.h |   92 -
 datapath/conntrack.c  | 2413 ---
 datapath/conntrack.h  |  113 -
 datapath/datapath.c   | 2707 -
 datapath/datapath.h   |  283 --
 datapath/dp_notify.c  |  102 -
 datapath/flow.c   |  972 -
 datapath/flow.h   |  297 --
 datapath/flow_netlink.c   | 3519 -
 datapath/flow_netlink.h   |   85 -
 datapath/flow_table.c |  988 -
 datapath/flow_table.h |  102 -
 datapath/linux/.gitignore |8 -
 datapath/linux/Kbuild.in  |   27 -
 datapath/linux/Makefile.in|9 -
 datapath/linux/Makefile.main.in   |  107 -
 datapath/linux/Modules.mk |  123 -
 .../compat/build-aux/export-check-allow-list  |1 -
 datapath/linux/compat/dev-openvswitch.c   |   83 -
 datapath/linux/compat/dst_cache.c |  173 -
 datapath/linux/compat/exthdrs_core.c  |  129 -
 datapath/linux/compat/genetlink-openvswitch.c |   55 -
 datapath/linux/compat/geneve.c| 1854 -
 datapath/linux/compat/gre.c   |  239 --
 datapath/linux/compat/gso.c   |  317 --
 datapath/linux/compat/gso.h   |  214 -
 datapath/linux/compat/include/linux/bug.h |   13 -
 datapath/linux/compat/include/linux/cache.h   |   23 -
 .../linux/compat/include/linux/compiler-gcc.h |   20 -
 .../linux/compat/include/linux/compiler.h |   26 -
 datapath/linux/compat/include/linux/cpumask.h |   11 -
 datapath/linux/compat/include/linux/err.h |   37 -
 .../linux/compat/include/linux/etherdevice.h  |   62 -
 .../linux/compat/include/linux/genetlink.h|   16 -
 datapath/linux/compat/include/linux/if.h  |6 -
 .../linux/compat/include/linux/if_ether.h |   39 -
 datapath/linux/compat/include/linux/if_link.h |  171 -
 datapath/linux/compat/include/linux/if_vlan.h |  306 --
 datapath/linux/compat/include/linux/in.h  |   56 -
 datapath/linux/compat/include/linux/jiffies.h |   34 -
 datapath/linux/compat/include/linux/kconfig.h |   49 -
 datapath/linux/compat/include/linux/kernel.h  |   39 -
 datapath/linux/compat/include/linux/list.h|   31 -
 datapath/linux/compat/include/linux/mm.h  |   44 -
 datapath/linux/compat/include/linux/mpls.h|   40 -
 datapath/linux/compat/include/linux/net.h |   62 -
 .../compat/include/linux/netdev_features.h|   77 -
 .../linux/compat/include/linux/netdevice.h|  336 --
 .../linux/compat/include/linux/netfilter.h|   19 -
 .../compat/include/linux/netfilter_ipv6.h |   32 -
 datapath/linux/compat/include/linux/netlink.h |   19 -
 .../linux/compat/include/linux

[ovs-dev] [PATCH V2 2/8] rhel: Remove kernel mode spec

2022-07-08 Thread Greg Rose
Remove the kernel driver specification for RHEL 7.x, 8.x and Fedora.

Signed-off-by: Greg Rose 
---
 Vagrantfile  |   9 +-
 poc/playbook-fedora-builder.yml  |  13 ---
 rhel/.gitignore  |   4 -
 rhel/automake.mk |  12 ---
 rhel/openvswitch-dkms.spec.in| 103 --
 rhel/openvswitch-kmod-fedora.spec.in | 152 ---
 6 files changed, 1 insertion(+), 292 deletions(-)
 delete mode 100644 rhel/openvswitch-dkms.spec.in
 delete mode 100644 rhel/openvswitch-kmod-fedora.spec.in

diff --git a/Vagrantfile b/Vagrantfile
index 2cd603932..c2c59265d 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -54,7 +54,7 @@ cd /vagrant
 [ -f Makefile ] && ./configure && make distclean
 mkdir -p ~/build
 cd ~/build
-/vagrant/configure --with-linux=/lib/modules/`uname -r`/build 
--enable-silent-rules
+/vagrant/configure --enable-silent-rules
 SCRIPT
 
 $build_ovs = <

[ovs-dev] [PATCH V2 3/8] rhel: Remove RHEL 6 kernel module spec

2022-07-08 Thread Greg Rose
Remove the RHEL 6 kernel driver module specification.

Signed-off-by: Greg Rose 
---
 Documentation/intro/install/rhel.rst |  18 
 poc/playbook-centos-builder.yml  |   8 --
 rhel/automake.mk |  10 ---
 rhel/kmod-openvswitch-rhel6.spec.in  | 123 ---
 4 files changed, 159 deletions(-)
 delete mode 100644 rhel/kmod-openvswitch-rhel6.spec.in

diff --git a/Documentation/intro/install/rhel.rst 
b/Documentation/intro/install/rhel.rst
index b21b274b7..d1fc42021 100644
--- a/Documentation/intro/install/rhel.rst
+++ b/Documentation/intro/install/rhel.rst
@@ -194,24 +194,6 @@ the unit tests, run::
/lib/modules/2.6.32-279.el6.x86_64/build doesn't exist`` or similar, then
the kernel-devel package is missing or buggy.
 
-Kernel Module
-~
-
-On RHEL 6, to build the Open vSwitch kernel module run::
-
-$ rpmbuild -bb rhel/kmod-openvswitch-rhel6.spec
-
-You might have to specify a kernel version and/or variants, e.g.::
-
-$ rpmbuild -bb \
--D "kversion 2.6.32-131.6.1.el6.x86_64" \
--D "kflavors default debug kdump" \
-rhel/kmod-openvswitch-rhel6.spec
-
-This produces an "kmod-openvswitch" RPM for each kernel variant, in this
-example: "kmod-openvswitch", "kmod-openvswitch-debug", and
-"kmod-openvswitch-kdump".
-
 .. _rhel-script-integrations:
 
 Red Hat Network Scripts Integration
diff --git a/poc/playbook-centos-builder.yml b/poc/playbook-centos-builder.yml
index e902db75d..b38a6c4ef 100644
--- a/poc/playbook-centos-builder.yml
+++ b/poc/playbook-centos-builder.yml
@@ -41,13 +41,11 @@
 chdir: /git/ovs/rhel
 with_items:
   - openvswitch.spec
-  - kmod-openvswitch-rhel6.spec
 
   - name: Install build dependencies specified from spec files
 shell: echo "y" | yum-builddep /tmp/{{item}}
 with_items:
   - openvswitch.spec
-  - kmod-openvswitch-rhel6.spec
 
   - name: Create rpm dev tree
 command: rpmdev-setuptree
@@ -81,18 +79,12 @@
   line: "Release: {{ ansible_local.builder.release }}"
 with_items:
   - openvswitch.spec
-  - kmod-openvswitch-rhel6.spec
 
   - name: Build Open vSwitch user space rpms
 command: rpmbuild -bb --without check rhel/openvswitch.spec
 args:
 chdir: "{{SOURCE}}/openvswitch-{{version.stdout}}"
 
-  - name: Build Open vSwitch kmod rpms (only for currently loaded kernel)
-command: rpmbuild -bb  --without check rhel/kmod-openvswitch-rhel6.spec
-args:
-chdir: "{{SOURCE}}/openvswitch-{{version.stdout}}"
-
   - name: Copy RPM packages to /var/www/html
 command: cp -r /root/rpmbuild/RPMS/ /var/www/html
 
diff --git a/rhel/automake.mk b/rhel/automake.mk
index 235779b49..51ee9b961 100644
--- a/rhel/automake.mk
+++ b/rhel/automake.mk
@@ -13,10 +13,6 @@ EXTRA_DIST += \
rhel/etc_openvswitch_default.conf \
rhel/etc_sysconfig_network-scripts_ifdown-ovs \
rhel/etc_sysconfig_network-scripts_ifup-ovs \
-   rhel/openvswitch-dkms.spec \
-   rhel/openvswitch-dkms.spec.in \
-   rhel/kmod-openvswitch-rhel6.spec \
-   rhel/kmod-openvswitch-rhel6.spec.in \
rhel/openvswitch.spec \
rhel/openvswitch.spec.in \
rhel/openvswitch-fedora.spec \
@@ -39,12 +35,6 @@ update_rhel_spec = \
 < $(srcdir)/rhel/$(@F).in > $(@F).tmp || exit 1; \
   if cmp -s $(@F).tmp $@; then touch $@; rm $(@F).tmp; else mv $(@F).tmp $@; fi
 
-$(srcdir)/rhel/openvswitch-dkms.spec: rhel/openvswitch-dkms.spec.in 
$(top_builddir)/config.status
-   $(update_rhel_spec)
-
-$(srcdir)/rhel/kmod-openvswitch-rhel6.spec: 
rhel/kmod-openvswitch-rhel6.spec.in $(top_builddir)/config.status
-   $(update_rhel_spec)
-
 $(srcdir)/rhel/openvswitch.spec: rhel/openvswitch.spec.in 
$(top_builddir)/config.status
$(update_rhel_spec)
 
diff --git a/rhel/kmod-openvswitch-rhel6.spec.in 
b/rhel/kmod-openvswitch-rhel6.spec.in
deleted file mode 100644
index de69863d7..0
--- a/rhel/kmod-openvswitch-rhel6.spec.in
+++ /dev/null
@@ -1,123 +0,0 @@
-# Spec file for Open vSwitch kernel modules on Red Hat Enterprise
-# Linux 6.
-
-# Copyright (C) 2011, 2012, 2018 Nicira, 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.
-
-%define oname openvswitch
-%{!?release_number:%define release_number 1}
-
-Name:   kmod-%{oname}
-Version:@VERSION@
-Release:%{release_number}%{?dist}
-Summary:Open vSwitch kernel module
-
-Group:  System/Kernel
-License:GPLv2
-URL:http://openvswitch.org/
-Source0:%{oname}-%{version}.tar.gz
-BuildRoot:  %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XX)
-
-# Without this we get an empty openvswitch-debugi

[ovs-dev] [PATCH V2 1/8] Disable unsupported kernel builds

2022-07-08 Thread Greg Rose
Remove kernel based github workflows since the OVS kernel driver is
no longer supported since Release 2.18

Signed-off-by: Greg Rose 
---
 .github/workflows/build-and-test.yml | 53 
 1 file changed, 53 deletions(-)

diff --git a/.github/workflows/build-and-test.yml 
b/.github/workflows/build-and-test.yml
index 9e3583781..64454c5ea 100644
--- a/.github/workflows/build-and-test.yml
+++ b/.github/workflows/build-and-test.yml
@@ -9,21 +9,14 @@ jobs:
 automake libtool gcc bc libjemalloc1 libjemalloc-dev\
 libssl-dev llvm-dev libelf-dev libnuma-dev libpcap-dev  \
 ninja-build selinux-policy-dev
-  deb_dependencies: |
-linux-headers-$(uname -r) build-essential fakeroot devscripts equivs
-  AFXDP:   ${{ matrix.afxdp }}
   ASAN:${{ matrix.asan }}
   UBSAN:   ${{ matrix.ubsan }}
   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
@@ -38,56 +31,13 @@ jobs:
   - compiler: clang
 opts: --disable-ssl
 
-  - compiler: gcc
-testsuite:test
-kernel:   3.16
   - compiler: clang
 testsuite:test
-kernel:   3.16
 asan: asan
   - compiler: clang
 testsuite:test
-kernel:   3.16
 ubsan:ubsan
 
-  - 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.8 5.5 5.4 4.19
-  - compiler: clang
-kernel_list:  5.8 5.5 5.4 4.19
-
-  - compiler: gcc
-kernel_list:  4.14 4.9 4.4 3.16
-  - compiler: clang
-kernel_list:  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
@@ -111,9 +61,6 @@ jobs:
 m32:  m32
 opts: --disable-ssl
 
-  - compiler: gcc
-deb_package:  deb
-
 steps:
 - name: checkout
   uses: actions/checkout@v2
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH 6/6] Disable unsupported kernel builds

2022-07-06 Thread Greg Rose
Remove kernel based github workflows since the OVS kernel driver is
no longer supported since Release 2.18

Signed-off-by: Greg Rose 
---
 .github/workflows/build-and-test.yml | 53 
 1 file changed, 53 deletions(-)

diff --git a/.github/workflows/build-and-test.yml 
b/.github/workflows/build-and-test.yml
index 9e3583781..64454c5ea 100644
--- a/.github/workflows/build-and-test.yml
+++ b/.github/workflows/build-and-test.yml
@@ -9,21 +9,14 @@ jobs:
 automake libtool gcc bc libjemalloc1 libjemalloc-dev\
 libssl-dev llvm-dev libelf-dev libnuma-dev libpcap-dev  \
 ninja-build selinux-policy-dev
-  deb_dependencies: |
-linux-headers-$(uname -r) build-essential fakeroot devscripts equivs
-  AFXDP:   ${{ matrix.afxdp }}
   ASAN:${{ matrix.asan }}
   UBSAN:   ${{ matrix.ubsan }}
   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
@@ -38,56 +31,13 @@ jobs:
   - compiler: clang
 opts: --disable-ssl
 
-  - compiler: gcc
-testsuite:test
-kernel:   3.16
   - compiler: clang
 testsuite:test
-kernel:   3.16
 asan: asan
   - compiler: clang
 testsuite:test
-kernel:   3.16
 ubsan:ubsan
 
-  - 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.8 5.5 5.4 4.19
-  - compiler: clang
-kernel_list:  5.8 5.5 5.4 4.19
-
-  - compiler: gcc
-kernel_list:  4.14 4.9 4.4 3.16
-  - compiler: clang
-kernel_list:  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
@@ -111,9 +61,6 @@ jobs:
 m32:  m32
 opts: --disable-ssl
 
-  - compiler: gcc
-deb_package:  deb
-
 steps:
 - name: checkout
   uses: actions/checkout@v2
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH 4/6] tests: Remove support for check-kmod test

2022-07-06 Thread Greg Rose
The OVS kernel module is no longer supported as of OVS 2.18

Signed-off-by: Greg Rose 
---
 tests/automake.mk | 6 --
 1 file changed, 6 deletions(-)

diff --git a/tests/automake.mk b/tests/automake.mk
index b29cb783e..3496f9002 100644
--- a/tests/automake.mk
+++ b/tests/automake.mk
@@ -343,12 +343,6 @@ check-kernel: all
set $(SHELL) '$(SYSTEM_KMOD_TESTSUITE)' -C tests  
AUTOTEST_PATH='$(AUTOTEST_PATH)'; \
"$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && "$$@" 
--recheck)
 
-# Testing the out of tree Kernel module
-check-kmod: all
-   $(MAKE) modules_install
-   modprobe -r -a vport-geneve vport-gre vport-lisp vport-stt vport-vxlan 
openvswitch
-   $(MAKE) check-kernel
-
 check-system-userspace: all
set $(SHELL) '$(SYSTEM_USERSPACE_TESTSUITE)' -C tests  
AUTOTEST_PATH='$(AUTOTEST_PATH)'; \
"$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && "$$@" 
--recheck)
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH 5/6] Documentation: Remove kernel module documentation

2022-07-06 Thread Greg Rose
As of Open vSwitch release 2.18 the OVS kernel module is no longer
supported.  Pull the documentation references.

Signed-off-by: Greg Rose 
---
 Documentation/faq/releases.rst|  5 +-
 .../contributing/backporting-patches.rst  |  7 +++
 Documentation/intro/install/fedora.rst| 24 ---
 Documentation/intro/install/general.rst   | 63 ---
 4 files changed, 10 insertions(+), 89 deletions(-)

diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index 8cfe2d392..ab2925a62 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -74,7 +74,7 @@ Q: What Linux kernel versions does each Open vSwitch release 
work with?
 2.14.x   3.16 to 5.5
 2.15.x   3.16 to 5.8
 2.16.x   3.16 to 5.8
-2.17.x   3.16 to 5.8
+2.17.x   N/A
  ==
 
 Open vSwitch userspace should also work with the Linux kernel module built
@@ -110,7 +110,8 @@ Q: Are all features available with all datapaths?
 Linux OVS tree
   The datapath implemented by the Linux kernel module distributed with
   the OVS source tree. This datapath is deprecated starting with OVS
-  2.15.x and support capped at Linux kernel version 5.8.
+  2.15.x and support capped at Linux kernel version 5.8. As of OVS 2.17.x
+  the Linux OVS tree is no longer supported.
 
 Userspace
   This datapath supports conventional system devices as well as
diff --git a/Documentation/internals/contributing/backporting-patches.rst 
b/Documentation/internals/contributing/backporting-patches.rst
index 162e9d209..8370c954d 100644
--- a/Documentation/internals/contributing/backporting-patches.rst
+++ b/Documentation/internals/contributing/backporting-patches.rst
@@ -119,6 +119,13 @@ userspace changes.
 How to backport kernel patches
 ~~
 
+These instructions only apply to Open vSwitch releases 2.16 and older.
+As of Open vSwitch branch 2.17 the Open vSwitch kernel module is no
+longer supported and only the Linux openvswitch kernel module is used.
+In the case of Open vSwitch releases 2.16 and older kernel backports
+may be required for bux fixes and feature implementation so these
+instructions are preserved for that reason.
+
 First, the patch should be submitted upstream to `netdev`. When the patch has
 been applied to `net-next`, it is ready to be backported. Starting from the
 Linux tree, use ``git format-patch`` to format each patch that should be
diff --git a/Documentation/intro/install/fedora.rst 
b/Documentation/intro/install/fedora.rst
index 06a0bd3d5..02481597f 100644
--- a/Documentation/intro/install/fedora.rst
+++ b/Documentation/intro/install/fedora.rst
@@ -132,36 +132,12 @@ tests.  This can take several minutes.
 $ make rpm-fedora RPMBUILD_OPT="--with check"
 
 
-Kernel OVS Tree Datapath RPM
-
-
-To build the Open vSwitch kernel module for the currently running kernel
-version, run:
-
-::
-
-$ make rpm-fedora-kmod
-
-To build the Open vSwitch kernel module for another kernel version, the desired
-kernel version can be specified via the `kversion` macro.  For example:
-
-::
-
-$ make rpm-fedora-kmod \
- RPMBUILD_OPT='-D "kversion 4.3.4-300.fc23.x86_64"'
-
 Installing
 --
 
 RPM packages can be installed by using the command ``rpm -i``. Package
 installation requires superuser privileges.
 
-The `openvswitch-kmod` RPM should be installed first if the Linux OVS tree
-datapath module is to be used. The `openvswitch-kmod` RPM should not be
-installed if only the in-tree Linux datapath or user-space datapath is needed.
-Refer to the :doc:`/faq/index` for more information about the various Open
-vSwitch datapath options.
-
 In most cases only the `openvswitch` RPM will need to be installed. The
 `python3-openvswitch`, `openvswitch-test`, `openvswitch-devel`, and
 `openvswitch-debuginfo` RPMs are optional unless required for a specific
diff --git a/Documentation/intro/install/general.rst 
b/Documentation/intro/install/general.rst
index a297aadac..c2208bbed 100644
--- a/Documentation/intro/install/general.rst
+++ b/Documentation/intro/install/general.rst
@@ -302,24 +302,6 @@ example::
 
 $ ./configure CFLAGS="-g -O2 -fsanitize=address -fno-omit-frame-pointer 
-fno-common"
 
-To build the Linux kernel module, so that you can run the kernel-based switch,
-pass the location of the kernel build directory on ``--with-linux``. For
-example, to build for a running instance of Linux::
-
-$ ./configure --with-linux=/lib/modules/$(uname -r)/build
-
-.. note::
-  If ``--with-linux`` requests building for an unsupported version of Linux,
-  then ``configure`` will fail with an error message. Refer to the
-  :doc:`/faq/index` for advice in that case.
-
-If you wish to build the kernel module for an architecture other than the
-architecture of the machine used for the build, you may sp

[ovs-dev] [PATCH 1/6] acinclude.m4: Remove support for building the OVS kernel module

2022-07-06 Thread Greg Rose
Since the openvswitch project inception it has had support for building
a Linux kernel module to support the OVS kernel datapath.  Since Linux
kernel release 5.8 support for newer kernels has been deprecated.  Now
is the time to fully discontinue support for building the openvswitch
kernel driver. Since Linux 5.9 the Linux built-in openvswitch kernel
driver supports all necessary features and functions of the kernel
datapath and the need to support this additional "out of tree" kernel
module is gone.

Remove the --with-linux configuration support from the acinclude.m4
configuration and warn user it is not supported any longer.

Signed-off-by: Greg Rose 
---
 acinclude.m4 | 683 +--
 1 file changed, 1 insertion(+), 682 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index b518aa624..30ee143e4 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -115,132 +115,11 @@ dnl OVS_CHECK_LINUX
 dnl
 dnl Configure linux kernel source tree
 AC_DEFUN([OVS_CHECK_LINUX], [
-  AC_ARG_WITH([linux],
-  [AC_HELP_STRING([--with-linux=/path/to/linux],
-  [Specify the Linux kernel build directory])])
-  AC_ARG_WITH([linux-source],
-  [AC_HELP_STRING([--with-linux-source=/path/to/linux-source],
-  [Specify the Linux kernel source directory
-   (usually figured out automatically from build
-   directory)])])
-
-  # Deprecated equivalents to --with-linux, --with-linux-source.
-  AC_ARG_WITH([l26])
-  AC_ARG_WITH([l26-source])
-
   if test X"$with_linux" != X; then
-KBUILD=$with_linux
-AC_MSG_WARN([--with-linux is deprecated and kernel support is limited to 
5.8 and below])
-  elif test X"$with_l26" != X; then
-KBUILD=$with_l26
-AC_MSG_WARN([--with-l26 is deprecated, please use --with-linux instead])
-  else
+AC_MSG_WARN([--with-linux is no longer supported])
 KBUILD=
   fi
 
-  if test X"$KBUILD" != X; then
-if test X"$with_linux_source" != X; then
-  KSRC=$with_linux_source
-elif test X"$with_l26_source" != X; then
-  KSRC=$with_l26_source
-  AC_MSG_WARN([--with-l26-source is deprecated, please use 
--with-linux-source instead])
-else
-  KSRC=
-fi
-  elif test X"$with_linux_source" != X || test X"$with_l26_source" != X; then
-AC_MSG_ERROR([Linux source directory may not be specified without Linux 
build directory])
-  fi
-
-  if test -n "$KBUILD"; then
-KBUILD=`eval echo "$KBUILD"`
-case $KBUILD in
-/*) ;;
-*) KBUILD=`pwd`/$KBUILD ;;
-esac
-
-# The build directory is what the user provided.
-# Make sure that it exists.
-AC_MSG_CHECKING([for Linux build directory])
-if test -d "$KBUILD"; then
-AC_MSG_RESULT([$KBUILD])
-AC_SUBST(KBUILD)
-else
-AC_MSG_RESULT([no])
-AC_ERROR([source dir $KBUILD doesn't exist])
-fi
-
-# Debian breaks kernel headers into "source" header and "build" headers.
-# We want the source headers, but $KBUILD gives us the "build" headers.
-# Use heuristics to find the source headers.
-AC_MSG_CHECKING([for Linux source directory])
-if test -n "$KSRC"; then
-  KSRC=`eval echo "$KSRC"`
-  case $KSRC in
-  /*) ;;
-  *) KSRC=`pwd`/$KSRC ;;
-  esac
-  if test ! -e $KSRC/include/linux/kernel.h; then
-AC_MSG_ERROR([$KSRC is not a kernel source directory])
-  fi
-else
-  KSRC=$KBUILD
-  if test ! -e $KSRC/include/linux/kernel.h; then
-# Debian kernel build Makefiles tend to include a line of the form:
-# MAKEARGS := -C /usr/src/linux-headers-3.2.0-1-common 
O=/usr/src/linux-headers-3.2.0-1-486
-# First try to extract the source directory from this line.
-KSRC=`sed -n 's/.*-C \([[^ ]]*\).*/\1/p' "$KBUILD"/Makefile`
-if test ! -e "$KSRC"/include/linux/kernel.h; then
-  # Didn't work.  Fall back to name-based heuristics that used to work.
-  case `echo "$KBUILD" | sed 's,/*$,,'` in # (
-*/build)
-  KSRC=`echo "$KBUILD" | sed 's,/build/*$,/source,'`
-  ;; # (
-*)
-  KSRC=`(cd $KBUILD && pwd -P) | sed 's,-[[^-]]*$,-common,'`
-  ;;
-  esac
-fi
-  fi
-  if test ! -e "$KSRC"/include/linux/kernel.h; then
-AC_MSG_ERROR([cannot find source directory (please use 
--with-linux-source)])
-  fi
-fi
-AC_MSG_RESULT([$KSRC])
-
-AC_MSG_CHECKING([for kernel version])
-version=`sed -n 's/^VERSION = //p' "$KSRC/Makefile"`
-patchlevel=`sed -n 's/^PATCHLEVEL = //p' "$KSRC/Makefile"`
-sublevel=`sed -n 's/^SUBLEVEL = //p' "

[ovs-dev] [PATCH 3/6] rhel: Remove RHEL 6 kernel module spec

2022-07-06 Thread Greg Rose
Remove the RHEL 6 kernel driver module specification.

Signed-off-by: Greg Rose 
---
 rhel/automake.mk|   5 --
 rhel/kmod-openvswitch-rhel6.spec.in | 123 
 2 files changed, 128 deletions(-)
 delete mode 100644 rhel/kmod-openvswitch-rhel6.spec.in

diff --git a/rhel/automake.mk b/rhel/automake.mk
index 235779b49..e0f5ec013 100644
--- a/rhel/automake.mk
+++ b/rhel/automake.mk
@@ -15,8 +15,6 @@ EXTRA_DIST += \
rhel/etc_sysconfig_network-scripts_ifup-ovs \
rhel/openvswitch-dkms.spec \
rhel/openvswitch-dkms.spec.in \
-   rhel/kmod-openvswitch-rhel6.spec \
-   rhel/kmod-openvswitch-rhel6.spec.in \
rhel/openvswitch.spec \
rhel/openvswitch.spec.in \
rhel/openvswitch-fedora.spec \
@@ -42,9 +40,6 @@ update_rhel_spec = \
 $(srcdir)/rhel/openvswitch-dkms.spec: rhel/openvswitch-dkms.spec.in 
$(top_builddir)/config.status
$(update_rhel_spec)
 
-$(srcdir)/rhel/kmod-openvswitch-rhel6.spec: 
rhel/kmod-openvswitch-rhel6.spec.in $(top_builddir)/config.status
-   $(update_rhel_spec)
-
 $(srcdir)/rhel/openvswitch.spec: rhel/openvswitch.spec.in 
$(top_builddir)/config.status
$(update_rhel_spec)
 
diff --git a/rhel/kmod-openvswitch-rhel6.spec.in 
b/rhel/kmod-openvswitch-rhel6.spec.in
deleted file mode 100644
index de69863d7..0
--- a/rhel/kmod-openvswitch-rhel6.spec.in
+++ /dev/null
@@ -1,123 +0,0 @@
-# Spec file for Open vSwitch kernel modules on Red Hat Enterprise
-# Linux 6.
-
-# Copyright (C) 2011, 2012, 2018 Nicira, 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.
-
-%define oname openvswitch
-%{!?release_number:%define release_number 1}
-
-Name:   kmod-%{oname}
-Version:@VERSION@
-Release:%{release_number}%{?dist}
-Summary:Open vSwitch kernel module
-
-Group:  System/Kernel
-License:GPLv2
-URL:http://openvswitch.org/
-Source0:%{oname}-%{version}.tar.gz
-BuildRoot:  %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XX)
-
-# Without this we get an empty openvswitch-debuginfo package (whose name
-# conflicts with the openvswitch-debuginfo package for OVS userspace).
-%undefine _enable_debug_packages
-
-%define kernel_source_extended() /usr/src/kernels/%{2}$([ %{1} = default ] || 
echo ".%{1}")
-
-# Use -D 'kversion 2.6.32-131.6.1.el6.x86_64' to build package
-# for specified kernel version.
-# Use -D 'kversion 3.10.0-693.1.1.el7.x86_64 3.10.0-693.17.1.el7.x86_64'
-# to build package for mulitple kernel versions in the same package
-# This only works for kernel 3.10.0 major revision 693 (RHEL 7.4)
-# and major revision 327 (RHEL 7.2)
-# By default, build against the latest installed kernel-devel
-%{!?kversion:%global kversion %(rpm -qa | egrep "^kernel(-rt|-aarch64)?-devel" 
| /usr/lib/rpm/redhat/rpmsort -r | head -n 1| sed "s/^kernel.*-devel-//")}
-
-# Use -D 'kflavors default debug kdump' to build packages for
-# specified kernel variants.
-%{!?kflavors:%global kflavors default}
-
-%description
-Open vSwitch Linux kernel module.
-
-%prep
-
-%setup -n %{oname}-%{version}
-
-%build
-for kv in %{kversion}; do
-for flavor in %{kflavors}; do
-mkdir -p _$flavor/_$kv
-(cd _$flavor/_$kv && ../../configure 
--with-linux="%{kernel_source_extended $flavor $kv}")
-%{__make} -C _$flavor/_$kv/datapath/linux %{?_smp_mflags}
-done
-done
-
-%install
-export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
-export INSTALL_MOD_DIR=extra/%{oname}
-for kv in %{kversion}; do
-for flavor in %{kflavors} ; do
-make -C %{kernel_source_extended $flavor $kv} modules_install \
-M="`pwd`"/_$flavor/_$kv/datapath/linux
-# Cleanup unnecessary kernel-generated module dependency files.
-find $INSTALL_MOD_PATH/lib/modules -iname 'modules.*' -exec rm {} \;
-done
-done
-install -d %{buildroot}%{_sysconfdir}/depmod.d/
-for kv in %{kversion}; do
-for module in %{buildroot}/lib/modules/$kv/$INSTALL_MOD_DIR/*.ko;
-do
-modname="$(basename ${module})"
-grep -qsPo "^\s*override ${modname%.ko} \* extra\/%{oname}" 
%{oname}.conf || \
-echo "override ${modname%.ko} * extra/%{oname}" >> %{oname}.conf
-grep -qsPo "^\s*override ${modname%.ko} \* weak-updates\/%{oname}" 
%{oname}.conf || \
-echo "override ${modname%.ko} * weak-updates/%{oname}" >> 
%{oname}.conf
-done
-done
-install -m 644 %{oname}.conf %{buildroot}%{_sysconfdir}/depmod.d/
-install -d -m 0755 $RPM_BUILD_ROOT/usr/share/%{oname}/scripts
-install -p -m 0755 rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh \
-$RPM_BUILD_ROOT/usr/share/%{oname}/scr

[ovs-dev] [PATCH 2/6] rhel: Remove kernel mode spec

2022-07-06 Thread Greg Rose
Remove the kernel driver specification for RHEL 7.x, 8.x and Fedora.

Signed-off-by: Greg Rose 
---
 rhel/automake.mk |  12 ---
 rhel/openvswitch-kmod-fedora.spec.in | 152 ---
 2 files changed, 164 deletions(-)
 delete mode 100644 rhel/openvswitch-kmod-fedora.spec.in

diff --git a/rhel/automake.mk b/rhel/automake.mk
index c75406e05..235779b49 100644
--- a/rhel/automake.mk
+++ b/rhel/automake.mk
@@ -17,8 +17,6 @@ EXTRA_DIST += \
rhel/openvswitch-dkms.spec.in \
rhel/kmod-openvswitch-rhel6.spec \
rhel/kmod-openvswitch-rhel6.spec.in \
-   rhel/openvswitch-kmod-fedora.spec \
-   rhel/openvswitch-kmod-fedora.spec.in \
rhel/openvswitch.spec \
rhel/openvswitch.spec.in \
rhel/openvswitch-fedora.spec \
@@ -47,9 +45,6 @@ $(srcdir)/rhel/openvswitch-dkms.spec: 
rhel/openvswitch-dkms.spec.in $(top_buildd
 $(srcdir)/rhel/kmod-openvswitch-rhel6.spec: 
rhel/kmod-openvswitch-rhel6.spec.in $(top_builddir)/config.status
$(update_rhel_spec)
 
-$(srcdir)/rhel/openvswitch-kmod-fedora.spec: 
rhel/openvswitch-kmod-fedora.spec.in $(top_builddir)/config.status
-   $(update_rhel_spec)
-
 $(srcdir)/rhel/openvswitch.spec: rhel/openvswitch.spec.in 
$(top_builddir)/config.status
$(update_rhel_spec)
 
@@ -67,10 +62,3 @@ rpm-fedora: dist $(srcdir)/rhel/openvswitch-fedora.spec
  -D "_topdir ${RPMBUILD_TOP}" \
  -ba $(srcdir)/rhel/openvswitch-fedora.spec
 
-# Build kernel datapath RPM
-rpm-fedora-kmod: dist $(srcdir)/rhel/openvswitch-kmod-fedora.spec
-   ${MKDIR_P} ${RPMBUILD_TOP}/SOURCES
-   cp ${DIST_ARCHIVES} ${RPMBUILD_TOP}/SOURCES
-   rpmbuild -D "kversion $(shell uname -r)" ${RPMBUILD_OPT} \
- -D "_topdir ${RPMBUILD_TOP}" \
- -ba $(srcdir)/rhel/openvswitch-kmod-fedora.spec
diff --git a/rhel/openvswitch-kmod-fedora.spec.in 
b/rhel/openvswitch-kmod-fedora.spec.in
deleted file mode 100644
index e5f78701f..0
--- a/rhel/openvswitch-kmod-fedora.spec.in
+++ /dev/null
@@ -1,152 +0,0 @@
-# Spec file for Open vSwitch.
-
-# Copyright (C) 2009, 2010, 2015, 2018 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.
-
-%global debug_package %{nil}
-
-# Use the kversion macro such as
-# RPMBUILD_OPT='-D "kversion 3.10.0-693.1.1.el7.x86_64 
3.10.0-693.17.1.el7.x86_64"'
-# to build package for mulitple kernel versions in the same package
-# This only works for the following kernels.
-#   - 3.10.0 major revision 327  (RHEL 7.2)
-#   - 3.10.0 major revision 693  (RHEL 7.4)
-#   - 3.10.0 major revision 957  (RHEL 7.6)
-#   - 3.10.0 major revision 1062 (RHEL 7.7)
-#   - 3.10.0 major revision 1101 (RHEL 7.8 Beta)
-#   - 3.10.0 major revision 1127 (RHEL 7.8 GA)
-#   - 3.10.0 major revision 1160 (RHEL 7.9 GA)
-# By default, build against the current running kernel version
-#%define kernel 3.1.5-1.fc16.x86_64
-#define kernel %{kernel_source}
-%{?kversion:%define kernel %kversion}
-
-%{!?release_number:%define release_number 1}
-
-Name: openvswitch-kmod
-Summary: Open vSwitch Kernel Modules
-Group: System Environment/Daemons
-URL: http://www.openvswitch.org/
-Vendor: OpenSource Security Ralf Spenneberg 
-Version: @VERSION@
-
-# The entire source code is ASL 2.0 except datapath/ which is GPLv2
-License: GPLv2
-Release: %{release_number}%{?dist}
-Source: openvswitch-%{version}.tar.gz
-#Source1: openvswitch-init
-Buildroot: /tmp/openvswitch-xen-rpm
-Provides: kmod-openvswitch
-Obsoletes: kmod-openvswitch < %{version}-%{release}
-
-%description
-Open vSwitch provides standard network bridging functions augmented with
-support for the OpenFlow protocol for remote per-flow control of
-traffic. This package contains the kernel modules.
-
-%prep
-%setup -q -n openvswitch-%{version}
-
-%build
-for kv in %{kversion}; do
-mkdir -p _$kv
-(cd _$kv && /bin/cp -f ../configure . && %configure --srcdir=.. \
---with-linux=/lib/modules/${kv}/build --enable-ssl 
%{_ovs_config_extra_flags})
-make %{_smp_mflags} -C _$kv/datapath/linux
-done
-
-%install
-export INSTALL_MOD_DIR=extra/openvswitch
-rm -rf $RPM_BUILD_ROOT
-for kv in %{kversion}; do
-make INSTALL_MOD_PATH=$RPM_BUILD_ROOT -C _$kv/datapath/linux 
modules_install
-done
-mkdir -p $RPM_BUILD_ROOT/etc/depmod.d
-for kv in %{kversion}; do
-for module in $RPM_BUILD_ROOT/lib/modules/${kv}/extra/openvswitch/*.ko
-do
-modname="$(basename ${module})"
-grep -qsPo "^\s*override ${modname%.ko} \* extra\/openvwitch" \
-$RPM_BUILD_ROOT/etc/depmod.d/kmod-openvswitch.conf || \
-echo "override ${modname%.ko} * extra/openvswitch" >> \
-$RPM_BUILD_R

[ovs-dev] [PATCH 0/6] Remove OVS kernel driver

2022-07-06 Thread Greg Rose
It is time to remove support for the OVS kernel driver and push
towards use of the upstream Linux openvswitch kernel driver
in it's place [1].

There are many Linux specific source modules in the datapath that
will need eventual removal but some headers are still required for
the userspace code (which seems counterintuitive but...)

1.  https://mail.openvswitch.org/pipermail/ovs-dev/2022-April/393292.html

Greg Rose (6):
  acinclude.m4: Remove support for building the OVS kernel module
  rhel: Remove kernel mode spec
  rhel: Remove RHEL 6 kernel module spec
  tests: Remove support for check-kmod test
  Documentation: Remove kernel module documentation
  Disable unsupported kernel builds

 .github/workflows/build-and-test.yml  |  53 --
 Documentation/faq/releases.rst|   5 +-
 .../contributing/backporting-patches.rst  |   7 +
 Documentation/intro/install/fedora.rst|  24 -
 Documentation/intro/install/general.rst   |  63 --
 acinclude.m4  | 683 +-
 rhel/automake.mk  |  17 -
 rhel/kmod-openvswitch-rhel6.spec.in   | 123 
 rhel/openvswitch-kmod-fedora.spec.in  | 152 
 tests/automake.mk |   6 -
 10 files changed, 11 insertions(+), 1122 deletions(-)
 delete mode 100644 rhel/kmod-openvswitch-rhel6.spec.in
 delete mode 100644 rhel/openvswitch-kmod-fedora.spec.in

-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [RFC PATCH 6/6] Disable unsupported kernel builds

2022-04-15 Thread Greg Rose
Remove kernel based github workflows since the OVS kernel driver is
no longer supported since Release 2.17

Signed-off-by: Greg Rose 
---
 .github/workflows/build-and-test.yml | 35 
 1 file changed, 35 deletions(-)

diff --git a/.github/workflows/build-and-test.yml 
b/.github/workflows/build-and-test.yml
index eac3504e4..cf483dc1e 100644
--- a/.github/workflows/build-and-test.yml
+++ b/.github/workflows/build-and-test.yml
@@ -9,16 +9,9 @@ jobs:
 automake libtool gcc bc libjemalloc1 libjemalloc-dev\
 libssl-dev llvm-dev libelf-dev libnuma-dev libpcap-dev  \
 ninja-build selinux-policy-dev
-  deb_dependencies: |
-linux-headers-$(uname -r) build-essential fakeroot devscripts equivs
-  AFXDP:   ${{ matrix.afxdp }}
-  ASAN:${{ matrix.asan }}
   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 }}
@@ -37,14 +30,6 @@ jobs:
   - compiler: clang
 opts: --disable-ssl
 
-  - compiler: gcc
-testsuite:test
-kernel:   3.16
-  - compiler: clang
-testsuite:test
-kernel:   3.16
-asan: asan
-
   - compiler: gcc
 testsuite:test
 opts: --enable-shared
@@ -66,23 +51,6 @@ jobs:
 testsuite:test
 libs: -ljemalloc
 
-  - compiler: gcc
-kernel_list:  5.8 5.5 5.4 4.19
-  - compiler: clang
-kernel_list:  5.8 5.5 5.4 4.19
-
-  - compiler: gcc
-kernel_list:  4.14 4.9 4.4 3.16
-  - compiler: clang
-kernel_list:  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
@@ -106,9 +74,6 @@ jobs:
 m32:  m32
 opts: --disable-ssl
 
-  - compiler: gcc
-deb_package:  deb
-
 steps:
 - name: checkout
   uses: actions/checkout@v2
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [RFC PATCH 5/6] Documentation: Remove kernel module documentation

2022-04-15 Thread Greg Rose
As of Open vSwitch release 2.17 the OVS kernel module is no longer
supported.  Pull the documentation references.

Signed-off-by: Greg Rose 
---
 Documentation/faq/releases.rst|  5 +-
 .../contributing/backporting-patches.rst  |  7 +++
 Documentation/intro/install/fedora.rst| 24 ---
 Documentation/intro/install/general.rst   | 63 ---
 4 files changed, 10 insertions(+), 89 deletions(-)

diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index 5edc1e204..1b4c27b7d 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -74,7 +74,7 @@ Q: What Linux kernel versions does each Open vSwitch release 
work with?
 2.14.x   3.16 to 5.5
 2.15.x   3.16 to 5.8
 2.16.x   3.16 to 5.8
-2.17.x   3.16 to 5.8
+2.17.x   N/A
  ==
 
 Open vSwitch userspace should also work with the Linux kernel module built
@@ -110,7 +110,8 @@ Q: Are all features available with all datapaths?
 Linux OVS tree
   The datapath implemented by the Linux kernel module distributed with
   the OVS source tree. This datapath is deprecated starting with OVS
-  2.15.x and support capped at Linux kernel version 5.8.
+  2.15.x and support capped at Linux kernel version 5.8. As of OVS 2.17.x
+  the Linux OVS tree is no longer supported.
 
 Userspace
   This datapath supports conventional system devices as well as
diff --git a/Documentation/internals/contributing/backporting-patches.rst 
b/Documentation/internals/contributing/backporting-patches.rst
index 162e9d209..8370c954d 100644
--- a/Documentation/internals/contributing/backporting-patches.rst
+++ b/Documentation/internals/contributing/backporting-patches.rst
@@ -119,6 +119,13 @@ userspace changes.
 How to backport kernel patches
 ~~
 
+These instructions only apply to Open vSwitch releases 2.16 and older.
+As of Open vSwitch branch 2.17 the Open vSwitch kernel module is no
+longer supported and only the Linux openvswitch kernel module is used.
+In the case of Open vSwitch releases 2.16 and older kernel backports
+may be required for bux fixes and feature implementation so these
+instructions are preserved for that reason.
+
 First, the patch should be submitted upstream to `netdev`. When the patch has
 been applied to `net-next`, it is ready to be backported. Starting from the
 Linux tree, use ``git format-patch`` to format each patch that should be
diff --git a/Documentation/intro/install/fedora.rst 
b/Documentation/intro/install/fedora.rst
index 06a0bd3d5..02481597f 100644
--- a/Documentation/intro/install/fedora.rst
+++ b/Documentation/intro/install/fedora.rst
@@ -132,36 +132,12 @@ tests.  This can take several minutes.
 $ make rpm-fedora RPMBUILD_OPT="--with check"
 
 
-Kernel OVS Tree Datapath RPM
-
-
-To build the Open vSwitch kernel module for the currently running kernel
-version, run:
-
-::
-
-$ make rpm-fedora-kmod
-
-To build the Open vSwitch kernel module for another kernel version, the desired
-kernel version can be specified via the `kversion` macro.  For example:
-
-::
-
-$ make rpm-fedora-kmod \
- RPMBUILD_OPT='-D "kversion 4.3.4-300.fc23.x86_64"'
-
 Installing
 --
 
 RPM packages can be installed by using the command ``rpm -i``. Package
 installation requires superuser privileges.
 
-The `openvswitch-kmod` RPM should be installed first if the Linux OVS tree
-datapath module is to be used. The `openvswitch-kmod` RPM should not be
-installed if only the in-tree Linux datapath or user-space datapath is needed.
-Refer to the :doc:`/faq/index` for more information about the various Open
-vSwitch datapath options.
-
 In most cases only the `openvswitch` RPM will need to be installed. The
 `python3-openvswitch`, `openvswitch-test`, `openvswitch-devel`, and
 `openvswitch-debuginfo` RPMs are optional unless required for a specific
diff --git a/Documentation/intro/install/general.rst 
b/Documentation/intro/install/general.rst
index a297aadac..c2208bbed 100644
--- a/Documentation/intro/install/general.rst
+++ b/Documentation/intro/install/general.rst
@@ -302,24 +302,6 @@ example::
 
 $ ./configure CFLAGS="-g -O2 -fsanitize=address -fno-omit-frame-pointer 
-fno-common"
 
-To build the Linux kernel module, so that you can run the kernel-based switch,
-pass the location of the kernel build directory on ``--with-linux``. For
-example, to build for a running instance of Linux::
-
-$ ./configure --with-linux=/lib/modules/$(uname -r)/build
-
-.. note::
-  If ``--with-linux`` requests building for an unsupported version of Linux,
-  then ``configure`` will fail with an error message. Refer to the
-  :doc:`/faq/index` for advice in that case.
-
-If you wish to build the kernel module for an architecture other than the
-architecture of the machine used for the build, you may sp

[ovs-dev] [RFC PATCH 1/6] acinclude.m4: Remove support for building the OVS kernel module

2022-04-15 Thread Greg Rose
Since the openvswitch project inception it has had support for building
a Linux kernel module to support the OVS kernel datapath.  Since Linux
kernel release 5.8 support for newer kernels has been deprecated.  Now
is the time to fully discontinue support for building the openvswitch
kernel driver. Since Linux 5.9 the Linux built-in openvswitch kernel
driver supports all necessary features and functions of the kernel
datapath and the need to support this additional "out of tree" kernel
module is gone.

Remove the --with-linux configuration support from the acinclude.m4
configuration and warn user it is not supported any longer.

Signed-off-by: Greg Rose 
---
 acinclude.m4 | 683 +--
 1 file changed, 1 insertion(+), 682 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index 61e88105f..0b1be92f7 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -117,132 +117,11 @@ dnl OVS_CHECK_LINUX
 dnl
 dnl Configure linux kernel source tree
 AC_DEFUN([OVS_CHECK_LINUX], [
-  AC_ARG_WITH([linux],
-  [AC_HELP_STRING([--with-linux=/path/to/linux],
-  [Specify the Linux kernel build directory])])
-  AC_ARG_WITH([linux-source],
-  [AC_HELP_STRING([--with-linux-source=/path/to/linux-source],
-  [Specify the Linux kernel source directory
-   (usually figured out automatically from build
-   directory)])])
-
-  # Deprecated equivalents to --with-linux, --with-linux-source.
-  AC_ARG_WITH([l26])
-  AC_ARG_WITH([l26-source])
-
   if test X"$with_linux" != X; then
-KBUILD=$with_linux
-AC_MSG_WARN([--with-linux is deprecated and kernel support is limited to 
5.8 and below])
-  elif test X"$with_l26" != X; then
-KBUILD=$with_l26
-AC_MSG_WARN([--with-l26 is deprecated, please use --with-linux instead])
-  else
+AC_MSG_WARN([--with-linux is no longer supported])
 KBUILD=
   fi
 
-  if test X"$KBUILD" != X; then
-if test X"$with_linux_source" != X; then
-  KSRC=$with_linux_source
-elif test X"$with_l26_source" != X; then
-  KSRC=$with_l26_source
-  AC_MSG_WARN([--with-l26-source is deprecated, please use 
--with-linux-source instead])
-else
-  KSRC=
-fi
-  elif test X"$with_linux_source" != X || test X"$with_l26_source" != X; then
-AC_MSG_ERROR([Linux source directory may not be specified without Linux 
build directory])
-  fi
-
-  if test -n "$KBUILD"; then
-KBUILD=`eval echo "$KBUILD"`
-case $KBUILD in
-/*) ;;
-*) KBUILD=`pwd`/$KBUILD ;;
-esac
-
-# The build directory is what the user provided.
-# Make sure that it exists.
-AC_MSG_CHECKING([for Linux build directory])
-if test -d "$KBUILD"; then
-AC_MSG_RESULT([$KBUILD])
-AC_SUBST(KBUILD)
-else
-AC_MSG_RESULT([no])
-AC_ERROR([source dir $KBUILD doesn't exist])
-fi
-
-# Debian breaks kernel headers into "source" header and "build" headers.
-# We want the source headers, but $KBUILD gives us the "build" headers.
-# Use heuristics to find the source headers.
-AC_MSG_CHECKING([for Linux source directory])
-if test -n "$KSRC"; then
-  KSRC=`eval echo "$KSRC"`
-  case $KSRC in
-  /*) ;;
-  *) KSRC=`pwd`/$KSRC ;;
-  esac
-  if test ! -e $KSRC/include/linux/kernel.h; then
-AC_MSG_ERROR([$KSRC is not a kernel source directory])
-  fi
-else
-  KSRC=$KBUILD
-  if test ! -e $KSRC/include/linux/kernel.h; then
-# Debian kernel build Makefiles tend to include a line of the form:
-# MAKEARGS := -C /usr/src/linux-headers-3.2.0-1-common 
O=/usr/src/linux-headers-3.2.0-1-486
-# First try to extract the source directory from this line.
-KSRC=`sed -n 's/.*-C \([[^ ]]*\).*/\1/p' "$KBUILD"/Makefile`
-if test ! -e "$KSRC"/include/linux/kernel.h; then
-  # Didn't work.  Fall back to name-based heuristics that used to work.
-  case `echo "$KBUILD" | sed 's,/*$,,'` in # (
-*/build)
-  KSRC=`echo "$KBUILD" | sed 's,/build/*$,/source,'`
-  ;; # (
-*)
-  KSRC=`(cd $KBUILD && pwd -P) | sed 's,-[[^-]]*$,-common,'`
-  ;;
-  esac
-fi
-  fi
-  if test ! -e "$KSRC"/include/linux/kernel.h; then
-AC_MSG_ERROR([cannot find source directory (please use 
--with-linux-source)])
-  fi
-fi
-AC_MSG_RESULT([$KSRC])
-
-AC_MSG_CHECKING([for kernel version])
-version=`sed -n 's/^VERSION = //p' "$KSRC/Makefile"`
-patchlevel=`sed -n 's/^PATCHLEVEL = //p' "$KSRC/Makefile"`
-sublevel=`sed -n 's/^SUBLEVEL = //p' "

[ovs-dev] [RFC PATCH 4/6] tests: Remove support for check-kmod test

2022-04-15 Thread Greg Rose
The OVS kernel module is no longer supported as of OVS 2.17

Signed-off-by: Greg Rose 
---
 tests/automake.mk | 6 --
 1 file changed, 6 deletions(-)

diff --git a/tests/automake.mk b/tests/automake.mk
index 8a9151f81..90a38b9bf 100644
--- a/tests/automake.mk
+++ b/tests/automake.mk
@@ -342,12 +342,6 @@ check-kernel: all
set $(SHELL) '$(SYSTEM_KMOD_TESTSUITE)' -C tests  
AUTOTEST_PATH='$(AUTOTEST_PATH)'; \
"$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && "$$@" 
--recheck)
 
-# Testing the out of tree Kernel module
-check-kmod: all
-   $(MAKE) modules_install
-   modprobe -r -a vport-geneve vport-gre vport-lisp vport-stt vport-vxlan 
openvswitch
-   $(MAKE) check-kernel
-
 check-system-userspace: all
set $(SHELL) '$(SYSTEM_USERSPACE_TESTSUITE)' -C tests  
AUTOTEST_PATH='$(AUTOTEST_PATH)'; \
"$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && "$$@" 
--recheck)
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [RFC PATCH 2/6] rhel: Remove kernel mode spec

2022-04-15 Thread Greg Rose
Remove the kernel driver specification for RHEL 7.x, 8.x and Fedora.

Signed-off-by: Greg Rose 
---
 rhel/automake.mk |  12 ---
 rhel/openvswitch-kmod-fedora.spec.in | 152 ---
 2 files changed, 164 deletions(-)
 delete mode 100644 rhel/openvswitch-kmod-fedora.spec.in

diff --git a/rhel/automake.mk b/rhel/automake.mk
index c75406e05..235779b49 100644
--- a/rhel/automake.mk
+++ b/rhel/automake.mk
@@ -17,8 +17,6 @@ EXTRA_DIST += \
rhel/openvswitch-dkms.spec.in \
rhel/kmod-openvswitch-rhel6.spec \
rhel/kmod-openvswitch-rhel6.spec.in \
-   rhel/openvswitch-kmod-fedora.spec \
-   rhel/openvswitch-kmod-fedora.spec.in \
rhel/openvswitch.spec \
rhel/openvswitch.spec.in \
rhel/openvswitch-fedora.spec \
@@ -47,9 +45,6 @@ $(srcdir)/rhel/openvswitch-dkms.spec: 
rhel/openvswitch-dkms.spec.in $(top_buildd
 $(srcdir)/rhel/kmod-openvswitch-rhel6.spec: 
rhel/kmod-openvswitch-rhel6.spec.in $(top_builddir)/config.status
$(update_rhel_spec)
 
-$(srcdir)/rhel/openvswitch-kmod-fedora.spec: 
rhel/openvswitch-kmod-fedora.spec.in $(top_builddir)/config.status
-   $(update_rhel_spec)
-
 $(srcdir)/rhel/openvswitch.spec: rhel/openvswitch.spec.in 
$(top_builddir)/config.status
$(update_rhel_spec)
 
@@ -67,10 +62,3 @@ rpm-fedora: dist $(srcdir)/rhel/openvswitch-fedora.spec
  -D "_topdir ${RPMBUILD_TOP}" \
  -ba $(srcdir)/rhel/openvswitch-fedora.spec
 
-# Build kernel datapath RPM
-rpm-fedora-kmod: dist $(srcdir)/rhel/openvswitch-kmod-fedora.spec
-   ${MKDIR_P} ${RPMBUILD_TOP}/SOURCES
-   cp ${DIST_ARCHIVES} ${RPMBUILD_TOP}/SOURCES
-   rpmbuild -D "kversion $(shell uname -r)" ${RPMBUILD_OPT} \
- -D "_topdir ${RPMBUILD_TOP}" \
- -ba $(srcdir)/rhel/openvswitch-kmod-fedora.spec
diff --git a/rhel/openvswitch-kmod-fedora.spec.in 
b/rhel/openvswitch-kmod-fedora.spec.in
deleted file mode 100644
index e5f78701f..0
--- a/rhel/openvswitch-kmod-fedora.spec.in
+++ /dev/null
@@ -1,152 +0,0 @@
-# Spec file for Open vSwitch.
-
-# Copyright (C) 2009, 2010, 2015, 2018 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.
-
-%global debug_package %{nil}
-
-# Use the kversion macro such as
-# RPMBUILD_OPT='-D "kversion 3.10.0-693.1.1.el7.x86_64 
3.10.0-693.17.1.el7.x86_64"'
-# to build package for mulitple kernel versions in the same package
-# This only works for the following kernels.
-#   - 3.10.0 major revision 327  (RHEL 7.2)
-#   - 3.10.0 major revision 693  (RHEL 7.4)
-#   - 3.10.0 major revision 957  (RHEL 7.6)
-#   - 3.10.0 major revision 1062 (RHEL 7.7)
-#   - 3.10.0 major revision 1101 (RHEL 7.8 Beta)
-#   - 3.10.0 major revision 1127 (RHEL 7.8 GA)
-#   - 3.10.0 major revision 1160 (RHEL 7.9 GA)
-# By default, build against the current running kernel version
-#%define kernel 3.1.5-1.fc16.x86_64
-#define kernel %{kernel_source}
-%{?kversion:%define kernel %kversion}
-
-%{!?release_number:%define release_number 1}
-
-Name: openvswitch-kmod
-Summary: Open vSwitch Kernel Modules
-Group: System Environment/Daemons
-URL: http://www.openvswitch.org/
-Vendor: OpenSource Security Ralf Spenneberg 
-Version: @VERSION@
-
-# The entire source code is ASL 2.0 except datapath/ which is GPLv2
-License: GPLv2
-Release: %{release_number}%{?dist}
-Source: openvswitch-%{version}.tar.gz
-#Source1: openvswitch-init
-Buildroot: /tmp/openvswitch-xen-rpm
-Provides: kmod-openvswitch
-Obsoletes: kmod-openvswitch < %{version}-%{release}
-
-%description
-Open vSwitch provides standard network bridging functions augmented with
-support for the OpenFlow protocol for remote per-flow control of
-traffic. This package contains the kernel modules.
-
-%prep
-%setup -q -n openvswitch-%{version}
-
-%build
-for kv in %{kversion}; do
-mkdir -p _$kv
-(cd _$kv && /bin/cp -f ../configure . && %configure --srcdir=.. \
---with-linux=/lib/modules/${kv}/build --enable-ssl 
%{_ovs_config_extra_flags})
-make %{_smp_mflags} -C _$kv/datapath/linux
-done
-
-%install
-export INSTALL_MOD_DIR=extra/openvswitch
-rm -rf $RPM_BUILD_ROOT
-for kv in %{kversion}; do
-make INSTALL_MOD_PATH=$RPM_BUILD_ROOT -C _$kv/datapath/linux 
modules_install
-done
-mkdir -p $RPM_BUILD_ROOT/etc/depmod.d
-for kv in %{kversion}; do
-for module in $RPM_BUILD_ROOT/lib/modules/${kv}/extra/openvswitch/*.ko
-do
-modname="$(basename ${module})"
-grep -qsPo "^\s*override ${modname%.ko} \* extra\/openvwitch" \
-$RPM_BUILD_ROOT/etc/depmod.d/kmod-openvswitch.conf || \
-echo "override ${modname%.ko} * extra/openvswitch" >> \
-$RPM_BUILD_R

[ovs-dev] [RFC PATCH 3/6] rhel: Remove RHEL 6 kernel module spec

2022-04-15 Thread Greg Rose
Remove the RHEL 6 kernel driver module specification.

Signed-off-by: Greg Rose 
---
 rhel/automake.mk|   5 --
 rhel/kmod-openvswitch-rhel6.spec.in | 123 
 2 files changed, 128 deletions(-)
 delete mode 100644 rhel/kmod-openvswitch-rhel6.spec.in

diff --git a/rhel/automake.mk b/rhel/automake.mk
index 235779b49..e0f5ec013 100644
--- a/rhel/automake.mk
+++ b/rhel/automake.mk
@@ -15,8 +15,6 @@ EXTRA_DIST += \
rhel/etc_sysconfig_network-scripts_ifup-ovs \
rhel/openvswitch-dkms.spec \
rhel/openvswitch-dkms.spec.in \
-   rhel/kmod-openvswitch-rhel6.spec \
-   rhel/kmod-openvswitch-rhel6.spec.in \
rhel/openvswitch.spec \
rhel/openvswitch.spec.in \
rhel/openvswitch-fedora.spec \
@@ -42,9 +40,6 @@ update_rhel_spec = \
 $(srcdir)/rhel/openvswitch-dkms.spec: rhel/openvswitch-dkms.spec.in 
$(top_builddir)/config.status
$(update_rhel_spec)
 
-$(srcdir)/rhel/kmod-openvswitch-rhel6.spec: 
rhel/kmod-openvswitch-rhel6.spec.in $(top_builddir)/config.status
-   $(update_rhel_spec)
-
 $(srcdir)/rhel/openvswitch.spec: rhel/openvswitch.spec.in 
$(top_builddir)/config.status
$(update_rhel_spec)
 
diff --git a/rhel/kmod-openvswitch-rhel6.spec.in 
b/rhel/kmod-openvswitch-rhel6.spec.in
deleted file mode 100644
index de69863d7..0
--- a/rhel/kmod-openvswitch-rhel6.spec.in
+++ /dev/null
@@ -1,123 +0,0 @@
-# Spec file for Open vSwitch kernel modules on Red Hat Enterprise
-# Linux 6.
-
-# Copyright (C) 2011, 2012, 2018 Nicira, 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.
-
-%define oname openvswitch
-%{!?release_number:%define release_number 1}
-
-Name:   kmod-%{oname}
-Version:@VERSION@
-Release:%{release_number}%{?dist}
-Summary:Open vSwitch kernel module
-
-Group:  System/Kernel
-License:GPLv2
-URL:http://openvswitch.org/
-Source0:%{oname}-%{version}.tar.gz
-BuildRoot:  %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XX)
-
-# Without this we get an empty openvswitch-debuginfo package (whose name
-# conflicts with the openvswitch-debuginfo package for OVS userspace).
-%undefine _enable_debug_packages
-
-%define kernel_source_extended() /usr/src/kernels/%{2}$([ %{1} = default ] || 
echo ".%{1}")
-
-# Use -D 'kversion 2.6.32-131.6.1.el6.x86_64' to build package
-# for specified kernel version.
-# Use -D 'kversion 3.10.0-693.1.1.el7.x86_64 3.10.0-693.17.1.el7.x86_64'
-# to build package for mulitple kernel versions in the same package
-# This only works for kernel 3.10.0 major revision 693 (RHEL 7.4)
-# and major revision 327 (RHEL 7.2)
-# By default, build against the latest installed kernel-devel
-%{!?kversion:%global kversion %(rpm -qa | egrep "^kernel(-rt|-aarch64)?-devel" 
| /usr/lib/rpm/redhat/rpmsort -r | head -n 1| sed "s/^kernel.*-devel-//")}
-
-# Use -D 'kflavors default debug kdump' to build packages for
-# specified kernel variants.
-%{!?kflavors:%global kflavors default}
-
-%description
-Open vSwitch Linux kernel module.
-
-%prep
-
-%setup -n %{oname}-%{version}
-
-%build
-for kv in %{kversion}; do
-for flavor in %{kflavors}; do
-mkdir -p _$flavor/_$kv
-(cd _$flavor/_$kv && ../../configure 
--with-linux="%{kernel_source_extended $flavor $kv}")
-%{__make} -C _$flavor/_$kv/datapath/linux %{?_smp_mflags}
-done
-done
-
-%install
-export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
-export INSTALL_MOD_DIR=extra/%{oname}
-for kv in %{kversion}; do
-for flavor in %{kflavors} ; do
-make -C %{kernel_source_extended $flavor $kv} modules_install \
-M="`pwd`"/_$flavor/_$kv/datapath/linux
-# Cleanup unnecessary kernel-generated module dependency files.
-find $INSTALL_MOD_PATH/lib/modules -iname 'modules.*' -exec rm {} \;
-done
-done
-install -d %{buildroot}%{_sysconfdir}/depmod.d/
-for kv in %{kversion}; do
-for module in %{buildroot}/lib/modules/$kv/$INSTALL_MOD_DIR/*.ko;
-do
-modname="$(basename ${module})"
-grep -qsPo "^\s*override ${modname%.ko} \* extra\/%{oname}" 
%{oname}.conf || \
-echo "override ${modname%.ko} * extra/%{oname}" >> %{oname}.conf
-grep -qsPo "^\s*override ${modname%.ko} \* weak-updates\/%{oname}" 
%{oname}.conf || \
-echo "override ${modname%.ko} * weak-updates/%{oname}" >> 
%{oname}.conf
-done
-done
-install -m 644 %{oname}.conf %{buildroot}%{_sysconfdir}/depmod.d/
-install -d -m 0755 $RPM_BUILD_ROOT/usr/share/%{oname}/scripts
-install -p -m 0755 rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh \
-$RPM_BUILD_ROOT/usr/share/%{oname}/scr

[ovs-dev] [RFC PATCH 0/6] Remove OVS kernel driver

2022-04-15 Thread Greg Rose
It is time to remove support for the OVS kernel driver and push
towards use of the upstream Linux openvswitch kernel driver
in it's place [1].

This patch series represents a first attempt but there are a few
primary remaining issues that I have yet to address.

A) Removal of debian packing support for the dkms kernel driver
   module. The debian/rules are not well known to me - I've never
   actually made any changes in that area and do not have a
   well formed understanding of how debian packaging works.  I wil
   attempt to fix that up in upcoming patch series.
B) Figuring out how the github workflow - I removed the tests I
   could find that depend on the Linux kernel (i.e. they use
   install_kernel() function.  Several other tests are  failing
   that would not seem to depend on the Linux kernel.  I need to
   read and understand that code better.
C) There are many Linux specific source modules in the datapath that
   will need eventual removal but some headers are still required for
   the userspace code (which seems counterintuitive but...)

Reviews, suggestions, etc. are appreciated!

1.  https://mail.openvswitch.org/pipermail/ovs-dev/2022-April/393292.html

Greg Rose (6):
  acinclude.m4: Remove support for building the OVS kernel module
  rhel: Remove kernel mode spec
  rhel: Remove RHEL 6 kernel module spec
  tests: Remove support for check-kmod test
  Documentation: Remove kernel module documentation
  Disable unsupported kernel builds

 .github/workflows/build-and-test.yml  |  35 -
 Documentation/faq/releases.rst|   5 +-
 .../contributing/backporting-patches.rst  |   7 +
 Documentation/intro/install/fedora.rst|  24 -
 Documentation/intro/install/general.rst   |  63 --
 acinclude.m4  | 683 +-
 rhel/automake.mk  |  17 -
 rhel/kmod-openvswitch-rhel6.spec.in   | 123 
 rhel/openvswitch-kmod-fedora.spec.in  | 152 
 tests/automake.mk |   6 -
 10 files changed, 11 insertions(+), 1104 deletions(-)
 delete mode 100644 rhel/kmod-openvswitch-rhel6.spec.in
 delete mode 100644 rhel/openvswitch-kmod-fedora.spec.in

-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH] rhel: Fix dual kernel rpm install for RHEL 8.4

2021-08-23 Thread Greg Rose
RHEL 8.4 is the first of the RHEL 8.x kernels that has broken ABI so
it requires the same sort of fix as we did for several RHEL 7.x kernel
that needed two kernel rpms to work for all minor revisions of the
baseline kernel module.

Signed-off-by: Greg Rose 
---
 rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh | 8 
 1 file changed, 8 insertions(+)

diff --git a/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh 
b/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh
index 22bebaa58..01d31a216 100644
--- a/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh
+++ b/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh
@@ -24,6 +24,7 @@
 #   - 3.10.0 major revision 1160 (RHEL 7.9)
 #   - 4.4.x,  x >= 73   (SLES 12 SP3)
 #   - 4.12.x, x >= 14   (SLES 12 SP4).
+#   - 4.18.x major revision 305  (RHEL 8.4)
 # It is packaged in the openvswitch kmod RPM and run in the post-install
 # scripts.
 #
@@ -139,6 +140,13 @@ elif [ "$mainline_major" = "4" ] && [ "$mainline_minor" = 
"12" ]; then
 ver_offset=2
 installed_ver="$mainline_patch"
 fi
+elif [ "$mainline_major" = "4" ] && [ "$mainline_minor" = "18" ]; then
+if [ "$major_rev" = "305" ]; then
+echo "rhel84"
+comp_ver=9
+ver_offset=4
+installed_ver="$minor_rev"
+fi
 fi
 
 if [ X"$ver_offset" = X ]; then
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH] rhel: Do not update kmod RPM newer major revision kernels

2021-02-09 Thread Greg Rose
The ovs-kmod-manage.sh script will run weak-updates even on newer
release kernels installing a non-compatible or un-runnable kernel
module.

Update the script to never install weak-updates onto kernels with
newer major release versions.

VMware-BZ: #2717283
Signed-off-by: Greg Rose 
---
 rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh 
b/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh
index f147857e4..66b09472a 100644
--- a/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh
+++ b/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh
@@ -155,6 +155,16 @@ kmod_versions=()
 kversion=$(rpm -ql ${rpmname} | grep '\.ko$' | \
sed -n -e 's/^\/lib\/modules\/\(.*\)\/extra\/.*$/\1/p' | \
sort | uniq)
+
+IFS='.\|-' read installed_major installed_minor installed_patch \
+installed_major_rev installed_minor_rev installed_extra <<<"${kversion}"
+
+if [ "$installed_major_rev" -lt "$major_rev" ]; then
+echo Not installing RPM with major revision "$installed_major_rev" \
+to kernel with greater major revision "$major_rev.  Exiting"
+exit 1
+fi
+
 for kv in $kversion; do
 IFS='.\|-' read -r -a kv_nums <<<"${kv}"
 kmod_versions+=(${kv_nums[$ver_offset]})
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V5 2/2] acinclude: Warn when --with-linux parameter is supplied

2021-01-12 Thread Greg Rose
Building the Linux kernel driver from the Open vSwitch source tree
is deprecated.  Emit a warning when the '--with-linux' configure
parameter is supplied to remind the user.

Signed-off-by: Greg Rose 

---
V5 - Change wording to clarify the OVS source tree.
`
---
 acinclude.m4 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/acinclude.m4 b/acinclude.m4
index 60871f67a..3432e1f9b 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -77,6 +77,7 @@ AC_DEFUN([OVS_CHECK_LINUX], [
 
   if test X"$with_linux" != X; then
 KBUILD=$with_linux
+AC_MSG_WARN([--with-linux is deprecated and kernel support is limited to 
5.8 and below])
   elif test X"$with_l26" != X; then
 KBUILD=$with_l26
 AC_MSG_WARN([--with-l26 is deprecated, please use --with-linux instead])
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V5 1/2] doc: Deprecate building Linux kernel module from OVS source tree

2021-01-12 Thread Greg Rose
It is decided (1) to deprecate building the Linux kernel module
from the Open vSwitch source tree.

Update the NEWS and FAQ to provide notice.

1. https://mail.openvswitch.org/pipermail/ovs-dev/2020-December/378831.html

Signed-off-by: Greg Rose 
---
V2 - s/driver/module and add notice for when the OOT module will be
 completely removed
V4 - Reword the faq and NEWS as suggested by Ilya and Ben
V5 - Further word smithing to clarify building the Linux kernel module
 from Open vSwitch source tree.
---
 Documentation/faq/releases.rst | 11 +--
 NEWS   |  5 +
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index 4b9620015..9638d3196 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -85,6 +85,12 @@ Q: What Linux kernel versions does each Open vSwitch release 
work with?
 RHEL and CentOS 7 3.10 based kernels since they have diverged from the
 Linux kernel.org 3.10 kernels.
 
+Starting with Open vSwitch 2.15, building the Linux kernel module from
+the Open vSwitch source tree is deprecated.  It will not be updated to
+support Linux versions later than 5.8.  We will remove the kernel module
+source code from the Open vSwitch source tree for the Open vSwitch 2.18
+release.
+
 Q: Are all features available with all datapaths?
 
 A: Open vSwitch supports different datapaths on different platforms.  Each
@@ -100,8 +106,9 @@ Q: Are all features available with all datapaths?
   feature.
 
 Linux OVS tree
-  The datapath implemented by the Linux kernel module distributed with the
-  OVS source tree.
+  The datapath implemented by the Linux kernel module distributed with
+  the OVS source tree. This datapath is deprecated starting with OVS
+  2.15.x and support capped at Linux kernel version 5.8.
 
 Userspace
   This datapath supports conventional system devices as well as
diff --git a/NEWS b/NEWS
index 617fe8e6a..75048abb9 100644
--- a/NEWS
+++ b/NEWS
@@ -43,6 +43,11 @@ Post-v2.14.0
tearing down IPsec tunnels.
  * Add option '--no-restart-ike-daemon' to allow ovs-monitor-ipsec to start
without restarting ipsec daemon.
+   - Building the Linux kernel module from the OVS source tree is deprecated
+ * Support for the Linux kernel is capped at version 5.8
+ * Only bug fixes for the Linux OOT kernel module will be accepted.
+ * The Linux OOT kernel module will be fully removed in OVS branch
+   2.18
 
 
 v2.14.0 - 17 Aug 2020
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V5 0/2] Deprecate Linux kernel module

2021-01-12 Thread Greg Rose
As agreed in (1) deprecate building the Linux kernel module from
the Open vSwitch source tree.

github Build and Test here:
https://github.com/gvrose8192/ovs-experimental/actions/runs/480920378

1. https://mail.openvswitch.org/pipermail/ovs-dev/2020-December

Greg Rose (2):
  doc: Deprecate building Linux kernel module from OVS source tree
  acinclude: Warn when --with-linux parameter is supplied

 Documentation/faq/releases.rst | 11 +--
 NEWS   |  5 +
 acinclude.m4   |  1 +
 3 files changed, 15 insertions(+), 2 deletions(-)

-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V4 2/2] acinclude: Warn when --with-linux parameter is supplied

2021-01-11 Thread Greg Rose
The Linux Out of Tree kernel driver is deprecated.  Emit a warning
when the '--with-linux' configure parameter is supplied to remind
the user.

Signed-off-by: Greg Rose 
---
 acinclude.m4 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/acinclude.m4 b/acinclude.m4
index 60871f67a..3432e1f9b 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -77,6 +77,7 @@ AC_DEFUN([OVS_CHECK_LINUX], [
 
   if test X"$with_linux" != X; then
 KBUILD=$with_linux
+AC_MSG_WARN([--with-linux is deprecated and kernel support is limited to 
5.8 and below])
   elif test X"$with_l26" != X; then
 KBUILD=$with_l26
 AC_MSG_WARN([--with-l26 is deprecated, please use --with-linux instead])
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V4 1/2] doc: Deprecate the Linux Out of Tree module

2021-01-11 Thread Greg Rose
It is decided (1) to deprecate the Linux Out of Tree (OOT) module.
Update the NEWS and FAQ to provide notice.

1. https://mail.openvswitch.org/pipermail/ovs-dev/2020-December/378831.html

Signed-off-by: Greg Rose 
---
V2 - s/driver/module and add notice for when the OOT module will be
 completely removed
V4 - Reword the faq and NEWS as suggested by Ilya and Ben
---
 Documentation/faq/releases.rst | 11 +--
 NEWS   |  5 +
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index 4b9620015..9638d3196 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -85,6 +85,12 @@ Q: What Linux kernel versions does each Open vSwitch release 
work with?
 RHEL and CentOS 7 3.10 based kernels since they have diverged from the
 Linux kernel.org 3.10 kernels.
 
+Starting with Open vSwitch 2.15, building the Linux kernel module from
+the Open vSwitch source tree is deprecated.  It will not be updated to
+support Linux versions later than 5.8.  We will remove the kernel module
+source code from the Open vSwitch source tree for the Open vSwitch 2.18
+release.
+
 Q: Are all features available with all datapaths?
 
 A: Open vSwitch supports different datapaths on different platforms.  Each
@@ -100,8 +106,9 @@ Q: Are all features available with all datapaths?
   feature.
 
 Linux OVS tree
-  The datapath implemented by the Linux kernel module distributed with the
-  OVS source tree.
+  The datapath implemented by the Linux kernel module distributed with
+  the OVS source tree. This datapath is deprecated starting with OVS
+  2.15.x and support capped at Linux kernel version 5.8.
 
 Userspace
   This datapath supports conventional system devices as well as
diff --git a/NEWS b/NEWS
index 617fe8e6a..75048abb9 100644
--- a/NEWS
+++ b/NEWS
@@ -43,6 +43,11 @@ Post-v2.14.0
tearing down IPsec tunnels.
  * Add option '--no-restart-ike-daemon' to allow ovs-monitor-ipsec to start
without restarting ipsec daemon.
+   - Building the Linux kernel module from the OVS source tree is deprecated
+ * Support for the Linux kernel is capped at version 5.8
+ * Only bug fixes for the Linux OOT kernel module will be accepted.
+ * The Linux OOT kernel module will be fully removed in OVS branch
+   2.18
 
 
 v2.14.0 - 17 Aug 2020
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V4 0/2] Deprecate the Linux OOT module

2021-01-11 Thread Greg Rose
As agreed in (1) deprecate the Linux OOT driver.

github Build and Test here:
https://github.com/gvrose8192/ovs-experimental/actions/runs/463987690

1. https://mail.openvswitch.org/pipermail/ovs-dev/2020-December

Greg Rose (2):
  doc: Deprecate the Linux Out of Tree module
  acinclude: Warn when --with-linux parameter is supplied

 Documentation/faq/releases.rst | 11 +--
 NEWS   |  5 +
 acinclude.m4   |  1 +
 3 files changed, 15 insertions(+), 2 deletions(-)

-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V3 1/2] doc: Deprecate the Linux Out of Tree module

2021-01-07 Thread Greg Rose
It is decided (1) to deprecate the Linux Out of Tree (OOT) module.
Update the NEWS and FAQ to provide notice.

1. https://mail.openvswitch.org/pipermail/ovs-dev/2020-December/378831.html

Signed-off-by: Greg Rose 
---
V2 - s/driver/module and add notice for when the OOT module will be
 completely removed
---
 Documentation/faq/releases.rst | 8 +++-
 NEWS   | 5 +
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index 4b9620015..d96894221 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -85,6 +85,11 @@ Q: What Linux kernel versions does each Open vSwitch release 
work with?
 RHEL and CentOS 7 3.10 based kernels since they have diverged from the
 Linux kernel.org 3.10 kernels.
 
+Beginning with Open vSwitch branch 2.15 the Open vSwitch Out of Tree
+(OOT) Linux kernel module is deprecated and support is capped at Linux
+kernel version 5.8. The Linux OOT kernel module will be fully removed
+from Open vSwitch in branch 2.18.
+
 Q: Are all features available with all datapaths?
 
 A: Open vSwitch supports different datapaths on different platforms.  Each
@@ -101,7 +106,8 @@ Q: Are all features available with all datapaths?
 
 Linux OVS tree
   The datapath implemented by the Linux kernel module distributed with the
-  OVS source tree.
+  OVS source tree. This datapath will be deprecated starting with OVS
+  2.15.x and support capped at Linux kernel version 5.8.
 
 Userspace
   This datapath supports conventional system devices as well as
diff --git a/NEWS b/NEWS
index 617fe8e6a..b664d94eb 100644
--- a/NEWS
+++ b/NEWS
@@ -43,6 +43,11 @@ Post-v2.14.0
tearing down IPsec tunnels.
  * Add option '--no-restart-ike-daemon' to allow ovs-monitor-ipsec to start
without restarting ipsec daemon.
+   - Support for the Linux Out of Tree (OOT) kernel module is deprecated
+ * Support for the Linux kernel is capped at version 5.8
+ * Only bug fixes for the Linux OOT kernel module will be accepted.
+ * The Linux OOT kernel module will be fully removed in OVS branch
+   2.18
 
 
 v2.14.0 - 17 Aug 2020
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V3 2/2] acinclude: Warn when --with-linux parameter is supplied

2021-01-07 Thread Greg Rose
The Linux Out of Tree kernel driver is deprecated.  Emit a warning
when the '--with-linux' configure parameter is supplied to remind
the user.

Signed-off-by: Greg Rose 
---
 acinclude.m4 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/acinclude.m4 b/acinclude.m4
index 60871f67a..3432e1f9b 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -77,6 +77,7 @@ AC_DEFUN([OVS_CHECK_LINUX], [
 
   if test X"$with_linux" != X; then
 KBUILD=$with_linux
+AC_MSG_WARN([--with-linux is deprecated and kernel support is limited to 
5.8 and below])
   elif test X"$with_l26" != X; then
 KBUILD=$with_l26
 AC_MSG_WARN([--with-l26 is deprecated, please use --with-linux instead])
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V3 0/2] Deprecate the Linux OOT module

2021-01-07 Thread Greg Rose
As agreed in (1) deprecate the Linux OOT driver.

github Build and Test here:
https://github.com/gvrose8192/ovs-experimental/actions/runs/463987690

1. https://mail.openvswitch.org/pipermail/ovs-dev/2020-December

Greg Rose (2):
  doc: Deprecate the Linux Out of Tree module
  acinclude: Warn when --with-linux parameter is supplied

 Documentation/faq/releases.rst | 8 +++-
 NEWS   | 5 +
 acinclude.m4   | 1 +
 3 files changed, 13 insertions(+), 1 deletion(-)

-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V2 0/2] Deprecate the Linux OOT module

2021-01-07 Thread Greg Rose
As agreed in (1) deprecate the Linux OOT driver.

github Build and Test here:
https://github.com/gvrose8192/ovs-experimental/actions/runs/463987690

1. https://mail.openvswitch.org/pipermail/ovs-dev/2020-December/378831.html

Greg Rose (2):
  doc: Deprecate the Linux Out of Tree module
  acinclude: Warn when --with-linux parameter is supplied

 Documentation/faq/releases.rst | 8 +++-
 NEWS   | 5 +
 acinclude.m4   | 1 +
 3 files changed, 13 insertions(+), 1 deletion(-)

-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V2 2/2] acinclude: Warn when --with-linux parameter is supplied

2021-01-07 Thread Greg Rose
The Linux Out of Tree kernel driver is deprecated.  Emit a warning
when the '--with-linux' configure parameter is supplied to remind
the user.

Signed-off-by: Greg Rose 
---
 acinclude.m4 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/acinclude.m4 b/acinclude.m4
index 60871f67a..3432e1f9b 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -77,6 +77,7 @@ AC_DEFUN([OVS_CHECK_LINUX], [
 
   if test X"$with_linux" != X; then
 KBUILD=$with_linux
+AC_MSG_WARN([--with-linux is deprecated and kernel support is limited to 
5.8 and below])
   elif test X"$with_l26" != X; then
 KBUILD=$with_l26
 AC_MSG_WARN([--with-l26 is deprecated, please use --with-linux instead])
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V2 1/2] doc: Deprecate the Linux Out of Tree module

2021-01-07 Thread Greg Rose
It is decided (1) to deprecate the Linux Out of Tree (OOT) module.
Update the NEWS and FAQ to provide notice.

1. https://mail.openvswitch.org/pipermail/ovs-dev/2020-December/378831.html

Signed-off-by: Greg Rose 
---
 Documentation/faq/releases.rst | 8 +++-
 NEWS   | 5 +
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index 4b9620015..d96894221 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -85,6 +85,11 @@ Q: What Linux kernel versions does each Open vSwitch release 
work with?
 RHEL and CentOS 7 3.10 based kernels since they have diverged from the
 Linux kernel.org 3.10 kernels.
 
+Beginning with Open vSwitch branch 2.15 the Open vSwitch Out of Tree
+(OOT) Linux kernel module is deprecated and support is capped at Linux
+kernel version 5.8. The Linux OOT kernel module will be fully removed
+from Open vSwitch in branch 2.18.
+
 Q: Are all features available with all datapaths?
 
 A: Open vSwitch supports different datapaths on different platforms.  Each
@@ -101,7 +106,8 @@ Q: Are all features available with all datapaths?
 
 Linux OVS tree
   The datapath implemented by the Linux kernel module distributed with the
-  OVS source tree.
+  OVS source tree. This datapath will be deprecated starting with OVS
+  2.15.x and support capped at Linux kernel version 5.8.
 
 Userspace
   This datapath supports conventional system devices as well as
diff --git a/NEWS b/NEWS
index d357da31d..6b64994af 100644
--- a/NEWS
+++ b/NEWS
@@ -35,6 +35,11 @@ Post-v2.14.0
  * Bareudp device support is present in linux kernel from version 5.7
  * Kernel bareudp device is not backported to ovs tree.
  * Userspace datapath support is not added
+   - Support for the Linux Out of Tree (OOT) kernel module is deprecated
+ * Support for the Linux kernel is capped at version 5.8
+ * Only bug fixes for the Linux OOT kernel module will be accepted.
+ * The Linux OOT kernel module will be fully removed in OVS branch
+   2.18
 
 
 v2.14.0 - 17 Aug 2020
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH 2/2] acinclude: Warn when --with-linux parameter is supplied

2021-01-05 Thread Greg Rose
The Linux Out of Tree kernel driver is deprecated.  Emit a warning
when the '--with-linux' configure parameter is supplied to remind
the user.

Signed-off-by: Greg Rose 
---
 acinclude.m4 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/acinclude.m4 b/acinclude.m4
index 60871f67a..3432e1f9b 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -77,6 +77,7 @@ AC_DEFUN([OVS_CHECK_LINUX], [
 
   if test X"$with_linux" != X; then
 KBUILD=$with_linux
+AC_MSG_WARN([--with-linux is deprecated and kernel support is limited to 
5.8 and below])
   elif test X"$with_l26" != X; then
 KBUILD=$with_l26
 AC_MSG_WARN([--with-l26 is deprecated, please use --with-linux instead])
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH 1/2] doc: Deprecate the Linux Out of Tree drivers

2021-01-05 Thread Greg Rose
It is decided (1) to deprecate the Linux Out of Tree (OOT) drivers.
Update the NEWS and FAQ to provide notice.

1. https://mail.openvswitch.org/pipermail/ovs-dev/2020-December/378831.html

Signed-off-by: Greg Rose 
---
 Documentation/faq/releases.rst | 7 ++-
 NEWS   | 3 +++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index 4b9620015..5e0bba4cc 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -85,6 +85,10 @@ Q: What Linux kernel versions does each Open vSwitch release 
work with?
 RHEL and CentOS 7 3.10 based kernels since they have diverged from the
 Linux kernel.org 3.10 kernels.
 
+Beginning with Open vSwitch branch 2.15 the Open vSwitch Out of Tree
+(OOT) Linux kernel driver is deprecated and support is capped at Linux
+kernel version 5.8.
+
 Q: Are all features available with all datapaths?
 
 A: Open vSwitch supports different datapaths on different platforms.  Each
@@ -101,7 +105,8 @@ Q: Are all features available with all datapaths?
 
 Linux OVS tree
   The datapath implemented by the Linux kernel module distributed with the
-  OVS source tree.
+  OVS source tree. This datapath will be deprecated starting with OVS
+  2.15.x and support capped at Linux kernel version 5.8.
 
 Userspace
   This datapath supports conventional system devices as well as
diff --git a/NEWS b/NEWS
index d357da31d..54e9f4db4 100644
--- a/NEWS
+++ b/NEWS
@@ -35,6 +35,9 @@ Post-v2.14.0
  * Bareudp device support is present in linux kernel from version 5.7
  * Kernel bareudp device is not backported to ovs tree.
  * Userspace datapath support is not added
+   - Support for the Linux Out of Tree (OOT) kernel driver is deprecated
+ * Support for the Linux kernel is capped at version 5.8
+ * Only bug fixes for the Linux OOT kernel drivers will be accepted.
 
 
 v2.14.0 - 17 Aug 2020
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH 0/2] Deprecate the Linux OOT driver

2021-01-05 Thread Greg Rose
As agreed in (1) deprecate the Linux OOT driver.

github Build and Test here:
https://github.com/gvrose8192/ovs-experimental/actions/runs/463987690

1. https://mail.openvswitch.org/pipermail/ovs-dev/2020-December/378831.html

Greg Rose (2):
  doc: Deprecate the Linux Out of Tree drivers
  acinclude: Warn when --with-linux parameter is supplied

 Documentation/faq/releases.rst | 7 ++-
 NEWS   | 3 +++
 acinclude.m4   | 1 +
 3 files changed, 10 insertions(+), 1 deletion(-)

-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V2] Update scripts to support RHEL 7.9

2020-11-17 Thread Greg Rose
Add support for RHEL7.9 GA release with kernel 3.10.0-1160

Signed-off-by: Greg Rose 

---
V2 - Correct the author
---
 rhel/openvswitch-kmod-fedora.spec.in  | 6 --
 rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh | 6 ++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/rhel/openvswitch-kmod-fedora.spec.in 
b/rhel/openvswitch-kmod-fedora.spec.in
index 15eec6d4c..ff190064f 100644
--- a/rhel/openvswitch-kmod-fedora.spec.in
+++ b/rhel/openvswitch-kmod-fedora.spec.in
@@ -19,6 +19,7 @@
 #   - 3.10.0 major revision 1062 (RHEL 7.7)
 #   - 3.10.0 major revision 1101 (RHEL 7.8 Beta)
 #   - 3.10.0 major revision 1127 (RHEL 7.8 GA)
+#   - 3.10.0 major revision 1160 (RHEL 7.9 GA)
 # By default, build against the current running kernel version
 #%define kernel 3.1.5-1.fc16.x86_64
 #define kernel %{kernel_source}
@@ -98,8 +99,9 @@ if grep -qs "suse" /etc/os-release; then
 elif [ "$mainline_major" = "3" ] && [ "$mainline_minor" = "10" ] &&
  { [ "$major_rev" = "327" ] || [ "$major_rev" = "693" ] || \
[ "$major_rev" = "957" ] || [ "$major_rev" == "1062" ] || \
-   [ "$major_rev" = "1101" ] || [ "$major_rev" = "1127" ] ; }; then
-# For RHEL 7.2, 7.4, 7.6, 7.7, and 7.8
+   [ "$major_rev" = "1101" ] || [ "$major_rev" = "1127" ] || \
+   [ "$major_rev" = "1160" ] ; }; then
+# For RHEL 7.2, 7.4, 7.6, 7.7, 7.8 and 7.9
 if [ -x "%{_datadir}/openvswitch/scripts/ovs-kmod-manage.sh" ]; then
 %{_datadir}/openvswitch/scripts/ovs-kmod-manage.sh
 fi
diff --git a/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh 
b/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh
index c70e135cd..9bf25a46b 100644
--- a/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh
+++ b/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh
@@ -21,6 +21,7 @@
 #   - 3.10.0 major revision 1062 (RHEL 7.7)
 #   - 3.10.0 major revision 1101 (RHEL 7.8 Beta)
 #   - 3.10.0 major revision 1127 (RHEL 7.8 GA)
+#   - 3.10.0 major revision 1160 (RHEL 7.9)
 #   - 4.4.x,  x >= 73   (SLES 12 SP3)
 #   - 4.12.x, x >= 14   (SLES 12 SP4).
 # It is packaged in the openvswitch kmod RPM and run in the post-install
@@ -118,6 +119,11 @@ if [ "$mainline_major" = "3" ] && [ "$mainline_minor" = 
"10" ]; then
 comp_ver=10
 ver_offset=4
 installed_ver="$minor_rev"
+elif [ "$major_rev" = "1160" ]; then
+#echo "rhel79"
+comp_ver=10
+ver_offset=4
+installed_ver="$minor_rev"
 fi
 elif [ "$mainline_major" = "4" ] && [ "$mainline_minor" = "4" ]; then
 if [ "$mainline_patch" -ge "73" ]; then
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH] Update scripts to support RHEL 7.9

2020-11-17 Thread Greg Rose
From: Greg Rose 

Add support for RHEL7.9 GA release with kernel 3.10.0-1160

Signed-off-by: Greg Rose 
---
 rhel/openvswitch-kmod-fedora.spec.in  | 6 --
 rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh | 6 ++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/rhel/openvswitch-kmod-fedora.spec.in 
b/rhel/openvswitch-kmod-fedora.spec.in
index 15eec6d4c..bdaeadbba 100644
--- a/rhel/openvswitch-kmod-fedora.spec.in
+++ b/rhel/openvswitch-kmod-fedora.spec.in
@@ -19,6 +19,7 @@
 #   - 3.10.0 major revision 1062 (RHEL 7.7)
 #   - 3.10.0 major revision 1101 (RHEL 7.8 Beta)
 #   - 3.10.0 major revision 1127 (RHEL 7.8 GA)
+#   - 3.10.0 major revision  (RHEL 7.9 GA)
 # By default, build against the current running kernel version
 #%define kernel 3.1.5-1.fc16.x86_64
 #define kernel %{kernel_source}
@@ -98,8 +99,9 @@ if grep -qs "suse" /etc/os-release; then
 elif [ "$mainline_major" = "3" ] && [ "$mainline_minor" = "10" ] &&
  { [ "$major_rev" = "327" ] || [ "$major_rev" = "693" ] || \
[ "$major_rev" = "957" ] || [ "$major_rev" == "1062" ] || \
-   [ "$major_rev" = "1101" ] || [ "$major_rev" = "1127" ] ; }; then
-# For RHEL 7.2, 7.4, 7.6, 7.7, and 7.8
+   [ "$major_rev" = "1101" ] || [ "$major_rev" = "1127" ] || \
+   [ "$major_rev" = "1160" ] ; }; then
+# For RHEL 7.2, 7.4, 7.6, 7.7, 7.8 and 7.9
 if [ -x "%{_datadir}/openvswitch/scripts/ovs-kmod-manage.sh" ]; then
 %{_datadir}/openvswitch/scripts/ovs-kmod-manage.sh
 fi
diff --git a/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh 
b/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh
index c70e135cd..9bf25a46b 100644
--- a/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh
+++ b/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh
@@ -21,6 +21,7 @@
 #   - 3.10.0 major revision 1062 (RHEL 7.7)
 #   - 3.10.0 major revision 1101 (RHEL 7.8 Beta)
 #   - 3.10.0 major revision 1127 (RHEL 7.8 GA)
+#   - 3.10.0 major revision 1160 (RHEL 7.9)
 #   - 4.4.x,  x >= 73   (SLES 12 SP3)
 #   - 4.12.x, x >= 14   (SLES 12 SP4).
 # It is packaged in the openvswitch kmod RPM and run in the post-install
@@ -118,6 +119,11 @@ if [ "$mainline_major" = "3" ] && [ "$mainline_minor" = 
"10" ]; then
 comp_ver=10
 ver_offset=4
 installed_ver="$minor_rev"
+elif [ "$major_rev" = "1160" ]; then
+#echo "rhel79"
+comp_ver=10
+ver_offset=4
+installed_ver="$minor_rev"
 fi
 elif [ "$mainline_major" = "4" ] && [ "$mainline_minor" = "4" ]; then
 if [ "$mainline_patch" -ge "73" ]; then
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V2 3/3] compat: Fix compile warning

2020-11-12 Thread Greg Rose
In ../compat/nf_conntrack_reasm.c nf_frags_cache_name is declared
if OVS_NF_DEFRAG6_BACKPORT is defined.  However, later in the patch
it is only used if HAVE_INET_FRAGS_WITH_FRAGS_WORK is defined and
HAVE_INET_FRAGS_RND is not defined.  This will cause a compile warning
about unused variables.

Fix it up by using the same defines that enable its use to decide
if it should be declared and avoid the compiler warning.

Fixes: 4a90b277baca ("compat: Fixup ipv6 fragmentation on 4.9.135+ kernels")
Signed-off-by: Greg Rose 

---
V2 No change
---
 datapath/linux/compat/nf_conntrack_reasm.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/datapath/linux/compat/nf_conntrack_reasm.c 
b/datapath/linux/compat/nf_conntrack_reasm.c
index ced9fba98..77b4b2548 100644
--- a/datapath/linux/compat/nf_conntrack_reasm.c
+++ b/datapath/linux/compat/nf_conntrack_reasm.c
@@ -57,10 +57,13 @@
 #include 
 #include "datapath.h"
 
-#ifdef OVS_NF_DEFRAG6_BACKPORT
+#if defined(HAVE_INET_FRAGS_WITH_FRAGS_WORK) || !defined(HAVE_INET_FRAGS_RND)
 
 static const char nf_frags_cache_name[] = "ovs-frag6";
 
+#endif
+
+#ifdef OVS_NF_DEFRAG6_BACKPORT
 struct nf_ct_frag6_skb_cb
 {
struct inet6_skb_parm   h;
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V2 2/3] compat: Fix build issue on RHEL 7.7

2020-11-12 Thread Greg Rose
RHEL 7.2 introduced a KABI fixup in struct sk_buff for the name
change of  l4_rxhash to l4_hash.  Then patch
9ba57fc7 ("datapath: Add hash info to upcall") introduced a
compile error by using l4_hash and not fixing up the HAVE_L4_RXHASH
configuration flag.

Remove all references to HAVE_L4_RXHASH and always use l4_hash to
resolve the issue.  This will break compilation on RHEL 7.0 and
RHEL 7.1 but dropping support for these older kernels shouldn't be
a problem.

Fixes: 9ba57fc7 ("datapath: Add hash info to upcall")
Signed-off-by: Greg Rose 

---
V2 - Just removes l4_rxhash and ends support for RHEL 7.x < 7.2
---
 acinclude.m4 |  2 --
 datapath/datapath.c  |  4 
 datapath/linux/compat/include/linux/skbuff.h | 10 ++
 3 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index 9c2236f9e..ddf4b71e1 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -877,8 +877,6 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_clear_hash])
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [int.skb_zerocopy(],
   [OVS_DEFINE([HAVE_SKB_ZEROCOPY])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [u8.*l4_rxhash],
-  [OVS_DEFINE([HAVE_L4_RXHASH])])
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_ensure_writable])
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_vlan_pop])
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [__skb_vlan_pop])
diff --git a/datapath/datapath.c b/datapath/datapath.c
index 52a59f135..8e9b9a706 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -529,11 +529,7 @@ static int queue_userspace_packet(struct datapath *dp, 
struct sk_buff *skb,
hash |= OVS_PACKET_HASH_SW_BIT;
 #endif
 
-#ifdef HAVE_L4_RXHASH
-   if (skb->l4_rxhash)
-#else
if (skb->l4_hash)
-#endif
hash |= OVS_PACKET_HASH_L4_BIT;
 
if (nla_put(user_skb, OVS_PACKET_ATTR_HASH, sizeof (u64), )) {
diff --git a/datapath/linux/compat/include/linux/skbuff.h 
b/datapath/linux/compat/include/linux/skbuff.h
index bc73255d5..d3bc6c715 100644
--- a/datapath/linux/compat/include/linux/skbuff.h
+++ b/datapath/linux/compat/include/linux/skbuff.h
@@ -278,9 +278,7 @@ static inline void skb_clear_hash(struct sk_buff *skb)
 #ifdef HAVE_RXHASH
skb->rxhash = 0;
 #endif
-#if defined(HAVE_L4_RXHASH)
-   skb->l4_rxhash = 0;
-#endif
+   skb->l4_hash = 0;
 }
 #endif
 
@@ -371,7 +369,7 @@ static inline void skb_pop_mac_header(struct sk_buff *skb)
 #ifndef HAVE_SKB_CLEAR_HASH_IF_NOT_L4
 static inline void skb_clear_hash_if_not_l4(struct sk_buff *skb)
 {
-   if (!skb->l4_rxhash)
+   if (!skb->l4_hash)
skb_clear_hash(skb);
 }
 #endif
@@ -465,11 +463,7 @@ __skb_set_hash(struct sk_buff *skb, __u32 hash, bool 
is_sw, bool is_l4)
 #else
skb->hash = hash;
 #endif
-#if defined(HAVE_L4_RXHASH)
-   skb->l4_rxhash = is_l4;
-#else
skb->l4_hash = is_l4;
-#endif
 #ifdef HAVE_SW_HASH
skb->sw_hash = is_sw;
 #endif
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V2 1/3] compat: Remove stale code

2020-11-12 Thread Greg Rose
Remove stale and unused code left over after support for kernels
older than 3.10 was removed.

Fixes: 8063e0958780 ("datapath: Drop support for kernel older than 3.10")
Signed-off-by: Greg Rose 

---
V2 Separate out stale code removal to it's own patch as per suggestion
   from Yi-Hung
---
 acinclude.m4 | 2 --
 datapath/linux/compat/include/linux/percpu.h | 6 --
 datapath/linux/compat/include/linux/skbuff.h | 2 +-
 3 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index 1460289ca..9c2236f9e 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -975,8 +975,6 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
 
   OVS_GREP_IFELSE([$KSRC/include/net/sock.h], [sk_no_check_tx])
   OVS_GREP_IFELSE([$KSRC/include/linux/udp.h], [no_check6_tx])
-  OVS_GREP_IFELSE([$KSRC/include/linux/utsrelease.h], [el6],
-  [OVS_DEFINE([HAVE_RHEL6_PER_CPU])])
   OVS_FIND_PARAM_IFELSE([$KSRC/include/net/protocol.h],
 [udp_add_offload], [net],
 [OVS_DEFINE([HAVE_UDP_ADD_OFFLOAD_TAKES_NET])])
diff --git a/datapath/linux/compat/include/linux/percpu.h 
b/datapath/linux/compat/include/linux/percpu.h
index 7c346aa31..a039142e2 100644
--- a/datapath/linux/compat/include/linux/percpu.h
+++ b/datapath/linux/compat/include/linux/percpu.h
@@ -7,12 +7,6 @@
 #define this_cpu_ptr(ptr) per_cpu_ptr(ptr, smp_processor_id())
 #endif
 
-#ifdef HAVE_RHEL6_PER_CPU
-#undef this_cpu_read
-#undef this_cpu_inc
-#undef this_cpu_dec
-#endif
-
 #if !defined this_cpu_read
 #define this_cpu_read(ptr) percpu_read(ptr)
 #endif
diff --git a/datapath/linux/compat/include/linux/skbuff.h 
b/datapath/linux/compat/include/linux/skbuff.h
index 204ce5497..bc73255d5 100644
--- a/datapath/linux/compat/include/linux/skbuff.h
+++ b/datapath/linux/compat/include/linux/skbuff.h
@@ -278,7 +278,7 @@ static inline void skb_clear_hash(struct sk_buff *skb)
 #ifdef HAVE_RXHASH
skb->rxhash = 0;
 #endif
-#if defined(HAVE_L4_RXHASH) && !defined(HAVE_RHEL_OVS_HOOK)
+#if defined(HAVE_L4_RXHASH)
skb->l4_rxhash = 0;
 #endif
 }
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V2 0/3] Fix RHEL 7.7 build

2020-11-12 Thread Greg Rose
Fix build for RHEL 7.7.  Also remove some stale code and fix
compile warning.

Greg Rose (3):
  compat: Remove stale code
  compat: Fix build issue on RHEL 7.7
  compat: Fix compile warning

 acinclude.m4 |  4 
 datapath/datapath.c  |  4 
 datapath/linux/compat/include/linux/percpu.h |  6 --
 datapath/linux/compat/include/linux/skbuff.h | 10 ++
 datapath/linux/compat/nf_conntrack_reasm.c   |  5 -
 5 files changed, 6 insertions(+), 23 deletions(-)

-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH 0/2] Backport upstream lockdep bug fix

2020-10-21 Thread Greg Rose
First backport the rcu patch that adds conditional and then
the bug fix from Tonghao Zhang that fixes a lockdep bug.

Passes Travis here:
https://travis-ci.org/github/gvrose8192/ovs-experimental/builds/737547340

Joel Fernandes (Google) (1):
  compat: rcu: Add support for consolidated-RCU reader checking

Tonghao Zhang (1):
  datapath: ovs_ct_exit to be done under ovs_lock

 datapath/conntrack.c  |  3 ++-
 datapath/datapath.c   |  4 +++-
 datapath/linux/compat/include/linux/rculist.h | 23 +--
 3 files changed, 26 insertions(+), 4 deletions(-)

-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH 1/2] compat: rcu: Add support for consolidated-RCU reader checking

2020-10-21 Thread Greg Rose
From: "Joel Fernandes (Google)" 

Upstream commit:
commit 28875945ba98d1b47a8a706812b6494d165bb0a0
Author: Joel Fernandes (Google) 
Date:   Tue Jul 16 18:12:22 2019 -0400

rcu: Add support for consolidated-RCU reader checking

This commit adds RCU-reader checks to list_for_each_entry_rcu() and
hlist_for_each_entry_rcu().  These checks are optional, and are indicated
by a lockdep expression passed to a new optional argument to these two
macros.  If this optional lockdep expression is omitted, these two macros
act as before, checking for an RCU read-side critical section.

Signed-off-by: Joel Fernandes (Google) 
[ paulmck: Update to eliminate return within macro and update comment. ]
Signed-off-by: Paul E. McKenney 

Backport portion of upstream commit for hlist_for_each_entry_rcu() macro
so that it can be used in following bug fix.

Cc: Joel Fernandes (Google) 
Signed-off-by: Greg Rose 
---
 datapath/linux/compat/include/linux/rculist.h | 23 +--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/datapath/linux/compat/include/linux/rculist.h 
b/datapath/linux/compat/include/linux/rculist.h
index 8df8ad8a2..40fd5e171 100644
--- a/datapath/linux/compat/include/linux/rculist.h
+++ b/datapath/linux/compat/include/linux/rculist.h
@@ -9,9 +9,28 @@
 #define hlist_pprev_rcu(node)   (*((struct hlist_node __rcu 
**)((node)->pprev)))
 #endif
 
+/*
+ * Check during list traversal that we are within an RCU reader
+ */
+
+#define check_arg_count_one(dummy)
+
+#ifdef CONFIG_PROVE_RCU_LIST
+#define __list_check_rcu(dummy, cond, extra...)
\
+   ({  \
+   check_arg_count_one(extra); \
+   RCU_LOCKDEP_WARN(!cond && !rcu_read_lock_any_held(),\
+"RCU-list traversed in non-reader section!");  \
+})
+#else
+#define __list_check_rcu(dummy, cond, extra...)
\
+   ({ check_arg_count_one(extra); })
+#endif
+
 #undef hlist_for_each_entry_rcu
-#define hlist_for_each_entry_rcu(pos, head, member)\
-   for (pos = hlist_entry_safe 
(rcu_dereference_raw(hlist_first_rcu(head)),\
+#define hlist_for_each_entry_rcu(pos, head, member, cond...)   \
+   for (__list_check_rcu(dummy, ## cond, 0),   \
+pos = hlist_entry_safe(rcu_dereference_raw(hlist_first_rcu(head)),\
typeof(*(pos)), member);\
pos;\
pos = hlist_entry_safe(rcu_dereference_raw(hlist_next_rcu(\
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH 2/2] datapath: ovs_ct_exit to be done under ovs_lock

2020-10-21 Thread Greg Rose
From: Tonghao Zhang 

Upstream commit:
commit 27de77cec985233bdf6546437b9761853265c505
Author: Tonghao Zhang 
Date:   Fri Apr 17 02:57:31 2020 +0800

net: openvswitch: ovs_ct_exit to be done under ovs_lock

syzbot wrote:
| =
| WARNING: suspicious RCU usage
| 5.7.0-rc1+ #45 Not tainted
| -
| net/openvswitch/conntrack.c:1898 RCU-list traversed in non-reader 
section!!
|
| other info that might help us debug this:
| rcu_scheduler_active = 2, debug_locks = 1
| ...
|
| stack backtrace:
| Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 
rel-1.12.0-0-ga698c8995f-prebuilt.qemu.org 04/01/2014
| Workqueue: netns cleanup_net
| Call Trace:
| ...
| ovs_ct_exit
| ovs_exit_net
| ops_exit_list.isra.7
| cleanup_net
| process_one_work
| worker_thread

To avoid that warning, invoke the ovs_ct_exit under ovs_lock and add
lockdep_ovsl_is_held as optional lockdep expression.

Link: https://lore.kernel.org/lkml/e642a905a0cbe...@google.com
Fixes: 11efd5cb04a1 ("openvswitch: Support conntrack zone limit")
Cc: Pravin B Shelar 
Cc: Yi-Hung Wei 
Reported-by: syzbot+7ef50afd3a211f879...@syzkaller.appspotmail.com
Signed-off-by: Tonghao Zhang 
Acked-by: Pravin B Shelar 
Signed-off-by: David S. Miller 

Cc: Tonghao Zhang 
Fixes: cb2a5486a3a3 ("datapath: conntrack: Support conntrack zone limit")
Signed-off-by: Greg Rose 
---
 datapath/conntrack.c | 3 ++-
 datapath/datapath.c  | 4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/datapath/conntrack.c b/datapath/conntrack.c
index c7a318baf..50b4d7bd6 100644
--- a/datapath/conntrack.c
+++ b/datapath/conntrack.c
@@ -1984,7 +1984,8 @@ static void ovs_ct_limit_exit(struct net *net, struct 
ovs_net *ovs_net)
struct hlist_head *head = >limits[i];
struct ovs_ct_limit *ct_limit;
 
-   hlist_for_each_entry_rcu(ct_limit, head, hlist_node)
+   hlist_for_each_entry_rcu(ct_limit, head, hlist_node,
+lockdep_ovsl_is_held())
kfree_rcu(ct_limit, rcu);
}
kfree(ovs_net->ct_limit_info->limits);
diff --git a/datapath/datapath.c b/datapath/datapath.c
index 52a59f135..97ba5fb72 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -2576,8 +2576,10 @@ static void __net_exit ovs_exit_net(struct net *dnet)
 
ovs_netns_frags6_exit(dnet);
ovs_netns_frags_exit(dnet);
-   ovs_ct_exit(dnet);
ovs_lock();
+
+   ovs_ct_exit(dnet);
+
list_for_each_entry_safe(dp, dp_next, _net->dps, list_node)
__dp_destroy(dp);
 
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH 2/2] compat: Fix compile warning

2020-10-20 Thread Greg Rose
In ../compat/nf_conntrack_reasm.c nf_frags_cache_name is declared
if OVS_NF_DEFRAG6_BACKPORT is defined.  However, later in the patch
it is only used if HAVE_INET_FRAGS_WITH_FRAGS_WORK is defined and
HAVE_INET_FRAGS_RND is not defined.  This will cause a compile warning
about unused variables.

Fix it up by using the same defines that enable its use to decide
if it should be declared and avoid the compiler warning.

Fixes: 4a90b277baca ("compat: Fixup ipv6 fragmentation on 4.9.135+ kernels")
Signed-off-by: Greg Rose 
---
 datapath/linux/compat/nf_conntrack_reasm.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/datapath/linux/compat/nf_conntrack_reasm.c 
b/datapath/linux/compat/nf_conntrack_reasm.c
index ced9fba98..77b4b2548 100644
--- a/datapath/linux/compat/nf_conntrack_reasm.c
+++ b/datapath/linux/compat/nf_conntrack_reasm.c
@@ -57,10 +57,13 @@
 #include 
 #include "datapath.h"
 
-#ifdef OVS_NF_DEFRAG6_BACKPORT
+#if defined(HAVE_INET_FRAGS_WITH_FRAGS_WORK) || !defined(HAVE_INET_FRAGS_RND)
 
 static const char nf_frags_cache_name[] = "ovs-frag6";
 
+#endif
+
+#ifdef OVS_NF_DEFRAG6_BACKPORT
 struct nf_ct_frag6_skb_cb
 {
struct inet6_skb_parm   h;
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V4 18/24] datapath: support asymmetric conntrack

2020-10-12 Thread Greg Rose
From: aaron conole 

Upstream commit:
commit 5d50aa83e2c8e91ced2cca77c198b468ca9210f4
author: aaron conole 
date:   tue dec 3 16:34:13 2019 -0500

openvswitch: support asymmetric conntrack

the openvswitch module shares a common conntrack and nat infrastructure
exposed via netfilter.  it's possible that a packet needs both snat and
dnat manipulation, due to e.g. tuple collision.  netfilter can support
this because it runs through the nat table twice - once on ingress and
again after egress.  the openvswitch module doesn't have such capability.

like netfilter hook infrastructure, we should run through nat twice to
keep the symmetry.

fixes: 05752523e565 ("openvswitch: interface with nat.")
signed-off-by: aaron conole 
signed-off-by: david s. miller 

Fixes: c5f6c06b58d6 ("datapath: Interface with NAT.")
Cc: aaron conole 
Acked-by: Aaron Conole 
Signed-off-by: Greg Rose 
---
 datapath/conntrack.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/datapath/conntrack.c b/datapath/conntrack.c
index 5b4d6cce0..c7a318baf 100644
--- a/datapath/conntrack.c
+++ b/datapath/conntrack.c
@@ -978,6 +978,17 @@ static int ovs_ct_nat(struct net *net, struct sw_flow_key 
*key,
}
err = ovs_ct_nat_execute(skb, ct, ctinfo, >range, maniptype);
 
+   if (err == NF_ACCEPT &&
+   ct->status & IPS_SRC_NAT && ct->status & IPS_DST_NAT) {
+   if (maniptype == NF_NAT_MANIP_SRC)
+   maniptype = NF_NAT_MANIP_DST;
+   else
+   maniptype = NF_NAT_MANIP_SRC;
+
+   err = ovs_ct_nat_execute(skb, ct, ctinfo, >range,
+maniptype);
+   }
+
/* Mark NAT done if successful and update the flow key. */
if (err == NF_ACCEPT)
ovs_nat_update_key(key, skb, maniptype);
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V4 23/24] travis: Update kernel list as of 5.8

2020-10-12 Thread Greg Rose
Update the list to more closely track the LTS releases on kernel.org.

Signed-off-by: Greg Rose 
---
 .travis.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 43e6a75cc..9fd8bbe01 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -38,8 +38,8 @@ env:
   - TESTSUITE=1 OPTS="--enable-shared"
   - TESTSUITE=1 DPDK=1
   - TESTSUITE=1 LIBS=-ljemalloc
-  - KERNEL_LIST="5.5  4.20 4.19 4.18 4.17 4.16"
-  - KERNEL_LIST="4.15 4.14 4.9  4.4  3.19 3.16"
+  - KERNEL_LIST="5.8 5.5 5.4 4.19"
+  - KERNEL_LIST="4.14 4.9 4.4 3.16"
   - AFXDP=1 KERNEL=5.3
   - M32=1 OPTS="--disable-ssl"
   - DPDK=1 OPTS="--enable-shared"
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V4 22/24] acinclude: Enable builds up to Linux 5.8

2020-10-12 Thread Greg Rose
Allow building openvswitch against Linux kernels up to and including
version 5.8.

Signed-off-by: Greg Rose 
---
 acinclude.m4 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index 3d56510a0..1460289ca 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -167,10 +167,10 @@ AC_DEFUN([OVS_CHECK_LINUX], [
 AC_MSG_RESULT([$kversion])
 
 if test "$version" -ge 5; then
-   if test "$version" = 5 && test "$patchlevel" -le 5; then
+   if test "$version" = 5 && test "$patchlevel" -le 8; then
   : # Linux 5.x
else
-  AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version 
newer than 5.5.x is not supported (please refer to the FAQ for advice)])
+  AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version 
newer than 5.8.x is not supported (please refer to the FAQ for advice)])
fi
 elif test "$version" = 4; then
: # Linux 4.x
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V4 20/24] datapath: Distribute switch variables for initialization

2020-10-12 Thread Greg Rose
From: Kees Cook 

Upstream commit:
commit 16a556eeb7ed2dc3709fe2c5be76accdfa4901ab
Author: Kees Cook 
Date:   Wed Feb 19 22:23:09 2020 -0800

openvswitch: Distribute switch variables for initialization

Variables declared in a switch statement before any case statements
cannot be automatically initialized with compiler instrumentation (as
they are not part of any execution flow). With GCC's proposed automatic
stack variable initialization feature, this triggers a warning (and they
don't get initialized). Clang's automatic stack variable initialization
(via CONFIG_INIT_STACK_ALL=y) doesn't throw a warning, but it also
doesn't initialize such variables[1]. Note that these warnings (or silent
skipping) happen before the dead-store elimination optimization phase,
so even when the automatic initializations are later elided in favor of
direct initializations, the warnings remain.

To avoid these problems, move such variables into the "case" where
they're used or lift them up into the main function body.

net/openvswitch/flow_netlink.c: In function ‘validate_set’:
net/openvswitch/flow_netlink.c:2711:29: warning: statement will never be 
executed [-Wswitch-unreachable]
 2711 |  const struct ovs_key_ipv4 *ipv4_key;
  | ^~~~

[1] https://bugs.llvm.org/show_bug.cgi?id=44916

Signed-off-by: Kees Cook 
Signed-off-by: David S. Miller 

Cc: Kees Cook 
Signed-off-by: Greg Rose 
---
 datapath/flow_netlink.c | 18 ++
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/datapath/flow_netlink.c b/datapath/flow_netlink.c
index d3fd77106..996041602 100644
--- a/datapath/flow_netlink.c
+++ b/datapath/flow_netlink.c
@@ -2700,10 +2700,6 @@ static int validate_set(const struct nlattr *a,
return -EINVAL;
 
switch (key_type) {
-   const struct ovs_key_ipv4 *ipv4_key;
-   const struct ovs_key_ipv6 *ipv6_key;
-   int err;
-
case OVS_KEY_ATTR_PRIORITY:
case OVS_KEY_ATTR_SKB_MARK:
case OVS_KEY_ATTR_CT_MARK:
@@ -2715,7 +2711,9 @@ static int validate_set(const struct nlattr *a,
return -EINVAL;
break;
 
-   case OVS_KEY_ATTR_TUNNEL:
+   case OVS_KEY_ATTR_TUNNEL: {
+   int err;
+
 #ifndef USE_UPSTREAM_TUNNEL
if (eth_p_mpls(eth_type))
return -EINVAL;
@@ -2728,8 +2726,10 @@ static int validate_set(const struct nlattr *a,
if (err)
return err;
break;
+   }
+   case OVS_KEY_ATTR_IPV4: {
+   const struct ovs_key_ipv4 *ipv4_key;
 
-   case OVS_KEY_ATTR_IPV4:
if (eth_type != htons(ETH_P_IP))
return -EINVAL;
 
@@ -2749,8 +2749,10 @@ static int validate_set(const struct nlattr *a,
return -EINVAL;
}
break;
+   }
+   case OVS_KEY_ATTR_IPV6: {
+   const struct ovs_key_ipv6 *ipv6_key;
 
-   case OVS_KEY_ATTR_IPV6:
if (eth_type != htons(ETH_P_IPV6))
return -EINVAL;
 
@@ -2777,7 +2779,7 @@ static int validate_set(const struct nlattr *a,
return -EINVAL;
 
break;
-
+   }
case OVS_KEY_ATTR_TCP:
if ((eth_type != htons(ETH_P_IP) &&
 eth_type != htons(ETH_P_IPV6)) ||
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V4 16/24] datapath: drop unneeded BUG_ON() in ovs_flow_cmd_build_info()

2020-10-12 Thread Greg Rose
From: Paolo Abeni 

Upstream commit:
commit 8ffeb03fbba3b599690b361467bfd2373e8c450f
Author: Paolo Abeni 
Date:   Sun Dec 1 18:41:24 2019 +0100

openvswitch: drop unneeded BUG_ON() in ovs_flow_cmd_build_info()

All the callers of ovs_flow_cmd_build_info() already deal with
error return code correctly, so we can handle the error condition
in a more gracefull way. Still dump a warning to preserve
debuggability.

v1 -> v2:
 - clarify the commit message
 - clean the skb and report the error (DaveM)

Fixes: ccb1352e76cf ("net: Add Open vSwitch kernel components.")
Signed-off-by: Paolo Abeni 
Signed-off-by: David S. Miller 

Cc: Paolo Abeni 
Signed-off-by: Greg Rose 
---
 datapath/datapath.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/datapath/datapath.c b/datapath/datapath.c
index 1020fee41..9448a4c1a 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -946,7 +946,10 @@ static struct sk_buff *ovs_flow_cmd_build_info(const 
struct sw_flow *flow,
retval = ovs_flow_cmd_fill_info(flow, dp_ifindex, skb,
info->snd_portid, info->snd_seq, 0,
cmd, ufid_flags);
-   BUG_ON(retval < 0);
+   if (WARN_ON_ONCE(retval < 0)) {
+   kfree_skb(skb);
+   skb = ERR_PTR(retval);
+   }
return skb;
 }
 
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V4 24/24] Documentation: Update faq and NEWS for kernel 5.8

2020-10-12 Thread Greg Rose
Update the NEWS and faq now that we will support up to Linux kernel
5.8.

Signed-off-by: Greg Rose 
---
 Documentation/faq/releases.rst | 1 +
 NEWS   | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index 9d5d2c3e1..dcba97e16 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -72,6 +72,7 @@ Q: What Linux kernel versions does each Open vSwitch release 
work with?
 2.12.x   3.16 to 5.0
 2.13.x   3.16 to 5.0
 2.14.x   3.16 to 5.5
+2.15.x   3.16 to 5.8
  ==
 
 Open vSwitch userspace should also work with the Linux kernel module built
diff --git a/NEWS b/NEWS
index 4619e73bf..b0bce4195 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,8 @@ Post-v2.14.0
  * Removed support for vhost-user dequeue zero-copy.
- The environment variable OVS_UNBOUND_CONF, if set, is now used
  as the DNS resolver's (unbound) configuration file.
+   - Linux datapath:
+ * Support for kernel versions up to 5.8.x.
 
 
 v2.14.0 - 17 Aug 2020
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V4 15/24] datapath: fix flow command message size

2020-10-12 Thread Greg Rose
From: Paolo Abeni 

Upstream commit:
commit 4e81c0b3fa93d07653e2415fa71656b080a112fd
Author: Paolo Abeni 
Date:   Tue Nov 26 12:55:50 2019 +0100

openvswitch: fix flow command message size

When user-space sets the OVS_UFID_F_OMIT_* flags, and the relevant
flow has no UFID, we can exceed the computed size, as
ovs_nla_put_identifier() will always dump an OVS_FLOW_ATTR_KEY
attribute.
Take the above in account when computing the flow command message
size.

Fixes: 74ed7ab9264c ("openvswitch: Add support for unique flow IDs.")
Reported-by: Qi Jun Ding 
Signed-off-by: Paolo Abeni 
Signed-off-by: David S. Miller 

Cc: Paolo Abeni 
Signed-off-by: Greg Rose 
---
 datapath/datapath.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/datapath/datapath.c b/datapath/datapath.c
index ddc0b4491..1020fee41 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -763,9 +763,13 @@ static size_t ovs_flow_cmd_msg_size(const struct 
sw_flow_actions *acts,
 {
size_t len = NLMSG_ALIGN(sizeof(struct ovs_header));
 
-   /* OVS_FLOW_ATTR_UFID */
+   /* OVS_FLOW_ATTR_UFID, or unmasked flow key as fallback
+* see ovs_nla_put_identifier()
+*/
if (sfid && ovs_identifier_is_ufid(sfid))
len += nla_total_size(sfid->ufid_len);
+   else
+   len += nla_total_size(ovs_key_attr_size());
 
/* OVS_FLOW_ATTR_KEY */
if (!sfid || should_fill_key(sfid, ufid_flags))
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V4 21/24] datapath: use hlist_for_each_entry_rcu instead of hlist_for_each_entry

2020-10-12 Thread Greg Rose
From: Tonghao Zhang 

Upstream commit:
commit 64948427a63f49dd0ce403388d232f22cc1971a8
Author: Tonghao Zhang 
Date:   Thu Mar 26 04:27:24 2020 +0800

net: openvswitch: use hlist_for_each_entry_rcu instead of 
hlist_for_each_entry

The struct sw_flow is protected by RCU, when traversing them,
use hlist_for_each_entry_rcu.

Signed-off-by: Tonghao Zhang 
Tested-by: Greg Rose 
Reviewed-by: Greg Rose 
Signed-off-by: David S. Miller 

Compat fixup - OVS doesn't support lockdep_ovsl_is_held() yet

Cc: Tonghao Zhang 
Reviewed-by: Tonghao Zhang 
Signed-off-by: Greg Rose 
---
 datapath/flow_table.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/datapath/flow_table.c b/datapath/flow_table.c
index bd05dd394..650338fb0 100644
--- a/datapath/flow_table.c
+++ b/datapath/flow_table.c
@@ -485,12 +485,12 @@ static void flow_table_copy_flows(struct table_instance 
*old,
struct hlist_head *head = >buckets[i];
 
if (ufid)
-   hlist_for_each_entry(flow, head,
-ufid_table.node[old_ver])
+   hlist_for_each_entry_rcu(flow, head,
+ufid_table.node[old_ver])
ufid_table_instance_insert(new, flow);
else
-   hlist_for_each_entry(flow, head,
-flow_table.node[old_ver])
+   hlist_for_each_entry_rcu(flow, head,
+flow_table.node[old_ver])
table_instance_insert(new, flow);
}
 
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V4 05/24] datapath: Set OvS recirc_id from tc chain index

2020-10-12 Thread Greg Rose
From: Paul Blakey 

Upstream commit:
commit 95a7233c452a58a4c2310c456c73997853b2ec46
Author: Paul Blakey 
Date:   Wed Sep 4 16:56:37 2019 +0300

net: openvswitch: Set OvS recirc_id from tc chain index

Offloaded OvS datapath rules are translated one to one to tc rules,
for example the following simplified OvS rule:

recirc_id(0),in_port(dev1),eth_type(0x0800),ct_state(-trk) 
actions:ct(),recirc(2)

Will be translated to the following tc rule:

$ tc filter add dev dev1 ingress \
prio 1 chain 0 proto ip \
flower tcp ct_state -trk \
action ct pipe \
action goto chain 2

Received packets will first travel though tc, and if they aren't stolen
by it, like in the above rule, they will continue to OvS datapath.
Since we already did some actions (action ct in this case) which might
modify the packets, and updated action stats, we would like to continue
the proccessing with the correct recirc_id in OvS (here recirc_id(2))
where we left off.

To support this, introduce a new skb extension for tc, which
will be used for translating tc chain to ovs recirc_id to
handle these miss cases. Last tc chain index will be set
by tc goto chain action and read by OvS datapath.

Signed-off-by: Paul Blakey 
Signed-off-by: Vlad Buslov 
Acked-by: Jiri Pirko 
Acked-by: Pravin B Shelar 
Signed-off-by: David S. Miller 

Backport the local datapath changes from this patch and add compat
layer fixup for the DECLARE_STATIC_KEY_FALSE macro.

Cc: Paul Blakey 
Signed-off-by: Greg Rose 

---
V4 - Add in portion of commit for ovs_dp_cmd_set which was missed
 in first patch.
---
 acinclude.m4  |  3 ++
 datapath/datapath.c   | 38 ---
 datapath/datapath.h   |  2 +
 datapath/flow.c   | 13 +++
 .../linux/compat/include/linux/static_key.h   |  7 
 5 files changed, 58 insertions(+), 5 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index 84f344da0..3d56510a0 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -631,6 +631,9 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
   [OVS_DEFINE([HAVE_UPSTREAM_STATIC_KEY])])
   OVS_GREP_IFELSE([$KSRC/include/linux/jump_label.h], 
[DEFINE_STATIC_KEY_FALSE],
   [OVS_DEFINE([HAVE_DEFINE_STATIC_KEY])])
+  OVS_GREP_IFELSE([$KSRC/include/linux/jump_label.h],
+  [DECLARE_STATIC_KEY_FALSE],
+  [OVS_DEFINE([HAVE_DECLARE_STATIC_KEY])])
 
   OVS_GREP_IFELSE([$KSRC/include/linux/etherdevice.h], [eth_hw_addr_random])
   OVS_GREP_IFELSE([$KSRC/include/linux/etherdevice.h], [ether_addr_copy])
diff --git a/datapath/datapath.c b/datapath/datapath.c
index c8c21d774..009887691 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -1635,10 +1635,34 @@ static void ovs_dp_reset_user_features(struct sk_buff 
*skb, struct genl_info *in
dp->user_features = 0;
 }
 
-static void ovs_dp_change(struct datapath *dp, struct nlattr *a[])
+DEFINE_STATIC_KEY_FALSE(tc_recirc_sharing_support);
+
+static int ovs_dp_change(struct datapath *dp, struct nlattr *a[])
 {
-   if (a[OVS_DP_ATTR_USER_FEATURES])
-   dp->user_features = nla_get_u32(a[OVS_DP_ATTR_USER_FEATURES]);
+   u32 user_features = 0;
+
+   if (a[OVS_DP_ATTR_USER_FEATURES]) {
+   user_features = nla_get_u32(a[OVS_DP_ATTR_USER_FEATURES]);
+
+   if (user_features & ~(OVS_DP_F_VPORT_PIDS |
+ OVS_DP_F_UNALIGNED |
+ OVS_DP_F_TC_RECIRC_SHARING))
+   return -EOPNOTSUPP;
+
+#if !IS_ENABLED(CONFIG_NET_TC_SKB_EXT)
+   if (user_features & OVS_DP_F_TC_RECIRC_SHARING)
+   return -EOPNOTSUPP;
+#endif
+   }
+
+   dp->user_features = user_features;
+
+   if (dp->user_features & OVS_DP_F_TC_RECIRC_SHARING)
+   static_branch_enable(_recirc_sharing_support);
+   else
+   static_branch_disable(_recirc_sharing_support);
+
+   return 0;
 }
 
 static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info)
@@ -1700,7 +1724,9 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct 
genl_info *info)
parms.port_no = OVSP_LOCAL;
parms.upcall_portids = a[OVS_DP_ATTR_UPCALL_PID];
 
-   ovs_dp_change(dp, a);
+   err = ovs_dp_change(dp, a);
+   if (err)
+   goto err_destroy_meters;
 
/* So far only local changes have been made, now need the lock. */
ovs_lock();
@@ -1825,7 +1851,9 @@ static int ovs_dp_cmd_set(struct sk_buff *skb, struct 
genl_info *info)
if (IS_ERR(dp))
goto err_unlock_free;
 
-   ovs_dp_change(dp, info->attrs);
+   err = ovs_dp_change(dp, info->attrs);
+   if (err)
+   goto 

[ovs-dev] [PATCH V4 06/24] datapath: fix GFP flags in rtnl_net_notifyid()

2020-10-12 Thread Greg Rose
From: Guillaume Nault 

Upstream commit:
commit d4e4fdf9e4a27c87edb79b1478955075be141f67
Author: Guillaume Nault 
Date:   Wed Oct 23 18:39:04 2019 +0200

netns: fix GFP flags in rtnl_net_notifyid()

In rtnl_net_notifyid(), we certainly can't pass a null GFP flag to
rtnl_notify(). A GFP_KERNEL flag would be fine in most circumstances,
but there are a few paths calling rtnl_net_notifyid() from atomic
context or from RCU critical sections. The later also precludes the use
of gfp_any() as it wouldn't detect the RCU case. Also, the nlmsg_new()
call is wrong too, as it uses GFP_KERNEL unconditionally.

Therefore, we need to pass the GFP flags as parameter and propagate it
through function calls until the proper flags can be determined.

In most cases, GFP_KERNEL is fine. The exceptions are:
  * openvswitch: ovs_vport_cmd_get() and ovs_vport_cmd_dump()
indirectly call rtnl_net_notifyid() from RCU critical section,

  * rtnetlink: rtmsg_ifinfo_build_skb() already receives GFP flags as
parameter.

Also, in ovs_vport_cmd_build_info(), let's change the GFP flags used
by nlmsg_new(). The function is allowed to sleep, so better make the
flags consistent with the ones used in the following
ovs_vport_cmd_fill_info() call.

Found by code inspection.

Fixes: 9a9634545c70 ("netns: notify netns id events")
Signed-off-by: Guillaume Nault 
Acked-by: Nicolas Dichtel 
Acked-by: Pravin B Shelar 
Signed-off-by: David S. Miller 

Backport the datapath.c portion of this fix.

Cc:  Guillaume Nault 
Signed-off-by: Greg Rose 
---
 datapath/datapath.c | 20 +++-
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/datapath/datapath.c b/datapath/datapath.c
index 009887691..aceb655bd 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -1992,7 +1992,7 @@ static struct genl_family dp_datapath_genl_family 
__ro_after_init = {
 /* Called with ovs_mutex or RCU read lock. */
 static int ovs_vport_cmd_fill_info(struct vport *vport, struct sk_buff *skb,
   struct net *net, u32 portid, u32 seq,
-  u32 flags, u8 cmd)
+  u32 flags, u8 cmd, gfp_t gfp)
 {
struct ovs_header *ovs_header;
struct ovs_vport_stats vport_stats;
@@ -2014,7 +2014,7 @@ static int ovs_vport_cmd_fill_info(struct vport *vport, 
struct sk_buff *skb,
 
 #ifdef HAVE_PEERNET2ID_ALLOC
if (!net_eq(net, dev_net(vport->dev))) {
-   int id = peernet2id_alloc(net, dev_net(vport->dev));
+   int id = peernet2id_alloc(net, dev_net(vport->dev), gfp);
 
if (nla_put_s32(skb, OVS_VPORT_ATTR_NETNSID, id))
goto nla_put_failure;
@@ -2056,11 +2056,12 @@ struct sk_buff *ovs_vport_cmd_build_info(struct vport 
*vport, struct net *net,
struct sk_buff *skb;
int retval;
 
-   skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);
+   skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
if (!skb)
return ERR_PTR(-ENOMEM);
 
-   retval = ovs_vport_cmd_fill_info(vport, skb, net, portid, seq, 0, cmd);
+   retval = ovs_vport_cmd_fill_info(vport, skb, net, portid, seq, 0, cmd,
+GFP_KERNEL);
BUG_ON(retval < 0);
 
return skb;
@@ -2202,7 +2203,7 @@ restart:
 
err = ovs_vport_cmd_fill_info(vport, reply, genl_info_net(info),
  info->snd_portid, info->snd_seq, 0,
- OVS_VPORT_CMD_NEW);
+ OVS_VPORT_CMD_NEW, GFP_KERNEL);
BUG_ON(err < 0);
 
new_headroom = netdev_get_fwd_headroom(vport->dev);
@@ -2262,7 +2263,7 @@ static int ovs_vport_cmd_set(struct sk_buff *skb, struct 
genl_info *info)
 
err = ovs_vport_cmd_fill_info(vport, reply, genl_info_net(info),
  info->snd_portid, info->snd_seq, 0,
- OVS_VPORT_CMD_SET);
+ OVS_VPORT_CMD_SET, GFP_KERNEL);
BUG_ON(err < 0);
ovs_unlock();
 
@@ -2302,7 +2303,7 @@ static int ovs_vport_cmd_del(struct sk_buff *skb, struct 
genl_info *info)
 
err = ovs_vport_cmd_fill_info(vport, reply, genl_info_net(info),
  info->snd_portid, info->snd_seq, 0,
- OVS_VPORT_CMD_DEL);
+ OVS_VPORT_CMD_DEL, GFP_KERNEL);
BUG_ON(err < 0);
 
/* the vport deletion may trigger dp headroom update */
@@ -2349,7 +2350,7 @@ static int ovs_vport_cmd_get(struct sk_buff *skb, struct 
genl_info *info)
goto exit_unlock_free;
err = ovs_vport_cmd_fill_info(vport, reply, genl_info_net(info),

[ovs-dev] [PATCH V4 14/24] datapath: don't call pad_packet if not necessary

2020-10-12 Thread Greg Rose
From: Tonghao Zhang 

Upstream commit:
commit 61ca533c0e94104c35fcb7858a23ec9a05d78143
Author: Tonghao Zhang 
Date:   Thu Nov 14 23:51:08 2019 +0800

net: openvswitch: don't call pad_packet if not necessary

The nla_put_u16/nla_put_u32 makes sure that
*attrlen is align. The call tree is that:

nla_put_u16/nla_put_u32
  -> nla_putattrlen = sizeof(u16) or sizeof(u32)
  -> __nla_put  attrlen
  -> __nla_reserve  attrlen
  -> skb_put(skb, nla_total_size(attrlen))

nla_total_size returns the total length of attribute
including padding.

Cc: Joe Stringer 
Cc: William Tu 
Signed-off-by: Tonghao Zhang 
Acked-by: Pravin B Shelar 
Signed-off-by: David S. Miller 

Cc: Tonghao Zhang 
Reviewed-by: Tonghao Zhang 
Signed-off-by: Greg Rose 
---
 datapath/datapath.c | 22 --
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/datapath/datapath.c b/datapath/datapath.c
index 22a08baa3..ddc0b4491 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -512,23 +512,17 @@ static int queue_userspace_packet(struct datapath *dp, 
struct sk_buff *skb,
}
 
/* Add OVS_PACKET_ATTR_MRU */
-   if (upcall_info->mru) {
-   if (nla_put_u16(user_skb, OVS_PACKET_ATTR_MRU,
-   upcall_info->mru)) {
-   err = -ENOBUFS;
-   goto out;
-   }
-   pad_packet(dp, user_skb);
+   if (upcall_info->mru &&
+   nla_put_u16(user_skb, OVS_PACKET_ATTR_MRU, upcall_info->mru)) {
+   err = -ENOBUFS;
+   goto out;
}
 
/* Add OVS_PACKET_ATTR_LEN when packet is truncated */
-   if (cutlen > 0) {
-   if (nla_put_u32(user_skb, OVS_PACKET_ATTR_LEN,
-   skb->len)) {
-   err = -ENOBUFS;
-   goto out;
-   }
-   pad_packet(dp, user_skb);
+   if (cutlen > 0 &&
+   nla_put_u32(user_skb, OVS_PACKET_ATTR_LEN, skb->len)) {
+   err = -ENOBUFS;
+   goto out;
}
 
/* Add OVS_PACKET_ATTR_HASH */
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V4 17/24] datapath: remove another BUG_ON()

2020-10-12 Thread Greg Rose
From: Paolo Abeni 

Upstream commit:
commit 8a574f86652a4540a2433946ba826ccb87f398cc
Author: Paolo Abeni 
Date:   Sun Dec 1 18:41:25 2019 +0100

openvswitch: remove another BUG_ON()

If we can't build the flow del notification, we can simply delete
the flow, no need to crash the kernel. Still keep a WARN_ON to
preserve debuggability.

Note: the BUG_ON() predates the Fixes tag, but this change
can be applied only after the mentioned commit.

v1 -> v2:
 - do not leak an skb on error

Fixes: aed067783e50 ("openvswitch: Minimize ovs_flow_cmd_del critical 
section.")
Signed-off-by: Paolo Abeni 
Signed-off-by: David S. Miller 

Cc: Paolo Abeni 
Signed-off-by: Greg Rose 
---
 datapath/datapath.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/datapath/datapath.c b/datapath/datapath.c
index 9448a4c1a..1bc8e1439 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -1414,7 +1414,10 @@ static int ovs_flow_cmd_del(struct sk_buff *skb, struct 
genl_info *info)
 OVS_FLOW_CMD_DEL,
 ufid_flags);
rcu_read_unlock();
-   BUG_ON(err < 0);
+   if (WARN_ON_ONCE(err < 0)) {
+   kfree_skb(reply);
+   goto out_free;
+   }
ovs_notify(_flow_genl_family, 
_dp_flow_multicast_group, reply, info);
} else {
genl_set_err(_flow_genl_family, sock_net(skb->sk), 0,
@@ -1423,6 +1426,7 @@ static int ovs_flow_cmd_del(struct sk_buff *skb, struct 
genl_info *info)
}
}
 
+out_free:
ovs_flow_free(flow, true);
return 0;
 unlock:
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V4 10/24] datapath: add likely in flow_lookup

2020-10-12 Thread Greg Rose
From: Tonghao Zhang 

Upstream commit:
commit 0a3e01371db17d753dd92ec4d0fc6247412d3b01
Author: Tonghao Zhang 
Date:   Fri Nov 1 22:23:51 2019 +0800

net: openvswitch: add likely in flow_lookup

The most case *index < ma->max, and flow-mask is not NULL.
We add un/likely for performance.

Signed-off-by: Tonghao Zhang 
Tested-by: Greg Rose 
Acked-by: William Tu 
Acked-by: Pravin B Shelar 
Signed-off-by: David S. Miller 

Cc: Tonghao Zhang 
Reviewed-by: Tonghao Zhang 
Signed-off-by: Greg Rose 
---
 datapath/flow_table.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/datapath/flow_table.c b/datapath/flow_table.c
index 7efaa8044..ca2efe94d 100644
--- a/datapath/flow_table.c
+++ b/datapath/flow_table.c
@@ -541,7 +541,7 @@ static struct sw_flow *flow_lookup(struct flow_table *tbl,
struct sw_flow_mask *mask;
int i;
 
-   if (*index < ma->max) {
+   if (likely(*index < ma->max)) {
mask = rcu_dereference_ovsl(ma->masks[*index]);
if (mask) {
flow = masked_flow_lookup(ti, key, mask, n_mask_hit);
@@ -556,7 +556,7 @@ static struct sw_flow *flow_lookup(struct flow_table *tbl,
continue;
 
mask = rcu_dereference_ovsl(ma->masks[i]);
-   if (!mask)
+   if (unlikely(!mask))
break;
 
flow = masked_flow_lookup(ti, key, mask, n_mask_hit);
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V4 13/24] datapath: select vport upcall portid directly

2020-10-12 Thread Greg Rose
From: Tonghao Zhang 

Upstream commit:
commit 90ce9f23a886bdef7a4b7a9bd52c7a50a6a81635
Author: Tonghao Zhang 
Date:   Thu Nov 7 00:34:28 2019 +0800

net: openvswitch: select vport upcall portid directly

The commit 69c51582ff786 ("dpif-netlink: don't allocate per
thread netlink sockets"), in Open vSwitch ovs-vswitchd, has
changed the number of allocated sockets to just one per port
by moving the socket array from a per handler structure to
a per datapath one. In the kernel datapath, a vport will have
only one socket in most case, if so select it directly in
fast-path.

Signed-off-by: Tonghao Zhang 
Acked-by: Pravin B Shelar 
Signed-off-by: David S. Miller 

Cc: Tonghao Zhang 
Reviewed-by: Tonghao Zhang 
Signed-off-by: Greg Rose 
---
 datapath/vport.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/datapath/vport.c b/datapath/vport.c
index f929282dc..bd62c5612 100644
--- a/datapath/vport.c
+++ b/datapath/vport.c
@@ -507,8 +507,9 @@ u32 ovs_vport_find_upcall_portid(const struct vport *vport, 
struct sk_buff *skb)
 
ids = rcu_dereference(vport->upcall_portids);
 
-   if (ids->n_ids == 1 && ids->ids[0] == 0)
-   return 0;
+   /* If there is only one portid, select it in the fast-path. */
+   if (ids->n_ids == 1)
+   return ids->ids[0];
 
hash = skb_get_hash(skb);
ids_index = hash - ids->n_ids * reciprocal_divide(hash, ids->rn_ids);
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V4 19/24] datapath: use skb_list_walk_safe helper for gso segments

2020-10-12 Thread Greg Rose
From: "Jason A. Donenfeld" 

Upstream commit:
commit 2cec4448db38758832c2edad439f99584bb8fa0d
Author: Jason A. Donenfeld 
Date:   Mon Jan 13 18:42:29 2020 -0500

net: openvswitch: use skb_list_walk_safe helper for gso segments

This is a straight-forward conversion case for the new function, keeping
the flow of the existing code as intact as possible.

Signed-off-by: Jason A. Donenfeld 
Signed-off-by: David S. Miller 

Cc: Jason A. Donenfeld 
Signed-off-by: Greg Rose 
---
 datapath/datapath.c  | 11 ---
 datapath/linux/compat/include/linux/skbuff.h |  7 +++
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/datapath/datapath.c b/datapath/datapath.c
index 1bc8e1439..52a59f135 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -343,8 +343,7 @@ static int queue_gso_packets(struct datapath *dp, struct 
sk_buff *skb,
}
 #endif
/* Queue all of the segments. */
-   skb = segs;
-   do {
+   skb_list_walk_safe(segs, skb, nskb) {
*OVS_CB(skb) = ovs_cb;
 #ifdef HAVE_SKB_GSO_UDP
if (gso_type & SKB_GSO_UDP && skb != segs)
@@ -354,17 +353,15 @@ static int queue_gso_packets(struct datapath *dp, struct 
sk_buff *skb,
if (err)
break;
 
-   } while ((skb = skb->next));
+   }
 
/* Free all of the segments. */
-   skb = segs;
-   do {
-   nskb = skb->next;
+   skb_list_walk_safe(segs, skb, nskb) {
if (err)
kfree_skb(skb);
else
consume_skb(skb);
-   } while ((skb = nskb));
+   }
return err;
 }
 
diff --git a/datapath/linux/compat/include/linux/skbuff.h 
b/datapath/linux/compat/include/linux/skbuff.h
index 6d248b3ed..204ce5497 100644
--- a/datapath/linux/compat/include/linux/skbuff.h
+++ b/datapath/linux/compat/include/linux/skbuff.h
@@ -487,4 +487,11 @@ static inline __u32 skb_get_hash_raw(const struct sk_buff 
*skb)
 }
 #endif
 
+#ifndef skb_list_walk_safe
+/* Iterate through singly-linked GSO fragments of an skb. */
+#define skb_list_walk_safe(first, skb, next_skb)   
\
+   for ((skb) = (first), (next_skb) = (skb) ? (skb)->next : NULL; (skb);  \
+(skb) = (next_skb), (next_skb) = (skb) ? (skb)->next : NULL)
+#endif
+
 #endif
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V4 12/24] datapath: simplify the ovs_dp_cmd_new

2020-10-12 Thread Greg Rose
From: Tonghao Zhang 

Upstream commit:
commit eec62eadd1d757b0743ccbde55973814f3ad396e
Author: Tonghao Zhang 
Date:   Fri Nov 1 22:23:54 2019 +0800

net: openvswitch: simplify the ovs_dp_cmd_new

use the specified functions to init resource.

Signed-off-by: Tonghao Zhang 
Tested-by: Greg Rose 
Acked-by: Pravin B Shelar 
Signed-off-by: David S. Miller 

Cc: Tonghao Zhang 
Reviewed-by: Tonghao Zhang 
Signed-off-by: Greg Rose 
---
 datapath/datapath.c | 60 -
 1 file changed, 38 insertions(+), 22 deletions(-)

diff --git a/datapath/datapath.c b/datapath/datapath.c
index cf216c8ec..22a08baa3 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -1665,6 +1665,31 @@ static int ovs_dp_change(struct datapath *dp, struct 
nlattr *a[])
return 0;
 }
 
+static int ovs_dp_stats_init(struct datapath *dp)
+{
+   dp->stats_percpu = netdev_alloc_pcpu_stats(struct dp_stats_percpu);
+   if (!dp->stats_percpu)
+   return -ENOMEM;
+
+   return 0;
+}
+
+static int ovs_dp_vport_init(struct datapath *dp)
+{
+   int i;
+
+   dp->ports = kmalloc_array(DP_VPORT_HASH_BUCKETS,
+ sizeof(struct hlist_head),
+ GFP_KERNEL);
+   if (!dp->ports)
+   return -ENOMEM;
+
+   for (i = 0; i < DP_VPORT_HASH_BUCKETS; i++)
+   INIT_HLIST_HEAD(>ports[i]);
+
+   return 0;
+}
+
 static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info)
 {
struct nlattr **a = info->attrs;
@@ -1673,7 +1698,7 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct 
genl_info *info)
struct datapath *dp;
struct vport *vport;
struct ovs_net *ovs_net;
-   int err, i;
+   int err;
 
err = -EINVAL;
if (!a[OVS_DP_ATTR_NAME] || !a[OVS_DP_ATTR_UPCALL_PID])
@@ -1686,35 +1711,26 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct 
genl_info *info)
err = -ENOMEM;
dp = kzalloc(sizeof(*dp), GFP_KERNEL);
if (dp == NULL)
-   goto err_free_reply;
+   goto err_destroy_reply;
 
ovs_dp_set_net(dp, sock_net(skb->sk));
 
/* Allocate table. */
err = ovs_flow_tbl_init(>table);
if (err)
-   goto err_free_dp;
+   goto err_destroy_dp;
 
-   dp->stats_percpu = netdev_alloc_pcpu_stats(struct dp_stats_percpu);
-   if (!dp->stats_percpu) {
-   err = -ENOMEM;
+   err = ovs_dp_stats_init(dp);
+   if (err)
goto err_destroy_table;
-   }
 
-   dp->ports = kmalloc_array(DP_VPORT_HASH_BUCKETS,
- sizeof(struct hlist_head),
- GFP_KERNEL);
-   if (!dp->ports) {
-   err = -ENOMEM;
-   goto err_destroy_percpu;
-   }
-
-   for (i = 0; i < DP_VPORT_HASH_BUCKETS; i++)
-   INIT_HLIST_HEAD(>ports[i]);
+   err = ovs_dp_vport_init(dp);
+   if (err)
+   goto err_destroy_stats;
 
err = ovs_meters_init(dp);
if (err)
-   goto err_destroy_ports_array;
+   goto err_destroy_ports;
 
/* Set up our datapath device. */
parms.name = nla_data(a[OVS_DP_ATTR_NAME]);
@@ -1764,15 +1780,15 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct 
genl_info *info)
 
 err_destroy_meters:
ovs_meters_exit(dp);
-err_destroy_ports_array:
+err_destroy_ports:
kfree(dp->ports);
-err_destroy_percpu:
+err_destroy_stats:
free_percpu(dp->stats_percpu);
 err_destroy_table:
ovs_flow_tbl_destroy(>table);
-err_free_dp:
+err_destroy_dp:
kfree(dp);
-err_free_reply:
+err_destroy_reply:
kfree_skb(reply);
 err:
return err;
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V4 11/24] datapath: fix possible memleak on destroy flow-table

2020-10-12 Thread Greg Rose
From: Tonghao Zhang 

Upstream commit:
commit 50b0e61b32ee890a75b4377d5fbe770a86d6a4c1
Author: Tonghao Zhang 
Date:   Fri Nov 1 22:23:52 2019 +0800

net: openvswitch: fix possible memleak on destroy flow-table

When we destroy the flow tables which may contain the flow_mask,
so release the flow mask struct.

Signed-off-by: Tonghao Zhang 
Tested-by: Greg Rose 
Acked-by: Pravin B Shelar 
Signed-off-by: David S. Miller 

Added additional compat layer fixup for WRITE_ONCE()

Cc: Tonghao Zhang 
Reviewed-by: Tonghao Zhang 
Signed-off-by: Greg Rose 

---
V4 - Simplify the WRITE_ONCE macro implemention as suggested by
 Yihung.
---
 datapath/flow_table.c | 186 +-
 .../linux/compat/include/linux/compiler.h |   8 +
 2 files changed, 106 insertions(+), 88 deletions(-)

diff --git a/datapath/flow_table.c b/datapath/flow_table.c
index ca2efe94d..bd05dd394 100644
--- a/datapath/flow_table.c
+++ b/datapath/flow_table.c
@@ -234,6 +234,74 @@ static int tbl_mask_array_realloc(struct flow_table *tbl, 
int size)
return 0;
 }
 
+static int tbl_mask_array_add_mask(struct flow_table *tbl,
+  struct sw_flow_mask *new)
+{
+   struct mask_array *ma = ovsl_dereference(tbl->mask_array);
+   int err, ma_count = READ_ONCE(ma->count);
+
+   if (ma_count >= ma->max) {
+   err = tbl_mask_array_realloc(tbl, ma->max +
+ MASK_ARRAY_SIZE_MIN);
+   if (err)
+   return err;
+
+   ma = ovsl_dereference(tbl->mask_array);
+   }
+
+   BUG_ON(ovsl_dereference(ma->masks[ma_count]));
+
+   rcu_assign_pointer(ma->masks[ma_count], new);
+   WRITE_ONCE(ma->count, ma_count +1);
+
+   return 0;
+}
+
+static void tbl_mask_array_del_mask(struct flow_table *tbl,
+   struct sw_flow_mask *mask)
+{
+   struct mask_array *ma = ovsl_dereference(tbl->mask_array);
+   int i, ma_count = READ_ONCE(ma->count);
+
+   /* Remove the deleted mask pointers from the array */
+   for (i = 0; i < ma_count; i++) {
+   if (mask == ovsl_dereference(ma->masks[i]))
+   goto found;
+   }
+
+   BUG();
+   return;
+
+found:
+   WRITE_ONCE(ma->count, ma_count -1);
+
+   rcu_assign_pointer(ma->masks[i], ma->masks[ma_count -1]);
+   RCU_INIT_POINTER(ma->masks[ma_count -1], NULL);
+
+   kfree_rcu(mask, rcu);
+
+   /* Shrink the mask array if necessary. */
+   if (ma->max >= (MASK_ARRAY_SIZE_MIN * 2) &&
+   ma_count <= (ma->max / 3))
+   tbl_mask_array_realloc(tbl, ma->max / 2);
+}
+
+/* Remove 'mask' from the mask list, if it is not needed any more. */
+static void flow_mask_remove(struct flow_table *tbl, struct sw_flow_mask *mask)
+{
+   if (mask) {
+   /* ovs-lock is required to protect mask-refcount and
+* mask list.
+*/
+   ASSERT_OVSL();
+   BUG_ON(!mask->ref_count);
+   mask->ref_count--;
+
+   if (!mask->ref_count)
+   tbl_mask_array_del_mask(tbl, mask);
+   }
+}
+
 int ovs_flow_tbl_init(struct flow_table *table)
 {
struct table_instance *ti, *ufid_ti;
@@ -280,7 +348,28 @@ static void flow_tbl_destroy_rcu_cb(struct rcu_head *rcu)
__table_instance_destroy(ti);
 }
 
-static void table_instance_destroy(struct table_instance *ti,
+static void table_instance_flow_free(struct flow_table *table,
+ struct table_instance *ti,
+ struct table_instance *ufid_ti,
+ struct sw_flow *flow,
+ bool count)
+{
+   hlist_del_rcu(>flow_table.node[ti->node_ver]);
+   if (count)
+   table->count--;
+
+   if (ovs_identifier_is_ufid(>id)) {
+   hlist_del_rcu(>ufid_table.node[ufid_ti->node_ver]);
+
+   if (count)
+   table->ufid_count--;
+   }
+
+   flow_mask_remove(table, flow->mask);
+}
+
+static void table_instance_destroy(struct flow_table *table,
+  struct table_instance *ti,
   struct table_instance *ufid_ti,
   bool deferred)
 {
@@ -297,13 +386,12 @@ static void table_instance_destroy(struct table_instance 
*ti,
struct sw_flow *flow;
struct hlist_head *head = >buckets[i];
struct hlist_node *n;
-   int ver = ti->node_ver;
-   int ufid_ver = ufid_ti->node_ver;
 
-   hlist_for_each_entry_safe(flow, n, head, flow_table.node[ver]) {
-   hlist_del_rcu(>flow_t

[ovs-dev] [PATCH V4 08/24] datapath: optimize flow-mask looking up

2020-10-12 Thread Greg Rose
From: Tonghao Zhang 

Upstream commit:
commit 57f7d7b9164426c496300d254fd5167fbbf205ea
Author: Tonghao Zhang 
Date:   Fri Nov 1 22:23:49 2019 +0800

net: openvswitch: optimize flow-mask looking up

The full looking up on flow table traverses all mask array.
If mask-array is too large, the number of invalid flow-mask
increase, performance will be drop.

One bad case, for example: M means flow-mask is valid and NULL
of flow-mask means deleted.

+---+
| M | NULL | ...  | NULL | M|
+---+

In that case, without this patch, openvswitch will traverses all
mask array, because there will be one flow-mask in the tail. This
patch changes the way of flow-mask inserting and deleting, and the
mask array will be keep as below: there is not a NULL hole. In the
fast path, we can "break" "for" (not "continue") in flow_lookup
when we get a NULL flow-mask.

 "break"
v
+---+
| M | M |  NULL |...   | NULL | NULL|
+---+

This patch don't optimize slow or control path, still using ma->max
to traverse. Slow path:
* tbl_mask_array_realloc
* ovs_flow_tbl_lookup_exact
* flow_mask_find

Signed-off-by: Tonghao Zhang 
Tested-by: Greg Rose 
Acked-by: Pravin B Shelar 
Signed-off-by: David S. Miller 

Cc: Tonghao Zhang 
Reviewed-by: Tonghao Zhang 
Signed-off-by: Greg Rose 
---
 datapath/flow_table.c | 103 ++
 1 file changed, 53 insertions(+), 50 deletions(-)

diff --git a/datapath/flow_table.c b/datapath/flow_table.c
index 76b390e9c..62d726ddd 100644
--- a/datapath/flow_table.c
+++ b/datapath/flow_table.c
@@ -540,8 +540,8 @@ static struct sw_flow *flow_lookup(struct flow_table *tbl,
   u32 *n_mask_hit,
   u32 *index)
 {
-   struct sw_flow_mask *mask;
struct sw_flow *flow;
+   struct sw_flow_mask *mask;
int i;
 
if (*index < ma->max) {
@@ -560,7 +560,7 @@ static struct sw_flow *flow_lookup(struct flow_table *tbl,
 
mask = rcu_dereference_ovsl(ma->masks[i]);
if (!mask)
-   continue;
+   break;
 
flow = masked_flow_lookup(ti, key, mask, n_mask_hit);
if (flow) { /* Found */
@@ -716,7 +716,7 @@ int ovs_flow_tbl_num_masks(const struct flow_table *table)
struct mask_array *ma;
 
ma = rcu_dereference_ovsl(table->mask_array);
-   return ma->count;
+   return READ_ONCE(ma->count);
 }
 
 static struct table_instance *table_instance_expand(struct table_instance *ti,
@@ -725,21 +725,33 @@ static struct table_instance 
*table_instance_expand(struct table_instance *ti,
return table_instance_rehash(ti, ti->n_buckets * 2, ufid);
 }
 
-static void tbl_mask_array_delete_mask(struct mask_array *ma,
-  struct sw_flow_mask *mask)
+static void tbl_mask_array_del_mask(struct flow_table *tbl,
+   struct sw_flow_mask *mask)
 {
-   int i;
+   struct mask_array *ma = ovsl_dereference(tbl->mask_array);
+   int i, ma_count = READ_ONCE(ma->count);
 
/* Remove the deleted mask pointers from the array */
-   for (i = 0; i < ma->max; i++) {
-   if (mask == ovsl_dereference(ma->masks[i])) {
-   RCU_INIT_POINTER(ma->masks[i], NULL);
-   ma->count--;
-   kfree_rcu(mask, rcu);
-   return;
-   }
+   for (i = 0; i < ma_count; i++) {
+   if (mask == ovsl_dereference(ma->masks[i]))
+   goto found;
}
+
BUG();
+   return;
+
+found:
+   WRITE_ONCE(ma->count, ma_count -1);
+
+   rcu_assign_pointer(ma->masks[i], ma->masks[ma_count -1]);
+   RCU_INIT_POINTER(ma->masks[ma_count -1], NULL);
+
+   kfree_rcu(mask, rcu);
+
+   /* Shrink the mask array if necessary. */
+   if (ma->max >= (MASK_ARRAY_SIZE_MIN * 2) &&
+   ma_count <= (ma->max / 3))
+   tbl_mask_array_realloc(tbl, ma->max / 2);
 }
 
 /* Remove 'mask' from the mask list, if it is not needed any more. */
@@ -753,18 +765,8 @@ static void flow_mask_remove(struct flow_table *tbl, 
struct sw_flow_mask *mask)
BUG_ON(!mask->ref_count);
mask->ref_count--;
 
-   if (!mask->ref_count) {
-   struct mask_array *ma;
-
-   ma = ovsl_dereference(tbl->mask_array);
-   tbl_mask_array_delete_mask(ma, 

[ovs-dev] [PATCH V4 00/24] Add support for Linux kernels up to 5.8.x

2020-10-12 Thread Greg Rose
This patch set will add support for Linux kernels up to 5.8. In
addition there are quite a few patches for openvswitch on the Linux
kernel mailing list that have not been backported - here is a first
batch attempting to catch up on some of that technical debt.  There
will be a follow up batch of patches to this one but I didn't want
the patch bomb to get too large.

V4 passes Travis here:
https://travis-ci.org/github/gvrose8192/ovs-experimental/builds/735114390

---
V2 - V2 of this patch set changes the NEWS as suggested by Ilya
   - Moves the acinclude patch for 5.8 support to the end of the
 patch series
   - Reduces targeted Linux kernel support to 5.8 since 5.9 is
 still not baked
   - Updates the travis kernel test list
   - Adds tags from authors from the first patch series.
V3 - Add tag from Eelco Chaldron
   - Mix mistaken warning message in acinclude.m4
   - Remember to add link to passing Travis build in cover letter
V4 - Add portion change in ovs_dp_cmd_set missed in previous patch set
   - Simplify the WRITE_ONCE macro implemention for compat.

Eelco Chaudron (1):
  datapath: return an error instead of doing BUG_ON()

Enrico Weigelt (1):
  datapath: drop unneeded likely() call around IS_ERR()

Greg Rose (3):
  acinclude: Enable builds up to Linux 5.8
  travis: Update kernel list as of 5.8
  Documentation: Update faq and NEWS for kernel 5.8

Guillaume Nault (1):
  datapath: fix GFP flags in rtnl_net_notifyid()

Jason A. Donenfeld (1):
  datapath: use skb_list_walk_safe helper for gso segments

Kees Cook (1):
  datapath: Distribute switch variables for initialization

Paolo Abeni (3):
  datapath: fix flow command message size
  datapath: drop unneeded BUG_ON() in ovs_flow_cmd_build_info()
  datapath: remove another BUG_ON()

Paul Blakey (1):
  datapath: Set OvS recirc_id from tc chain index

Taehee Yoo (1):
  datapath: do not update max_headroom if new headroom is equal to old
headroom

Tonghao Zhang (9):
  datapath: don't unlock mutex when changing the user_features fails
  datapath: optimize flow-mask looking up
  datapath: simplify the flow_hash
  datapath: add likely in flow_lookup
  datapath: fix possible memleak on destroy flow-table
  datapath: simplify the ovs_dp_cmd_new
  datapath: select vport upcall portid directly
  datapath: don't call pad_packet if not necessary
  datapath: use hlist_for_each_entry_rcu instead of hlist_for_each_entry

Yifeng Sun (1):
  datapath: Print error when ovs_execute_actions() fails

aaron conole (1):
  datapath: support asymmetric conntrack

 .travis.yml   |   4 +-
 Documentation/faq/releases.rst|   1 +
 NEWS  |   2 +
 acinclude.m4  |   7 +-
 datapath/conntrack.c  |  11 +
 datapath/datapath.c   | 224 --
 datapath/datapath.h   |   2 +
 datapath/flow.c   |  13 +
 datapath/flow_netlink.c   |  18 +-
 datapath/flow_table.c | 214 +
 .../linux/compat/include/linux/compiler.h |   8 +
 datapath/linux/compat/include/linux/skbuff.h  |   7 +
 .../linux/compat/include/linux/static_key.h   |   7 +
 datapath/vport.c  |   5 +-
 14 files changed, 330 insertions(+), 193 deletions(-)

-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V4 03/24] datapath: do not update max_headroom if new headroom is equal to old headroom

2020-10-12 Thread Greg Rose
From: Taehee Yoo 

Upstream commit:
commit 6b660c4177aaebdc73df7a3378f0e8b110aa4b51
Author: Taehee Yoo 
Date:   Sat Jul 6 01:08:09 2019 +0900

net: openvswitch: do not update max_headroom if new headroom is equal to 
old headroom

When a vport is deleted, the maximum headroom size would be changed.
If the vport which has the largest headroom is deleted,
the new max_headroom would be set.
But, if the new headroom size is equal to the old headroom size,
updating routine is unnecessary.

Signed-off-by: Taehee Yoo 
Tested-by: Greg Rose 
Reviewed-by: Greg Rose 
Signed-off-by: David S. Miller 

Cc: Taehee Yoo 
Signed-off-by: Greg Rose 
---
 datapath/datapath.c | 38 +++---
 1 file changed, 27 insertions(+), 11 deletions(-)

diff --git a/datapath/datapath.c b/datapath/datapath.c
index 4c485c88a..2879f24ef 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -2072,10 +2072,9 @@ static struct vport *lookup_vport(struct net *net,
 
 }
 
-/* Called with ovs_mutex */
-static void update_headroom(struct datapath *dp)
+static unsigned int ovs_get_max_headroom(struct datapath *dp)
 {
-   unsigned dev_headroom, max_headroom = 0;
+   unsigned int dev_headroom, max_headroom = 0;
struct net_device *dev;
struct vport *vport;
int i;
@@ -2089,10 +2088,19 @@ static void update_headroom(struct datapath *dp)
}
}
 
-   dp->max_headroom = max_headroom;
+   return max_headroom;
+}
+
+/* Called with ovs_mutex */
+static void ovs_update_headroom(struct datapath *dp, unsigned int new_headroom)
+{
+   struct vport *vport;
+   int i;
+
+   dp->max_headroom = new_headroom;
for (i = 0; i < DP_VPORT_HASH_BUCKETS; i++)
hlist_for_each_entry_rcu(vport, >ports[i], dp_hash_node)
-   netdev_set_rx_headroom(vport->dev, max_headroom);
+   netdev_set_rx_headroom(vport->dev, new_headroom);
 }
 
 static int ovs_vport_cmd_new(struct sk_buff *skb, struct genl_info *info)
@@ -2103,6 +2111,7 @@ static int ovs_vport_cmd_new(struct sk_buff *skb, struct 
genl_info *info)
struct sk_buff *reply;
struct vport *vport;
struct datapath *dp;
+   unsigned int new_headroom;
u32 port_no;
int err;
 
@@ -2165,8 +2174,10 @@ restart:
  OVS_VPORT_CMD_NEW);
BUG_ON(err < 0);
 
-   if (netdev_get_fwd_headroom(vport->dev) > dp->max_headroom)
-   update_headroom(dp);
+   new_headroom = netdev_get_fwd_headroom(vport->dev);
+
+   if (new_headroom > dp->max_headroom)
+   ovs_update_headroom(dp, new_headroom);
else
netdev_set_rx_headroom(vport->dev, dp->max_headroom);
 
@@ -2235,11 +2246,12 @@ exit_unlock_free:
 
 static int ovs_vport_cmd_del(struct sk_buff *skb, struct genl_info *info)
 {
-   bool must_update_headroom = false;
+   bool update_headroom = false;
struct nlattr **a = info->attrs;
struct sk_buff *reply;
struct datapath *dp;
struct vport *vport;
+   unsigned int new_headroom;
int err;
 
reply = ovs_vport_cmd_alloc_info();
@@ -2265,13 +2277,17 @@ static int ovs_vport_cmd_del(struct sk_buff *skb, 
struct genl_info *info)
/* the vport deletion may trigger dp headroom update */
dp = vport->dp;
if (netdev_get_fwd_headroom(vport->dev) == dp->max_headroom)
-   must_update_headroom = true;
+   update_headroom = true;
+
netdev_reset_rx_headroom(vport->dev);
ovs_dp_detach_port(vport);
 
-   if (must_update_headroom)
-   update_headroom(dp);
+   if (update_headroom) {
+   new_headroom = ovs_get_max_headroom(dp);
 
+   if (new_headroom < dp->max_headroom)
+   ovs_update_headroom(dp, new_headroom);
+   }
ovs_unlock();
 
ovs_notify(_vport_genl_family, _dp_vport_multicast_group, reply, 
info);
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V4 07/24] datapath: don't unlock mutex when changing the user_features fails

2020-10-12 Thread Greg Rose
From: Tonghao Zhang 

Upstream commit:
commit 4c76bf696a608ea5cc555fe97ec59a9033236604
Author: Tonghao Zhang 
Date:   Fri Nov 1 22:23:53 2019 +0800

net: openvswitch: don't unlock mutex when changing the user_features fails

Unlocking of a not locked mutex is not allowed.
Other kernel thread may be in critical section while
we unlock it because of setting user_feature fail.

Fixes: 95a7233c4 ("net: openvswitch: Set OvS recirc_id from tc chain index")
Cc: Paul Blakey 
Signed-off-by: Tonghao Zhang 
Tested-by: Greg Rose 
Acked-by: William Tu 
Acked-by: Pravin B Shelar 
Signed-off-by: David S. Miller 

Cc: Tonghao Zhang 
Reviewed-by: Tonghao Zhang 
Signed-off-by: Greg Rose 
---
 datapath/datapath.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/datapath/datapath.c b/datapath/datapath.c
index aceb655bd..cf216c8ec 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -1746,6 +1746,7 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct 
genl_info *info)
ovs_dp_reset_user_features(skb, info);
}
 
+   ovs_unlock();
goto err_destroy_meters;
}
 
@@ -1762,7 +1763,6 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct 
genl_info *info)
return 0;
 
 err_destroy_meters:
-   ovs_unlock();
ovs_meters_exit(dp);
 err_destroy_ports_array:
kfree(dp->ports);
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V4 01/24] datapath: return an error instead of doing BUG_ON()

2020-10-12 Thread Greg Rose
From: Eelco Chaudron 

Upstream commit:
commit a734d1f4c2fc962ef4daa179e216df84a8ec5f84
Author: Eelco Chaudron 
Date:   Thu May 2 16:12:38 2019 -0400

net: openvswitch: return an error instead of doing BUG_ON()

For all other error cases in queue_userspace_packet() the error is
returned, so it makes sense to do the same for these two error cases.

Reported-by: Davide Caratti 
Signed-off-by: Eelco Chaudron 
Acked-by: Flavio Leitner 
Signed-off-by: David S. Miller 

Cc: Eelco Chaudron 
Acked-by: Eelco Chaudron 
Signed-off-by: Greg Rose 
---
 datapath/datapath.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/datapath/datapath.c b/datapath/datapath.c
index 05c1e4274..d604bfd36 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -469,7 +469,8 @@ static int queue_userspace_packet(struct datapath *dp, 
struct sk_buff *skb,
upcall->dp_ifindex = dp_ifindex;
 
err = ovs_nla_put_key(key, key, OVS_PACKET_ATTR_KEY, false, user_skb);
-   BUG_ON(err);
+   if (err)
+   goto out;
 
if (upcall_info->userdata)
__nla_put(user_skb, OVS_PACKET_ATTR_USERDATA,
@@ -486,7 +487,9 @@ static int queue_userspace_packet(struct datapath *dp, 
struct sk_buff *skb,
}
err = ovs_nla_put_tunnel_info(user_skb,
  upcall_info->egress_tun_info);
-   BUG_ON(err);
+   if (err)
+   goto out;
+
nla_nest_end(user_skb, nla);
}
 
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V4 09/24] datapath: simplify the flow_hash

2020-10-12 Thread Greg Rose
From: Tonghao Zhang 

Upstream commit:
commit 515b65a4b99197ae062a795ab4de919e6d04be04
Author: Tonghao Zhang 
Date:   Fri Nov 1 22:23:50 2019 +0800

net: openvswitch: simplify the flow_hash

Simplify the code and remove the unnecessary BUILD_BUG_ON.

Signed-off-by: Tonghao Zhang 
Tested-by: Greg Rose 
Acked-by: William Tu 
Acked-by: Pravin B Shelar 
Signed-off-by: David S. Miller 

Cc: Tonghao Zhang 
Reviewed-by: Tonghao Zhang 
Signed-off-by: Greg Rose 
---
 datapath/flow_table.c | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/datapath/flow_table.c b/datapath/flow_table.c
index 62d726ddd..7efaa8044 100644
--- a/datapath/flow_table.c
+++ b/datapath/flow_table.c
@@ -455,13 +455,10 @@ err_free_ti:
 static u32 flow_hash(const struct sw_flow_key *key,
 const struct sw_flow_key_range *range)
 {
-   int key_start = range->start;
-   int key_end = range->end;
-   const u32 *hash_key = (const u32 *)((const u8 *)key + key_start);
-   int hash_u32s = (key_end - key_start) >> 2;
+   const u32 *hash_key = (const u32 *)((const u8 *)key + range->start);
 
/* Make sure number of hash bytes are multiple of u32. */
-   BUILD_BUG_ON(sizeof(long) % sizeof(u32));
+   int hash_u32s = range_n_bytes(range) >> 2;
 
return jhash2(hash_key, hash_u32s, 0);
 }
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V4 02/24] datapath: drop unneeded likely() call around IS_ERR()

2020-10-12 Thread Greg Rose
From: Enrico Weigelt 

Upstream commit:
commit b90f5aa4d6268e81dd1fd51e5ef89d2892bf040d
Author: Enrico Weigelt 
Date:   Wed Jun 5 23:06:40 2019 +0200

net: openvswitch: drop unneeded likely() call around IS_ERR()

IS_ERR() already calls unlikely(), so this extra likely() call
around the !IS_ERR() is not needed.

Signed-off-by: Enrico Weigelt 
Signed-off-by: David S. Miller 

Cc: Enrico Weigelt 
Signed-off-by: Greg Rose 
---
 datapath/datapath.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/datapath/datapath.c b/datapath/datapath.c
index d604bfd36..4c485c88a 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -1402,7 +1402,7 @@ static int ovs_flow_cmd_del(struct sk_buff *skb, struct 
genl_info *info)
>id, info, false, ufid_flags);
 
if (likely(reply)) {
-   if (likely(!IS_ERR(reply))) {
+   if (!IS_ERR(reply)) {
rcu_read_lock();/*To keep RCU checker happy. */
err = ovs_flow_cmd_fill_info(flow, 
ovs_header->dp_ifindex,
 reply, info->snd_portid,
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH V4 04/24] datapath: Print error when ovs_execute_actions() fails

2020-10-12 Thread Greg Rose
From: Yifeng Sun 

Upstream commit:
commit aa733660dbd8d9192b8c528ae0f4b84f3fef74e4
Author: Yifeng Sun 
Date:   Sun Aug 4 19:56:11 2019 -0700

openvswitch: Print error when ovs_execute_actions() fails

Currently in function ovs_dp_process_packet(), return values of
ovs_execute_actions() are silently discarded. This patch prints out
an debug message when error happens so as to provide helpful hints
for debugging.
Acked-by: Pravin B Shelar 

Signed-off-by: David S. Miller 

Cc: Yifeng Sun 
Reviewed-by: Yifeng Sun 
Signed-off-by: Greg Rose 
---
 datapath/datapath.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/datapath/datapath.c b/datapath/datapath.c
index 2879f24ef..c8c21d774 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -240,6 +240,7 @@ void ovs_dp_process_packet(struct sk_buff *skb, struct 
sw_flow_key *key)
struct dp_stats_percpu *stats;
u64 *stats_counter;
u32 n_mask_hit;
+   int error;
 
stats = this_cpu_ptr(dp->stats_percpu);
 
@@ -248,7 +249,6 @@ void ovs_dp_process_packet(struct sk_buff *skb, struct 
sw_flow_key *key)
 _mask_hit);
if (unlikely(!flow)) {
struct dp_upcall_info upcall;
-   int error;
 
memset(, 0, sizeof(upcall));
upcall.cmd = OVS_PACKET_CMD_MISS;
@@ -265,7 +265,10 @@ void ovs_dp_process_packet(struct sk_buff *skb, struct 
sw_flow_key *key)
 
ovs_flow_stats_update(flow, key->tp.flags, skb);
sf_acts = rcu_dereference(flow->sf_acts);
-   ovs_execute_actions(dp, skb, sf_acts, key);
+   error = ovs_execute_actions(dp, skb, sf_acts, key);
+   if (unlikely(error))
+   net_dbg_ratelimited("ovs: action execution error on datapath 
%s: %d\n",
+   ovs_dp_name(dp), error);
 
stats_counter = >n_hit;
 
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


  1   2   3   4   5   6   7   8   9   10   >