Skip to contentSkip to conversation

bridge: don't flood multicast packets if no snooping entry

PATCH In review Lin Ming 2 participants 5 messages Oct 12, 2012

Subsystems (3)
lore
Share & tools
lore

Lin Ming

author
#0 lore raw

PATCH 1/1 bridge: don't flood multicast packets if no snooping entry

From: Lin Ming <[email protected]>

Currently, multicast packets will be flood even if there is no mutlicast snooping entry attached to port.

With IGMP snooping enabled, we should stop sending multicast packets if there is no member joined.

---
 net/bridge/br_input.c   |    2 ++
 net/bridge/br_private.h |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)
net/bridge/br_input.c +2 -0
index 76f15fd..2821085 100644
@@ -90,6 +90,8 @@ int br_handle_frame_finish(struct sk_buff *skb)
 			skb = NULL;
 			if (!skb2)
 				goto out;
+		} else if (!mdst && BR_INPUT_SKB_CB_NOT_IGMP(skb)) {
+			skb = NULL;
 		} else
 			skb2 = skb;
 
net/bridge/br_private.h +2 -0
index 9b278c4..e2c894d 100644
@@ -268,8 +268,10 @@ struct br_input_skb_cb {
 
 #ifdef CONFIG_BRIDGE_IGMP_SNOOPING
 # define BR_INPUT_SKB_CB_MROUTERS_ONLY(__skb)	(BR_INPUT_SKB_CB(__skb)->mrouters_only)
+# define BR_INPUT_SKB_CB_NOT_IGMP(__skb)	(!BR_INPUT_SKB_CB(__skb)->igmp)
 #else
 # define BR_INPUT_SKB_CB_MROUTERS_ONLY(__skb)	(0)
+# define BR_INPUT_SKB_CB_NOT_IGMP(__skb)	(0)
 #endif
 
 #define br_printk(level, br, format, args...)	\
Signature · 1 line
1.7.2.5
#1 lore raw
Quoted 7 lines · Lin Ming

From: Lin Ming <[email protected]>

Currently, multicast packets will be flood even if there is no mutlicast snooping entry attached to port.

With IGMP snooping enabled, we should stop sending multicast packets if there is no member joined.

Hmm, the default is deliberately this way so that we don't disrupt traffic when we boot up. If you want to stop flooding unknown groups by default you have to make it an option.

Cheers,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
author
#2 lore raw
Quoted 6 lines · Herbert Xu
Quoted 5 lines · Lin Ming

From: Lin Ming <[email protected]>

Currently, multicast packets will be flood even if there is no mutlicast snooping entry attached to port.

Quoted 6 lines
Quoted 2 lines

With IGMP snooping enabled, we should stop sending multicast packets if there is no member joined.

Hmm, the default is deliberately this way so that we don't disrupt traffic when we boot up. If you want to stop flooding unknown groups by default you have to make it an option.

Do you mean adding a sysfs entry, for example
/sys/class/net/br0/bridge/multicast_no_flood ?

Thanks.

Quoted 2 lines

Cheers,

#3 lore raw
Quoted 3 lines · Lin Ming

Do you mean adding a sysfs entry, for example
/sys/class/net/br0/bridge/multicast_no_flood ?

Yes something like that.

Cheers,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
author
#4 lore raw
Quoted 6 lines · Herbert Xu
Quoted 3 lines · Lin Ming

Do you mean adding a sysfs entry, for example
/sys/class/net/br0/bridge/multicast_no_flood ?

Yes something like that.

Or a better name: multicast_fast_leave

Quote from Internet:
"
IGMP Fast Leave enhances your control over router or switch bandwidth. Enabling Fast Leave tells IGMP snooping to stop the transmission of a group multicast stream to a port as soon as it receives a Leave message on that port. No timeouts are observed.

Ordinarily, when IGMP snooping sees a Leave message, it waits for a Membership Query message before setting the entry timeout to 2 seconds. Fast Leave tells IGMP to drop the entry from the port as soon as the Leave message is seen. For this reason, Fast Leave should only be configured on interfaces that have one client per port.
"

I'm going to add fast leave support. It would need other changes in addition to this patch.

Thanks.

Quoted 2 lines

Cheers,