aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ipv4/tcp.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 0eb7cf1002c1..987b94403be5 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1116,7 +1116,6 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
1116 long timeo; 1116 long timeo;
1117 struct task_struct *user_recv = NULL; 1117 struct task_struct *user_recv = NULL;
1118 int copied_early = 0; 1118 int copied_early = 0;
1119 int available = 0;
1120 struct sk_buff *skb; 1119 struct sk_buff *skb;
1121 1120
1122 lock_sock(sk); 1121 lock_sock(sk);
@@ -1145,15 +1144,22 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
1145 tp->ucopy.dma_chan = NULL; 1144 tp->ucopy.dma_chan = NULL;
1146 preempt_disable(); 1145 preempt_disable();
1147 skb = skb_peek_tail(&sk->sk_receive_queue); 1146 skb = skb_peek_tail(&sk->sk_receive_queue);
1148 if (skb) 1147 {
1149 available = TCP_SKB_CB(skb)->seq + skb->len - (*seq); 1148 int available = 0;
1150 if ((available < target) && 1149
1151 (len > sysctl_tcp_dma_copybreak) && !(flags & MSG_PEEK) && 1150 if (skb)
1152 !sysctl_tcp_low_latency && __get_cpu_var(softnet_data).net_dma) { 1151 available = TCP_SKB_CB(skb)->seq + skb->len - (*seq);
1153 preempt_enable_no_resched(); 1152 if ((available < target) &&
1154 tp->ucopy.pinned_list = dma_pin_iovec_pages(msg->msg_iov, len); 1153 (len > sysctl_tcp_dma_copybreak) && !(flags & MSG_PEEK) &&
1155 } else 1154 !sysctl_tcp_low_latency &&
1156 preempt_enable_no_resched(); 1155 __get_cpu_var(softnet_data).net_dma) {
1156 preempt_enable_no_resched();
1157 tp->ucopy.pinned_list =
1158 dma_pin_iovec_pages(msg->msg_iov, len);
1159 } else {
1160 preempt_enable_no_resched();
1161 }
1162 }
1157#endif 1163#endif
1158 1164
1159 do { 1165 do {