diff options
author | Arnaldo Carvalho de Melo <acme@ghostprotocols.net> | 2005-08-09 22:49:02 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2005-08-29 18:37:48 -0400 |
commit | 6cbb0df788b90777a7ed0f9d8261260353f48076 (patch) | |
tree | 152b75c0279b8f612412f24a5ab35ab6d5a208d8 /include | |
parent | 614c6cb4f225a7da9f13e5dd0fac3b531078eb9f (diff) |
[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')
-rw-r--r-- | include/net/sock.h | 10 | ||||
-rw-r--r-- | include/net/tcp.h | 9 |
2 files changed, 10 insertions, 9 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) | |||
1025 | return dst; | 1025 | return dst; |
1026 | } | 1026 | } |
1027 | 1027 | ||
1028 | static inline void sk_setup_caps(struct sock *sk, struct dst_entry *dst) | ||
1029 | { | ||
1030 | __sk_dst_set(sk, dst); | ||
1031 | sk->sk_route_caps = dst->dev->features; | ||
1032 | if (sk->sk_route_caps & NETIF_F_TSO) { | ||
1033 | if (sock_flag(sk, SOCK_NO_LARGESEND) || dst->header_len) | ||
1034 | sk->sk_route_caps &= ~NETIF_F_TSO; | ||
1035 | } | ||
1036 | } | ||
1037 | |||
1028 | static inline void sk_charge_skb(struct sock *sk, struct sk_buff *skb) | 1038 | static inline void sk_charge_skb(struct sock *sk, struct sk_buff *skb) |
1029 | { | 1039 | { |
1030 | sk->sk_wmem_queued += skb->truesize; | 1040 | sk->sk_wmem_queued += skb->truesize; |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 31984733777b..d95661a3aeeb 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -1658,15 +1658,6 @@ static inline int tcp_paws_check(const struct tcp_options_received *rx_opt, int | |||
1658 | return 1; | 1658 | return 1; |
1659 | } | 1659 | } |
1660 | 1660 | ||
1661 | static inline void tcp_v4_setup_caps(struct sock *sk, struct dst_entry *dst) | ||
1662 | { | ||
1663 | sk->sk_route_caps = dst->dev->features; | ||
1664 | if (sk->sk_route_caps & NETIF_F_TSO) { | ||
1665 | if (sock_flag(sk, SOCK_NO_LARGESEND) || dst->header_len) | ||
1666 | sk->sk_route_caps &= ~NETIF_F_TSO; | ||
1667 | } | ||
1668 | } | ||
1669 | |||
1670 | #define TCP_CHECK_TIMER(sk) do { } while (0) | 1661 | #define TCP_CHECK_TIMER(sk) do { } while (0) |
1671 | 1662 | ||
1672 | static inline int tcp_use_frto(const struct sock *sk) | 1663 | static inline int tcp_use_frto(const struct sock *sk) |