netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipv6: use RCU in inet6_csk_xmit()
@ 2011-07-28 13:43 Eric Dumazet
  2011-08-01  8:55 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2011-07-28 13:43 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

Use RCU to avoid changing dst_entry refcount in fast path.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
 net/ipv6/inet6_connection_sock.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c
index 8a58e8c..2916200 100644
--- a/net/ipv6/inet6_connection_sock.c
+++ b/net/ipv6/inet6_connection_sock.c
@@ -211,6 +211,7 @@ int inet6_csk_xmit(struct sk_buff *skb, struct flowi *fl_unused)
 	struct flowi6 fl6;
 	struct dst_entry *dst;
 	struct in6_addr *final_p, final;
+	int res;
 
 	memset(&fl6, 0, sizeof(fl6));
 	fl6.flowi6_proto = sk->sk_protocol;
@@ -241,12 +242,14 @@ int inet6_csk_xmit(struct sk_buff *skb, struct flowi *fl_unused)
 		__inet6_csk_dst_store(sk, dst, NULL, NULL);
 	}
 
-	skb_dst_set(skb, dst_clone(dst));
+	rcu_read_lock();
+	skb_dst_set_noref(skb, dst);
 
 	/* Restore final destination back after routing done */
 	ipv6_addr_copy(&fl6.daddr, &np->daddr);
 
-	return ip6_xmit(sk, skb, &fl6, np->opt);
+	res = ip6_xmit(sk, skb, &fl6, np->opt);
+	rcu_read_unlock();
+	return res;
 }
-
 EXPORT_SYMBOL_GPL(inet6_csk_xmit);



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

* Re: [PATCH] ipv6: use RCU in inet6_csk_xmit()
  2011-07-28 13:43 [PATCH] ipv6: use RCU in inet6_csk_xmit() Eric Dumazet
@ 2011-08-01  8:55 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-08-01  8:55 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 28 Jul 2011 15:43:47 +0200

> Use RCU to avoid changing dst_entry refcount in fast path.
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

Queued up for net-next

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

end of thread, other threads:[~2011-08-01  8:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-28 13:43 [PATCH] ipv6: use RCU in inet6_csk_xmit() Eric Dumazet
2011-08-01  8:55 ` 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).