Skip to content

openvswitch: remove support for legacy tunnel ports

Ilya Maximets linux-kselftest lkml netdev 1 version Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 1 replyApplied 6/6

Patches in v1 All 6 applied

#Subject and filesSizeRepliesApplied
1/6openvswitch: remove support for legacy tunnel typesinclude/uapi/linux/openvswitch.h net/openvswitch/Kconfig net/openvswitch/Makefile +10 more+52 -6130 repliesApplied
2/6openvswitch: vport: remove infrastructure for vport optionsnet/openvswitch/datapath.c net/openvswitch/vport.c net/openvswitch/vport.h+4 -840 repliesApplied
3/6openvswitch: vport: remove infrastructure for separate modulesnet/openvswitch/datapath.c net/openvswitch/vport.c net/openvswitch/vport.h+5 -350 repliesApplied
4/6net: geneve: remove unused geneve_dev_create_fbdrivers/net/geneve.c include/net/geneve.h+0 -540 repliesApplied
5/6net: gre: remove unused gretap_fb_dev_createinclude/net/gre.h net/ipv4/ip_gre.c+0 -490 repliesApplied
6/6net: vxlan: remove unused vxlan_dev_createdrivers/net/vxlan/vxlan_core.c include/net/vxlan.h+4 -410 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net-next 0/6] openvswitch: remove support for legacy tunnel ports

ovs-vswitchd doesn't use OVS_VPORT_TYPE_GRE/VXLAN/GENEVE with the Linux kernel module since adding support for standard tunnel devices with COLLECT_METADATA back in 2017. The code to use them was only activated as a fallback for old kernels, so not used in practice. And it is now fully removed in the upcoming OVS 4.0 release.

Modern way to use tunnels with OVS is to create standard tunnel ports with RTM_NEWLINK + COLLECT_METADATA and add them as OVS_VPORT_TYPE_NETDEV.

Device reference management and the netlink options parsing for these legacy port types is complicated and was a CVE magnet in the previous release cycles. Existence of these modules also makes locking analysis for geneve module and other core tunnel devices unnecessarily more complicated, especially in light of migration to per-netns locking:
https://lore.kernel.org/r/CAAVpQUDmZEaQNDSySLayqexgTrUbhBaL7XPCt9XNQzh+NGQ=UQ@mail.gmail.com

Since there are no actual users for these port types for a very long time, let's just remove the support entirely. There is no practical reason to run OVS from 2017 on a recent kernel.

While it's technically a uAPI change in some sense, from the user's perspective this removal looks indistinguishable from the kernel built with CONFIG_OPENVSWITCH_GENEVE/VXLAN/GRE disabled. And it seems like removal of unused drivers/modules is not a rare event these days.

There are 3 parts to this set:

1. The first patch does the tunnel port removal, which is the primary goal here.

2. Patches 2 and 3 remove extra infrastructure that is no longer in use by anything inside the openvswitch module.

3. Patches 4-6 remove functions from gre/vxlan/geneve modules that were added for openvswitch in the past to support the tunnel types. openvswitch is the only in-tree consumer of these functions.

Version 1:
- Rebased.
- Removed the tunnel modules from the new OVS selftest config.
- Addressed RFC review from Sashiko:
* Made ovs_netdev_link() static.
* Restored -EOPNOTSUPP if OVS_VPORT_ATTR_OPTIONS was provided.
* Removed retry in ovs_vport_cmd_new() as not needed anymore.

RFC:
- https://lore.kernel.org/r/[email protected]

Ilya Maximets (6):
openvswitch: remove support for legacy tunnel types
openvswitch: vport: remove infrastructure for vport options
openvswitch: vport: remove infrastructure for separate modules
net: geneve: remove unused geneve_dev_create_fb
net: gre: remove unused gretap_fb_dev_create
net: vxlan: remove unused vxlan_dev_create

 drivers/net/geneve.c                          |  49 -----
 drivers/net/vxlan/vxlan_core.c                |  42 +----
 include/net/geneve.h                          |   5 -
 include/net/gre.h                             |   2 -
 include/net/vxlan.h                           |   3 -
 include/uapi/linux/openvswitch.h              |  31 +++-
 net/ipv4/ip_gre.c                             |  47 -----
 net/openvswitch/Kconfig                       |  35 ----
 net/openvswitch/Makefile                      |   4 -
 net/openvswitch/datapath.c                    |  28 +--
 net/openvswitch/vport-geneve.c                | 143 ---------------
 net/openvswitch/vport-gre.c                   | 106 -----------
 net/openvswitch/vport-netdev.c                |  29 +--
 net/openvswitch/vport-netdev.h                |   2 -
 net/openvswitch/vport-vxlan.c                 | 172 ------------------
 net/openvswitch/vport.c                       |  79 +-------
 net/openvswitch/vport.h                       |  23 +--
 tools/testing/selftests/net/config            |   3 -
 .../testing/selftests/net/openvswitch/config  |   3 -
 .../selftests/net/openvswitch/openvswitch.sh  |  38 ----
 .../selftests/net/openvswitch/ovs-dpctl.py    |  93 +++-------
 21 files changed, 63 insertions(+), 874 deletions(-)
 delete mode 100644 net/openvswitch/vport-geneve.c
 delete mode 100644 net/openvswitch/vport-gre.c
 delete mode 100644 net/openvswitch/vport-vxlan.c
Signature · 1 line
2.55.0