summaryrefslogtreecommitdiffstats
path: root/include/net/sock.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo2005-08-10 04:49:02 +0200
committerDavid S. Miller2005-08-30 00:37:48 +0200
commit6cbb0df788b90777a7ed0f9d8261260353f48076 (patch)
tree152b75c0279b8f612412f24a5ab35ab6d5a208d8 /include/net/sock.h
parent[SOCK]: Rename __tcp_v4_rehash to __sk_prot_rehash (diff)
downloadkernel-qcow2-linux-6cbb0df788b90777a7ed0f9d8261260353f48076.tar.gz
kernel-qcow2-linux-6cbb0df788b90777a7ed0f9d8261260353f48076.tar.xz
kernel-qcow2-linux-6cbb0df788b90777a7ed0f9d8261260353f48076.zip
[SOCK]: Introduce sk_setup_caps
From tcp_v4_setup_caps, that always is preceded by a call to __sk_dst_set, so coalesce this sequence into sk_setup_caps, removing one call to a TCP function in the IP layer. Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sock.h')
-rw-r--r--include/net/sock.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index f91ee82522ff..69d869e41c35 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1025,6 +1025,16 @@ sk_dst_check(struct sock *sk, u32 cookie)
return dst;
}
+static inline void sk_setup_caps(struct sock *sk, struct dst_entry *dst)
+{
+ __sk_dst_set(sk, dst);
+ sk->sk_route_caps = dst->dev->features;
+ if (sk->sk_route_caps & NETIF_F_TSO) {
+ if (sock_flag(sk, SOCK_NO_LARGESEND) || dst->header_len)
+ sk->sk_route_caps &= ~NETIF_F_TSO;
+ }
+}
+
static inline void sk_charge_skb(struct sock *sk, struct sk_buff *skb)
{
sk->sk_wmem_queued += skb->truesize;