summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-04-21 19:36:04 (GMT)
committerDavid S. Miller <davem@davemloft.net>2016-04-21 19:36:04 (GMT)
commit22d37b6b0058365a80378ee6198d21e7f6c86327 (patch)
treedfb1140e166ecf89f994f667e0cb9e73969845e8 /include
parent7f348a60762afd4cd0e4e7fa14cfa66331b7c30e (diff)
parent681e683ff30ada19f73c17c38a528528dd8824f1 (diff)
downloadlinux-22d37b6b0058365a80378ee6198d21e7f6c86327.tar.xz
Merge branch 'geneve-vxlan-deps'
Hannes Frederic Sowa says: ==================== net: network drivers should not depend on geneve/vxlan This patchset removes the dependency of network drivers on vxlan or geneve, so those don't get autoloaded when the nic driver is loaded. Also audited the code such that vxlan_get_rx_port and geneve_get_rx_port are not called without rtnl lock. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/netdevice.h2
-rw-r--r--include/net/geneve.h6
-rw-r--r--include/net/vxlan.h6
3 files changed, 6 insertions, 8 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index a3bb534..1f6d5db 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2244,6 +2244,8 @@ struct netdev_lag_lower_state_info {
#define NETDEV_BONDING_INFO 0x0019
#define NETDEV_PRECHANGEUPPER 0x001A
#define NETDEV_CHANGELOWERSTATE 0x001B
+#define NETDEV_OFFLOAD_PUSH_VXLAN 0x001C
+#define NETDEV_OFFLOAD_PUSH_GENEVE 0x001D
int register_netdevice_notifier(struct notifier_block *nb);
int unregister_netdevice_notifier(struct notifier_block *nb);
diff --git a/include/net/geneve.h b/include/net/geneve.h
index e6c23dc..cb544a5 100644
--- a/include/net/geneve.h
+++ b/include/net/geneve.h
@@ -62,13 +62,11 @@ struct genevehdr {
struct geneve_opt options[];
};
-#if IS_ENABLED(CONFIG_GENEVE)
-void geneve_get_rx_port(struct net_device *netdev);
-#else
static inline void geneve_get_rx_port(struct net_device *netdev)
{
+ ASSERT_RTNL();
+ call_netdevice_notifiers(NETDEV_OFFLOAD_PUSH_GENEVE, netdev);
}
-#endif
#ifdef CONFIG_INET
struct net_device *geneve_dev_create_fb(struct net *net, const char *name,
diff --git a/include/net/vxlan.h b/include/net/vxlan.h
index d442eb3..673e9f9 100644
--- a/include/net/vxlan.h
+++ b/include/net/vxlan.h
@@ -390,13 +390,11 @@ static inline __be32 vxlan_compute_rco(unsigned int start, unsigned int offset)
return vni_field;
}
-#if IS_ENABLED(CONFIG_VXLAN)
-void vxlan_get_rx_port(struct net_device *netdev);
-#else
static inline void vxlan_get_rx_port(struct net_device *netdev)
{
+ ASSERT_RTNL();
+ call_netdevice_notifiers(NETDEV_OFFLOAD_PUSH_VXLAN, netdev);
}
-#endif
static inline unsigned short vxlan_get_sk_family(struct vxlan_sock *vs)
{