From nobody Fri Jun 12 17:18:01 2026 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 845803B1EC7 for ; Wed, 13 May 2026 18:36:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.67 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778697386; cv=none; b=GVQ2zOxau3YaRCkwwJ7xbk803Bomhv7lQnvXVesvkD4AqBAGGIGbgSPfPk/wmYxcevgPYGJZugq5u0iIpHRFbYIOi1+Vvoa5VX5YoRrsOYbOuKzjYcNm1cYXM04X0GiE6VM5Bz8pryI+lcoLJR93CUgpZgqidIbgZP18NuOoS8w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778697386; c=relaxed/simple; bh=wWa1JBSE3nhXt0Rji3VN7q4eeVvPHVU0QnbEnwlLuzs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=L3qTBigUF5ugqme/b8n6kf/Yp6ccBTva8jQXhwZzZ7sapqauG/6Dmcc2/v+YZWPMCTebdgZMyHUxlntIK+p4rr9MRn3wf/kCV7Z7RZB4vq/MSZdWpQ1MvqHuwMIsegp4Nm9WLwDngBFV26NLEP3u4Ljr8IG/28MRA/x2JECKkAY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ovn.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.128.67 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ovn.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f67.google.com with SMTP id 5b1f17b1804b1-48e56c1bf5dso43100225e9.3 for ; Wed, 13 May 2026 11:36:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778697380; x=1779302180; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=G7xkY4psIDuneV/U6xl1v5+LWyryeqTzrgr/KXeFrns=; b=OBOHaPDM+STjdInGk/a0FfKzsIj7U0q3tCIqN6s8orRgKxfvRP7gVLDwnBHx70FfOB vowUHpdpg/Kh6jdCu2qNzteAzvjqbHlNtYcMAecLtLFI18Np9cz5XzUgIPyqJrS4ObE/ KXw39inff5cjJisk0XHcf3N4vuhzl3pDXzdgQm0rtBw4/Ze/jP2cb04TT1PdNcfRKStf 1llwgQXvZsdhWcir/p1Sinhx9n/nM0sYzI/IFGf1+s8FShEZfQiFJymvGoLi9Q/d7xTD T99+CK8sp1lJkExTCrwnxpmAViMQHc1cKpHtYe0g4Ml53XiyCM4kg5zTuKJYjntCA/+o lHyg== X-Forwarded-Encrypted: i=1; AFNElJ+urXdQWClPW63MT2s3xwiRAhB/RA+MLwOLhuLyK9IEawCPjAkN+wXLGvLBrRfhFm1TOfvgtP0BOwGm6y0=@vger.kernel.org X-Gm-Message-State: AOJu0YzBQGcDXPUSmMUqpj5OZBsxaWMTjKP3n96C1vS/MaYD8ZNnPh0n cUTJNSH/vOyGyFogW63SFyf9gQ1w8tJ30O3fc1952vcf9JNM0+vWMmAz X-Gm-Gg: Acq92OHNY/QgOhhj1y06750a+TxmglappkMfivPQVeqw8Y+1sI20G89CwgoB+SzME/d Iol0OTovN9nbu9iS+MA7VdF8kx802+fsJmxDEcqWUutEn+NMsCzcm+x5+gEBt0t4iiNg7SM/pBW N7t3JWTkAPcKJDXsS9Jm6OZ1Cy2MZzgH6CcjpAgymGOgGtiWzUBOFp9Q5eCDCuPEt6CjnWYvT5a RgAPVRYlfgqpmKuHUne/yEBFJwiK6fPSd8oBztHhvpBxN1ZHzfema9NcGxvYrxMeDoVDZlNDyOl Vnv7BPyQyjbjABpAOdbToMUiyzAyoJSXRBgoiPpu5LjJ2h/iVk7Od/9HycY2yTXURPGx++i10+w KADrXEO7B+5qPSbhQM1ncykf2u3dwtEJtD9pz0pr4zky6IPL3+pypiBAFWOsyp0CRkn0eBuWNxU 4tV2j/ltlJQ+gWcVRei6LGjPdJl524Z6pbRZcHkJs6QorisqSe7oXc/j7pZjb6bOR5gB00AQ== X-Received: by 2002:a05:600c:4c29:b0:48f:d1b8:9aa4 with SMTP id 5b1f17b1804b1-48fd1b8a058mr27450615e9.7.1778697379653; Wed, 13 May 2026 11:36:19 -0700 (PDT) Received: from im-t490s.redhat.com (37-48-40-237.nat.epc.tmcz.cz. [37.48.40.237]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45da15a6454sm720609f8f.34.2026.05.13.11.36.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2026 11:36:19 -0700 (PDT) From: Ilya Maximets To: netdev@vger.kernel.org Cc: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Aaron Conole , Eelco Chaudron , David Ahern , Ido Schimmel , Shuah Khan , Nikolay Aleksandrov , Kuniyuki Iwashima , Petr Machata , Fernando Fernandez Mancera , Antoine Tenart , Stanislav Fomichev , linux-kernel@vger.kernel.org, dev@openvswitch.org, linux-kselftest@vger.kernel.org, Ilya Maximets Subject: [RFC net-next 1/6] openvswitch: remove support for legacy tunnel types Date: Wed, 13 May 2026 20:35:21 +0200 Message-ID: <20260513183559.2141010-2-i.maximets@ovn.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260513183559.2141010-1-i.maximets@ovn.org> References: <20260513183559.2141010-1-i.maximets@ovn.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" ovs-vswitchd doesn't use OVS_VPORT_TYPE_GRE/VXLAN/GENEVE with upstream Linux kernel module since adding support for standard tunnel devices with COLLECT_METADATA back in 2017. The code to use them is still present, but it is only activated as a fallback for old kernels, so not used in practice. And it is marked for removal in the next OVS release this summer. Device reference management and the netlink options parsing for these port types is complicated and was a CVE magnet recently. Since there are no actual users for these port types for a very long time, let's just remove the support entirely. A comment is added to the uAPI header noting that standard RTM_NEWLINK with COLLECT_METADATA followed by OVS_VPORT_CMD_NEW with the simple OVS_VPORT_TYPE_NETDEV should be used instead. Modules responsible for these tunnel ports are removed as well as selftests covering this functionality. Further cleanups will follow. Signed-off-by: Ilya Maximets --- include/uapi/linux/openvswitch.h | 31 +++- net/openvswitch/Kconfig | 35 ---- net/openvswitch/Makefile | 4 - net/openvswitch/datapath.c | 6 +- net/openvswitch/vport-geneve.c | 143 --------------- net/openvswitch/vport-gre.c | 106 ----------- net/openvswitch/vport-netdev.c | 28 +-- net/openvswitch/vport-netdev.h | 3 +- net/openvswitch/vport-vxlan.c | 172 ------------------ tools/testing/selftests/net/config | 3 - .../selftests/net/openvswitch/openvswitch.sh | 37 ---- .../selftests/net/openvswitch/ovs-dpctl.py | 93 +++------- 12 files changed, 53 insertions(+), 608 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 diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswi= tch.h index aa2acdbda8f89..440825e658371 100644 --- a/include/uapi/linux/openvswitch.h +++ b/include/uapi/linux/openvswitch.h @@ -244,13 +244,33 @@ enum ovs_vport_cmd { OVS_VPORT_CMD_SET }; =20 +/** + * enum ovs_vport_type - OVS vport types for %OVS_VPORT_ATTR_TYPE. + * @OVS_VPORT_TYPE_NETDEV: Existing network device attached as a vport. + * @OVS_VPORT_TYPE_INTERNAL: Network device implemented by the OVS datapat= h. + * @OVS_VPORT_TYPE_GRE: Legacy GRE tunnel. Not supported, see below. + * @OVS_VPORT_TYPE_VXLAN: Legacy VXLAN tunnel. Not supported, see below. + * @OVS_VPORT_TYPE_GENEVE: Legacy Geneve tunnel. Not supported, see below. + * + * The tunnel vport types are not supported. Instead, create the tunnel d= evice + * using %RTM_NEWLINK with the appropriate %IFLA_INFO_KIND (e.g. ``gre``, + * ``gretap``, ``vxlan``, ``geneve``, or other tunnel types) and add it as + * %OVS_VPORT_TYPE_NETDEV. To match and set tunnel parameters on a per-fl= ow + * basis, the tunnel device should collect metadata. To do that, some tun= nel + * types require an explicit flag such as %IFLA_VXLAN_COLLECT_METADATA for + * ``vxlan``, while others such as ``bareudp`` collect metadata + * unconditionally. + */ enum ovs_vport_type { + /* private: */ OVS_VPORT_TYPE_UNSPEC, + /* public: */ OVS_VPORT_TYPE_NETDEV, /* network device */ OVS_VPORT_TYPE_INTERNAL, /* network device implemented by datapath */ - OVS_VPORT_TYPE_GRE, /* GRE tunnel. */ - OVS_VPORT_TYPE_VXLAN, /* VXLAN tunnel. */ - OVS_VPORT_TYPE_GENEVE, /* Geneve tunnel. */ + OVS_VPORT_TYPE_GRE, /* GRE tunnel (legacy, not supported). */ + OVS_VPORT_TYPE_VXLAN, /* VXLAN tunnel (legacy, not supported). */ + OVS_VPORT_TYPE_GENEVE, /* Geneve tunnel (legacy, not supported). */ + /* private: */ __OVS_VPORT_TYPE_MAX }; =20 @@ -284,7 +304,7 @@ enum ovs_vport_type { * %OVS_VPORT_ATTR_NAME attributes are required. %OVS_VPORT_ATTR_PORT_NO = is * optional; if not specified a free port number is automatically selected. * Whether %OVS_VPORT_ATTR_OPTIONS is required or optional depends on the = type - * of vport. + * of vport. None of currently supported vport types support options. * * For other requests, if %OVS_VPORT_ATTR_NAME is specified then it is use= d to * look up the vport to operate on; otherwise dp_idx from the &struct @@ -336,7 +356,8 @@ enum { #define OVS_VXLAN_EXT_MAX (__OVS_VXLAN_EXT_MAX - 1) =20 =20 -/* OVS_VPORT_ATTR_OPTIONS attributes for tunnels. +/* OVS_VPORT_ATTR_OPTIONS attributes for legacy tunnel vports. + * Not supported, see the note for enum ovs_vport_type. */ enum { OVS_TUNNEL_ATTR_UNSPEC, diff --git a/net/openvswitch/Kconfig b/net/openvswitch/Kconfig index e6aaee92dba48..19ac9ae18f1e7 100644 --- a/net/openvswitch/Kconfig +++ b/net/openvswitch/Kconfig @@ -40,38 +40,3 @@ config OPENVSWITCH called openvswitch. =20 If unsure, say N. - -config OPENVSWITCH_GRE - tristate "Open vSwitch GRE tunneling support" - depends on OPENVSWITCH - depends on NET_IPGRE - default OPENVSWITCH - help - If you say Y here, then the Open vSwitch will be able create GRE - vport. - - Say N to exclude this support and reduce the binary size. - - If unsure, say Y. - -config OPENVSWITCH_VXLAN - tristate "Open vSwitch VXLAN tunneling support" - depends on OPENVSWITCH - depends on VXLAN - default OPENVSWITCH - help - If you say Y here, then the Open vSwitch will be able create vxlan vpor= t. - - Say N to exclude this support and reduce the binary size. - - If unsure, say Y. - -config OPENVSWITCH_GENEVE - tristate "Open vSwitch Geneve tunneling support" - depends on OPENVSWITCH - depends on GENEVE - default OPENVSWITCH - help - If you say Y here, then the Open vSwitch will be able create geneve vpo= rt. - - Say N to exclude this support and reduce the binary size. diff --git a/net/openvswitch/Makefile b/net/openvswitch/Makefile index 28982630bef32..46a27ab369f90 100644 --- a/net/openvswitch/Makefile +++ b/net/openvswitch/Makefile @@ -22,8 +22,4 @@ ifneq ($(CONFIG_NF_CONNTRACK),) openvswitch-y +=3D conntrack.o endif =20 -obj-$(CONFIG_OPENVSWITCH_VXLAN)+=3D vport-vxlan.o -obj-$(CONFIG_OPENVSWITCH_GENEVE)+=3D vport-geneve.o -obj-$(CONFIG_OPENVSWITCH_GRE) +=3D vport-gre.o - CFLAGS_openvswitch_trace.o =3D -I$(src) diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index bbbde50fc6498..d86c53fedc1e1 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c @@ -2206,11 +2206,9 @@ static size_t ovs_vport_cmd_msg_size(void) /* OVS_VPORT_ATTR_UPCALL_PID */ msgsize +=3D nla_total_size(nr_cpu_ids * sizeof(u32)); =20 - /* OVS_VPORT_ATTR_OPTIONS(OVS_TUNNEL_ATTR_DST_PORT + - * OVS_TUNNEL_ATTR_EXTENSION(OVS_VXLAN_EXT_GBP)) + /* There are no vports supporting OVS_VPORT_ATTR_OPTIONS, so it is + * not included in the message size calculation. */ - msgsize +=3D nla_total_size(nla_total_size(sizeof(u16)) + - nla_total_size(nla_total_size(0))); =20 return msgsize; } diff --git a/net/openvswitch/vport-geneve.c b/net/openvswitch/vport-geneve.c deleted file mode 100644 index cb5ea4424ffc8..0000000000000 --- a/net/openvswitch/vport-geneve.c +++ /dev/null @@ -1,143 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Copyright (c) 2014 Nicira, Inc. - */ - -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "datapath.h" -#include "vport.h" -#include "vport-netdev.h" - -static struct vport_ops ovs_geneve_vport_ops; -/** - * struct geneve_port - Keeps track of open UDP ports - * @dst_port: destination port. - */ -struct geneve_port { - u16 dst_port; -}; - -static inline struct geneve_port *geneve_vport(const struct vport *vport) -{ - return vport_priv(vport); -} - -static int geneve_get_options(const struct vport *vport, - struct sk_buff *skb) -{ - struct geneve_port *geneve_port =3D geneve_vport(vport); - - if (nla_put_u16(skb, OVS_TUNNEL_ATTR_DST_PORT, geneve_port->dst_port)) - return -EMSGSIZE; - return 0; -} - -static struct vport *geneve_tnl_create(const struct vport_parms *parms) -{ - struct net *net =3D ovs_dp_get_net(parms->dp); - struct nlattr *options =3D parms->options; - struct geneve_port *geneve_port; - struct net_device *dev; - struct vport *vport; - struct nlattr *a; - u16 dst_port; - int err; - - if (!options) { - err =3D -EINVAL; - goto error; - } - - a =3D nla_find_nested(options, OVS_TUNNEL_ATTR_DST_PORT); - if (a && nla_len(a) =3D=3D sizeof(u16)) { - dst_port =3D nla_get_u16(a); - } else { - /* Require destination port from userspace. */ - err =3D -EINVAL; - goto error; - } - - vport =3D ovs_vport_alloc(sizeof(struct geneve_port), - &ovs_geneve_vport_ops, parms); - if (IS_ERR(vport)) - return vport; - - geneve_port =3D geneve_vport(vport); - geneve_port->dst_port =3D dst_port; - - rtnl_lock(); - dev =3D geneve_dev_create_fb(net, parms->name, NET_NAME_USER, dst_port); - if (IS_ERR(dev)) { - rtnl_unlock(); - ovs_vport_free(vport); - return ERR_CAST(dev); - } - - err =3D dev_change_flags(dev, dev->flags | IFF_UP, NULL); - if (err < 0) { - rtnl_delete_link(dev, 0, NULL); - rtnl_unlock(); - ovs_vport_free(vport); - goto error; - } - - vport->dev =3D dev; - netdev_hold(vport->dev, &vport->dev_tracker, GFP_KERNEL); - - rtnl_unlock(); - return vport; -error: - return ERR_PTR(err); -} - -static struct vport *geneve_create(const struct vport_parms *parms) -{ - struct vport *vport; - - vport =3D geneve_tnl_create(parms); - if (IS_ERR(vport)) - return vport; - - return ovs_netdev_link(vport, true); -} - -static struct vport_ops ovs_geneve_vport_ops =3D { - .type =3D OVS_VPORT_TYPE_GENEVE, - .create =3D geneve_create, - .destroy =3D ovs_netdev_tunnel_destroy, - .get_options =3D geneve_get_options, - .send =3D dev_queue_xmit, -}; - -static int __init ovs_geneve_tnl_init(void) -{ - return ovs_vport_ops_register(&ovs_geneve_vport_ops); -} - -static void __exit ovs_geneve_tnl_exit(void) -{ - ovs_vport_ops_unregister(&ovs_geneve_vport_ops); -} - -module_init(ovs_geneve_tnl_init); -module_exit(ovs_geneve_tnl_exit); - -MODULE_DESCRIPTION("OVS: Geneve switching port"); -MODULE_LICENSE("GPL"); -MODULE_ALIAS("vport-type-5"); diff --git a/net/openvswitch/vport-gre.c b/net/openvswitch/vport-gre.c deleted file mode 100644 index 6cb5a697b396a..0000000000000 --- a/net/openvswitch/vport-gre.c +++ /dev/null @@ -1,106 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * Copyright (c) 2007-2014 Nicira, Inc. - */ - -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "datapath.h" -#include "vport.h" -#include "vport-netdev.h" - -static struct vport_ops ovs_gre_vport_ops; - -static struct vport *gre_tnl_create(const struct vport_parms *parms) -{ - struct net *net =3D ovs_dp_get_net(parms->dp); - struct net_device *dev; - struct vport *vport; - int err; - - vport =3D ovs_vport_alloc(0, &ovs_gre_vport_ops, parms); - if (IS_ERR(vport)) - return vport; - - rtnl_lock(); - dev =3D gretap_fb_dev_create(net, parms->name, NET_NAME_USER); - if (IS_ERR(dev)) { - rtnl_unlock(); - ovs_vport_free(vport); - return ERR_CAST(dev); - } - - err =3D dev_change_flags(dev, dev->flags | IFF_UP, NULL); - if (err < 0) { - rtnl_delete_link(dev, 0, NULL); - rtnl_unlock(); - ovs_vport_free(vport); - return ERR_PTR(err); - } - - vport->dev =3D dev; - netdev_hold(vport->dev, &vport->dev_tracker, GFP_KERNEL); - - rtnl_unlock(); - return vport; -} - -static struct vport *gre_create(const struct vport_parms *parms) -{ - struct vport *vport; - - vport =3D gre_tnl_create(parms); - if (IS_ERR(vport)) - return vport; - - return ovs_netdev_link(vport, true); -} - -static struct vport_ops ovs_gre_vport_ops =3D { - .type =3D OVS_VPORT_TYPE_GRE, - .create =3D gre_create, - .send =3D dev_queue_xmit, - .destroy =3D ovs_netdev_tunnel_destroy, -}; - -static int __init ovs_gre_tnl_init(void) -{ - return ovs_vport_ops_register(&ovs_gre_vport_ops); -} - -static void __exit ovs_gre_tnl_exit(void) -{ - ovs_vport_ops_unregister(&ovs_gre_vport_ops); -} - -module_init(ovs_gre_tnl_init); -module_exit(ovs_gre_tnl_exit); - -MODULE_DESCRIPTION("OVS: GRE switching port"); -MODULE_LICENSE("GPL"); -MODULE_ALIAS("vport-type-3"); diff --git a/net/openvswitch/vport-netdev.c b/net/openvswitch/vport-netdev.c index c42642075685d..ebfee309e6dbb 100644 --- a/net/openvswitch/vport-netdev.c +++ b/net/openvswitch/vport-netdev.c @@ -73,7 +73,7 @@ static struct net_device *get_dpdev(const struct datapath= *dp) return local->dev; } =20 -struct vport *ovs_netdev_link(struct vport *vport, bool tunnel) +struct vport *ovs_netdev_link(struct vport *vport) { int err; =20 @@ -104,8 +104,6 @@ struct vport *ovs_netdev_link(struct vport *vport, bool= tunnel) error_master_upper_dev_unlink: netdev_upper_dev_unlink(vport->dev, get_dpdev(vport->dp)); error_put_unlock: - if (tunnel && vport->dev->reg_state =3D=3D NETREG_REGISTERED) - rtnl_delete_link(vport->dev, 0, NULL); netdev_put(vport->dev, &vport->dev_tracker); rtnl_unlock(); error_free_vport: @@ -144,7 +142,7 @@ static struct vport *netdev_create(const struct vport_p= arms *parms) goto error_put; } =20 - return ovs_netdev_link(vport, false); + return ovs_netdev_link(vport); error_put: netdev_put(vport->dev, &vport->dev_tracker); error_free_vport: @@ -196,28 +194,6 @@ static void netdev_destroy(struct vport *vport) call_rcu(&vport->rcu, vport_netdev_free); } =20 -void ovs_netdev_tunnel_destroy(struct vport *vport) -{ - rtnl_lock(); - if (netif_is_ovs_port(vport->dev)) - ovs_netdev_detach_dev(vport); - - /* We can be invoked by both explicit vport deletion and - * underlying netdev deregistration; delete the link only - * if it's not already shutting down. - */ - if (vport->dev->reg_state =3D=3D NETREG_REGISTERED) - rtnl_delete_link(vport->dev, 0, NULL); - - /* We can't put the device reference yet, since it can still be in - * use, but rtnl_unlock()->netdev_run_todo() will block until all - * the references are released, so the RCU call must be before it. - */ - call_rcu(&vport->rcu, vport_netdev_free); - rtnl_unlock(); -} -EXPORT_SYMBOL_GPL(ovs_netdev_tunnel_destroy); - /* Returns null if this device is not attached to a datapath. */ struct vport *ovs_netdev_get_vport(struct net_device *dev) { diff --git a/net/openvswitch/vport-netdev.h b/net/openvswitch/vport-netdev.h index 6c0d7366f9862..15fa27054b505 100644 --- a/net/openvswitch/vport-netdev.h +++ b/net/openvswitch/vport-netdev.h @@ -13,11 +13,10 @@ =20 struct vport *ovs_netdev_get_vport(struct net_device *dev); =20 -struct vport *ovs_netdev_link(struct vport *vport, bool tunnel); +struct vport *ovs_netdev_link(struct vport *vport); void ovs_netdev_detach_dev(struct vport *); =20 int __init ovs_netdev_init(void); void ovs_netdev_exit(void); =20 -void ovs_netdev_tunnel_destroy(struct vport *vport); #endif /* vport_netdev.h */ diff --git a/net/openvswitch/vport-vxlan.c b/net/openvswitch/vport-vxlan.c deleted file mode 100644 index c1b37b50d29e1..0000000000000 --- a/net/openvswitch/vport-vxlan.c +++ /dev/null @@ -1,172 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * Copyright (c) 2014 Nicira, Inc. - * Copyright (c) 2013 Cisco Systems, Inc. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "datapath.h" -#include "vport.h" -#include "vport-netdev.h" - -static struct vport_ops ovs_vxlan_netdev_vport_ops; - -static int vxlan_get_options(const struct vport *vport, struct sk_buff *sk= b) -{ - struct vxlan_dev *vxlan =3D netdev_priv(vport->dev); - __be16 dst_port =3D vxlan->cfg.dst_port; - - if (nla_put_u16(skb, OVS_TUNNEL_ATTR_DST_PORT, ntohs(dst_port))) - return -EMSGSIZE; - - if (vxlan->cfg.flags & VXLAN_F_GBP) { - struct nlattr *exts; - - exts =3D nla_nest_start_noflag(skb, OVS_TUNNEL_ATTR_EXTENSION); - if (!exts) - return -EMSGSIZE; - - if (vxlan->cfg.flags & VXLAN_F_GBP && - nla_put_flag(skb, OVS_VXLAN_EXT_GBP)) - return -EMSGSIZE; - - nla_nest_end(skb, exts); - } - - return 0; -} - -static const struct nla_policy exts_policy[OVS_VXLAN_EXT_MAX + 1] =3D { - [OVS_VXLAN_EXT_GBP] =3D { .type =3D NLA_FLAG, }, -}; - -static int vxlan_configure_exts(struct vport *vport, struct nlattr *attr, - struct vxlan_config *conf) -{ - struct nlattr *exts[OVS_VXLAN_EXT_MAX + 1]; - int err; - - if (nla_len(attr) < sizeof(struct nlattr)) - return -EINVAL; - - err =3D nla_parse_nested_deprecated(exts, OVS_VXLAN_EXT_MAX, attr, - exts_policy, NULL); - if (err < 0) - return err; - - if (exts[OVS_VXLAN_EXT_GBP]) - conf->flags |=3D VXLAN_F_GBP; - - return 0; -} - -static struct vport *vxlan_tnl_create(const struct vport_parms *parms) -{ - struct net *net =3D ovs_dp_get_net(parms->dp); - struct nlattr *options =3D parms->options; - struct net_device *dev; - struct vport *vport; - struct nlattr *a; - int err; - struct vxlan_config conf =3D { - .no_share =3D true, - .flags =3D VXLAN_F_COLLECT_METADATA | VXLAN_F_UDP_ZERO_CSUM6_RX, - /* Don't restrict the packets that can be sent by MTU */ - .mtu =3D IP_MAX_MTU, - }; - - if (!options) { - err =3D -EINVAL; - goto error; - } - - a =3D nla_find_nested(options, OVS_TUNNEL_ATTR_DST_PORT); - if (a && nla_len(a) =3D=3D sizeof(u16)) { - conf.dst_port =3D htons(nla_get_u16(a)); - } else { - /* Require destination port from userspace. */ - err =3D -EINVAL; - goto error; - } - - vport =3D ovs_vport_alloc(0, &ovs_vxlan_netdev_vport_ops, parms); - if (IS_ERR(vport)) - return vport; - - a =3D nla_find_nested(options, OVS_TUNNEL_ATTR_EXTENSION); - if (a) { - err =3D vxlan_configure_exts(vport, a, &conf); - if (err) { - ovs_vport_free(vport); - goto error; - } - } - - rtnl_lock(); - dev =3D vxlan_dev_create(net, parms->name, NET_NAME_USER, &conf); - if (IS_ERR(dev)) { - rtnl_unlock(); - ovs_vport_free(vport); - return ERR_CAST(dev); - } - - err =3D dev_change_flags(dev, dev->flags | IFF_UP, NULL); - if (err < 0) { - rtnl_delete_link(dev, 0, NULL); - rtnl_unlock(); - ovs_vport_free(vport); - goto error; - } - - vport->dev =3D dev; - netdev_hold(vport->dev, &vport->dev_tracker, GFP_KERNEL); - - rtnl_unlock(); - return vport; -error: - return ERR_PTR(err); -} - -static struct vport *vxlan_create(const struct vport_parms *parms) -{ - struct vport *vport; - - vport =3D vxlan_tnl_create(parms); - if (IS_ERR(vport)) - return vport; - - return ovs_netdev_link(vport, true); -} - -static struct vport_ops ovs_vxlan_netdev_vport_ops =3D { - .type =3D OVS_VPORT_TYPE_VXLAN, - .create =3D vxlan_create, - .destroy =3D ovs_netdev_tunnel_destroy, - .get_options =3D vxlan_get_options, - .send =3D dev_queue_xmit, -}; - -static int __init ovs_vxlan_tnl_init(void) -{ - return ovs_vport_ops_register(&ovs_vxlan_netdev_vport_ops); -} - -static void __exit ovs_vxlan_tnl_exit(void) -{ - ovs_vport_ops_unregister(&ovs_vxlan_netdev_vport_ops); -} - -module_init(ovs_vxlan_tnl_init); -module_exit(ovs_vxlan_tnl_exit); - -MODULE_DESCRIPTION("OVS: VXLAN switching port"); -MODULE_LICENSE("GPL"); -MODULE_ALIAS("vport-type-4"); diff --git a/tools/testing/selftests/net/config b/tools/testing/selftests/n= et/config index d07c5ac5cab7b..5e9ccc897a360 100644 --- a/tools/testing/selftests/net/config +++ b/tools/testing/selftests/net/config @@ -114,9 +114,6 @@ CONFIG_NFT_COMPAT=3Dm CONFIG_NFT_NAT=3Dm CONFIG_NUMA=3Dy CONFIG_OPENVSWITCH=3Dm -CONFIG_OPENVSWITCH_GENEVE=3Dm -CONFIG_OPENVSWITCH_GRE=3Dm -CONFIG_OPENVSWITCH_VXLAN=3Dm CONFIG_PAGE_POOL_STATS=3Dy CONFIG_PROC_SYSCTL=3Dy CONFIG_PSAMPLE=3Dm diff --git a/tools/testing/selftests/net/openvswitch/openvswitch.sh b/tools= /testing/selftests/net/openvswitch/openvswitch.sh index 3cdd953f68132..b327d3061ed53 100755 --- a/tools/testing/selftests/net/openvswitch/openvswitch.sh +++ b/tools/testing/selftests/net/openvswitch/openvswitch.sh @@ -26,7 +26,6 @@ tests=3D" netlink_checks ovsnl: validate netlink attrs and settings upcall_interfaces ovs: test the upcall interfaces tunnel_metadata ovs: test extraction of tunnel metadata - tunnel_refcount ovs: test tunnel vport reference cleanup drop_reason drop: test drop reasons are emitted psample psample: Sampling packets with psample" =20 @@ -831,42 +830,6 @@ test_tunnel_metadata() { return 0 } =20 -test_tunnel_refcount() { - sbxname=3D"test_tunnel_refcount" - sbx_add "${sbxname}" || return 1 - - ovs_sbx "${sbxname}" ip netns add trefns || return 1 - on_exit "ovs_sbx ${sbxname} ip netns del trefns" - - for tun_type in gre vxlan geneve; do - info "testing ${tun_type} tunnel vport refcount" - - ovs_sbx "${sbxname}" ip netns exec trefns \ - python3 $ovs_base/ovs-dpctl.py \ - add-dp dp-${tun_type} || return 1 - - ovs_sbx "${sbxname}" ip netns exec trefns \ - python3 $ovs_base/ovs-dpctl.py \ - add-if --no-lwt -t ${tun_type} \ - dp-${tun_type} ovs-${tun_type}0 || return 1 - - ovs_wait ip -netns trefns link show \ - ovs-${tun_type}0 >/dev/null 2>&1 || return 1 - - info "deleting dp - may hang if reference counting is broken" - ovs_sbx "${sbxname}" ip netns exec trefns \ - python3 $ovs_base/ovs-dpctl.py \ - del-dp dp-${tun_type} & - - dev_removed() { - ! ip -netns trefns link show "$1" >/dev/null 2>&1 - } - ovs_wait dev_removed dp-${tun_type} || return 1 - ovs_wait dev_removed ovs-${tun_type}0 || return 1 - done - return 0 -} - run_test() { ( tname=3D"$1" diff --git a/tools/testing/selftests/net/openvswitch/ovs-dpctl.py b/tools/t= esting/selftests/net/openvswitch/ovs-dpctl.py index bbe35e2718d26..ad8c47a482351 100644 --- a/tools/testing/selftests/net/openvswitch/ovs-dpctl.py +++ b/tools/testing/selftests/net/openvswitch/ovs-dpctl.py @@ -2012,9 +2012,6 @@ class OvsDatapath(GenericNetlinkSocket): class OvsVport(GenericNetlinkSocket): OVS_VPORT_TYPE_NETDEV =3D 1 OVS_VPORT_TYPE_INTERNAL =3D 2 - OVS_VPORT_TYPE_GRE =3D 3 - OVS_VPORT_TYPE_VXLAN =3D 4 - OVS_VPORT_TYPE_GENEVE =3D 5 =20 class ovs_vport_msg(ovs_dp_msg): nla_map =3D ( @@ -2022,7 +2019,7 @@ class OvsVport(GenericNetlinkSocket): ("OVS_VPORT_ATTR_PORT_NO", "uint32"), ("OVS_VPORT_ATTR_TYPE", "uint32"), ("OVS_VPORT_ATTR_NAME", "asciiz"), - ("OVS_VPORT_ATTR_OPTIONS", "vportopts"), + ("OVS_VPORT_ATTR_OPTIONS", "none"), ("OVS_VPORT_ATTR_UPCALL_PID", "array(uint32)"), ("OVS_VPORT_ATTR_STATS", "vportstats"), ("OVS_VPORT_ATTR_PAD", "none"), @@ -2030,13 +2027,6 @@ class OvsVport(GenericNetlinkSocket): ("OVS_VPORT_ATTR_NETNSID", "uint32"), ) =20 - class vportopts(nla): - nla_map =3D ( - ("OVS_TUNNEL_ATTR_UNSPEC", "none"), - ("OVS_TUNNEL_ATTR_DST_PORT", "uint16"), - ("OVS_TUNNEL_ATTR_EXTENSION", "none"), - ) - class vportstats(nla): fields =3D ( ("rx_packets", "=3DQ"), @@ -2054,25 +2044,13 @@ class OvsVport(GenericNetlinkSocket): return "netdev" elif vport_type =3D=3D OvsVport.OVS_VPORT_TYPE_INTERNAL: return "internal" - elif vport_type =3D=3D OvsVport.OVS_VPORT_TYPE_GRE: - return "gre" - elif vport_type =3D=3D OvsVport.OVS_VPORT_TYPE_VXLAN: - return "vxlan" - elif vport_type =3D=3D OvsVport.OVS_VPORT_TYPE_GENEVE: - return "geneve" raise ValueError("Unknown vport type:%d" % vport_type) =20 def str_to_type(vport_type): - if vport_type =3D=3D "netdev": + if vport_type in ["netdev", "gre", "vxlan", "geneve"]: return OvsVport.OVS_VPORT_TYPE_NETDEV elif vport_type =3D=3D "internal": return OvsVport.OVS_VPORT_TYPE_INTERNAL - elif vport_type =3D=3D "gre": - return OvsVport.OVS_VPORT_TYPE_GRE - elif vport_type =3D=3D "vxlan": - return OvsVport.OVS_VPORT_TYPE_VXLAN - elif vport_type =3D=3D "geneve": - return OvsVport.OVS_VPORT_TYPE_GENEVE raise ValueError("Unknown vport type: '%s'" % vport_type) =20 def __init__(self, packet=3DOvsPacket()): @@ -2105,16 +2083,18 @@ class OvsVport(GenericNetlinkSocket): raise ne return reply =20 - def attach(self, dpindex, vport_ifname, ptype, dport, lwt): + def attach(self, dpindex, vport_ifname, ptype, dport): msg =3D OvsVport.ovs_vport_msg() =20 msg["cmd"] =3D OVS_VPORT_CMD_NEW msg["version"] =3D OVS_DATAPATH_VERSION msg["reserved"] =3D 0 msg["dpifindex"] =3D dpindex - port_type =3D OvsVport.str_to_type(ptype) =20 msg["attrs"].append(["OVS_VPORT_ATTR_NAME", vport_ifname]) + msg["attrs"].append( + ["OVS_VPORT_ATTR_TYPE", OvsVport.str_to_type(ptype)] + ) msg["attrs"].append( ["OVS_VPORT_ATTR_UPCALL_PID", [self.upcall_packet.epid]] ) @@ -2128,36 +2108,21 @@ class OvsVport(GenericNetlinkSocket): if not dport: dport =3D tnl[1] =20 - if not lwt: - if tnl[0] =3D=3D "gre": - # GRE tunnels have no options. - break - - vportopt =3D OvsVport.ovs_vport_msg.vportopts() - vportopt["attrs"].append( - ["OVS_TUNNEL_ATTR_DST_PORT", dport] - ) - msg["attrs"].append( - ["OVS_VPORT_ATTR_OPTIONS", vportopt] - ) - else: - port_type =3D OvsVport.OVS_VPORT_TYPE_NETDEV - ipr =3D pyroute2.iproute.IPRoute() - - if tnl[0] =3D=3D "geneve": - ipr.link("add", ifname=3Dvport_ifname, kind=3Dtnl[= 0], - geneve_port=3Ddport, - geneve_collect_metadata=3DTrue, - geneve_udp_zero_csum6_rx=3D1) - elif tnl[0] =3D=3D "gre": - ipr.link("add", ifname=3Dvport_ifname, kind=3D"gre= tap", - gre_collect_metadata=3DTrue) - elif tnl[0] =3D=3D "vxlan": - ipr.link("add", ifname=3Dvport_ifname, kind=3Dtnl[= 0], - vxlan_learning=3D0, vxlan_collect_metadat= a=3D1, - vxlan_udp_zero_csum6_rx=3D1, vxlan_port= =3Ddport) + ipr =3D pyroute2.iproute.IPRoute() + + if tnl[0] =3D=3D "geneve": + ipr.link("add", ifname=3Dvport_ifname, kind=3Dtnl[0], + geneve_port=3Ddport, + geneve_collect_metadata=3DTrue, + geneve_udp_zero_csum6_rx=3D1) + elif tnl[0] =3D=3D "gre": + ipr.link("add", ifname=3Dvport_ifname, kind=3D"gretap", + gre_collect_metadata=3DTrue) + elif tnl[0] =3D=3D "vxlan": + ipr.link("add", ifname=3Dvport_ifname, kind=3Dtnl[0], + vxlan_learning=3D0, vxlan_collect_metadata=3D= 1, + vxlan_udp_zero_csum6_rx=3D1, vxlan_port=3Ddpo= rt) break - msg["attrs"].append(["OVS_VPORT_ATTR_TYPE", port_type]) =20 try: reply =3D self.nlm_request( @@ -2565,19 +2530,12 @@ def print_ovsdp_full(dp_lookup_rep, ifindex, ndb=3D= NDB(), vpl=3DOvsVport()): for iface in ndb.interfaces: rep =3D vpl.info(iface.ifname, ifindex) if rep is not None: - opts =3D "" - vpo =3D rep.get_attr("OVS_VPORT_ATTR_OPTIONS") - if vpo: - dpo =3D vpo.get_attr("OVS_TUNNEL_ATTR_DST_PORT") - if dpo: - opts +=3D " tnl-dport:%s" % dpo print( - " port %d: %s (%s%s)" + " port %d: %s (%s)" % ( rep.get_attr("OVS_VPORT_ATTR_PORT_NO"), rep.get_attr("OVS_VPORT_ATTR_NAME"), OvsVport.type_to_str(rep.get_attr("OVS_VPORT_ATTR_TYPE= ")), - opts, ) ) =20 @@ -2649,13 +2607,6 @@ def main(argv): default=3D0, help=3D"Destination port (0 for default)" ) - addifcmd.add_argument( - "-l", - "--lwt", - action=3Dargparse.BooleanOptionalAction, - default=3DTrue, - help=3D"Use LWT infrastructure instead of vport (default true)." - ) delifcmd =3D subparsers.add_parser("del-if") delifcmd.add_argument("dpname", help=3D"Datapath Name") delifcmd.add_argument("delif", help=3D"Interface name for adding") @@ -2729,7 +2680,7 @@ def main(argv): return 1 dpindex =3D rep["dpifindex"] rep =3D ovsvp.attach(rep["dpifindex"], args.addif, args.ptype, - args.dport, args.lwt) + args.dport) msg =3D "vport '%s'" % args.addif if rep and rep["header"]["error"] is None: msg +=3D " added." --=20 2.53.0 From nobody Fri Jun 12 17:18:01 2026 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1A5C93B2FEA for ; Wed, 13 May 2026 18:36:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.66 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778697387; cv=none; b=SgqU3uV/NocSA/kFX0A13KKOTcc+TbkA2EKfRTIK2LLhunLVPlTC9y6hJxhivt6BkAQt/6i82kemo1axYLpnQm66ikVQ8p97xMQfdVD6fuFRBuG/cBwQ+qh93Nma7glxnFRLR0erCP+NStonDvErbbB6bJGMdV1wGBmiwjyHp1k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778697387; c=relaxed/simple; bh=o0pCRzhxwmfMV3TcD5VlPb9JbEKxbxvZW3AI+AvXYbM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JUxFR0Q73z5P44cnh/OiZC8FnrVPCTZXXwGIJYGGHlbfoXXa+1XzhCUq6DmInkAnXdYd/5maIpxJHovilkAMfPxoMOmM5DwyYR31GYH1zxKSRFAtcgENqrYJvGP5vFlsepWP20aa1bG6A4MXzGbPjXDpKYnexRN2i50cqAttiZc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ovn.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.221.66 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ovn.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f66.google.com with SMTP id ffacd0b85a97d-45297094718so5718684f8f.3 for ; Wed, 13 May 2026 11:36:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778697382; x=1779302182; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=aDjn5A6QB434U5615WGA/fHygBkP687Auiym2D0+n2I=; b=iqR6mgqZhC2FpwM8vuQQB5gaAJoUedLcgEZcmVoPSJj4u7r/v7SItW9u91uP4/I2qt k97FkWKAiiAsKwcbdXp5cXbwosSlhu0O3oX2toq1unANpU4c5u+cibvXnpAxHZdgRZJz R/qvFASqWr52oAK8Nm6RqFE5PSgtFYik43KdxY5sCuh0PR6MPBMs3Wc0ZmeAXTS5TDhj 3qLa/I0+a4M2VAW3F2KbHt5roYg7t+/vX7QL/pE3FdpvdC6B9yKe3oAAzpMRO/++aQJX 7W5w5j3HTkVuVw/2jes3mQNDUTaUsv5qDVXeIE/J7+G7rlIsRsECIrgF3xGX8cSYH19+ VauQ== X-Forwarded-Encrypted: i=1; AFNElJ/uX7FmCZHGM30IODGlYiAHcLimW3A16o4sZMmo8y1QAUVzi2IBQEj9gtNRGNgGTTe+gx9FBgWpi4ST7Ok=@vger.kernel.org X-Gm-Message-State: AOJu0Ywi86wWcrkELfmdtfO2ky98tJz1jqn8gbzeMkfsMSMFtUCdOJgJ B1y4CNG0R8B/AteOJ7sxBuY6seabxc+CgkmmPaBTuZ0O1QGJUI1U8VSu X-Gm-Gg: Acq92OEqngxaibmghVBmwFVSP2LXtpqQ+vg3y+sgYLWebBbRtpoVSdLruFle7chews0 NI9izcWp0pCwjrlMWI01n0tH/KtJDF5bK+8BrvwJjXiui9e4Uf0uRZmWeu4svX/k2EGCr4JdgaZ Fp/4cxjvxdl3Y+9aBTCT+K+4B09byKZXXCO+nyN1uKx6ivhcWgh62x+zyXrx8GmMKPszoD6tlfM LT7KtbeWBFAn9mBKGwhZ1j2kCEKc+ORmGM8Po7Xvrm6emvupJ3cZ5/T7m8pWVgrXYC7PexWbjWs uAc1zlLN3ZFOSpJnE888nGRB5SNk1nfbYopQaXxAszhUuHNjGX05+xAwBK2be1+5ejRl9A6zvA8 U1br6ZEYJ5A7JwJ9oGER8N92AlJX9v6uqtPN9/C7ql8ZRtP8V3poQyFym776d3oV1636oUP0630 ayjC+EUigSNVGTUhDzX5Ky2oeo+kYabWYKMTJ8H6RxccBIuFh7xLEPe0rgQbw= X-Received: by 2002:a05:6000:2386:b0:43c:f1a5:56f6 with SMTP id ffacd0b85a97d-45c5b2184f5mr7318960f8f.43.1778697381945; Wed, 13 May 2026 11:36:21 -0700 (PDT) Received: from im-t490s.redhat.com (37-48-40-237.nat.epc.tmcz.cz. [37.48.40.237]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45da15a6454sm720609f8f.34.2026.05.13.11.36.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2026 11:36:21 -0700 (PDT) From: Ilya Maximets To: netdev@vger.kernel.org Cc: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Aaron Conole , Eelco Chaudron , David Ahern , Ido Schimmel , Shuah Khan , Nikolay Aleksandrov , Kuniyuki Iwashima , Petr Machata , Fernando Fernandez Mancera , Antoine Tenart , Stanislav Fomichev , linux-kernel@vger.kernel.org, dev@openvswitch.org, linux-kselftest@vger.kernel.org, Ilya Maximets Subject: [RFC net-next 2/6] openvswitch: vport: remove infrastructure for vport options Date: Wed, 13 May 2026 20:35:22 +0200 Message-ID: <20260513183559.2141010-3-i.maximets@ovn.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260513183559.2141010-1-i.maximets@ovn.org> References: <20260513183559.2141010-1-i.maximets@ovn.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Since removal of tunnel vport types, there aren't any vports that support options. Let's remove the options-related infrastructure. Can be reinstated if we ever need a new vport type or if we need extra options for the existing ones. The uAPI attribute remains. Clarification comment is added to highlight that none of the supported vports support options at the moment. Note: It is technically possible that someone has an out-of-tree module named vport-type-N that implements a different vport type and they have options for this vport type. However, our message size calculations do not account for whatever options such a port would have and so it is dangerous to load such a module without modifying the code in the main datapath.c, unless the options are smaller than the ones we had for vxlan. A more robust solution would be to have a different version of the entire openvswitch module instead, so the use case of a separate vport-type-N loaded with the upstream openvswitch module is unlikely. At this time we're not aware of anyone doing that. Alternative to immediate removal would be printing out a deprecation warning whenever the options setting is attempted. Signed-off-by: Ilya Maximets --- net/openvswitch/datapath.c | 20 +------------- net/openvswitch/vport.c | 54 -------------------------------------- net/openvswitch/vport.h | 14 ---------- 3 files changed, 1 insertion(+), 87 deletions(-) diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index d86c53fedc1e1..a9c0cc2c702a4 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c @@ -1852,7 +1852,6 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct= genl_info *info) /* Set up our datapath device. */ parms.name =3D nla_data(a[OVS_DP_ATTR_NAME]); parms.type =3D OVS_VPORT_TYPE_INTERNAL; - parms.options =3D NULL; parms.dp =3D dp; parms.port_no =3D OVSP_LOCAL; parms.upcall_portids =3D a[OVS_DP_ATTR_UPCALL_PID]; @@ -2168,10 +2167,6 @@ static int ovs_vport_cmd_fill_info(struct vport *vpo= rt, struct sk_buff *skb, if (ovs_vport_get_upcall_portids(vport, skb)) goto nla_put_failure; =20 - err =3D ovs_vport_get_options(vport, skb); - if (err =3D=3D -EMSGSIZE) - goto error; - genlmsg_end(skb, ovs_header); return 0; =20 @@ -2179,7 +2174,6 @@ static int ovs_vport_cmd_fill_info(struct vport *vpor= t, struct sk_buff *skb, rcu_read_unlock(); nla_put_failure: err =3D -EMSGSIZE; -error: genlmsg_cancel(skb, ovs_header); return err; } @@ -2206,10 +2200,6 @@ static size_t ovs_vport_cmd_msg_size(void) /* OVS_VPORT_ATTR_UPCALL_PID */ msgsize +=3D nla_total_size(nr_cpu_ids * sizeof(u32)); =20 - /* There are no vports supporting OVS_VPORT_ATTR_OPTIONS, so it is - * not included in the message size calculation. - */ - return msgsize; } =20 @@ -2361,7 +2351,6 @@ static int ovs_vport_cmd_new(struct sk_buff *skb, str= uct genl_info *info) } =20 parms.name =3D nla_data(a[OVS_VPORT_ATTR_NAME]); - parms.options =3D a[OVS_VPORT_ATTR_OPTIONS]; parms.dp =3D dp; parms.port_no =3D port_no; parms.upcall_portids =3D a[OVS_VPORT_ATTR_UPCALL_PID]; @@ -2422,13 +2411,6 @@ static int ovs_vport_cmd_set(struct sk_buff *skb, st= ruct genl_info *info) goto exit_unlock_free; } =20 - if (a[OVS_VPORT_ATTR_OPTIONS]) { - err =3D ovs_vport_set_options(vport, a[OVS_VPORT_ATTR_OPTIONS]); - if (err) - goto exit_unlock_free; - } - - if (a[OVS_VPORT_ATTR_UPCALL_PID]) { struct nlattr *ids =3D a[OVS_VPORT_ATTR_UPCALL_PID]; =20 @@ -2602,7 +2584,7 @@ static const struct nla_policy vport_policy[OVS_VPORT= _ATTR_MAX + 1] =3D { [OVS_VPORT_ATTR_PORT_NO] =3D { .type =3D NLA_U32 }, [OVS_VPORT_ATTR_TYPE] =3D { .type =3D NLA_U32 }, [OVS_VPORT_ATTR_UPCALL_PID] =3D { .type =3D NLA_UNSPEC }, - [OVS_VPORT_ATTR_OPTIONS] =3D { .type =3D NLA_NESTED }, + [OVS_VPORT_ATTR_OPTIONS] =3D { .type =3D NLA_NESTED }, /* Unused. */ [OVS_VPORT_ATTR_IFINDEX] =3D NLA_POLICY_MIN(NLA_S32, 0), [OVS_VPORT_ATTR_NETNSID] =3D { .type =3D NLA_S32 }, [OVS_VPORT_ATTR_UPCALL_STATS] =3D { .type =3D NLA_NESTED }, diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c index 56b2e2d1a749f..7a9caacfd6ac2 100644 --- a/net/openvswitch/vport.c +++ b/net/openvswitch/vport.c @@ -239,22 +239,6 @@ struct vport *ovs_vport_add(const struct vport_parms *= parms) return ERR_PTR(-EAGAIN); } =20 -/** - * ovs_vport_set_options - modify existing vport device (for kernel caller= s) - * - * @vport: vport to modify. - * @options: New configuration. - * - * Modifies an existing device with the specified configuration (which is - * dependent on device type). ovs_mutex must be held. - */ -int ovs_vport_set_options(struct vport *vport, struct nlattr *options) -{ - if (!vport->ops->set_options) - return -EOPNOTSUPP; - return vport->ops->set_options(vport, options); -} - /** * ovs_vport_del - delete existing vport device * @@ -348,44 +332,6 @@ int ovs_vport_get_upcall_stats(struct vport *vport, st= ruct sk_buff *skb) return 0; } =20 -/** - * ovs_vport_get_options - retrieve device options - * - * @vport: vport from which to retrieve the options. - * @skb: sk_buff where options should be appended. - * - * Retrieves the configuration of the given device, appending an - * %OVS_VPORT_ATTR_OPTIONS attribute that in turn contains nested - * vport-specific attributes to @skb. - * - * Returns 0 if successful, -EMSGSIZE if @skb has insufficient room, or an= other - * negative error code if a real error occurred. If an error occurs, @skb= is - * left unmodified. - * - * Must be called with ovs_mutex or rcu_read_lock. - */ -int ovs_vport_get_options(const struct vport *vport, struct sk_buff *skb) -{ - struct nlattr *nla; - int err; - - if (!vport->ops->get_options) - return 0; - - nla =3D nla_nest_start_noflag(skb, OVS_VPORT_ATTR_OPTIONS); - if (!nla) - return -EMSGSIZE; - - err =3D vport->ops->get_options(vport, skb); - if (err) { - nla_nest_cancel(skb, nla); - return err; - } - - nla_nest_end(skb, nla); - return 0; -} - /** * ovs_vport_set_upcall_portids - set upcall portids of @vport. * diff --git a/net/openvswitch/vport.h b/net/openvswitch/vport.h index 9f67b9dd49f98..636788b59907c 100644 --- a/net/openvswitch/vport.h +++ b/net/openvswitch/vport.h @@ -34,9 +34,6 @@ void ovs_vport_get_stats(struct vport *, struct ovs_vport= _stats *); =20 int ovs_vport_get_upcall_stats(struct vport *vport, struct sk_buff *skb); =20 -int ovs_vport_set_options(struct vport *, struct nlattr *options); -int ovs_vport_get_options(const struct vport *, struct sk_buff *); - int ovs_vport_set_upcall_portids(struct vport *, const struct nlattr *pids= ); int ovs_vport_get_upcall_portids(const struct vport *, struct sk_buff *); u32 ovs_vport_find_upcall_portid(const struct vport *, struct sk_buff *); @@ -92,8 +89,6 @@ struct vport { * * @name: New vport's name. * @type: New vport's type. - * @options: %OVS_VPORT_ATTR_OPTIONS attribute from Netlink message, %NULL= if - * none was supplied. * @desired_ifindex: New vport's ifindex. * @dp: New vport's datapath. * @port_no: New vport's port number. @@ -104,7 +99,6 @@ struct vport_parms { const char *name; enum ovs_vport_type type; int desired_ifindex; - struct nlattr *options; =20 /* For ovs_vport_alloc(). */ struct datapath *dp; @@ -120,11 +114,6 @@ struct vport_parms { * a new vport allocated with ovs_vport_alloc(), otherwise an ERR_PTR() va= lue. * @destroy: Destroys a vport. Must call vport_free() on the vport but not * before an RCU grace period has elapsed. - * @set_options: Modify the configuration of an existing vport. May be %N= ULL - * if modification is not supported. - * @get_options: Appends vport-specific attributes for the configuration o= f an - * existing vport to a &struct sk_buff. May be %NULL for a vport that doe= s not - * have any configuration. * @send: Send a packet on the device. * zero for dropped packets or negative for error. * @owner: Module that implements this vport type. @@ -137,9 +126,6 @@ struct vport_ops { struct vport *(*create)(const struct vport_parms *); void (*destroy)(struct vport *); =20 - int (*set_options)(struct vport *, struct nlattr *); - int (*get_options)(const struct vport *, struct sk_buff *); - int (*send)(struct sk_buff *skb); struct module *owner; struct list_head list; --=20 2.53.0 From nobody Fri Jun 12 17:18:01 2026 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 45DF33B38AF for ; Wed, 13 May 2026 18:36:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.67 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778697388; cv=none; b=nLrfhghl83o2bR6yfOboHmNBRoZJoNo97cpdVQA0mRTlKfdhXEqxjvfhNZh4auy9UZ2mnvg2ItlDCT8SVZeaMD5TMxyShTyLL9Ci2ppMu1XtXTqk9regMpYCq0IPpej+p7c9dSJXqcoRVslDRgmNsMVT3ZEkTkKyLXnyofY3+Ks= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778697388; c=relaxed/simple; bh=+5u5jJ60v1xjveGW2ChiPGnJYtxZ0kG5T3OCYSA6QtY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cB7YLwNUptZ5O9yCGG0/bcHVCno9O3mz7bh338c6tvBMAuanw/Ky7r9LfWNGt7NnyGz03Zj+msD20SLURA/pZQRnERMejf8FIHS/tK6FouiBXAp/AAINVJMxvjU+SF5VmRcieuZZCgoZIAktjACxH0YqCtKm+gGdbmZqCS/iCpw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ovn.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.128.67 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ovn.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f67.google.com with SMTP id 5b1f17b1804b1-488ad135063so57612905e9.0 for ; Wed, 13 May 2026 11:36:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778697385; x=1779302185; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=lFrGXmGkGqSJhTRhqyzlGScwr6w06YpxqqRUHTQ9L1A=; b=jd7h7j6iR8vZG9YddkqdGLi146SuuXNAjoWTxRpUYYRvBJQJwOMW3TnSqCiLqlu3Hg 8yADebBIVnTOkQo922gJzx5sYAdhA/CFG11Ow8Ialy/tebYu89ZslXEUaWWTfaL5/CNP ipD8Z5hSidfmnIQyPZGJFW46uW1IUZQL7V6osBY2Tm5hN1mrM8r3bgVXH7tlbo9/sReq 9L6kyso+I5BqmI7hrx6BtZnZ+wvlkf25Czk/zgqbGKYht41DQIxqWHDMFmy9mO19xlaQ qk33j55om6gQo8BQ24Y/ZqNMLb1Mdt65FFWMbogaSSCHccoUtmjSmrrCkWLfupO8LLnk +6yw== X-Forwarded-Encrypted: i=1; AFNElJ/LECsBCHPVkDzXCWUhk6UIBIXrXNWsII2B6o5Gv2h1BZfWce5AsNaHzYRCqPQmOYyCnJURMNtTNrYAQug=@vger.kernel.org X-Gm-Message-State: AOJu0YzYgr664xmjvxPLNnBWDgtO/CITvzVzRyuJpLPGKzAnAyg8zFRL 1UDGYTBBWQZMMLFMopN3cSu/GFxysBhpo7tANLWG4diIZtUB33Fb/vQ7 X-Gm-Gg: Acq92OGFaYqmTrsKSRvSUaMyRutB0NtoelhXXGsgauwoA4DKAqL9mnl5lQbynB6VwIh XpyHgs0qNaG2GL5cJZMOoc/9wLqkvSNlBEA9CZwsRF1yJ8BCBWYpcwDco3uS4Gt4RKtJndKeFfb c+MRzQrJyMG8YBhD6MG2tLJx0VUC8QhsG7TVVvXaPKyeao4eZWcGM6yNdJHEgCpB0UG5tI+IDHE TNj8JMva7hEUOzN1MYMNjEE32dzubIeKV1+UWh57kpoY8nX0vN0Vaa2xNWCeCojR2CKOh16b3P+ ykYyvfnON/mjaTGTO0oR0uc8WwTOzgk9Z4J6n6QZm+cWReS0060EV3jilkG8TPXxLuux+1nUiHb EVyiBbQEONURPyrjmCHw7jcNu2mAaDJ6t53aPciRCEOzDnDa2yWrhvjb6rDZB5ECj+do8B3pRKV B/qLY+tiCvg2c0kzQuTLo77GIHIzwmZvQ21Vqb15csVMiXTEH5JOD1SiDAPN8= X-Received: by 2002:a05:600d:18:b0:48a:5574:3a5d with SMTP id 5b1f17b1804b1-48fce9bd5d1mr49631725e9.7.1778697384382; Wed, 13 May 2026 11:36:24 -0700 (PDT) Received: from im-t490s.redhat.com (37-48-40-237.nat.epc.tmcz.cz. [37.48.40.237]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45da15a6454sm720609f8f.34.2026.05.13.11.36.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2026 11:36:24 -0700 (PDT) From: Ilya Maximets To: netdev@vger.kernel.org Cc: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Aaron Conole , Eelco Chaudron , David Ahern , Ido Schimmel , Shuah Khan , Nikolay Aleksandrov , Kuniyuki Iwashima , Petr Machata , Fernando Fernandez Mancera , Antoine Tenart , Stanislav Fomichev , linux-kernel@vger.kernel.org, dev@openvswitch.org, linux-kselftest@vger.kernel.org, Ilya Maximets Subject: [RFC net-next 3/6] openvswitch: vport: remove infrastructure for separate modules Date: Wed, 13 May 2026 20:35:23 +0200 Message-ID: <20260513183559.2141010-4-i.maximets@ovn.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260513183559.2141010-1-i.maximets@ovn.org> References: <20260513183559.2141010-1-i.maximets@ovn.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Since removal of legacy tunnel vport types only the built-in ones remain. So, there is no need for the extra infrastructure for dynamic module loading. Can be reinstated in the future if we need a new vport type. Note: It is technically possible that someone has an out-of-tree module named vport-type-N that implements a different vport type. At this time we're not aware of anyone doing that. People running out-of-tree modules normally just have an out-of-tree openvswitch module as a whole. And there are actually no supported out-of-tree implementations of the openvswitch module known to the community. Alternative to immediate removal would be printing out a deprecation warning whenever a vport module is loaded, but I'm not sure if we need it at this time. Signed-off-by: Ilya Maximets --- net/openvswitch/vport.c | 22 ++-------------------- net/openvswitch/vport.h | 9 +-------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c index 7a9caacfd6ac2..ef2fff4353c0a 100644 --- a/net/openvswitch/vport.c +++ b/net/openvswitch/vport.c @@ -57,7 +57,7 @@ static struct hlist_head *hash_bucket(const struct net *n= et, const char *name) return &dev_table[hash & (VPORT_HASH_BUCKETS - 1)]; } =20 -int __ovs_vport_ops_register(struct vport_ops *ops) +int ovs_vport_ops_register(struct vport_ops *ops) { int err =3D -EEXIST; struct vport_ops *o; @@ -73,7 +73,6 @@ int __ovs_vport_ops_register(struct vport_ops *ops) ovs_unlock(); return err; } -EXPORT_SYMBOL_GPL(__ovs_vport_ops_register); =20 void ovs_vport_ops_unregister(struct vport_ops *ops) { @@ -81,7 +80,6 @@ void ovs_vport_ops_unregister(struct vport_ops *ops) list_del(&ops->list); ovs_unlock(); } -EXPORT_SYMBOL_GPL(ovs_vport_ops_unregister); =20 /** * ovs_vport_locate - find a port that has already been created @@ -210,12 +208,8 @@ struct vport *ovs_vport_add(const struct vport_parms *= parms) if (ops) { struct hlist_head *bucket; =20 - if (!try_module_get(ops->owner)) - return ERR_PTR(-EAFNOSUPPORT); - vport =3D ops->create(parms); if (IS_ERR(vport)) { - module_put(ops->owner); return vport; } =20 @@ -225,18 +219,7 @@ struct vport *ovs_vport_add(const struct vport_parms *= parms) return vport; } =20 - /* Unlock to attempt module load and return -EAGAIN if load - * was successful as we need to restart the port addition - * workflow. - */ - ovs_unlock(); - request_module("vport-type-%d", parms->type); - ovs_lock(); - - if (!ovs_vport_lookup(parms)) - return ERR_PTR(-EAFNOSUPPORT); - else - return ERR_PTR(-EAGAIN); + return ERR_PTR(-EAFNOSUPPORT); } =20 /** @@ -250,7 +233,6 @@ struct vport *ovs_vport_add(const struct vport_parms *p= arms) void ovs_vport_del(struct vport *vport) { hlist_del_rcu(&vport->hash_node); - module_put(vport->ops->owner); vport->ops->destroy(vport); } =20 diff --git a/net/openvswitch/vport.h b/net/openvswitch/vport.h index 636788b59907c..930f1ccc85581 100644 --- a/net/openvswitch/vport.h +++ b/net/openvswitch/vport.h @@ -116,7 +116,6 @@ struct vport_parms { * before an RCU grace period has elapsed. * @send: Send a packet on the device. * zero for dropped packets or negative for error. - * @owner: Module that implements this vport type. * @list: List entry in the global list of vport types. */ struct vport_ops { @@ -127,7 +126,6 @@ struct vport_ops { void (*destroy)(struct vport *); =20 int (*send)(struct sk_buff *skb); - struct module *owner; struct list_head list; }; =20 @@ -191,12 +189,7 @@ static inline const char *ovs_vport_name(struct vport = *vport) return vport->dev->name; } =20 -int __ovs_vport_ops_register(struct vport_ops *ops); -#define ovs_vport_ops_register(ops) \ - ({ \ - (ops)->owner =3D THIS_MODULE; \ - __ovs_vport_ops_register(ops); \ - }) +int ovs_vport_ops_register(struct vport_ops *ops); =20 void ovs_vport_ops_unregister(struct vport_ops *ops); void ovs_vport_send(struct vport *vport, struct sk_buff *skb, u8 mac_proto= ); --=20 2.53.0 From nobody Fri Jun 12 17:18:01 2026 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E62A63B6BE3 for ; Wed, 13 May 2026 18:36:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.65 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778697391; cv=none; b=LtFzjH64/CejuKcapm1XGl5mF2hUwQ6iJ1V+XDy0U+2IQgy49q573o1KqKaaTGIuulTxxwhVzVAlrTNlmP14YJomPiMsfPuqGZGJdALSZjkOxpMxjlY/FBDZ7V9XH+e1paiN+jqrdiy45YxYDY6vxLW0xppV9bMCanWO26H9MbI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778697391; c=relaxed/simple; bh=kkNx7pBIe4lTrSygNXIC+r7fP19o5wlqxg31cX6buFg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WFekEZzEkiBrJh5/pQIaz21HcAILJK8AzpGAfCHxxviAOJ7esCUb35MaqhaCJNhC4kWFJOqyW0oc3M5ykW2MT+xA+8Sz1wg/TNDFsk1vtXNrX+/xjgDnkCXI++jvYpcyxUkaaTofJJyi35Gq+ZOVwHC8amVoHze2XXSqIzOgH5c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ovn.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.221.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ovn.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f65.google.com with SMTP id ffacd0b85a97d-449de065cb3so6533442f8f.2 for ; Wed, 13 May 2026 11:36:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778697387; x=1779302187; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=j17dyAXjVQ5kVJZNPUptY+dBBjRJ1RjAOk+0kE7NMQ4=; b=jKJOFyTf+a6I/y14X+lIMVATMgcu90ERqiEY5G/wKvSsrmGvwkFKF4FyT3FB5QpkRL xmFwIHro/ofmvhKfhW+oKvwyWKySIh/2HIH2Ld4h5UM7ccn6aSAQ0znAe2LWFnlOPLm8 FpasZlr+qNYBTZxPS+HoMsHYo5A3bz0KRNHOGnzItYNkf2B+RI35HIo75Lp5bJt3xgyo UTL1Im1zhCeLv/dAMb9zChdWgzKvvedYVi1gw3kX4FcgKh7J4DS9slud0Ha6Ly2rTPb5 L/1wfpRzWukqAVJ0gDBEO/Ul8iv8mABQC0uT1iT5uRMdvnVjiI+j3TULxWwbt11+DPVV 1YNA== X-Forwarded-Encrypted: i=1; AFNElJ/vbqsif5f5R4/pFt3QNo2RjvYd3eWIZEGncc+QbUVDTUOYeljSZ6XUXl6O20c5isBRxF2VSZvVG+eUtAA=@vger.kernel.org X-Gm-Message-State: AOJu0YxysHvQ5jn9yQh6ilwyDpIQz0oZyizhyb//3ktdlAnFT+Ou58JN 9bQu/zbRSi+w60hW1i1KKaa7bQB2Q0f4Xg959aDrbJVrd5S3R2A4a4eS X-Gm-Gg: Acq92OE7zNGKoYxpY1iKbyjB+DYYkjKMMa2rivsCdizF2+4CE3hAFiZQJXHhFlyMBsB gd6YjcGW446jfs9ztyyadvG+uVliXsFSZ0tMNtccTDjFfH4F3X6wxrMe3BVcRpTNoWuP5gA00+q IQr/66KT9sE7ES/TskS2GONFdVRmBU5B43EReV8LFMx6hrJZcO1p4LSYGFjPdb8tHt681xdBnfi c/Y15tDpDBwd0UpGHS8zJ/otnK8rvous30iPnyZjGY3RUv8wUuskhw4qYKZuAWjwQ+5+qe3k1q4 4alcem1oIKuRjzVqwH3FC5frrY1mwptT+2ePxKRCRBbNp5p+COor6lKOzddishg9AxQTWjjrNQ6 Fbz0rHgukVTrS9vDHtuJThgzgkHztFq1kXp2DnB5b+7vKk1ETdTO2aVKoDNmE0MHIFnXGDoeWyp IVjKzApCYGU++ytWFMNFIIOPcsIIqvzlkUjiDqI1KpZdjzzu3iQXjIBKr72uerWFOSqkiVfg== X-Received: by 2002:a05:6000:1787:b0:452:d03a:7aad with SMTP id ffacd0b85a97d-45c7b7630famr6803975f8f.36.1778697387064; Wed, 13 May 2026 11:36:27 -0700 (PDT) Received: from im-t490s.redhat.com (37-48-40-237.nat.epc.tmcz.cz. [37.48.40.237]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45da15a6454sm720609f8f.34.2026.05.13.11.36.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2026 11:36:26 -0700 (PDT) From: Ilya Maximets To: netdev@vger.kernel.org Cc: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Aaron Conole , Eelco Chaudron , David Ahern , Ido Schimmel , Shuah Khan , Nikolay Aleksandrov , Kuniyuki Iwashima , Petr Machata , Fernando Fernandez Mancera , Antoine Tenart , Stanislav Fomichev , linux-kernel@vger.kernel.org, dev@openvswitch.org, linux-kselftest@vger.kernel.org, Ilya Maximets Subject: [RFC net-next 4/6] net: geneve: remove unused geneve_dev_create_fb Date: Wed, 13 May 2026 20:35:24 +0200 Message-ID: <20260513183559.2141010-5-i.maximets@ovn.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260513183559.2141010-1-i.maximets@ovn.org> References: <20260513183559.2141010-1-i.maximets@ovn.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The only user was vport-geneve in openvswitch and now it is gone. Note: since it's an exported symbol, there is a possibility that some out-of-tree module is using it. So, alternative is to deprecate it instead by adding a warning if it is ever called. Signed-off-by: Ilya Maximets --- drivers/net/geneve.c | 48 -------------------------------------------- include/net/geneve.h | 5 ----- 2 files changed, 53 deletions(-) diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c index b36fad8337245..153b15e4ef569 100644 --- a/drivers/net/geneve.c +++ b/drivers/net/geneve.c @@ -2364,54 +2364,6 @@ static struct rtnl_link_ops geneve_link_ops __read_m= ostly =3D { .fill_info =3D geneve_fill_info, }; =20 -struct net_device *geneve_dev_create_fb(struct net *net, const char *name, - u8 name_assign_type, u16 dst_port) -{ - struct nlattr *tb[IFLA_MAX + 1]; - struct net_device *dev; - LIST_HEAD(list_kill); - int err; - struct geneve_config cfg =3D { - .df =3D GENEVE_DF_UNSET, - .use_udp6_rx_checksums =3D true, - .ttl_inherit =3D false, - .collect_md =3D true, - .port_min =3D 1, - .port_max =3D USHRT_MAX, - }; - - memset(tb, 0, sizeof(tb)); - dev =3D rtnl_create_link(net, name, name_assign_type, - &geneve_link_ops, tb, NULL); - if (IS_ERR(dev)) - return dev; - - init_tnl_info(&cfg.info, dst_port); - err =3D geneve_configure(net, dev, NULL, &cfg); - if (err) { - free_netdev(dev); - return ERR_PTR(err); - } - - /* openvswitch users expect packet sizes to be unrestricted, - * so set the largest MTU we can. - */ - err =3D geneve_change_mtu(dev, IP_MAX_MTU); - if (err) - goto err; - - err =3D rtnl_configure_link(dev, NULL, 0, NULL); - if (err < 0) - goto err; - - return dev; -err: - geneve_dellink(dev, &list_kill); - unregister_netdevice_many(&list_kill); - return ERR_PTR(err); -} -EXPORT_SYMBOL_GPL(geneve_dev_create_fb); - static int geneve_netdevice_event(struct notifier_block *unused, unsigned long event, void *ptr) { diff --git a/include/net/geneve.h b/include/net/geneve.h index 5c96827a487e7..ba2c14d61e904 100644 --- a/include/net/geneve.h +++ b/include/net/geneve.h @@ -68,9 +68,4 @@ static inline bool netif_is_geneve(const struct net_devic= e *dev) !strcmp(dev->rtnl_link_ops->kind, "geneve"); } =20 -#ifdef CONFIG_INET -struct net_device *geneve_dev_create_fb(struct net *net, const char *name, - u8 name_assign_type, u16 dst_port); -#endif /*ifdef CONFIG_INET */ - #endif /*ifdef__NET_GENEVE_H */ --=20 2.53.0 From nobody Fri Jun 12 17:18:01 2026 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1DEC73B813C for ; Wed, 13 May 2026 18:36:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.67 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778697393; cv=none; b=Ss0xSu21Kg9fKgD39iuSa5q8OiHEbia5AZMOCE9ysahx+x4mBRLnLikd2lSYI4ZGkX9y5qCNci3mJczElhSzDetVg3ZrnLMZA2Tzw83UBC2tpvj2SkTS3m60cFxVU9PbQhB6jfOdBOL7woxDAQ2VjJhAXdbMUzmjz3pRWFxeUdY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778697393; c=relaxed/simple; bh=bbNVFjVByescbxlWSooR9HsipPYLdQ+oaSNYna3xljo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M/qLUKoSXwjlnsBDgy/OAIwl/fao42dh7fjvRXlRv3Memd8eB04itlT0Jm7nb0GDrnMznrnGt1I4DR3Uy8dV37KVmJKZ5iEz7G+hb4s3livt5603j70HMCFyIU5l0W/N3ekXMsBJ2X+V6g76cGWfIJ0DT35EcefZ8x31LHU8Pfg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ovn.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.221.67 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ovn.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f67.google.com with SMTP id ffacd0b85a97d-45562c41ec7so3497278f8f.1 for ; Wed, 13 May 2026 11:36:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778697389; x=1779302189; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=RFryEAJj/MmmFRvFqgOL8R9VRzL/GvvXFVwI7R7pOfI=; b=RAty8+TxiECtR6XltvqGecG78Ox/nk3pkWbtxQzZtq5s96mdgdU8AQyR/qOEmSr1J8 Y7fNG8XMlFQPr5zRnoq80FMQX/+pqibH2kZ5aOcQD95z79TGiLsVP+ulTq4e0HZ1vBct FZrRuVdDJPNe57lKEiP0bXooe5vBuWb+ihMRwxXPRVWuUnGhRChLN7mkHgOldVUoDiuW jRtbJIYWQfCb2/NJotnKT1hwRIGI1O1/sdm8lzi8DsVHtYm/5ByLI/I94s5HYIMOw3XV 5hcT2knFjbi0BACNv8O4H4srV8+Pk2kLAKa/0JC28oeNVC93bnzmKt9pUYh+v+SRTSNW tDeA== X-Forwarded-Encrypted: i=1; AFNElJ+P7yVJShTrldwQUPsFGLLo3/V1wCa2D0kHgg5rgVh8ElEf8bA9rzpNwNtrOheUZH4V/ArLaJKF/QoDgXc=@vger.kernel.org X-Gm-Message-State: AOJu0YwjswIsdTkYKSOgiJMy6vcYATT9P4wk6sQbP0cB8gw1Pj6DB+3W bxn9TNCkzjC/yh5BupWoqRbxSgpEpX5CG39vCR6ck/re4yloXAjMWEFv X-Gm-Gg: Acq92OFcQB4g1CYVMN6eKGwD/a6OSUCInIcTH1fw93NTBMQJZYnT9qNo5igYm3wopL4 TLmAXJJ7fpidA36NDHpfvo5E152Rj5kjfu+IUkrUdP3dzmFzwVQg14gyXNlxm0KC8N4wts+ebQ4 jjtK7vowMOmQUcjJcThtd427WBCHAByhXjfCqEvg0TjFcOuh0HG6s5Nydq5LBTWGwd+G/l0E0Of pLqMzLhPMTl1myFPX0TiTDb9iiLN3Ck6m0S6iyzHhouZZWJ+b+0idDcbnfme48mDjN3PdblvfYs /TSN+1QskhF0CDNSc5ItWqoPQE6VpWShLGM89ELNHrTmpgxb/sg7x9wyCwmxKuL7xicmMSLVkMX xFHLZUf9/RZ+DANqTXyDs9+A0h5cInYVfugdNf3Y6GQYFn/UPs/dQCUEIW175PX9w9+5dd9xLKs 7++QA0/gDZkt2KkAomSyn+h/j34E6Lz7KzbV1QMNR5ZypG/26baM1bFYHALT0= X-Received: by 2002:a05:6000:2902:b0:43d:3004:5fef with SMTP id ffacd0b85a97d-45c57de8025mr7061742f8f.7.1778697389364; Wed, 13 May 2026 11:36:29 -0700 (PDT) Received: from im-t490s.redhat.com (37-48-40-237.nat.epc.tmcz.cz. [37.48.40.237]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45da15a6454sm720609f8f.34.2026.05.13.11.36.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2026 11:36:29 -0700 (PDT) From: Ilya Maximets To: netdev@vger.kernel.org Cc: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Aaron Conole , Eelco Chaudron , David Ahern , Ido Schimmel , Shuah Khan , Nikolay Aleksandrov , Kuniyuki Iwashima , Petr Machata , Fernando Fernandez Mancera , Antoine Tenart , Stanislav Fomichev , linux-kernel@vger.kernel.org, dev@openvswitch.org, linux-kselftest@vger.kernel.org, Ilya Maximets Subject: [RFC net-next 5/6] net: gre: remove unused gretap_fb_dev_create Date: Wed, 13 May 2026 20:35:25 +0200 Message-ID: <20260513183559.2141010-6-i.maximets@ovn.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260513183559.2141010-1-i.maximets@ovn.org> References: <20260513183559.2141010-1-i.maximets@ovn.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The only user was vport-gre in openvswitch and now it is gone. Note: since it's an exported symbol, there is a possibility that some out-of-tree module is using it. So, alternative is to deprecate it instead by adding a warning if it is ever called. Signed-off-by: Ilya Maximets --- include/net/gre.h | 2 -- net/ipv4/ip_gre.c | 47 ----------------------------------------------- 2 files changed, 49 deletions(-) diff --git a/include/net/gre.h b/include/net/gre.h index ccd2932032844..b55f67ecd2fc4 100644 --- a/include/net/gre.h +++ b/include/net/gre.h @@ -32,8 +32,6 @@ struct gre_protocol { int gre_add_protocol(const struct gre_protocol *proto, u8 version); int gre_del_protocol(const struct gre_protocol *proto, u8 version); =20 -struct net_device *gretap_fb_dev_create(struct net *net, const char *name, - u8 name_assign_type); int gre_parse_header(struct sk_buff *skb, struct tnl_ptk_info *tpi, bool *csum_err, __be16 proto, int nhs); =20 diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 169e2921a851d..a1dd833ea1cad 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -1710,53 +1710,6 @@ static struct rtnl_link_ops erspan_link_ops __read_m= ostly =3D { .get_link_net =3D ip_tunnel_get_link_net, }; =20 -struct net_device *gretap_fb_dev_create(struct net *net, const char *name, - u8 name_assign_type) -{ - struct rtnl_newlink_params params =3D { .src_net =3D net }; - struct nlattr *tb[IFLA_MAX + 1]; - struct net_device *dev; - LIST_HEAD(list_kill); - struct ip_tunnel *t; - int err; - - memset(&tb, 0, sizeof(tb)); - params.tb =3D tb; - - dev =3D rtnl_create_link(net, name, name_assign_type, - &ipgre_tap_ops, tb, NULL); - if (IS_ERR(dev)) - return dev; - - /* Configure flow based GRE device. */ - t =3D netdev_priv(dev); - t->collect_md =3D true; - - err =3D ipgre_newlink(dev, ¶ms, NULL); - if (err < 0) { - free_netdev(dev); - return ERR_PTR(err); - } - - /* openvswitch users expect packet sizes to be unrestricted, - * so set the largest MTU we can. - */ - err =3D __ip_tunnel_change_mtu(dev, IP_MAX_MTU, false); - if (err) - goto out; - - err =3D rtnl_configure_link(dev, NULL, 0, NULL); - if (err < 0) - goto out; - - return dev; -out: - ip_tunnel_dellink(dev, &list_kill); - unregister_netdevice_many(&list_kill); - return ERR_PTR(err); -} -EXPORT_SYMBOL_GPL(gretap_fb_dev_create); - static int __net_init ipgre_tap_init_net(struct net *net) { return ip_tunnel_init_net(net, gre_tap_net_id, &ipgre_tap_ops, "gretap0"); --=20 2.53.0 From nobody Fri Jun 12 17:18:01 2026 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EBE863BB101 for ; Wed, 13 May 2026 18:36:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.65 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778697396; cv=none; b=F/es79NPEIrAtsIRGF78hLl2tYOetcmIpaoPuyY77+DkDlYXAm1VvcFT4pWT8maM1aehZM4VaQVtove/VqPgt69AN9BElV5uxyumHpLtqrHHIOMvqY3N9udLAbo4742wq8L69j4ui+KyUWuYHWoBl315GswN4Ff77SvxMvEmBt8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778697396; c=relaxed/simple; bh=kZX/r+OVbNS99jAb+BoohSS98YrAmd3t6gUja+MHPPw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b7x+vDoivOfQoyEKfpM5oiRCHHJdRuWR0l133FSE7xM3iHW4TfgxkOMkiOBigSHIfIBPeEJY8c7hW894uzNHrKd7jiqohEOOf4DEYtUli2Bqvbd6Y1vCJ36gzbM69Am+TeUUeOHjwNQTsOxpg9zpSVOCCdCgoq1YRpc5iTUbqC0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ovn.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.221.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ovn.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f65.google.com with SMTP id ffacd0b85a97d-459bf19e87bso2231325f8f.1 for ; Wed, 13 May 2026 11:36:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778697392; x=1779302192; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=5orSk5lz/dkdQ3h8M1OvcHYEXPczUi59eHca+Pa6CNU=; b=eVLiYBXSHsXmyHyHVRiywZeADheP5uES0IemyOMyJfnkHzQvPvRy1iqVwZF0GkIwgJ 1+v/lO3fuS/QEahr0F8PsotH9OGtVQ92XZAji0HDY40Mous0w4pMLR2EUMf8PmnyQEHN 3fjp9egyWZLMwYuLhjbUsBZT/r+0Ic+e9PTUqaxo/YwXzq2jZ309SIoG9NblSZJJlary YdTYgAZDE0+m6evC96uEbLmbPyoKvt83sMiZGXTeQrxVwGwL1VitaDqCJWKDKNUmiOUb 4CMbj/VpA+Ei9C+clafyOOl5jasJd0BkOEZsEmqRyKvnB6l4MBCFEsxY1m5g+5r65M91 gmyw== X-Forwarded-Encrypted: i=1; AFNElJ+mGFkA8g4G9A3/QZl9Uevlz+94DgssjW5hnOdCUgMzDF/7ArGPq0TzacdpYSK+h+Mpu9WuJpkNoXFXWkg=@vger.kernel.org X-Gm-Message-State: AOJu0Yxugy7t5od2RPi1g/eAjRKrpQWN2sBouBRe7Yxb0x4XsIkkWzGv FRRI6g+IhGVo/RnwDq84jNH4vU5YDu0wQolhvjib6Z1ncvLtTz5lFBtj X-Gm-Gg: Acq92OH8nzCJ2PFciyQEVubG7j6NWoJdQgSKDE3vl0AL+yxefYPZNhxJAHmMg/Q5x3x CHB/ErcjRq1HaV56hiHyVv6rRI6FwMqQvrNTrV0ITi06kiF60llcjte+Yt8gQ1uvCJt5dSM3szx DhbG3h5y8lPQArrKP/enB+tEJIqcmVccNW8bgupIxRSp1a+qIU8/vYPXS4DaLTNl+qUwgh6Fc4E 77ZD6HxOv3swKAkeTC57E+3UtHGBfpYJOV6prgOMRiPV0ZTZYQE/xzGZTLoLnp2mV42y6enLtuV gK9RIBhqf/92367hR38nH5ybEPnblr40vG8NsgcyMuE9NrMvAxnOeFvwuot5n8aXhiJhtAYyByu WyjbVepHB1Ydz751PVICF4cPy4HpzebgBciI1ujRLycABxpgYzmIjYDtALsQlp7QgB6GnNfG15J fngMJdDyogBb1JqVVd0i7oeMPWQxla2dOk8HJXXf0Ly1ZfOVU8U8veIh/QC80= X-Received: by 2002:a05:6000:1a8e:b0:43d:6244:f8b with SMTP id ffacd0b85a97d-45c58696efemr7199749f8f.13.1778697392060; Wed, 13 May 2026 11:36:32 -0700 (PDT) Received: from im-t490s.redhat.com (37-48-40-237.nat.epc.tmcz.cz. [37.48.40.237]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45da15a6454sm720609f8f.34.2026.05.13.11.36.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2026 11:36:31 -0700 (PDT) From: Ilya Maximets To: netdev@vger.kernel.org Cc: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Aaron Conole , Eelco Chaudron , David Ahern , Ido Schimmel , Shuah Khan , Nikolay Aleksandrov , Kuniyuki Iwashima , Petr Machata , Fernando Fernandez Mancera , Antoine Tenart , Stanislav Fomichev , linux-kernel@vger.kernel.org, dev@openvswitch.org, linux-kselftest@vger.kernel.org, Ilya Maximets Subject: [RFC net-next 6/6] net: vxlan: remove unused vxlan_dev_create Date: Wed, 13 May 2026 20:35:26 +0200 Message-ID: <20260513183559.2141010-7-i.maximets@ovn.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260513183559.2141010-1-i.maximets@ovn.org> References: <20260513183559.2141010-1-i.maximets@ovn.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The vport-vxlan in openvswitch was the last user and it is now gone. And we can now rename the internal function to have a better name. Note: since it's an exported symbol, there is a possibility that some out-of-tree module is using it. So, alternative is to deprecate it instead by adding a warning if it is ever called. Signed-off-by: Ilya Maximets --- drivers/net/vxlan/vxlan_core.c | 42 ++++------------------------------ include/net/vxlan.h | 3 --- 2 files changed, 4 insertions(+), 41 deletions(-) diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c index 00facbfabced4..a3e9608095685 100644 --- a/drivers/net/vxlan/vxlan_core.c +++ b/drivers/net/vxlan/vxlan_core.c @@ -3958,9 +3958,9 @@ static int vxlan_dev_configure(struct net *src_net, s= truct net_device *dev, return 0; } =20 -static int __vxlan_dev_create(struct net *net, struct net_device *dev, - struct vxlan_config *conf, - struct netlink_ext_ack *extack) +static int vxlan_dev_create(struct net *net, struct net_device *dev, + struct vxlan_config *conf, + struct netlink_ext_ack *extack) { struct vxlan_net *vn =3D net_generic(net, vxlan_net_id); struct vxlan_dev *vxlan =3D netdev_priv(dev); @@ -4408,7 +4408,7 @@ static int vxlan_newlink(struct net_device *dev, if (err) return err; =20 - return __vxlan_dev_create(link_net, dev, &conf, extack); + return vxlan_dev_create(link_net, dev, &conf, extack); } =20 static int vxlan_changelink(struct net_device *dev, struct nlattr *tb[], @@ -4689,40 +4689,6 @@ static struct rtnl_link_ops vxlan_link_ops __read_mo= stly =3D { .get_link_net =3D vxlan_get_link_net, }; =20 -struct net_device *vxlan_dev_create(struct net *net, const char *name, - u8 name_assign_type, - struct vxlan_config *conf) -{ - struct nlattr *tb[IFLA_MAX + 1]; - struct net_device *dev; - int err; - - memset(&tb, 0, sizeof(tb)); - - dev =3D rtnl_create_link(net, name, name_assign_type, - &vxlan_link_ops, tb, NULL); - if (IS_ERR(dev)) - return dev; - - err =3D __vxlan_dev_create(net, dev, conf, NULL); - if (err < 0) { - free_netdev(dev); - return ERR_PTR(err); - } - - err =3D rtnl_configure_link(dev, NULL, 0, NULL); - if (err < 0) { - LIST_HEAD(list_kill); - - vxlan_dellink(dev, &list_kill); - unregister_netdevice_many(&list_kill); - return ERR_PTR(err); - } - - return dev; -} -EXPORT_SYMBOL_GPL(vxlan_dev_create); - static void vxlan_handle_lowerdev_unregister(struct vxlan_net *vn, struct net_device *dev) { diff --git a/include/net/vxlan.h b/include/net/vxlan.h index dfba89695efcf..7db2c9dd67e79 100644 --- a/include/net/vxlan.h +++ b/include/net/vxlan.h @@ -359,9 +359,6 @@ struct vxlan_dev { VXLAN_F_MC_ROUTE | \ 0) =20 -struct net_device *vxlan_dev_create(struct net *net, const char *name, - u8 name_assign_type, struct vxlan_config *conf); - static inline netdev_features_t vxlan_features_check(struct sk_buff *skb, netdev_features_t features) { --=20 2.53.0