[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20081001.085104.193726318.davem@davemloft.net>
Date: Wed, 01 Oct 2008 08:51:04 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: hidden@....bme.hu
Cc: kaber@...sh.net, netdev@...r.kernel.org,
netfilter-devel@...r.kernel.org
Subject: Re: [net-next PATCH 10/16] Don't lookup the socket if there's a
socket attached to the skb
From: KOVACS Krisztian <hidden@....bme.hu>
Date: Wed, 01 Oct 2008 17:38:20 +0200
> The problem is that if you include the if() test then you have to
> include the lookup call as well and that's different for TCP/UDP.
No, I only mean to make a helper for this construct:
if (unlikely(skb->sk)) {
...
}
so, something like:
static inline struct sock *sock_skb_steal(struct sk_buff *skb)
{
if (unlikely(skb->sk)) {
struct sock *sk = skb->sk;
skb->destructor = NULL;
skb->sk = NULL;
return sk;
}
return NULL;
}
and then also get rid of the ifdefs at the place where
these calls are made (TCP and UDP).
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists