openvswitch: remove the intree kernel modules

The kmod-openvswitch-*-intree packages build the datapath shipped in the
Open vSwitch source tree, which only supports kernels 3.10 to 5.5. They
have not been buildable on any supported OpenWrt kernel since 22.03
(Linux 5.10). They still show up in menuconfig because kernel_version_cmp
is empty during the metadata scan, but selecting one only prints "intree
kmods selected but not supported".

Open vSwitch removed the out-of-tree datapath in 3.0. Remove the
packages together with the configure plumbing (--with-linux, KARCH,
OVS_KERNEL_MAKE_FLAGS), the patch for passing kernel make flags and the
README section. The kmod-openvswitch packages built from the kernel's
net/openvswitch are unchanged.

Signed-off-by: Sander van Deijck <sander@vandeijck.com>
This commit is contained in:
Sander van Deijck authored and Hannu Nyman committed 2026-10-24 10:04:44 +03:00
1 parent 5d270ef799
commit 5e520397b5
3 files changed
+5 -126

No files matched your search

+5 -70
View File
@@ -45,38 +45,27 @@ source "$(SOURCE)/Config.in"
endef
ovs_kmod_packages:=
ovs_kmod_intree_kernel_patchver_min:=3.10
ovs_kmod_intree_kernel_patchver_max:=5.5
ovs_kmod_intree_not_supported:=$(strip $(call kernel_patchver_lt,$(ovs_kmod_intree_kernel_patchver_min))$(call kernel_patchver_gt,$(ovs_kmod_intree_kernel_patchver_max)))
ovs_kmod_intree_dir:=$(PKG_BUILD_DIR)/datapath/linux
ovs_kmod_upstream_dir:=$(LINUX_DIR)/net/openvswitch
ovs_kmod_package_name=$(if $(filter openvswitch,$(1)),openvswitch,$(1))
ovs_kmod_is_intree=$(filter %-intree,$(1))
ovs_kmod_upstream_name=kmod-$(call ovs_kmod_package_name,$(patsubst %-intree,%,$(1)))
ovs_kmod_package_provides=$(call ovs_kmod_upstream_name,$(1))
# Do not use PROVIDES for any OVS kmod. The provider-alternation logic in
# scripts/package-metadata.pl generates recursive Kconfig dependencies when
# kmod-openvswitch-intree provides kmod-openvswitch, because userspace
# packages (openvswitch, ovsd, ovn-host) that +depend on kmod-openvswitch
# get cross-referenced against the intree provider via PACKAGE_<provider>
# < PACKAGE_<requester> conditions (#22664).
define OvsKmodPackageTemplate
ifeq ($(if $(call ovs_kmod_is_intree,$(1)),$(ovs_kmod_intree_not_supported)),)
define KernelPackage/$(call ovs_kmod_package_name,$(1))
SECTION:=kernel
CATEGORY:=Kernel modules
SUBMENU:=Network Support
TITLE:=$(ovs_kmod_$(1)_title)
DEPENDS:=$(ovs_kmod_$(1)_depends) $(if $(call ovs_kmod_is_intree,$(1)),@IPV6 @DEVEL)
DEPENDS:=$(ovs_kmod_$(1)_depends)
KCONFIG:=$(ovs_kmod_$(1)_kconfig)
FILES:=$(ovs_kmod_$(1)_files)
AUTOLOAD:=$(call AutoProbe,$(foreach m,$(ovs_kmod_$(1)_files),$(notdir $(patsubst %.ko,%,$(basename $(m))))))
endef
ovs_kmod_packages+=$(call ovs_kmod_package_name,$(1))
endif
endef
# NOTE depends
#
# - kmod-ipt-conntrack-extra: required for nf_conncount.ko
#
ovs_kmod_openvswitch_title:=Open vSwitch kernel datapath (upstream)
ovs_kmod_openvswitch_kconfig:=CONFIG_OPENVSWITCH
ovs_kmod_openvswitch_depends:=\
@@ -109,46 +98,6 @@ ovs_kmod_openvswitch-geneve_depends:= +kmod-openvswitch +kmod-geneve
ovs_kmod_openvswitch-geneve_files:= $(ovs_kmod_upstream_dir)/vport-geneve.ko
$(eval $(call OvsKmodPackageTemplate,openvswitch-geneve))
# NOTE depends
#
# - kmod-ipt-conntrack-extra: required for nf_conncount.ko
#
ovs_kmod_openvswitch-intree_title:=Open vSwitch kernel datapath (in tree)
ovs_kmod_openvswitch-intree_depends:=\
+kmod-nf-nat \
+IPV6:kmod-nf-nat6 \
+kmod-nf-conntrack \
+kmod-udptunnel4 \
+kmod-ipt-conntrack-extra \
ovs_kmod_openvswitch-intree_files:= $(ovs_kmod_intree_dir)/openvswitch.ko
$(eval $(call OvsKmodPackageTemplate,openvswitch-intree))
ovs_kmod_openvswitch-gre-intree_title:=Open vSwitch GRE tunneling support (in tree)
ovs_kmod_openvswitch-gre-intree_depends:= +kmod-openvswitch-intree +kmod-gre
ovs_kmod_openvswitch-gre-intree_files:= $(ovs_kmod_intree_dir)/vport-gre.ko
$(eval $(call OvsKmodPackageTemplate,openvswitch-gre-intree))
ovs_kmod_openvswitch-vxlan-intree_title:=Open vSwitch VXLAN tunneling support (in tree)
ovs_kmod_openvswitch-vxlan-intree_depends:= +kmod-openvswitch-intree +kmod-vxlan
ovs_kmod_openvswitch-vxlan-intree_files:= $(ovs_kmod_intree_dir)/vport-vxlan.ko
$(eval $(call OvsKmodPackageTemplate,openvswitch-vxlan-intree))
ovs_kmod_openvswitch-geneve-intree_title:=Open vSwitch Geneve tunneling support (in tree)
ovs_kmod_openvswitch-geneve-intree_depends:= +kmod-openvswitch-intree +kmod-geneve
ovs_kmod_openvswitch-geneve-intree_files:= $(ovs_kmod_intree_dir)/vport-geneve.ko
$(eval $(call OvsKmodPackageTemplate,openvswitch-geneve-intree))
ovs_kmod_openvswitch-stt-intree_title:=Open vSwitch STT tunneling support (in tree)
ovs_kmod_openvswitch-stt-intree_depends:= +kmod-openvswitch-intree
ovs_kmod_openvswitch-stt-intree_files:= $(ovs_kmod_intree_dir)/vport-stt.ko
$(eval $(call OvsKmodPackageTemplate,openvswitch-stt-intree))
ovs_kmod_openvswitch-lisp-intree_title:=Open vSwitch LISP tunneling support (in tree)
ovs_kmod_openvswitch-lisp-intree_depends:= +kmod-openvswitch-intree
ovs_kmod_openvswitch-lisp-intree_files:= $(ovs_kmod_intree_dir)/vport-lisp.ko
$(eval $(call OvsKmodPackageTemplate,openvswitch-lisp-intree))
# Dependency review
#
# for f in sbin/*; do echo $f; readelf -d $f | grep -i shared; done
@@ -258,24 +207,10 @@ CONFIGURE_VARS += \
ovs_cv_python3=$(PYTHON3) \
ovs_cv_python3_host=$(HOST_PYTHON3_BIN) \
SPHINXBUILD=none \
KARCH=$(LINUX_KARCH) \
ovs_intree_kmod_configs:=CONFIG_PACKAGE_kmod-openvswitch-intree
ovs_intree_kmod_enabled:=$(strip $(foreach c,$(ovs_intree_kmod_configs),$($(c))))
PKG_CONFIG_DEPENDS+=$(ovs_intree_kmod_configs)
ifneq ($(ovs_intree_kmod_enabled),)
ifeq ($(ovs_kmod_intree_not_supported),)
CONFIGURE_ARGS += --with-linux=$(LINUX_DIR)
else
$(warning XXX: openvswitch: intree kmods selected but not supported)
endif
endif
TARGET_CFLAGS += -std=gnu99
MAKE_VARS += PYTHONPATH="$(HOST_PYTHON3PATH)"
export OVS_KERNEL_MAKE_FLAGS=$(KERNEL_MAKE_FLAGS)
override CONFIG_AUTOREMOVE=
$(foreach p,$(ovs_kmod_packages),\
-33
View File
@@ -28,39 +28,6 @@ mainly a wrapper around `ovs-ctl` and `ovn-ctl` with simple knobs from
Use `ovs-ctl` and `ovn-ctl` directly for more functionalities
# Open vSwitch in-tree Linux datapath modules
The Open vSwitch build system uses regexp and conditional-compilation
heuristics to support building the shipped kernel module source code against a
wide range of kernels, as of openvswitch-2.10, the list is supposed to include
vanilla linux 3.10 to 4.15, plus a few distro kernels.
It may NOT work
- Sometimes the code does not compile
- Sometimes the code compiles but insmod will fail
- Sometimes modules are loaded okay but actually does not function right
For these reasons, the in-tree datapath modules are NOT visible/enabled by
default.
Building and using in-tree datapath modules requires some level of devel
abilities to proceed. You are expected to configure build options and build
the code on your own
E.g. pair openvswitch userspace with in-tree datapath module
CONFIG_DEVEL=y
CONFIG_PACKAGE_openvswitch=y
# CONFIG_PACKAGE_kmod-openvswitch is not set
CONFIG_PACKAGE_kmod-openvswitch-intree=y
E.g. replace in-tree datapath module with upstream version
opkg remove --force-depends kmod-openvswitch-intree
opkg install kmod-openvswitch
ovs-ctl force-reload-kmod
# UCI configuration options
There are 5 config section types in package openvswitch:
@@ -1,23 +0,0 @@
From 1df5a0eaf78e93e21d21f1438afbe5fa8a37ea61 Mon Sep 17 00:00:00 2001
From: Yousong Zhou <yszhou4tech@gmail.com>
Date: Tue, 26 May 2020 22:45:53 +0800
Subject: [PATCH] datapath: allow passing additional $(OVS_KERNEL_MAKE_FLAGS)
This can be useful for passing args like -iremap for reproducible builds
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
---
datapath/linux/Makefile.main.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/datapath/linux/Makefile.main.in
+++ b/datapath/linux/Makefile.main.in
@@ -68,7 +68,7 @@ ifeq (,$(wildcard $(CONFIG_FILE)))
endif
default:
- $(MAKE) -C $(KSRC) $(if @KARCH@,ARCH=@KARCH@) M=$(builddir) modules
+ $(MAKE) -C $(KSRC) $(OVS_KERNEL_MAKE_FLAGS) $(if @KARCH@,ARCH=@KARCH@) M=$(builddir) modules
modules_install:
$(MAKE) -C $(KSRC) $(if @KARCH@,ARCH=@KARCH@) M=$(builddir) modules_install