* [PATCH] bridge: don't flood multicast packets if no snooping entry
@ 2012-10-12 1:17 Lin Ming
2012-10-12 1:48 ` Herbert Xu
0 siblings, 1 reply; 5+ messages in thread
From: Lin Ming @ 2012-10-12 1:17 UTC (permalink / raw)
To: Herbert Xu; +Cc: netdev
From: Lin Ming <mlin@ss.pku.edu.cn>
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 <mlin@ss.pku.edu.cn>
---
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
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] bridge: don't flood multicast packets if no snooping entry
2012-10-12 1:17 [PATCH] bridge: don't flood multicast packets if no snooping entry Lin Ming
@ 2012-10-12 1:48 ` Herbert Xu
2012-10-12 2:14 ` Lin Ming
0 siblings, 1 reply; 5+ messages in thread
From: Herbert Xu @ 2012-10-12 1:48 UTC (permalink / raw)
To: Lin Ming; +Cc: netdev
On Fri, Oct 12, 2012 at 09:17:23AM +0800, Lin Ming wrote:
> From: Lin Ming <mlin@ss.pku.edu.cn>
>
> 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 <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] bridge: don't flood multicast packets if no snooping entry
2012-10-12 1:48 ` Herbert Xu
@ 2012-10-12 2:14 ` Lin Ming
2012-10-12 2:27 ` Herbert Xu
0 siblings, 1 reply; 5+ messages in thread
From: Lin Ming @ 2012-10-12 2:14 UTC (permalink / raw)
To: Herbert Xu; +Cc: netdev
On Fri, Oct 12, 2012 at 9:48 AM, Herbert Xu <herbert@gondor.apana.org.au> wrote:
> On Fri, Oct 12, 2012 at 09:17:23AM +0800, Lin Ming wrote:
>> From: Lin Ming <mlin@ss.pku.edu.cn>
>>
>> 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,
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] bridge: don't flood multicast packets if no snooping entry
2012-10-12 2:14 ` Lin Ming
@ 2012-10-12 2:27 ` Herbert Xu
2012-10-12 5:19 ` Lin Ming
0 siblings, 1 reply; 5+ messages in thread
From: Herbert Xu @ 2012-10-12 2:27 UTC (permalink / raw)
To: Lin Ming; +Cc: netdev
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 <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] bridge: don't flood multicast packets if no snooping entry
2012-10-12 2:27 ` Herbert Xu
@ 2012-10-12 5:19 ` Lin Ming
0 siblings, 0 replies; 5+ messages in thread
From: Lin Ming @ 2012-10-12 5:19 UTC (permalink / raw)
To: Herbert Xu; +Cc: netdev
On Fri, Oct 12, 2012 at 10:27 AM, Herbert Xu
<herbert@gondor.apana.org.au> wrote:
> 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.
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,
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-10-12 5:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-12 1:17 [PATCH] bridge: don't flood multicast packets if no snooping entry Lin Ming
2012-10-12 1:48 ` Herbert Xu
2012-10-12 2:14 ` Lin Ming
2012-10-12 2:27 ` Herbert Xu
2012-10-12 5:19 ` Lin Ming
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox