netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Cc: netdev@vger.kernel.org, roopa@cumulusnetworks.com
Subject: Re: [PATCH iproute2 net-next] bridge: vlan: add support to display per-vlan statistics
Date: Tue, 21 Jun 2016 09:01:41 -0700	[thread overview]
Message-ID: <20160621090141.0c13d12d@xeon-e3> (raw)
In-Reply-To: <1466417599-12940-1-git-send-email-nikolay@cumulusnetworks.com>

On Mon, 20 Jun 2016 12:13:19 +0200
Nikolay Aleksandrov <nikolay@cumulusnetworks.com> wrote:

> This patch adds support for the -statistics (-s) argument to the bridge
> vlan show command which will display the per-vlan statistics and the bridge
> device each vlan belongs to. The show command filtering options are both
> supported, also the man page is updated to explain the new option.
> This patch uses the new RTM_GETSTATS interface with a filter_mask to dump
> only the bridge vlans. Later we can add support for using the per-device
> dump and filter it in the kernel instead.
> 
> Example:
> $ bridge -s vlan
> port	vlan id	stats
> br0	 1	 RX: 33724730 bytes 492075 packets TX: 67409922 bytes 984029 packets
> 	 100	 RX: 0 bytes 0 packets TX: 0 bytes 0 packets
> 	 200	 RX: 0 bytes 0 packets TX: 0 bytes 0 packets
> 	 300	 RX: 0 bytes 0 packets TX: 0 bytes 0 packets
> 	 301	 RX: 169562135 bytes 790877 packets TX: 169550926 bytes 790824 packets
> br1	 1	 RX: 0 bytes 0 packets TX: 0 bytes 0 packets
> 
> Note that it will print the per-vlan statistics for all vlans in a bridge
> even if the vlan is only added to ports. Later when we add per-port
> per-vlan statistics support, we'll be able to print the exact ports each
> vlan belongs to, not only the bridge.
> 
> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>

Thanks, this is a useful tool, but I think the formatting of output may need to be
reworked.  The bridge tool works similar to ip command. And in the ip command the
-s flag causes additional lines, but does not change the output format.

There is also double line spacing in current output, which scrolls off when
managing in little VM windows. Plush the port name is too narrow a field width

Why not something like:

$ bridge vlan
port	   vlan ids
virbr1	   1 PVID Egress Untagged
virbr4	   1 PVID Egress Untagged
virbr0	   1 PVID Egress Untagged

$ bridge -s vlan
virbr1	   1 PVID Egress Untagged
             RX: 33724730 bytes 492075 packets
             TX: 67409922 bytes 984029 packets
virbr0	   1 PVID Egress Untagged
             RX: 169562135 bytes 790877 packets 
             TX: 169550926 bytes 790824 packets

The -d detail flag would also be useful to implement

  reply	other threads:[~2016-06-21 16:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-20 10:13 [PATCH iproute2 net-next] bridge: vlan: add support to display per-vlan statistics Nikolay Aleksandrov
2016-06-21 16:01 ` Stephen Hemminger [this message]
2016-06-21 16:10   ` Nikolay Aleksandrov
2016-06-21 16:11     ` Nikolay Aleksandrov
2016-07-01  0:06       ` Stephen Hemminger
2016-07-01  9:24         ` Nikolay Aleksandrov
2016-06-21 18:07 ` [PATCH iproute2 net-next v2] " Nikolay Aleksandrov
2016-06-21 18:08   ` Nikolay Aleksandrov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160621090141.0c13d12d@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@cumulusnetworks.com \
    --cc=roopa@cumulusnetworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).