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

Subsystems: ethernet bridge, networking [general], the rest

STALE5110d

5 messages, 2 authors, 2012-10-12 · open the first message on its own page

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

From: Lin Ming <hidden>
Date: 2012-10-12 01:18:39

From: Lin Ming <redacted>

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.

Signed-off-by: Lin Ming <redacted>
---
 net/bridge/br_input.c   |    2 ++
 net/bridge/br_private.h |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index 76f15fd..2821085 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -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;
 
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 9b278c4..e2c894d 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -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...)	\
-- 
1.7.2.5

Re: [PATCH] bridge: don't flood multicast packets if no snooping entry

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: 2012-10-12 01:48:54

On Fri, Oct 12, 2012 at 09:17:23AM +0800, Lin Ming wrote:
From: Lin Ming <redacted>

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,
-- 
Email: Herbert Xu [off-list ref]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH] bridge: don't flood multicast packets if no snooping entry

From: Lin Ming <hidden>
Date: 2012-10-12 02:14:02

On Fri, Oct 12, 2012 at 9:48 AM, Herbert Xu [off-list ref] wrote:
On Fri, Oct 12, 2012 at 09:17:23AM +0800, Lin Ming wrote:
quoted
From: Lin Ming <redacted>

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.
Do you mean adding a sysfs entry, for example
/sys/class/net/br0/bridge/multicast_no_flood ?

Thanks.
Cheers,

Re: [PATCH] bridge: don't flood multicast packets if no snooping entry

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: 2012-10-12 02:27:10

On Fri, Oct 12, 2012 at 10:14:00AM +0800, Lin Ming wrote:
Do you mean adding a sysfs entry, for example
/sys/class/net/br0/bridge/multicast_no_flood ?
Yes something like that.

Cheers,
-- 
Email: Herbert Xu [off-list ref]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH] bridge: don't flood multicast packets if no snooping entry

From: Lin Ming <hidden>
Date: 2012-10-12 05:19:09

On Fri, Oct 12, 2012 at 10:27 AM, Herbert Xu
[off-list ref] wrote:
On Fri, Oct 12, 2012 at 10:14:00AM +0800, Lin Ming wrote:
quoted
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.
Cheers,
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help