netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/6] bridge: add new attribute IFLA_BRIDGE_VLAN_RANGE_INFO to represent vlan range
@ 2014-12-29 21:05 roopa
  2014-12-29 21:52 ` Scott Feldman
  0 siblings, 1 reply; 3+ messages in thread
From: roopa @ 2014-12-29 21:05 UTC (permalink / raw)
  To: netdev, shemminger, vyasevic; +Cc: Roopa Prabhu, Wilson Kok

From: Roopa Prabhu <roopa@cumulusnetworks.com>

This patch adds new bridge netlink attribute IFLA_BRIDGE_VLAN_RANGE_INFO
to represent vlan range.

Current IFLA_BRIDGE_VLAN_INFO attribute represents a single vlan and
does not scale well when the port has large number of vlans.

IFLA_BRIDGE_VLAN_RANGE_INFO is similar to IFLA_BRIDGE_VLAN_INFO but helps
with packing consecutive vlans in a single attribute. Thus reducing the
size of the netlink msg during adds and also during dumps.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Wilson Kok <wkok@cumulusnetworks.com>
---
 include/uapi/linux/if_bridge.h |    7 +++++++
 net/bridge/br_netlink.c        |    2 ++
 2 files changed, 9 insertions(+)

diff --git a/include/uapi/linux/if_bridge.h b/include/uapi/linux/if_bridge.h
index b03ee8f..d41a346 100644
--- a/include/uapi/linux/if_bridge.h
+++ b/include/uapi/linux/if_bridge.h
@@ -118,6 +118,7 @@ enum {
 	IFLA_BRIDGE_FLAGS,
 	IFLA_BRIDGE_MODE,
 	IFLA_BRIDGE_VLAN_INFO,
+	IFLA_BRIDGE_VLAN_RANGE_INFO,
 	__IFLA_BRIDGE_MAX,
 };
 #define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1)
@@ -131,6 +132,12 @@ struct bridge_vlan_info {
 	__u16 vid;
 };
 
+struct bridge_vlan_range_info {
+	__u16 flags;
+	__u16 vid;
+	__u16 vid_end;
+};
+
 /* Bridge multicast database attributes
  * [MDBA_MDB] = {
  *     [MDBA_MDB_ENTRY] = {
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 75971b1..e7d1fc0 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -223,6 +223,8 @@ static const struct nla_policy ifla_br_policy[IFLA_MAX+1] = {
 	[IFLA_BRIDGE_MODE]	= { .type = NLA_U16 },
 	[IFLA_BRIDGE_VLAN_INFO]	= { .type = NLA_BINARY,
 				    .len = sizeof(struct bridge_vlan_info), },
+	[IFLA_BRIDGE_VLAN_RANGE_INFO] = { .type = NLA_BINARY,
+			 .len = sizeof(struct bridge_vlan_range_info), },
 };
 
 static int br_afspec(struct net_bridge *br,
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-12-29 22:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-29 21:05 [PATCH 2/6] bridge: add new attribute IFLA_BRIDGE_VLAN_RANGE_INFO to represent vlan range roopa
2014-12-29 21:52 ` Scott Feldman
2014-12-29 22:10   ` roopa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).