diff options
author | Alexander Duyck <aduyck@mirantis.com> | 2016-06-16 15:23:12 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-17 23:23:32 -0400 |
commit | 1938ee1fd3de74d761a60806b048df652666afec (patch) | |
tree | e16e09d5f68a6ca90da18cbe0ccb9548be87e6b0 /net/ipv4 | |
parent | 5e44f8e299f64c7b5ce8c9185d14f6f98ff30b21 (diff) |
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: Alexander Duyck <aduyck@mirantis.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/udp_tunnel.c | 79 |
1 files changed, 14 insertions, 65 deletions
diff --git a/net/ipv4/udp_tunnel.c b/net/ipv4/udp_tunnel.c index 683e494d9000..58bd39fb14b4 100644 --- a/net/ipv4/udp_tunnel.c +++ b/net/ipv4/udp_tunnel.c | |||
@@ -76,47 +76,20 @@ void setup_udp_tunnel_sock(struct net *net, struct socket *sock, | |||
76 | } | 76 | } |
77 | EXPORT_SYMBOL_GPL(setup_udp_tunnel_sock); | 77 | EXPORT_SYMBOL_GPL(setup_udp_tunnel_sock); |
78 | 78 | ||
79 | static void __udp_tunnel_push_rx_port(struct net_device *dev, | ||
80 | struct udp_tunnel_info *ti) | ||
81 | { | ||
82 | if (dev->netdev_ops->ndo_udp_tunnel_add) { | ||
83 | dev->netdev_ops->ndo_udp_tunnel_add(dev, ti); | ||
84 | return; | ||
85 | } | ||
86 | |||
87 | switch (ti->type) { | ||
88 | case UDP_TUNNEL_TYPE_VXLAN: | ||
89 | if (!dev->netdev_ops->ndo_add_vxlan_port) | ||
90 | break; | ||
91 | |||
92 | dev->netdev_ops->ndo_add_vxlan_port(dev, | ||
93 | ti->sa_family, | ||
94 | ti->port); | ||
95 | break; | ||
96 | case UDP_TUNNEL_TYPE_GENEVE: | ||
97 | if (!dev->netdev_ops->ndo_add_geneve_port) | ||
98 | break; | ||
99 | |||
100 | dev->netdev_ops->ndo_add_geneve_port(dev, | ||
101 | ti->sa_family, | ||
102 | ti->port); | ||
103 | break; | ||
104 | default: | ||
105 | break; | ||
106 | } | ||
107 | } | ||
108 | |||
109 | void udp_tunnel_push_rx_port(struct net_device *dev, struct socket *sock, | 79 | void udp_tunnel_push_rx_port(struct net_device *dev, struct socket *sock, |
110 | unsigned short type) | 80 | unsigned short type) |
111 | { | 81 | { |
112 | struct sock *sk = sock->sk; | 82 | struct sock *sk = sock->sk; |
113 | struct udp_tunnel_info ti; | 83 | struct udp_tunnel_info ti; |
114 | 84 | ||
85 | if (!dev->netdev_ops->ndo_udp_tunnel_add) | ||
86 | return; | ||
87 | |||
115 | ti.type = type; | 88 | ti.type = type; |
116 | ti.sa_family = sk->sk_family; | 89 | ti.sa_family = sk->sk_family; |
117 | ti.port = inet_sk(sk)->inet_sport; | 90 | ti.port = inet_sk(sk)->inet_sport; |
118 | 91 | ||
119 | __udp_tunnel_push_rx_port(dev, &ti); | 92 | dev->netdev_ops->ndo_udp_tunnel_add(dev, &ti); |
120 | } | 93 | } |
121 | EXPORT_SYMBOL_GPL(udp_tunnel_push_rx_port); | 94 | EXPORT_SYMBOL_GPL(udp_tunnel_push_rx_port); |
122 | 95 | ||
@@ -133,42 +106,15 @@ void udp_tunnel_notify_add_rx_port(struct socket *sock, unsigned short type) | |||
133 | ti.port = inet_sk(sk)->inet_sport; | 106 | ti.port = inet_sk(sk)->inet_sport; |
134 | 107 | ||
135 | rcu_read_lock(); | 108 | rcu_read_lock(); |
136 | for_each_netdev_rcu(net, dev) | 109 | for_each_netdev_rcu(net, dev) { |
137 | __udp_tunnel_push_rx_port(dev, &ti); | 110 | if (!dev->netdev_ops->ndo_udp_tunnel_add) |
111 | continue; | ||
112 | dev->netdev_ops->ndo_udp_tunnel_add(dev, &ti); | ||
113 | } | ||
138 | rcu_read_unlock(); | 114 | rcu_read_unlock(); |
139 | } | 115 | } |
140 | EXPORT_SYMBOL_GPL(udp_tunnel_notify_add_rx_port); | 116 | EXPORT_SYMBOL_GPL(udp_tunnel_notify_add_rx_port); |
141 | 117 | ||
142 | static void __udp_tunnel_pull_rx_port(struct net_device *dev, | ||
143 | struct udp_tunnel_info *ti) | ||
144 | { | ||
145 | if (dev->netdev_ops->ndo_udp_tunnel_del) { | ||
146 | dev->netdev_ops->ndo_udp_tunnel_del(dev, ti); | ||
147 | return; | ||
148 | } | ||
149 | |||
150 | switch (ti->type) { | ||
151 | case UDP_TUNNEL_TYPE_VXLAN: | ||
152 | if (!dev->netdev_ops->ndo_del_vxlan_port) | ||
153 | break; | ||
154 | |||
155 | dev->netdev_ops->ndo_del_vxlan_port(dev, | ||
156 | ti->sa_family, | ||
157 | ti->port); | ||
158 | break; | ||
159 | case UDP_TUNNEL_TYPE_GENEVE: | ||
160 | if (!dev->netdev_ops->ndo_del_geneve_port) | ||
161 | break; | ||
162 | |||
163 | dev->netdev_ops->ndo_del_geneve_port(dev, | ||
164 | ti->sa_family, | ||
165 | ti->port); | ||
166 | break; | ||
167 | default: | ||
168 | break; | ||
169 | } | ||
170 | } | ||
171 | |||
172 | /* Notify netdevs that UDP port is no more listening */ | 118 | /* Notify netdevs that UDP port is no more listening */ |
173 | void udp_tunnel_notify_del_rx_port(struct socket *sock, unsigned short type) | 119 | void udp_tunnel_notify_del_rx_port(struct socket *sock, unsigned short type) |
174 | { | 120 | { |
@@ -182,8 +128,11 @@ void udp_tunnel_notify_del_rx_port(struct socket *sock, unsigned short type) | |||
182 | ti.port = inet_sk(sk)->inet_sport; | 128 | ti.port = inet_sk(sk)->inet_sport; |
183 | 129 | ||
184 | rcu_read_lock(); | 130 | rcu_read_lock(); |
185 | for_each_netdev_rcu(net, dev) | 131 | for_each_netdev_rcu(net, dev) { |
186 | __udp_tunnel_pull_rx_port(dev, &ti); | 132 | if (!dev->netdev_ops->ndo_udp_tunnel_del) |
133 | continue; | ||
134 | dev->netdev_ops->ndo_udp_tunnel_del(dev, &ti); | ||
135 | } | ||
187 | rcu_read_unlock(); | 136 | rcu_read_unlock(); |
188 | } | 137 | } |
189 | EXPORT_SYMBOL_GPL(udp_tunnel_notify_del_rx_port); | 138 | EXPORT_SYMBOL_GPL(udp_tunnel_notify_del_rx_port); |