[RFC net-next 5/6] net: gre: remove unused gretap_fb_dev_create

From: Ilya Maximets

Date: Wed May 13 2026 - 14:45:52 EST


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 <i.maximets@xxxxxxx>
---
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);

-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);

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_mostly = {
.get_link_net = ip_tunnel_get_link_net,
};

-struct net_device *gretap_fb_dev_create(struct net *net, const char *name,
- u8 name_assign_type)
-{
- struct rtnl_newlink_params params = { .src_net = 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 = tb;
-
- dev = 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 = netdev_priv(dev);
- t->collect_md = true;
-
- err = ipgre_newlink(dev, &params, 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 = __ip_tunnel_change_mtu(dev, IP_MAX_MTU, false);
- if (err)
- goto out;
-
- err = 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");
--
2.53.0