提交 d27f9bc1 编写于 作者: D Dan Williams

net_dma: revert 'copied_early'

Now that tcp_dma_try_early_copy() is gone nothing ever sets
copied_early.

Also reverts "53240c20 tcp: Fix possible double-ack w/ user dma"
since it is no longer necessary.

Cc: Ali Saidi <saidi@engin.umich.edu>
Cc: James Morris <jmorris@namei.org>
Cc: Patrick McHardy <kaber@trash.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Cc: Neal Cardwell <ncardwell@google.com>
Reported-by: NDave Jones <davej@redhat.com>
Acked-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NDan Williams <dan.j.williams@intel.com>
上级 7bced397
...@@ -5148,19 +5148,15 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb, ...@@ -5148,19 +5148,15 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
} }
} else { } else {
int eaten = 0; int eaten = 0;
int copied_early = 0;
bool fragstolen = false; bool fragstolen = false;
if (tp->copied_seq == tp->rcv_nxt && if (tp->ucopy.task == current &&
len - tcp_header_len <= tp->ucopy.len) { tp->copied_seq == tp->rcv_nxt &&
if (tp->ucopy.task == current && len - tcp_header_len <= tp->ucopy.len &&
sock_owned_by_user(sk) && !copied_early) { sock_owned_by_user(sk)) {
__set_current_state(TASK_RUNNING); __set_current_state(TASK_RUNNING);
if (!tcp_copy_to_iovec(sk, skb, tcp_header_len)) if (!tcp_copy_to_iovec(sk, skb, tcp_header_len)) {
eaten = 1;
}
if (eaten) {
/* Predicted packet is in window by definition. /* Predicted packet is in window by definition.
* seq == rcv_nxt and rcv_wup <= rcv_nxt. * seq == rcv_nxt and rcv_wup <= rcv_nxt.
* Hence, check seq<=rcv_wup reduces to: * Hence, check seq<=rcv_wup reduces to:
...@@ -5176,9 +5172,8 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb, ...@@ -5176,9 +5172,8 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
__skb_pull(skb, tcp_header_len); __skb_pull(skb, tcp_header_len);
tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq; tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq;
NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPHPHITSTOUSER); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPHPHITSTOUSER);
eaten = 1;
} }
if (copied_early)
tcp_cleanup_rbuf(sk, skb->len);
} }
if (!eaten) { if (!eaten) {
if (tcp_checksum_complete_user(sk, skb)) if (tcp_checksum_complete_user(sk, skb))
...@@ -5215,8 +5210,7 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb, ...@@ -5215,8 +5210,7 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
goto no_ack; goto no_ack;
} }
if (!copied_early || tp->rcv_nxt != tp->rcv_wup) __tcp_ack_snd_check(sk, 0);
__tcp_ack_snd_check(sk, 0);
no_ack: no_ack:
if (eaten) if (eaten)
kfree_skb_partial(skb, fragstolen); kfree_skb_partial(skb, fragstolen);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册