net: bridge: add support for IGMP/MLD stats and export them via netlink
This patch adds stats support for the currently used IGMP/MLD types by the bridge. The stats are per-port (plus one stat per-bridge) and per-direction (RX/TX). The stats are exported via netlink via the new linkxstats API (RTM_GETSTATS). In order to minimize the performance impact, a new option is used to enable/disable the stats - multicast_stats_enabled, similar to the recent vlan stats. Also in order to avoid multiple IGMP/MLD type lookups and checks, we make use of the current "igmp" member of the bridge private skb->cb region to record the type on Rx (both host-generated and external packets pass by multicast_rcv()). We can do that since the igmp member was used as a boolean and all the valid IGMP/MLD types are positive values. The normal bridge fast-path is not affected at all, the only affected paths are the flooding ones and since we make use of the IGMP/MLD type, we can quickly determine if the packet should be counted using cache-hot data (cb's igmp member). We add counters for: * IGMP Queries * IGMP Leaves * IGMP v1/v2/v3 reports * MLD Queries * MLD Leaves * MLD v1/v2 reports These are invaluable when monitoring or debugging complex multicast setups with bridges. Signed-off-by:Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
Showing
- include/uapi/linux/if_bridge.h 26 additions, 0 deletionsinclude/uapi/linux/if_bridge.h
- include/uapi/linux/if_link.h 1 addition, 0 deletionsinclude/uapi/linux/if_link.h
- net/bridge/br_device.c 9 additions, 1 deletionnet/bridge/br_device.c
- net/bridge/br_forward.c 12 additions, 1 deletionnet/bridge/br_forward.c
- net/bridge/br_if.c 7 additions, 2 deletionsnet/bridge/br_if.c
- net/bridge/br_input.c 3 additions, 0 deletionsnet/bridge/br_input.c
- net/bridge/br_multicast.c 203 additions, 14 deletionsnet/bridge/br_multicast.c
- net/bridge/br_netlink.c 65 additions, 26 deletionsnet/bridge/br_netlink.c
- net/bridge/br_private.h 39 additions, 2 deletionsnet/bridge/br_private.h
- net/bridge/br_sysfs_br.c 25 additions, 0 deletionsnet/bridge/br_sysfs_br.c
Loading
Please register or sign in to comment