vxlan: break dependency with netdev drivers
Currently all drivers depend and autoload the vxlan module because how vxlan_get_rx_port is linked into them. Remove this dependency: By using a new event type in the netdevice notifier call chain we proxy the request from the drivers to flush and resetup the vxlan ports not directly via function call but by the already existing netdevice notifier call chain. I added a separate new event type, NETDEV_OFFLOAD_PUSH_VXLAN, to do so. We don't need to save those ids, as the event type field is an unsigned long and using specialized event types for this purpose seemed to be a more elegant way. This also comes in beneficial if in future we want to add offloading knobs for vxlan. Cc: Jesse Gross <jesse@kernel.org> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
50d65d7889
commit
b7aade1548
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user