]> git.proxmox.com Git - mirror_iproute2.git/commit - man/man8/bridge.8
bridge: vlan: add support to display per-vlan statistics
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Thu, 25 Aug 2016 12:28:55 +0000 (14:28 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 29 Aug 2016 17:58:40 +0000 (10:58 -0700)
commit7abf5de677e32f39dcd908f5b69adb047feeb76a
treeb5d384f9c8b6004d11e73201ef414b243c475894
parentf7708201f8e0f00b62810d0a053f1628acf31c5b
bridge: vlan: add support to display per-vlan statistics

This patch adds support for the stats argument to the bridge
vlan command which will display the per-vlan statistics and the device
each vlan belongs to with its flags. The supported command filtering
options are dev and vid. Also the man page is updated to explain the new
option.
The patch uses the new RTM_GETSTATS interface with a filter_mask to dump
all bridges and ports vlans. Later we can add support for using the
per-device dump and filter it in the kernel instead.

Example:
$ bridge -s vlan show
port             vlan id
br0               1 Egress Untagged
                    RX: 2536 bytes 20 packets
                    TX: 2536 bytes 20 packets
                  101
                    RX: 43158 bytes 50 packets
                    TX: 43158 bytes 50 packets
eth1              1 Egress Untagged
                    RX: 2536 bytes 20 packets
                    TX: 2536 bytes 20 packets
                  100
                    RX: 0 bytes 0 packets
                    TX: 0 bytes 0 packets
                  101
                    RX: 43158 bytes 50 packets
                    TX: 43158 bytes 50 packets
                  102
                    RX: 16897 bytes 93 packets
                    TX: 0 bytes 0 packets

The format is the same as bridge vlan show but with stats, even though
under the hood the calls done to the kernel are different.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
bridge/vlan.c
include/libnetlink.h
lib/libnetlink.c
man/man8/bridge.8