diff options
| author | David S. Miller <davem@davemloft.net> | 2018-11-21 17:10:32 -0800 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2018-11-21 17:10:32 -0800 |
| commit | f072df95f82811d3c2463b5626f65af499738fac (patch) | |
| tree | 4dc18c49c93e21896cc6189db3365cc222d717b9 /include | |
| parent | d59da3fbfe3f2bd9cbf29495e818b79d6349b12d (diff) | |
| parent | c39c56a8c8a06330eacc739fda7d175dd1781db5 (diff) | |
Merge branch 'mlxsw-Add-VxLAN-learning-support'
Ido Schimmel says:
====================
mlxsw: Add VxLAN learning support
This patchset adds VxLAN learning support in the mlxsw driver.
The first five patches from Petr add the required switchdev APIs which
allow device drivers to notify the VxLAN driver about learned / aged-out
FDB entries.
First in patch #1, an unnecessary argument is dropped from
__vxlan_fdb_delete().
In patches #2-#4, the VxLAN FDB handling code is extended to make
sending the switchdev events configurable; to mark user-added entries as
such; and to make sure HW-learned FDB entries do not take over
user-added ones.
Finally in patch #5, the necessary switchdev notifications are added and
handled by VxLAN, similarly to how this is handled in the bridge driver.
Patch #6 allows changing of the VxLAN's device ageing time since it is
useful for the selftest in the last patch.
Patch #7 adds support for querying bridge port flags of a given
netdevice, as a new entry should not be learned and notified to the
bridge driver in case learning is disabled on the bridge port.
Next patches gradually add learning support in mlxsw.
The last patch adds a new test case for VxLAN learning.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/if_bridge.h | 6 | ||||
| -rw-r--r-- | include/net/switchdev.h | 2 | ||||
| -rw-r--r-- | include/net/vxlan.h | 1 |
3 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h index c20c7e197d07..ef7c3d376b21 100644 --- a/include/linux/if_bridge.h +++ b/include/linux/if_bridge.h @@ -119,6 +119,7 @@ static inline int br_vlan_get_info(const struct net_device *dev, u16 vid, struct net_device *br_fdb_find_port(const struct net_device *br_dev, const unsigned char *addr, __u16 vid); +bool br_port_flag_is_set(const struct net_device *dev, unsigned long flag); #else static inline struct net_device * br_fdb_find_port(const struct net_device *br_dev, @@ -127,6 +128,11 @@ br_fdb_find_port(const struct net_device *br_dev, { return NULL; } +static inline bool +br_port_flag_is_set(const struct net_device *dev, unsigned long flag) +{ + return false; +} #endif #endif diff --git a/include/net/switchdev.h b/include/net/switchdev.h index 881ecb1555bf..7b371e7c4bc6 100644 --- a/include/net/switchdev.h +++ b/include/net/switchdev.h @@ -146,6 +146,8 @@ enum switchdev_notifier_type { SWITCHDEV_FDB_DEL_TO_DEVICE, SWITCHDEV_FDB_OFFLOADED, + SWITCHDEV_VXLAN_FDB_ADD_TO_BRIDGE, + SWITCHDEV_VXLAN_FDB_DEL_TO_BRIDGE, SWITCHDEV_VXLAN_FDB_ADD_TO_DEVICE, SWITCHDEV_VXLAN_FDB_DEL_TO_DEVICE, SWITCHDEV_VXLAN_FDB_OFFLOADED, diff --git a/include/net/vxlan.h b/include/net/vxlan.h index ec999c49df1f..b73c670df184 100644 --- a/include/net/vxlan.h +++ b/include/net/vxlan.h @@ -421,6 +421,7 @@ struct switchdev_notifier_vxlan_fdb_info { u8 eth_addr[ETH_ALEN]; __be32 vni; bool offloaded; + bool added_by_user; }; #if IS_ENABLED(CONFIG_VXLAN) |
