Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19265
b: refs/heads/master
c: 3f4cfc2
h: refs/heads/master
i:
  19263: dcc4f77
v: v3
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Feb 1, 2006
1 parent 119c223 commit aa73939
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5d39a795bfa217b5f7637028c83ab5cb291f37bf
refs/heads/master: 3f4cfc2d11c9e29709e6f0f3add54039614d847a
21 changes: 15 additions & 6 deletions trunk/net/bridge/br_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ static void destroy_nbp(struct net_bridge_port *p)
{
struct net_device *dev = p->dev;

dev->br_port = NULL;
p->br = NULL;
p->dev = NULL;
dev_put(dev);
Expand All @@ -118,30 +119,38 @@ static void destroy_nbp_rcu(struct rcu_head *head)
destroy_nbp(p);
}

/* called with RTNL */
/* Delete port(interface) from bridge is done in two steps.
* via RCU. First step, marks device as down. That deletes
* all the timers and stops new packets from flowing through.
*
* Final cleanup doesn't occur until after all CPU's finished
* processing packets.
*
* Protected from multiple admin operations by RTNL mutex
*/
static void del_nbp(struct net_bridge_port *p)
{
struct net_bridge *br = p->br;
struct net_device *dev = p->dev;

dev->br_port = NULL;
/* Race between RTNL notify and RCU callback */
if (p->deleted)
return;

dev_set_promiscuity(dev, -1);

cancel_delayed_work(&p->carrier_check);
flush_scheduled_work();

spin_lock_bh(&br->lock);
br_stp_disable_port(p);
p->deleted = 1;
spin_unlock_bh(&br->lock);

br_fdb_delete_by_port(br, p);

list_del_rcu(&p->list);

del_timer_sync(&p->message_age_timer);
del_timer_sync(&p->forward_delay_timer);
del_timer_sync(&p->hold_timer);

call_rcu(&p->rcu, destroy_nbp_rcu);
}

Expand Down
1 change: 1 addition & 0 deletions trunk/net/bridge/br_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ struct net_bridge_port
/* STP */
u8 priority;
u8 state;
u8 deleted;
u16 port_no;
unsigned char topology_change_ack;
unsigned char config_pending;
Expand Down

0 comments on commit aa73939

Please sign in to comment.