Subject: Re: [PATCH iproute2 net-next] bridge: vlan: add support to display per-vlan statistics

From: Nikolay Aleksandrov <[email-masked]>
Date: Fri, 1 Jul 2016 11:24:16 +0200

On 01/07/16 02:06, Stephen Hemminger wrote:
> On Tue, 21 Jun 2016 18:11:59 +0200
> Nikolay Aleksandrov <[email-masked]> wrote:
> 
>>>> 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.  
>>>
>>> Indeed, I agree that it needs refinement.
>>>   
>>
>> Or alternatively I can make it:
>> $ bridge vlan stats
>> a subcommand instead of using the "-s" argument in order to be consistent.
>> So it can have its own format.
> 
> Why not:
> 
> $ bridge -s vlan show
> 
> to be consistent with:
> 
> $ ip -s li show
> 

The problem is that currently it cannot be formated the same as "bridge vlan show"
because it cannot contain the flags since all vlan stats are fetched from the
bridge device even though some vlans might exist only on the ports (or have different
flags on the ports).
That might change soon though, if my IGMP stats patches are accepted we'll be able
to fetch the vlan stats per port as well and thus print the flags and make the
output consistent with "bridge vlan show". Thus my first version of this patch that
just printed the stats will work in that case, we'll just add the flags and port
output later. If you'd like to go down this road please let me know.

Me and Roopa have been discussing an alternative way to fetch the stats via a new
command, something like:
$ bridge stats { <igmp> | <vlan> } [ dev DEV ] [ vid VID ]
because of the IGMP/MLD stats which don't fit any of the other commands for a "-s"
flag.

What do you think ?

Cheers,
 Nik