bridge.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
To: netdev@vger.kernel.org
Cc: roopa@cumulusnetworks.com, bridge@lists.linux-foundation.org,
	davem@davemloft.net
Subject: Re: [Bridge] [PATCH net-next] net: bridge: add support for IGMP/MLD stats and export them via netlink
Date: Tue, 28 Jun 2016 14:48:17 +0200	[thread overview]
Message-ID: <57727211.30508@cumulusnetworks.com> (raw)
In-Reply-To: <1467051048-32604-1-git-send-email-nikolay@cumulusnetworks.com>

On 27/06/16 20:10, Nikolay Aleksandrov wrote:
> 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>
> ---
>  include/uapi/linux/if_bridge.h |  27 +++++++
>  include/uapi/linux/if_link.h   |   1 +
>  net/bridge/br_device.c         |  10 ++-
>  net/bridge/br_forward.c        |  13 ++-
>  net/bridge/br_if.c             |   9 ++-
>  net/bridge/br_input.c          |   3 +
>  net/bridge/br_multicast.c      | 176 +++++++++++++++++++++++++++++++++++++----
>  net/bridge/br_netlink.c        |  94 ++++++++++++++++------
>  net/bridge/br_private.h        |  41 +++++++++-
>  net/bridge/br_sysfs_br.c       |  25 ++++++
>  10 files changed, 356 insertions(+), 43 deletions(-)
> 

Self-NAK, while the patch is okay, me and Roopa have been talking about exporting
the stats via the new API better and would like to introduce a way to expose only
per-port stats via a specific RTM_GETSTATS request instead of dumping it all via
the bridge request in order to be able to get the stats only for a single device.

I will post v2 after working out the details on how to achieve per-port export of
linkxstats.

Thanks,
 Nik




      parent reply	other threads:[~2016-06-28 12:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-27 18:10 [Bridge] [PATCH net-next] net: bridge: add support for IGMP/MLD stats and export them via netlink Nikolay Aleksandrov
2016-06-28 11:03 ` Linus Lüssing
2016-06-28 12:02   ` Nikolay Aleksandrov
2016-06-28 12:48 ` Nikolay Aleksandrov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57727211.30508@cumulusnetworks.com \
    --to=nikolay@cumulusnetworks.com \
    --cc=bridge@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=roopa@cumulusnetworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).