bridge: uapi: add per vlan tunnel info
authorRoopa Prabhu <roopa@cumulusnetworks.com>
Wed, 1 Feb 2017 06:59:53 +0000 (22:59 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 3 Feb 2017 20:21:21 +0000 (15:21 -0500)
New nested netlink attribute to associate tunnel info per vlan.
This is used by bridge driver to send tunnel metadata to
bridge ports in vlan tunnel mode. This patch also adds new per
port flag IFLA_BRPORT_VLAN_TUNNEL to enable vlan tunnel mode.
off by default.

One example use for this is a vxlan bridging gateway or vtep
which maps vlans to vn-segments (or vnis). User can configure
per-vlan tunnel information which the bridge driver can use
to bridge vlan into the corresponding vn-segment.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/if_bridge.h
include/uapi/linux/if_bridge.h
include/uapi/linux/if_link.h

index debc9d5904e5cf624a607592177d20395c737f74..c5847dc75a937a5ceed4a762ffcc9f2644b499bc 100644 (file)
@@ -47,6 +47,7 @@ struct br_ip_list {
 #define BR_PROXYARP_WIFI       BIT(10)
 #define BR_MCAST_FLOOD         BIT(11)
 #define BR_MULTICAST_TO_UNICAST        BIT(12)
+#define BR_VLAN_TUNNEL         BIT(13)
 
 #define BR_DEFAULT_AGEING_TIME (300 * HZ)
 
index ab92bca6d448bb8040f366df430b7db6950aae5c..a9e6244ce43803339584f3f6e43757005363e621 100644 (file)
@@ -118,6 +118,7 @@ enum {
        IFLA_BRIDGE_FLAGS,
        IFLA_BRIDGE_MODE,
        IFLA_BRIDGE_VLAN_INFO,
+       IFLA_BRIDGE_VLAN_TUNNEL_INFO,
        __IFLA_BRIDGE_MAX,
 };
 #define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1)
@@ -134,6 +135,16 @@ struct bridge_vlan_info {
        __u16 vid;
 };
 
+enum {
+       IFLA_BRIDGE_VLAN_TUNNEL_UNSPEC,
+       IFLA_BRIDGE_VLAN_TUNNEL_ID,
+       IFLA_BRIDGE_VLAN_TUNNEL_VID,
+       IFLA_BRIDGE_VLAN_TUNNEL_FLAGS,
+       __IFLA_BRIDGE_VLAN_TUNNEL_MAX,
+};
+
+#define IFLA_BRIDGE_VLAN_TUNNEL_MAX (__IFLA_BRIDGE_VLAN_TUNNEL_MAX - 1)
+
 struct bridge_vlan_xstats {
        __u64 rx_bytes;
        __u64 rx_packets;
index b9aa5641ebe50d9ceed691625298a7ffe6da3719..320fc1e747ee9623db56fbaf26b2a514b5d5a3d1 100644 (file)
@@ -322,6 +322,7 @@ enum {
        IFLA_BRPORT_PAD,
        IFLA_BRPORT_MCAST_FLOOD,
        IFLA_BRPORT_MCAST_TO_UCAST,
+       IFLA_BRPORT_VLAN_TUNNEL,
        __IFLA_BRPORT_MAX
 };
 #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)