aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
authorAlexander Duyck <aduyck@mirantis.com>2016-06-16 15:21:00 -0400
committerDavid S. Miller <davem@davemloft.net>2016-06-17 23:23:29 -0400
commit7c46a640de6fcc4f35d0702710356a024eadf68f (patch)
tree0d19073b6febba8a3256dcd2928262e783f9643d /include/linux/netdevice.h
parente7b3db5e60e8f471c3f5ef93b497bafe5863e56a (diff)
net: Merge VXLAN and GENEVE push notifiers into a single notifier
This patch merges the notifiers for VXLAN and GENEVE into a single UDP tunnel notifier. The idea is that we will want to only have to make one notifier call to receive the list of ports for VXLAN and GENEVE tunnels that need to be offloaded. In addition we add a new set of ndo functions named ndo_udp_tunnel_add and ndo_udp_tunnel_del that are meant to allow us to track the tunnel meta-data such as port and address family as tunnels are added and removed. The tunnel meta-data is now transported in a structure named udp_tunnel_info which for now carries the type, address family, and port number. In the future this could be updated so that we can include a tuple of values including things such as the destination IP address and other fields. I also ended up going with a naming scheme that consisted of using the prefix udp_tunnel on function names. I applied this to the notifier and ndo ops as well so that it hopefully points to the fact that these are primarily used in the udp_tunnel functions. 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 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 890158e99159..577d2a1814b1 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -61,6 +61,8 @@ struct wireless_dev;
61/* 802.15.4 specific */ 61/* 802.15.4 specific */
62struct wpan_dev; 62struct wpan_dev;
63struct mpls_dev; 63struct mpls_dev;
64/* UDP Tunnel offloads */
65struct udp_tunnel_info;
64 66
65void netdev_set_default_ethtool_ops(struct net_device *dev, 67void netdev_set_default_ethtool_ops(struct net_device *dev,
66 const struct ethtool_ops *ops); 68 const struct ethtool_ops *ops);
@@ -1050,6 +1052,19 @@ struct tc_to_netdev {
1050 * address family that vxlan is not listening to anymore. The operation 1052 * address family that vxlan is not listening to anymore. The operation
1051 * is protected by the vxlan_net->sock_lock. 1053 * is protected by the vxlan_net->sock_lock.
1052 * 1054 *
1055 * void (*ndo_udp_tunnel_add)(struct net_device *dev,
1056 * struct udp_tunnel_info *ti);
1057 * Called by UDP tunnel to notify a driver about the UDP port and socket
1058 * address family that a UDP tunnel is listnening to. It is called only
1059 * when a new port starts listening. The operation is protected by the
1060 * RTNL.
1061 *
1062 * void (*ndo_udp_tunnel_del)(struct net_device *dev,
1063 * struct udp_tunnel_info *ti);
1064 * Called by UDP tunnel to notify the driver about a UDP port and socket
1065 * address family that the UDP tunnel is not listening to anymore. The
1066 * operation is protected by the RTNL.
1067 *
1053 * void* (*ndo_dfwd_add_station)(struct net_device *pdev, 1068 * void* (*ndo_dfwd_add_station)(struct net_device *pdev,
1054 * struct net_device *dev) 1069 * struct net_device *dev)
1055 * Called by upper layer devices to accelerate switching or other 1070 * Called by upper layer devices to accelerate switching or other
@@ -1269,6 +1284,10 @@ struct net_device_ops {
1269 void (*ndo_del_geneve_port)(struct net_device *dev, 1284 void (*ndo_del_geneve_port)(struct net_device *dev,
1270 sa_family_t sa_family, 1285 sa_family_t sa_family,
1271 __be16 port); 1286 __be16 port);
1287 void (*ndo_udp_tunnel_add)(struct net_device *dev,
1288 struct udp_tunnel_info *ti);
1289 void (*ndo_udp_tunnel_del)(struct net_device *dev,
1290 struct udp_tunnel_info *ti);
1272 void* (*ndo_dfwd_add_station)(struct net_device *pdev, 1291 void* (*ndo_dfwd_add_station)(struct net_device *pdev,
1273 struct net_device *dev); 1292 struct net_device *dev);
1274 void (*ndo_dfwd_del_station)(struct net_device *pdev, 1293 void (*ndo_dfwd_del_station)(struct net_device *pdev,
@@ -2255,8 +2274,7 @@ struct netdev_lag_lower_state_info {
2255#define NETDEV_BONDING_INFO 0x0019 2274#define NETDEV_BONDING_INFO 0x0019
2256#define NETDEV_PRECHANGEUPPER 0x001A 2275#define NETDEV_PRECHANGEUPPER 0x001A
2257#define NETDEV_CHANGELOWERSTATE 0x001B 2276#define NETDEV_CHANGELOWERSTATE 0x001B
2258#define NETDEV_OFFLOAD_PUSH_VXLAN 0x001C 2277#define NETDEV_UDP_TUNNEL_PUSH_INFO 0x001C
2259#define NETDEV_OFFLOAD_PUSH_GENEVE 0x001D
2260 2278
2261int register_netdevice_notifier(struct notifier_block *nb); 2279int register_netdevice_notifier(struct notifier_block *nb);
2262int unregister_netdevice_notifier(struct notifier_block *nb); 2280int unregister_netdevice_notifier(struct notifier_block *nb);