Message ID | 1304952044.3342.42.camel@edumazet-laptop |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
On Mon, May 9, 2011 at 7:40 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote: > At VLAN dismantle phase, unregister_vlan_dev() makes one > synchronize_net() call after vlan_group_set_device(grp, vlan_id, NULL). > > This call can be safely removed because we are calling > unregister_netdevice_queue() to queue device for deletion, and this > process needs at least one rcu grace period to complete. > > Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> > Cc: Ben Greear <greearb@candelatech.com> > Cc: Patrick McHardy <kaber@trash.net> > Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> > Cc: Jesse Gross <jesse@nicira.com> > Cc: Michał Mirosław <mirq-linux@rere.qmqm.pl> Acked-by: Jesse Gross <jesse@nicira.com> -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Am 09.05.2011 16:40, schrieb Eric Dumazet: > At VLAN dismantle phase, unregister_vlan_dev() makes one > synchronize_net() call after vlan_group_set_device(grp, vlan_id, NULL). > > This call can be safely removed because we are calling > unregister_netdevice_queue() to queue device for deletion, and this > process needs at least one rcu grace period to complete. > > Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> > Cc: Ben Greear <greearb@candelatech.com> > Cc: Patrick McHardy <kaber@trash.net> > Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> > Cc: Jesse Gross <jesse@nicira.com> > Cc: Michał Mirosław <mirq-linux@rere.qmqm.pl> > --- > include/linux/if_vlan.h | 1 - > net/8021q/vlan.c | 10 ++++------ > 2 files changed, 4 insertions(+), 7 deletions(-) > > diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h > index 546d9d3..290bd8a 100644 > --- a/include/linux/if_vlan.h > +++ b/include/linux/if_vlan.h > @@ -86,7 +86,6 @@ struct vlan_group { > * the vlan is attached to. > */ > unsigned int nr_vlans; > - int killall; Looks good, thanks Eric. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Eric Dumazet <eric.dumazet@gmail.com> Date: Mon, 09 May 2011 16:40:44 +0200 > At VLAN dismantle phase, unregister_vlan_dev() makes one > synchronize_net() call after vlan_group_set_device(grp, vlan_id, NULL). > > This call can be safely removed because we are calling > unregister_netdevice_queue() to queue device for deletion, and this > process needs at least one rcu grace period to complete. > > Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Applied. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 546d9d3..290bd8a 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h @@ -86,7 +86,6 @@ struct vlan_group { * the vlan is attached to. */ unsigned int nr_vlans; - int killall; struct hlist_node hlist; /* linked list */ struct net_device **vlan_devices_arrays[VLAN_GROUP_ARRAY_SPLIT_PARTS]; struct rcu_head rcu; diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index 969e700..718d635d 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c @@ -120,9 +120,10 @@ void unregister_vlan_dev(struct net_device *dev, struct list_head *head) grp->nr_vlans--; vlan_group_set_device(grp, vlan_id, NULL); - if (!grp->killall) - synchronize_net(); - + /* Because unregister_netdevice_queue() makes sure at least one rcu + * grace period is respected before device freeing, + * we dont need to call synchronize_net() here. + */ unregister_netdevice_queue(dev, head); /* If the group is now empty, kill off the group. */ @@ -478,9 +479,6 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event, if (dev->reg_state != NETREG_UNREGISTERING) break; - /* Delete all VLANs for this dev. */ - grp->killall = 1; - for (i = 0; i < VLAN_N_VID; i++) { vlandev = vlan_group_get_device(grp, i); if (!vlandev)
At VLAN dismantle phase, unregister_vlan_dev() makes one synchronize_net() call after vlan_group_set_device(grp, vlan_id, NULL). This call can be safely removed because we are calling unregister_netdevice_queue() to queue device for deletion, and this process needs at least one rcu grace period to complete. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Cc: Ben Greear <greearb@candelatech.com> Cc: Patrick McHardy <kaber@trash.net> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Jesse Gross <jesse@nicira.com> Cc: Michał Mirosław <mirq-linux@rere.qmqm.pl> --- include/linux/if_vlan.h | 1 - net/8021q/vlan.c | 10 ++++------ 2 files changed, 4 insertions(+), 7 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html