aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
authorChangli Gao <xiaosuo@gmail.com>2010-07-10 16:41:55 -0400
committerDavid S. Miller <davem@davemloft.net>2010-07-12 23:21:46 -0400
commit7ba42910073f8432934d61a6c08b1023c408fb62 (patch)
tree4f74648133eaf6cbea26d59c43d34e7153648f5d /net/ipv4/tcp.c
parent53d3176b282cc105493babb0fef36c8b873f6201 (diff)
inet, inet6: make tcp_sendmsg() and tcp_sendpage() through inet_sendmsg() and inet_sendpage()
a new boolean flag no_autobind is added to structure proto to avoid the autobind calls when the protocol is TCP. Then sock_rps_record_flow() is called int the TCP's sendmsg() and sendpage() pathes. Signed-off-by: Changli Gao <xiaosuo@gmail.com> ---- include/net/inet_common.h | 4 ++++ include/net/sock.h | 1 + include/net/tcp.h | 8 ++++---- net/ipv4/af_inet.c | 15 +++++++++------ net/ipv4/tcp.c | 11 +++++------ net/ipv4/tcp_ipv4.c | 3 +++ net/ipv6/af_inet6.c | 8 ++++---- net/ipv6/tcp_ipv6.c | 3 +++ 8 files changed, 33 insertions(+), 20 deletions(-) Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r--net/ipv4/tcp.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index b8601b7683a6..9fce8a8a13aa 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -857,15 +857,15 @@ out_err:
857 return sk_stream_error(sk, flags, err); 857 return sk_stream_error(sk, flags, err);
858} 858}
859 859
860ssize_t tcp_sendpage(struct socket *sock, struct page *page, int offset, 860int tcp_sendpage(struct sock *sk, struct page *page, int offset,
861 size_t size, int flags) 861 size_t size, int flags)
862{ 862{
863 ssize_t res; 863 ssize_t res;
864 struct sock *sk = sock->sk;
865 864
866 if (!(sk->sk_route_caps & NETIF_F_SG) || 865 if (!(sk->sk_route_caps & NETIF_F_SG) ||
867 !(sk->sk_route_caps & NETIF_F_ALL_CSUM)) 866 !(sk->sk_route_caps & NETIF_F_ALL_CSUM))
868 return sock_no_sendpage(sock, page, offset, size, flags); 867 return sock_no_sendpage(sk->sk_socket, page, offset, size,
868 flags);
869 869
870 lock_sock(sk); 870 lock_sock(sk);
871 TCP_CHECK_TIMER(sk); 871 TCP_CHECK_TIMER(sk);
@@ -899,10 +899,9 @@ static inline int select_size(struct sock *sk, int sg)
899 return tmp; 899 return tmp;
900} 900}
901 901
902int tcp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, 902int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
903 size_t size) 903 size_t size)
904{ 904{
905 struct sock *sk = sock->sk;
906 struct iovec *iov; 905 struct iovec *iov;
907 struct tcp_sock *tp = tcp_sk(sk); 906 struct tcp_sock *tp = tcp_sk(sk);
908 struct sk_buff *skb; 907 struct sk_buff *skb;