From: Cong Wang <amwang@redhat.com>
To: Herbert Xu <herbert@gondor.hengli.com.au>
Cc: netdev@vger.kernel.org,
Stephen Hemminger <stephen@networkplumber.org>,
"David S. Miller" <davem@davemloft.net>,
Adam Baker <linux@baker-net.org.uk>
Subject: Re: [Patch net-next v3 2/3] bridge: only expire the mdb entry when query is received
Date: Mon, 06 May 2013 11:24:13 +0800 [thread overview]
Message-ID: <1367810653.6246.5.camel@cr0> (raw)
In-Reply-To: <20130503093017.GA12471@gondor.apana.org.au>
On Fri, 2013-05-03 at 17:30 +0800, Herbert Xu wrote:
> On Fri, May 03, 2013 at 03:08:46PM +0800, Cong Wang wrote:
> > On Fri, 2013-05-03 at 12:01 +0800, Herbert Xu wrote:
> > >
> > > I think I quoted the wrong hunk in the patch, I meant the code
> > > that arms the timer should no longer be in the leave_group function
> > > unless we just sent a query ourselves (and in that case the expiration
> > > should also be adjusted accordingly).
> >
> > Is the following patch what you meant?
>
> Right, but also add the corresponding timers in case we send a
> group-specific query since that won't loop back to ourselves.
Ok, then something like below , it is a delta patch, the first piece
should go to patch 3/3.
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index d73276b..11946a4 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -1263,6 +1263,24 @@ static void br_multicast_leave_group(struct
net_bridge *br,
br->multicast_query_interval;
mod_timer(port ? &port->multicast_query_timer :
&br->multicast_query_timer, time);
+
+ time = jiffies + br->multicast_last_member_count *
+ br->multicast_last_member_interval;
+ for (p = mlock_dereference(mp->ports, br);
+ p != NULL;
+ p = mlock_dereference(p->next, br)) {
+ if (p->port != port)
+ continue;
+
+ if (!hlist_unhashed(&p->mglist) &&
+ (timer_pending(&p->timer) ?
+ time_after(p->timer.expires, time) :
+ try_to_del_timer_sync(&p->timer) >= 0)) {
+ mod_timer(&p->timer, time);
+ }
+
+ break;
+ }
}
if (port && (port->flags & BR_MULTICAST_FAST_LEAVE)) {
@@ -1298,24 +1316,6 @@ static void br_multicast_leave_group(struct
net_bridge *br,
try_to_del_timer_sync(&mp->timer) >= 0)) {
mod_timer(&mp->timer, time);
}
-
- goto out;
- }
-
- for (p = mlock_dereference(mp->ports, br);
- p != NULL;
- p = mlock_dereference(p->next, br)) {
- if (p->port != port)
- continue;
-
- if (!hlist_unhashed(&p->mglist) &&
- (timer_pending(&p->timer) ?
- time_after(p->timer.expires, time) :
- try_to_del_timer_sync(&p->timer) >= 0)) {
- mod_timer(&p->timer, time);
- }
-
- break;
}
out:
next prev parent reply other threads:[~2013-05-06 3:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-30 7:10 [Patch net-next v3 1/3] bridge: select IP addr as source addr for querier Cong Wang
2013-04-30 7:10 ` [Patch net-next v3 2/3] bridge: only expire the mdb entry when query is received Cong Wang
2013-05-02 1:59 ` Herbert Xu
2013-05-03 3:50 ` Cong Wang
2013-05-03 4:01 ` Herbert Xu
2013-05-03 7:08 ` Cong Wang
2013-05-03 9:30 ` Herbert Xu
2013-05-06 3:24 ` Cong Wang [this message]
2013-05-09 5:15 ` Herbert Xu
2013-05-09 12:53 ` Cong Wang
2013-05-10 3:21 ` Herbert Xu
2013-04-30 7:10 ` [Patch net-next v3 3/3] bridge: send query as soon as leave " Cong Wang
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=1367810653.6246.5.camel@cr0 \
--to=amwang@redhat.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.hengli.com.au \
--cc=linux@baker-net.org.uk \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/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).