Skip to content

Commit

Permalink
bridge: update mdb expiration timer upon reports.
Browse files Browse the repository at this point in the history
commit 9f00b2e
	bridge: only expire the mdb entry when query is received
changed the mdb expiration timer to be armed only when QUERY is
received.  Howerver, this causes issues in an environment where
the multicast server socket comes and goes very fast while a client
is trying to send traffic to it.

The root cause is a race where a sequence of LEAVE followed by REPORT
messages can race against QUERY messages generated in response to LEAVE.
The QUERY ends up starting the expiration timer, and that timer can
potentially expire after the new REPORT message has been received signaling
the new join operation.  This leads to a significant drop in multicast
traffic and possible complete stall.

The solution is to have REPORT messages update the expiration timer
on entries that already exist.

CC: Cong Wang <xiyou.wangcong@gmail.com>
CC: Herbert Xu <herbert@gondor.apana.org.au>
CC: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Vlad Yasevich authored and David S. Miller committed Oct 11, 2013
1 parent 5abbeea commit f144feb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion net/bridge/br_multicast.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,9 @@ struct net_bridge_mdb_entry *br_multicast_new_group(struct net_bridge *br,
break;

default:
/* If we have an existing entry, update it's expire timer */
mod_timer(&mp->timer,
jiffies + br->multicast_membership_interval);
goto out;
}

Expand Down Expand Up @@ -680,8 +683,12 @@ static int br_multicast_add_group(struct net_bridge *br,
for (pp = &mp->ports;
(p = mlock_dereference(*pp, br)) != NULL;
pp = &p->next) {
if (p->port == port)
if (p->port == port) {
/* We already have a portgroup, update the timer. */
mod_timer(&p->timer,
jiffies + br->multicast_membership_interval);
goto out;
}
if ((unsigned long)p->port < (unsigned long)port)
break;
}
Expand Down

0 comments on commit f144feb

Please sign in to comment.