All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH iproute2-next] iplink: bridge: add support for vlan_stats_per_port
@ 2019-04-16 13:19 Nikolay Aleksandrov
  2019-04-21 13:47 ` David Ahern
  0 siblings, 1 reply; 2+ messages in thread
From: Nikolay Aleksandrov @ 2019-04-16 13:19 UTC (permalink / raw)
  To: netdev; +Cc: dsa, roopa, Nikolay Aleksandrov

Add support for manipulating and showing the vlan_stats_per_port bridge
option which can be toggled only when there are no port VLANs
configured. Also update the man page with the new option.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
 ip/iplink_bridge.c    | 15 +++++++++++++++
 man/man8/ip-link.8.in |  9 +++++++++
 2 files changed, 24 insertions(+)

diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
index e9b77fdfe377..10ba85f6f1fe 100644
--- a/ip/iplink_bridge.c
+++ b/ip/iplink_bridge.c
@@ -41,6 +41,7 @@ static void print_explain(FILE *f)
 		"                  [ vlan_protocol VLAN_PROTOCOL ]\n"
 		"                  [ vlan_default_pvid VLAN_DEFAULT_PVID ]\n"
 		"                  [ vlan_stats_enabled VLAN_STATS_ENABLED ]\n"
+		"                  [ vlan_stats_per_port VLAN_STATS_PER_PORT ]\n"
 		"                  [ mcast_snooping MULTICAST_SNOOPING ]\n"
 		"                  [ mcast_router MULTICAST_ROUTER ]\n"
 		"                  [ mcast_query_use_ifaddr MCAST_QUERY_USE_IFADDR ]\n"
@@ -175,6 +176,14 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,
 				invarg("invalid vlan_stats_enabled", *argv);
 			addattr8(n, 1024, IFLA_BR_VLAN_STATS_ENABLED,
 				  vlan_stats_enabled);
+		} else if (matches(*argv, "vlan_stats_per_port") == 0) {
+			__u8 vlan_stats_per_port;
+
+			NEXT_ARG();
+			if (get_u8(&vlan_stats_per_port, *argv, 0))
+				invarg("invalid vlan_stats_per_port", *argv);
+			addattr8(n, 1024, IFLA_BR_VLAN_STATS_PER_PORT,
+				 vlan_stats_per_port);
 		} else if (matches(*argv, "mcast_router") == 0) {
 			__u8 mcast_router;
 
@@ -521,6 +530,12 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
 			   "vlan_stats_enabled %u ",
 			   rta_getattr_u8(tb[IFLA_BR_VLAN_STATS_ENABLED]));
 
+	if (tb[IFLA_BR_VLAN_STATS_PER_PORT])
+		print_uint(PRINT_ANY,
+			   "vlan_stats_per_port",
+			   "vlan_stats_per_port %u ",
+			   rta_getattr_u8(tb[IFLA_BR_VLAN_STATS_PER_PORT]));
+
 	if (tb[IFLA_BR_GROUP_FWD_MASK])
 		print_0xhex(PRINT_ANY,
 			    "group_fwd_mask",
diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in
index 6f31453cbd0e..da12ad6e6d76 100644
--- a/man/man8/ip-link.8.in
+++ b/man/man8/ip-link.8.in
@@ -1380,6 +1380,8 @@ the following additional arguments are supported:
 ] [
 .BI vlan_stats_enabled " VLAN_STATS_ENABLED "
 ] [
+.BI vlan_stats_per_port " VLAN_STATS_PER_PORT "
+] [
 .BI mcast_snooping " MULTICAST_SNOOPING "
 ] [
 .BI mcast_router " MULTICAST_ROUTER "
@@ -1473,6 +1475,13 @@ or disable
 .RI ( VLAN_STATS_ENABLED " == 0) "
 per-VLAN stats accounting.
 
+.BI vlan_stats_per_port " VLAN_STATS_PER_PORT "
+- enable
+.RI ( VLAN_STATS_PER_PORT " == 1) "
+or disable
+.RI ( VLAN_STATS_PER_PORT " == 0) "
+per-VLAN per-port stats accounting. Can be changed only when there are no port VLANs configured.
+
 .BI mcast_snooping " MULTICAST_SNOOPING "
 - turn multicast snooping on
 .RI ( MULTICAST_SNOOPING " > 0) "
-- 
2.20.1


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

* Re: [PATCH iproute2-next] iplink: bridge: add support for vlan_stats_per_port
  2019-04-16 13:19 [PATCH iproute2-next] iplink: bridge: add support for vlan_stats_per_port Nikolay Aleksandrov
@ 2019-04-21 13:47 ` David Ahern
  0 siblings, 0 replies; 2+ messages in thread
From: David Ahern @ 2019-04-21 13:47 UTC (permalink / raw)
  To: Nikolay Aleksandrov, netdev; +Cc: dsa, roopa

On 4/16/19 7:19 AM, Nikolay Aleksandrov wrote:
> Add support for manipulating and showing the vlan_stats_per_port bridge
> option which can be toggled only when there are no port VLANs
> configured. Also update the man page with the new option.
> 
> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
> ---
>  ip/iplink_bridge.c    | 15 +++++++++++++++
>  man/man8/ip-link.8.in |  9 +++++++++
>  2 files changed, 24 insertions(+)
> 


applied to iproute2-next. Thanks

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

end of thread, other threads:[~2019-04-21 13:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-16 13:19 [PATCH iproute2-next] iplink: bridge: add support for vlan_stats_per_port Nikolay Aleksandrov
2019-04-21 13:47 ` David Ahern

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.