net: bridge: export vlan flags with the stats
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Wed, 17 Aug 2016 10:53:10 +0000 (12:53 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 19 Aug 2016 06:18:42 +0000 (23:18 -0700)
Use one of the vlan xstats padding fields to export the vlan flags. This is
needed in order to be able to distinguish between master (bridge) and port
vlan entries in user-space when dumping the bridge vlan stats.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/uapi/linux/if_bridge.h
net/bridge/br_netlink.c

index c186f64fffca2473a3fe6821446f1f3158dafb6d..ab92bca6d448bb8040f366df430b7db6950aae5c 100644 (file)
@@ -140,7 +140,7 @@ struct bridge_vlan_xstats {
        __u64 tx_bytes;
        __u64 tx_packets;
        __u16 vid;
-       __u16 pad1;
+       __u16 flags;
        __u32 pad2;
 };
 
index 493ab9b3d51a5460f5ec68ba11d8029225183288..872d4c0deb59de778759b849ed2f8f3c9eadc119 100644 (file)
@@ -1321,6 +1321,7 @@ static int br_fill_linkxstats(struct sk_buff *skb,
                                continue;
                        memset(&vxi, 0, sizeof(vxi));
                        vxi.vid = v->vid;
+                       vxi.flags = v->flags;
                        br_vlan_get_stats(v, &stats);
                        vxi.rx_bytes = stats.rx_bytes;
                        vxi.rx_packets = stats.rx_packets;