Commit 1938ee1f authored by Alexander Duyck's avatar Alexander Duyck Committed by David S. Miller

net: Remove deprecated tunnel specific UDP offload functions

Now that we have all the drivers using udp_tunnel_get_rx_ports,
ndo_add_udp_enc_rx_port, and ndo_del_udp_enc_rx_port we can drop the
function calls that were specific to VXLAN and GENEVE.
Signed-off-by: default avatarAlexander Duyck <aduyck@mirantis.com>
Acked-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5e44f8e2
...@@ -1026,32 +1026,6 @@ struct tc_to_netdev { ...@@ -1026,32 +1026,6 @@ struct tc_to_netdev {
* not implement this, it is assumed that the hw is not able to have * not implement this, it is assumed that the hw is not able to have
* multiple net devices on single physical port. * multiple net devices on single physical port.
* *
* void (*ndo_add_vxlan_port)(struct net_device *dev,
* sa_family_t sa_family, __be16 port);
* Called by vxlan to notify a driver about the UDP port and socket
* address family that vxlan is listening to. It is called only when
* a new port starts listening. The operation is protected by the
* vxlan_net->sock_lock.
*
* void (*ndo_add_geneve_port)(struct net_device *dev,
* sa_family_t sa_family, __be16 port);
* Called by geneve to notify a driver about the UDP port and socket
* address family that geneve is listnening to. It is called only when
* a new port starts listening. The operation is protected by the
* geneve_net->sock_lock.
*
* void (*ndo_del_geneve_port)(struct net_device *dev,
* sa_family_t sa_family, __be16 port);
* Called by geneve to notify the driver about a UDP port and socket
* address family that geneve is not listening to anymore. The operation
* is protected by the geneve_net->sock_lock.
*
* void (*ndo_del_vxlan_port)(struct net_device *dev,
* sa_family_t sa_family, __be16 port);
* Called by vxlan to notify the driver about a UDP port and socket
* address family that vxlan is not listening to anymore. The operation
* is protected by the vxlan_net->sock_lock.
*
* void (*ndo_udp_tunnel_add)(struct net_device *dev, * void (*ndo_udp_tunnel_add)(struct net_device *dev,
* struct udp_tunnel_info *ti); * struct udp_tunnel_info *ti);
* Called by UDP tunnel to notify a driver about the UDP port and socket * Called by UDP tunnel to notify a driver about the UDP port and socket
...@@ -1272,18 +1246,6 @@ struct net_device_ops { ...@@ -1272,18 +1246,6 @@ struct net_device_ops {
struct netdev_phys_item_id *ppid); struct netdev_phys_item_id *ppid);
int (*ndo_get_phys_port_name)(struct net_device *dev, int (*ndo_get_phys_port_name)(struct net_device *dev,
char *name, size_t len); char *name, size_t len);
void (*ndo_add_vxlan_port)(struct net_device *dev,
sa_family_t sa_family,
__be16 port);
void (*ndo_del_vxlan_port)(struct net_device *dev,
sa_family_t sa_family,
__be16 port);
void (*ndo_add_geneve_port)(struct net_device *dev,
sa_family_t sa_family,
__be16 port);
void (*ndo_del_geneve_port)(struct net_device *dev,
sa_family_t sa_family,
__be16 port);
void (*ndo_udp_tunnel_add)(struct net_device *dev, void (*ndo_udp_tunnel_add)(struct net_device *dev,
struct udp_tunnel_info *ti); struct udp_tunnel_info *ti);
void (*ndo_udp_tunnel_del)(struct net_device *dev, void (*ndo_udp_tunnel_del)(struct net_device *dev,
......
...@@ -59,11 +59,6 @@ struct genevehdr { ...@@ -59,11 +59,6 @@ struct genevehdr {
struct geneve_opt options[]; struct geneve_opt options[];
}; };
static inline void geneve_get_rx_port(struct net_device *netdev)
{
udp_tunnel_get_rx_info(netdev);
}
#ifdef CONFIG_INET #ifdef CONFIG_INET
struct net_device *geneve_dev_create_fb(struct net *net, const char *name, struct net_device *geneve_dev_create_fb(struct net *net, const char *name,
u8 name_assign_type, u16 dst_port); u8 name_assign_type, u16 dst_port);
......
...@@ -389,11 +389,6 @@ static inline __be32 vxlan_compute_rco(unsigned int start, unsigned int offset) ...@@ -389,11 +389,6 @@ static inline __be32 vxlan_compute_rco(unsigned int start, unsigned int offset)
return vni_field; return vni_field;
} }
static inline void vxlan_get_rx_port(struct net_device *netdev)
{
udp_tunnel_get_rx_info(netdev);
}
static inline unsigned short vxlan_get_sk_family(struct vxlan_sock *vs) static inline unsigned short vxlan_get_sk_family(struct vxlan_sock *vs)
{ {
return vs->sock->sk->sk_family; return vs->sock->sk->sk_family;
......
...@@ -76,47 +76,20 @@ void setup_udp_tunnel_sock(struct net *net, struct socket *sock, ...@@ -76,47 +76,20 @@ void setup_udp_tunnel_sock(struct net *net, struct socket *sock,
} }
EXPORT_SYMBOL_GPL(setup_udp_tunnel_sock); EXPORT_SYMBOL_GPL(setup_udp_tunnel_sock);
static void __udp_tunnel_push_rx_port(struct net_device *dev,
struct udp_tunnel_info *ti)
{
if (dev->netdev_ops->ndo_udp_tunnel_add) {
dev->netdev_ops->ndo_udp_tunnel_add(dev, ti);
return;
}
switch (ti->type) {
case UDP_TUNNEL_TYPE_VXLAN:
if (!dev->netdev_ops->ndo_add_vxlan_port)
break;
dev->netdev_ops->ndo_add_vxlan_port(dev,
ti->sa_family,
ti->port);
break;
case UDP_TUNNEL_TYPE_GENEVE:
if (!dev->netdev_ops->ndo_add_geneve_port)
break;
dev->netdev_ops->ndo_add_geneve_port(dev,
ti->sa_family,
ti->port);
break;
default:
break;
}
}
void udp_tunnel_push_rx_port(struct net_device *dev, struct socket *sock, void udp_tunnel_push_rx_port(struct net_device *dev, struct socket *sock,
unsigned short type) unsigned short type)
{ {
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct udp_tunnel_info ti; struct udp_tunnel_info ti;
if (!dev->netdev_ops->ndo_udp_tunnel_add)
return;
ti.type = type; ti.type = type;
ti.sa_family = sk->sk_family; ti.sa_family = sk->sk_family;
ti.port = inet_sk(sk)->inet_sport; ti.port = inet_sk(sk)->inet_sport;
__udp_tunnel_push_rx_port(dev, &ti); dev->netdev_ops->ndo_udp_tunnel_add(dev, &ti);
} }
EXPORT_SYMBOL_GPL(udp_tunnel_push_rx_port); EXPORT_SYMBOL_GPL(udp_tunnel_push_rx_port);
...@@ -133,42 +106,15 @@ void udp_tunnel_notify_add_rx_port(struct socket *sock, unsigned short type) ...@@ -133,42 +106,15 @@ void udp_tunnel_notify_add_rx_port(struct socket *sock, unsigned short type)
ti.port = inet_sk(sk)->inet_sport; ti.port = inet_sk(sk)->inet_sport;
rcu_read_lock(); rcu_read_lock();
for_each_netdev_rcu(net, dev) for_each_netdev_rcu(net, dev) {
__udp_tunnel_push_rx_port(dev, &ti); if (!dev->netdev_ops->ndo_udp_tunnel_add)
continue;
dev->netdev_ops->ndo_udp_tunnel_add(dev, &ti);
}
rcu_read_unlock(); rcu_read_unlock();
} }
EXPORT_SYMBOL_GPL(udp_tunnel_notify_add_rx_port); EXPORT_SYMBOL_GPL(udp_tunnel_notify_add_rx_port);
static void __udp_tunnel_pull_rx_port(struct net_device *dev,
struct udp_tunnel_info *ti)
{
if (dev->netdev_ops->ndo_udp_tunnel_del) {
dev->netdev_ops->ndo_udp_tunnel_del(dev, ti);
return;
}
switch (ti->type) {
case UDP_TUNNEL_TYPE_VXLAN:
if (!dev->netdev_ops->ndo_del_vxlan_port)
break;
dev->netdev_ops->ndo_del_vxlan_port(dev,
ti->sa_family,
ti->port);
break;
case UDP_TUNNEL_TYPE_GENEVE:
if (!dev->netdev_ops->ndo_del_geneve_port)
break;
dev->netdev_ops->ndo_del_geneve_port(dev,
ti->sa_family,
ti->port);
break;
default:
break;
}
}
/* Notify netdevs that UDP port is no more listening */ /* Notify netdevs that UDP port is no more listening */
void udp_tunnel_notify_del_rx_port(struct socket *sock, unsigned short type) void udp_tunnel_notify_del_rx_port(struct socket *sock, unsigned short type)
{ {
...@@ -182,8 +128,11 @@ void udp_tunnel_notify_del_rx_port(struct socket *sock, unsigned short type) ...@@ -182,8 +128,11 @@ void udp_tunnel_notify_del_rx_port(struct socket *sock, unsigned short type)
ti.port = inet_sk(sk)->inet_sport; ti.port = inet_sk(sk)->inet_sport;
rcu_read_lock(); rcu_read_lock();
for_each_netdev_rcu(net, dev) for_each_netdev_rcu(net, dev) {
__udp_tunnel_pull_rx_port(dev, &ti); if (!dev->netdev_ops->ndo_udp_tunnel_del)
continue;
dev->netdev_ops->ndo_udp_tunnel_del(dev, &ti);
}
rcu_read_unlock(); rcu_read_unlock();
} }
EXPORT_SYMBOL_GPL(udp_tunnel_notify_del_rx_port); EXPORT_SYMBOL_GPL(udp_tunnel_notify_del_rx_port);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment