linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: "Allan W. Nielsen" <allan.nielsen@microchip.com>
Cc: Ido Schimmel <idosch@idosch.org>,
	Nikolay Aleksandrov <nikolay@cumulusnetworks.com>,
	Horatiu Vultur <horatiu.vultur@microchip.com>,
	roopa@cumulusnetworks.com, davem@davemloft.net,
	bridge@lists.linux-foundation.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: bridge: Allow bridge to joing multicast groups
Date: Wed, 31 Jul 2019 15:45:50 +0200	[thread overview]
Message-ID: <20190731134550.GA23028@lunn.ch> (raw)
In-Reply-To: <20190731080149.oyqcrw42utxjizsx@lx-anielsen.microsemi.net>

> > 2) The interface is part of a bridge. There are a few sub-cases
> > 
> > a) IGMP snooping is being performed. We can block multicast where
> > there is no interest in the group. But this is limited to IP
> > multicast.
> Agree. And this is done today by installing an explicit offload rule to limit
> the flooding of a specific group.
> 
> > b) IGMP snooping is not being used and all interfaces in the bridge
> > are ports of the switch. IP Multicast can be blocked to the CPU.
> Does it matter if IGMP snooping is used or not? A more general statement could
> be:
> 
> - "All interfaces in the bridge are ports of the switch. IP Multicast can be
>   blocked to the CPU."

We have seen IPv6 neighbour discovery break in conditions like this. I
don't know the exact details.

You also need to watch out for 224.0.0.0/24. This is the link local
multicast range. There is no need to join MC addresses in that
range. It is assumed they will always be received. So even if IGMP is
enabled, you still need to pass some multicast traffic to the CPU.

> > So one possibility here is to teach the SW bridge about non-IP
> > multicast addresses. Initially the switch should forward all MAC
> > multicast frames to the CPU. If the frame is not an IPv4 or IPv6
> > frame, and there has not been a call to set_rx_mode() for the MAC
> > address on the br0 interface, and the bridge only contains switch
> > ports, switchdev could be used to block the multicast to the CPU
> > frame, but forward it out all other ports of the bridge.
> Close, but not exactly (due to the arguments above).
> 
> Here is how I see it:
> 
> Teach the SW bridge about non-IP multicast addresses. Initially the switch
> should forward all MAC multicast frames to the CPU. Today MDB rules can be
> installed (either static or dynamic by IGMP), which limit the flooding of IPv4/6
> multicast streams. In the same way, we should have a way to install a rule
> (FDM/ or MDB) to limit the flooding of L2 multicast frames.
> 
> If foreign interfaces (or br0 it self) is part of the destination list, then
> traffic also needs to go to the CPU.
> 
> By doing this, we can for explicitly configured dst mac address:
> - limit the flooding on the on the SW bridge interfaces
> - limit the flooding on the on the HW bridge interfaces
> - prevent them to go to the CPU if they are not needed

This is all very complex because of all the different corner cases. So
i don't think we want a user API to do the CPU part, we want the
network stack to do it. Otherwise the user is going to get is wrong,
break their network, and then come running to the list for help.

This also fits with how we do things in DSA. There is deliberately no
user space concept for configuring the DSA CPU port. To user space,
the switch is just a bunch of Linux interfaces. Everything to do with
the CPU port is hidden away in the DSA core layer, the DSA drivers,
and a little bit in the bridge.

       Andrew

  reply	other threads:[~2019-07-31 13:46 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-25 11:44 [PATCH] net: bridge: Allow bridge to joing multicast groups Horatiu Vultur
2019-07-25 13:06 ` Nikolay Aleksandrov
2019-07-25 13:21   ` Nikolay Aleksandrov
2019-07-25 14:21     ` Horatiu Vultur
2019-07-26  8:41       ` Nikolay Aleksandrov
2019-07-26  9:26         ` Nikolay Aleksandrov
2019-07-26 12:02           ` Horatiu Vultur
2019-07-26 12:31             ` Nikolay Aleksandrov
2019-07-29 12:14               ` Allan W. Nielsen
2019-07-29 12:22                 ` Nikolay Aleksandrov
2019-07-29 12:50                   ` Nikolay Aleksandrov
2019-07-29 13:14                   ` Allan W. Nielsen
2019-07-29 13:42                     ` Nikolay Aleksandrov
2019-07-29 13:52                       ` Allan W. Nielsen
2019-07-29 14:21                         ` Nikolay Aleksandrov
2019-07-29 14:35                           ` Allan W. Nielsen
2019-07-29 17:51                             ` Ido Schimmel
2019-07-30  6:27                               ` Allan W. Nielsen
2019-07-30  7:06                                 ` Ido Schimmel
2019-07-30  8:30                                   ` Allan W. Nielsen
2019-07-30  8:58                                     ` Nikolay Aleksandrov
2019-07-30  9:21                                       ` Allan W. Nielsen
2019-07-30  9:55                                         ` Nikolay Aleksandrov
2019-07-30 11:23                                           ` Allan W. Nielsen
2019-07-30 10:04                                     ` Ido Schimmel
2019-07-30 12:19                                       ` Allan W. Nielsen
2019-07-30 14:34                                 ` Andrew Lunn
2019-07-30 19:00                                   ` Allan W. Nielsen
2019-07-31  3:31                                     ` Andrew Lunn
2019-07-31  8:01                                       ` Allan W. Nielsen
2019-07-31 13:45                                         ` Andrew Lunn [this message]
2019-07-31 19:38                                           ` Allan W. Nielsen
2019-08-01 14:22               ` Allan W. Nielsen
2019-07-26 13:46             ` Andrew Lunn
2019-07-26 19:50               ` Allan W. Nielsen
2019-07-27  3:02                 ` Andrew Lunn
2019-07-28 19:15                   ` Allan W. Nielsen
2019-07-28 23:07                     ` Andrew Lunn
2019-07-29  6:09                     ` Ido Schimmel
2019-07-29 12:43                       ` Allan W. Nielsen
2019-08-01 19:17 ` Vivien Didelot
2019-08-01 19:48   ` Horatiu Vultur
2019-08-01 20:08     ` Vivien Didelot

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=20190731134550.GA23028@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=allan.nielsen@microchip.com \
    --cc=bridge@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=horatiu.vultur@microchip.com \
    --cc=idosch@idosch.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@cumulusnetworks.com \
    --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).