diff options
author | Petr Machata <petrm@mellanox.com> | 2018-10-17 10:53:22 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-10-18 02:45:08 +0200 |
commit | 9a99735317866e821c75f957fc85c63d049d330c (patch) | |
tree | fff45955da03997f6e2eddaec8811e4bad5aeb09 /include/net/vxlan.h | |
parent | net: Add netif_is_vxlan() (diff) | |
download | linux-9a99735317866e821c75f957fc85c63d049d330c.tar.xz linux-9a99735317866e821c75f957fc85c63d049d330c.zip |
vxlan: Add switchdev notifications
When offloading VXLAN devices, drivers need to know about events in
VXLAN FDB database. Since VXLAN models a bridge, it is natural to
distribute the VXLAN FDB notifications using the pre-existing switchdev
notification mechanism.
To that end, introduce two new notification types:
SWITCHDEV_VXLAN_FDB_ADD_TO_DEVICE and SWITCHDEV_VXLAN_FDB_DEL_TO_DEVICE.
Introduce a new function, vxlan_fdb_switchdev_call_notifiers() to send
the new notifier types, and a struct switchdev_notifier_vxlan_fdb_info
to communicate the details of the FDB entry under consideration.
Invoke the new function from vxlan_fdb_notify().
Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/vxlan.h')
-rw-r--r-- | include/net/vxlan.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/net/vxlan.h b/include/net/vxlan.h index 95227fa925e8..3f00877f5edf 100644 --- a/include/net/vxlan.h +++ b/include/net/vxlan.h @@ -6,6 +6,7 @@ #include <net/udp_tunnel.h> #include <net/dst_metadata.h> #include <net/rtnetlink.h> +#include <net/switchdev.h> /* VXLAN protocol (RFC 7348) header: * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ @@ -409,4 +410,14 @@ static inline bool netif_is_vxlan(const struct net_device *dev) !strcmp(dev->rtnl_link_ops->kind, "vxlan"); } +struct switchdev_notifier_vxlan_fdb_info { + struct switchdev_notifier_info info; /* must be first */ + union vxlan_addr remote_ip; + __be16 remote_port; + __be32 remote_vni; + u32 remote_ifindex; + u8 eth_addr[ETH_ALEN]; + __be32 vni; +}; + #endif |