Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 247745
b: refs/heads/master
c: 449f454
h: refs/heads/master
i:
  247743: 32477df
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed May 20, 2011
1 parent 8624dd6 commit 09ca879
Show file tree
Hide file tree
Showing 4 changed files with 10 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: 034cfe48d0efc248ba4b725e3a94b95e76fbc5d3
refs/heads/master: 449f4544267e73d5db372971da63634707c32299
9 changes: 5 additions & 4 deletions trunk/drivers/net/macvlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,17 @@ static void macvlan_hash_add(struct macvlan_dev *vlan)
hlist_add_head_rcu(&vlan->hlist, &port->vlan_hash[addr[5]]);
}

static void macvlan_hash_del(struct macvlan_dev *vlan)
static void macvlan_hash_del(struct macvlan_dev *vlan, bool sync)
{
hlist_del_rcu(&vlan->hlist);
synchronize_rcu();
if (sync)
synchronize_rcu();
}

static void macvlan_hash_change_addr(struct macvlan_dev *vlan,
const unsigned char *addr)
{
macvlan_hash_del(vlan);
macvlan_hash_del(vlan, true);
/* Now that we are unhashed it is safe to change the device
* address without confusing packet delivery.
*/
Expand Down Expand Up @@ -345,7 +346,7 @@ static int macvlan_stop(struct net_device *dev)
dev_uc_del(lowerdev, dev->dev_addr);

hash_del:
macvlan_hash_del(vlan);
macvlan_hash_del(vlan, !dev->dismantle);
return 0;
}

Expand Down
4 changes: 3 additions & 1 deletion trunk/include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,9 @@ struct net_device {
NETREG_UNREGISTERED, /* completed unregister todo */
NETREG_RELEASED, /* called free_netdev */
NETREG_DUMMY, /* dummy device for NAPI poll */
} reg_state:16;
} reg_state:8;

bool dismantle; /* device is going do be freed */

enum {
RTNL_LINK_INITIALIZED,
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -5126,7 +5126,7 @@ static void rollback_registered_many(struct list_head *head)
list_del(&dev->unreg_list);
continue;
}

dev->dismantle = true;
BUG_ON(dev->reg_state != NETREG_REGISTERED);
}

Expand Down

0 comments on commit 09ca879

Please sign in to comment.