All of lore.kernel.org
 help / color / mirror / Atom feed
* MDB offloading of local ipv4 multicast groups
@ 2016-09-15 18:58 John Crispin
  2016-09-15 20:42 ` Ido Schimmel
  2016-09-15 22:28 ` Andrew Lunn
  0 siblings, 2 replies; 4+ messages in thread
From: John Crispin @ 2016-09-15 18:58 UTC (permalink / raw)
  To: Elad Raz, netdev
  Cc: Ido Schimmel, Jiri Pirko, Nikolay Aleksandrov, David S. Miller

Hi,

While adding MDB support to the qca8k dsa driver I found that ipv4 mcast
groups don't always get propagated to the dsa driver. In my setup there
are 2 clients connected to the switch, both running a mdns client. The
.port_mdb_add() callback is properly called for 33:33:00:00:00:FB but
01:00:5E:00:00:FB never got propagated to the dsa driver.

The reason is that the call to ipv4_is_local_multicast() here [1] will
return true and the notifier is never called. Is this intentional or is
there something missing in the code ?

	John

[1]
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/net/bridge/br_multicast.c?id=refs/tags/v4.8-rc6#n737

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: MDB offloading of local ipv4 multicast groups
  2016-09-15 18:58 MDB offloading of local ipv4 multicast groups John Crispin
@ 2016-09-15 20:42 ` Ido Schimmel
  2016-09-16  6:22   ` John Crispin
  2016-09-15 22:28 ` Andrew Lunn
  1 sibling, 1 reply; 4+ messages in thread
From: Ido Schimmel @ 2016-09-15 20:42 UTC (permalink / raw)
  To: John Crispin
  Cc: Elad Raz, netdev, Ido Schimmel, Jiri Pirko, Nikolay Aleksandrov,
	David S. Miller

On Thu, Sep 15, 2016 at 08:58:50PM +0200, John Crispin wrote:
> Hi,
> 
> While adding MDB support to the qca8k dsa driver I found that ipv4 mcast
> groups don't always get propagated to the dsa driver. In my setup there
> are 2 clients connected to the switch, both running a mdns client. The
> .port_mdb_add() callback is properly called for 33:33:00:00:00:FB but
> 01:00:5E:00:00:FB never got propagated to the dsa driver.
> 
> The reason is that the call to ipv4_is_local_multicast() here [1] will
> return true and the notifier is never called. Is this intentional or is
> there something missing in the code ?

I believe this is based on RFC 4541:

"Packets with a destination IP (DIP) address in the 224.0.0.X range
which are not IGMP must be forwarded on all ports."
https://tools.ietf.org/html/rfc4541

But, we are missing the offloading of router ports, which is needed for
the device to correctly flood unregistered multicast packets. That's
also according to the mentioned RFC:

"If a switch receives an unregistered packet, it must forward that
packet on all ports to which an IGMP router is attached."

Implemented at br_flood_multicast()

However, the marking is done per-port and not per-{port, VID}. We need
that in case vlan filtering is enabled. I think Nik is working on that,
but he can correct me if I'm wrong :). The switchdev bits can be added
soon after.

> 
> 	John
> 
> [1]
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/net/bridge/br_multicast.c?id=refs/tags/v4.8-rc6#n737

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: MDB offloading of local ipv4 multicast groups
  2016-09-15 18:58 MDB offloading of local ipv4 multicast groups John Crispin
  2016-09-15 20:42 ` Ido Schimmel
@ 2016-09-15 22:28 ` Andrew Lunn
  1 sibling, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2016-09-15 22:28 UTC (permalink / raw)
  To: John Crispin
  Cc: Elad Raz, netdev, Ido Schimmel, Jiri Pirko, Nikolay Aleksandrov,
	David S. Miller

On Thu, Sep 15, 2016 at 08:58:50PM +0200, John Crispin wrote:
> Hi,
> 
> While adding MDB support to the qca8k dsa driver I found that ipv4 mcast
> groups don't always get propagated to the dsa driver. In my setup there
> are 2 clients connected to the switch, both running a mdns client. The
> .port_mdb_add() callback is properly called for 33:33:00:00:00:FB but
> 01:00:5E:00:00:FB never got propagated to the dsa driver.
> 
> The reason is that the call to ipv4_is_local_multicast() here [1] will
> return true and the notifier is never called. Is this intentional or is
> there something missing in the code ?

Hi John

I've not looked too deeply at this yet, but here is my take on how it
should work.

By default, the switch needs to flood all multicast traffic from any
port in a bridge, to all other ports in a bridge, including the host.

Adding an mdb entry allows you to reduce where such flooding should
occur, i.e. it allows you to implement IGMP snooping and block traffic
going out a port when you know there is nobody interested in the
traffic on that port.

	Andrew

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: MDB offloading of local ipv4 multicast groups
  2016-09-15 20:42 ` Ido Schimmel
@ 2016-09-16  6:22   ` John Crispin
  0 siblings, 0 replies; 4+ messages in thread
From: John Crispin @ 2016-09-16  6:22 UTC (permalink / raw)
  To: Ido Schimmel
  Cc: Elad Raz, netdev, Ido Schimmel, Jiri Pirko, Nikolay Aleksandrov,
	David S. Miller



On 15/09/2016 22:42, Ido Schimmel wrote:
> On Thu, Sep 15, 2016 at 08:58:50PM +0200, John Crispin wrote:
>> Hi,
>>
>> While adding MDB support to the qca8k dsa driver I found that ipv4 mcast
>> groups don't always get propagated to the dsa driver. In my setup there
>> are 2 clients connected to the switch, both running a mdns client. The
>> .port_mdb_add() callback is properly called for 33:33:00:00:00:FB but
>> 01:00:5E:00:00:FB never got propagated to the dsa driver.
>>
>> The reason is that the call to ipv4_is_local_multicast() here [1] will
>> return true and the notifier is never called. Is this intentional or is
>> there something missing in the code ?
> 
> I believe this is based on RFC 4541:
> 
> "Packets with a destination IP (DIP) address in the 224.0.0.X range
> which are not IGMP must be forwarded on all ports."
> https://tools.ietf.org/html/rfc4541
> 
> But, we are missing the offloading of router ports, which is needed for
> the device to correctly flood unregistered multicast packets. That's
> also according to the mentioned RFC:
> 
> "If a switch receives an unregistered packet, it must forward that
> packet on all ports to which an IGMP router is attached."
> 
> Implemented at br_flood_multicast()
> 
> However, the marking is done per-port and not per-{port, VID}. We need
> that in case vlan filtering is enabled. I think Nik is working on that,
> but he can correct me if I'm wrong :). The switchdev bits can be added
> soon after.
> 

thanks for the explanation. i was not aware the the local groups should
always be flooded to all ports.

	John

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-09-16  6:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-15 18:58 MDB offloading of local ipv4 multicast groups John Crispin
2016-09-15 20:42 ` Ido Schimmel
2016-09-16  6:22   ` John Crispin
2016-09-15 22:28 ` Andrew Lunn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.