netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: Remove 'unlikely' qualifier in skb_steal_sock()
@ 2012-06-24 23:03 Vijay Subramanian
  2012-06-25  6:09 ` Eric Dumazet
  0 siblings, 1 reply; 3+ messages in thread
From: Vijay Subramanian @ 2012-06-24 23:03 UTC (permalink / raw)
  To: netdev
  Cc: davem, eric.dumazet, alexander.h.duyck, shemminger,
	Vijay Subramanian

With early demux enabled by default for TCP flows, there is high chance that
skb->sk will be non-null. 'unlikely()' was removed from __inet_lookup_skb() but
maybe it can be removed from skb_steal_sock() as well.

Note: skb_steal_sock() is also called by __inet6_lookup_skb() and
__udp4_lib_lookup_skb() but they are protected by their own 'unlikely' calls.

Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com>
---
 include/net/sock.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/net/sock.h b/include/net/sock.h
index 87b424a..2108603 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -2154,7 +2154,7 @@ static inline void sk_change_net(struct sock *sk, struct net *net)
 
 static inline struct sock *skb_steal_sock(struct sk_buff *skb)
 {
-	if (unlikely(skb->sk)) {
+	if (skb->sk) {
 		struct sock *sk = skb->sk;
 
 		skb->destructor = NULL;
-- 
1.7.0.4

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

* Re: [PATCH net-next] net: Remove 'unlikely' qualifier in skb_steal_sock()
  2012-06-24 23:03 [PATCH net-next] net: Remove 'unlikely' qualifier in skb_steal_sock() Vijay Subramanian
@ 2012-06-25  6:09 ` Eric Dumazet
  2012-06-25 23:08   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2012-06-25  6:09 UTC (permalink / raw)
  To: Vijay Subramanian; +Cc: netdev, davem, alexander.h.duyck, shemminger

On Sun, 2012-06-24 at 16:03 -0700, Vijay Subramanian wrote:
> With early demux enabled by default for TCP flows, there is high chance that
> skb->sk will be non-null. 'unlikely()' was removed from __inet_lookup_skb() but
> maybe it can be removed from skb_steal_sock() as well.
> 
> Note: skb_steal_sock() is also called by __inet6_lookup_skb() and
> __udp4_lib_lookup_skb() but they are protected by their own 'unlikely' calls.
> 
> Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com>
> ---

Acked-by: Eric Dumazet <edumazet@google.com>

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

* Re: [PATCH net-next] net: Remove 'unlikely' qualifier in skb_steal_sock()
  2012-06-25  6:09 ` Eric Dumazet
@ 2012-06-25 23:08   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2012-06-25 23:08 UTC (permalink / raw)
  To: eric.dumazet; +Cc: subramanian.vijay, netdev, alexander.h.duyck, shemminger

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 25 Jun 2012 08:09:37 +0200

> On Sun, 2012-06-24 at 16:03 -0700, Vijay Subramanian wrote:
>> With early demux enabled by default for TCP flows, there is high chance that
>> skb->sk will be non-null. 'unlikely()' was removed from __inet_lookup_skb() but
>> maybe it can be removed from skb_steal_sock() as well.
>> 
>> Note: skb_steal_sock() is also called by __inet6_lookup_skb() and
>> __udp4_lib_lookup_skb() but they are protected by their own 'unlikely' calls.
>> 
>> Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com>
>> ---
> 
> Acked-by: Eric Dumazet <edumazet@google.com>

Applied, thanks.

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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-24 23:03 [PATCH net-next] net: Remove 'unlikely' qualifier in skb_steal_sock() Vijay Subramanian
2012-06-25  6:09 ` Eric Dumazet
2012-06-25 23:08   ` 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).