netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next-2.6] macvlan: use call_rcu for port free
@ 2010-06-07 11:36 Jiri Pirko
  2010-06-07 12:15 ` Eric Dumazet
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Pirko @ 2010-06-07 11:36 UTC (permalink / raw)
  To: netdev; +Cc: davem, kaber

Use call_rcu rather than synchronize_rcu.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
---
 drivers/net/macvlan.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 53422ce..59c3155 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -37,6 +37,7 @@ struct macvlan_port {
 	struct net_device	*dev;
 	struct hlist_head	vlan_hash[MACVLAN_HASH_SIZE];
 	struct list_head	vlans;
+	struct rcu_head		rcu;
 };
 
 static struct macvlan_dev *macvlan_hash_lookup(const struct macvlan_port *port,
@@ -540,14 +541,21 @@ static int macvlan_port_create(struct net_device *dev)
 	return err;
 }
 
+static void macvlan_port_rcu_free(struct rcu_head *head)
+{
+	struct macvlan_port *port;
+
+	port = container_of(head, struct macvlan_port, rcu);
+	kfree(port);
+}
+
 static void macvlan_port_destroy(struct net_device *dev)
 {
 	struct macvlan_port *port = dev->macvlan_port;
 
 	netdev_rx_handler_unregister(dev);
 	rcu_assign_pointer(dev->macvlan_port, NULL);
-	synchronize_rcu();
-	kfree(port);
+	call_rcu(&port->rcu, macvlan_port_rcu_free);
 }
 
 static int macvlan_validate(struct nlattr *tb[], struct nlattr *data[])
-- 
1.7.0.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next-2.6] macvlan: use call_rcu for port free
  2010-06-07 11:36 [PATCH net-next-2.6] macvlan: use call_rcu for port free Jiri Pirko
@ 2010-06-07 12:15 ` Eric Dumazet
  2010-06-08  4:26   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2010-06-07 12:15 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: netdev, davem, kaber

Le lundi 07 juin 2010 à 13:36 +0200, Jiri Pirko a écrit :
> Use call_rcu rather than synchronize_rcu.
> 
> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
> ---
>  drivers/net/macvlan.c |   12 ++++++++++--
>  1 files changed, 10 insertions(+), 2 deletions(-)
> 

Acked-by: Eric Dumazet <eric.dumazet@gmail.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next-2.6] macvlan: use call_rcu for port free
  2010-06-07 12:15 ` Eric Dumazet
@ 2010-06-08  4:26   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2010-06-08  4:26 UTC (permalink / raw)
  To: eric.dumazet; +Cc: jpirko, netdev, kaber

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 07 Jun 2010 14:15:36 +0200

> Le lundi 07 juin 2010 à 13:36 +0200, Jiri Pirko a écrit :
>> Use call_rcu rather than synchronize_rcu.
>> 
>> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
>> ---
>>  drivers/net/macvlan.c |   12 ++++++++++--
>>  1 files changed, 10 insertions(+), 2 deletions(-)
>> 
> 
> Acked-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-06-08  4:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-07 11:36 [PATCH net-next-2.6] macvlan: use call_rcu for port free Jiri Pirko
2010-06-07 12:15 ` Eric Dumazet
2010-06-08  4:26   ` David Miller

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).