diff options
author | Nikolay Aleksandrov <nikolay@cumulusnetworks.com> | 2020-03-17 13:08:36 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-03-18 06:47:12 +0100 |
commit | 569da08228086ac6f7053d71c6cb713c1f115209 (patch) | |
tree | cccd412e56c23ec98a2ead61f057611f13f79af1 /net/bridge/br_private_tunnel.h | |
parent | net: bridge: vlan options: add support for tunnel id dumping (diff) | |
download | linux-569da08228086ac6f7053d71c6cb713c1f115209.tar.xz linux-569da08228086ac6f7053d71c6cb713c1f115209.zip |
net: bridge: vlan options: add support for tunnel mapping set/del
This patch adds support for manipulating vlan/tunnel mappings. The
tunnel ids are globally unique and are one per-vlan. There were two
trickier issues - first in order to support vlan ranges we have to
compute the current tunnel id in the following way:
- base tunnel id (attr) + current vlan id - starting vlan id
This is in line how the old API does vlan/tunnel mapping with ranges. We
already have the vlan range present, so it's redundant to add another
attribute for the tunnel range end. It's simply base tunnel id + vlan
range. And second to support removing mappings we need an out-of-band way
to tell the option manipulating function because there are no
special/reserved tunnel id values, so we use a vlan flag to denote the
operation is tunnel mapping removal.
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_private_tunnel.h')
-rw-r--r-- | net/bridge/br_private_tunnel.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/bridge/br_private_tunnel.h b/net/bridge/br_private_tunnel.h index b27a0c0371f2..c54cc26211d7 100644 --- a/net/bridge/br_private_tunnel.h +++ b/net/bridge/br_private_tunnel.h @@ -45,6 +45,8 @@ int br_handle_egress_vlan_tunnel(struct sk_buff *skb, struct net_bridge_vlan *vlan); bool vlan_tunid_inrange(const struct net_bridge_vlan *v_curr, const struct net_bridge_vlan *v_last); +int br_vlan_tunnel_info(const struct net_bridge_port *p, int cmd, + u16 vid, u32 tun_id, bool *changed); #else static inline int vlan_tunnel_init(struct net_bridge_vlan_group *vg) { |