On 21/06/16 20:07, Nikolay Aleksandrov wrote:
> This patch adds support for the stats argument to the bridge
> vlan command which will display the per-vlan statistics and the bridge
> device each vlan belongs to. The supported command filtering options are
> dev and vid. 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 vlan stats
> port             vlan id
> br0               1
>                     RX: 34816114 bytes 495195 packets
>                     TX: 68501306 bytes 987149 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 <niko...@cumulusnetworks.com>
> ---
> v2: Change the output format as per Stephen's comment and change the -s use
> to a subcommand called stats in order to have a different format than show,
> update the man page appropriately.
> 

I forgot to add - I also tested this in a small VM window and it fits
well. :-)

Cheers,
 Nik


Reply via email to