diff options
author | Ali Saidi <saidi@engin.umich.edu> | 2008-10-07 18:31:19 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-07 18:31:19 -0400 |
commit | 53240c208776d557dba9d7afedbcdbf512774c16 (patch) | |
tree | b47429ecaf4ea004857e5464cf0612cbd06081c7 /net/ipv4/tcp_input.c | |
parent | b6c40d68ff6498b7f63ddf97cf0aa818d748dee7 (diff) |
tcp: Fix possible double-ack w/ user dma
From: Ali Saidi <saidi@engin.umich.edu>
When TCP receive copy offload is enabled it's possible that
tcp_rcv_established() will cause two acks to be sent for a single
packet. In the case that a tcp_dma_early_copy() is successful,
copied_early is set to true which causes tcp_cleanup_rbuf() to be
called early which can send an ack. Further along in
tcp_rcv_established(), __tcp_ack_snd_check() is called and will
schedule a delayed ACK. If no packets are processed before the delayed
ack timer expires the packet will be acked twice.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r-- | net/ipv4/tcp_input.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 67ccce2a96bd..7abc6b80d47d 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -4879,7 +4879,8 @@ int tcp_rcv_established(struct sock *sk, struct sk_buff *skb, | |||
4879 | goto no_ack; | 4879 | goto no_ack; |
4880 | } | 4880 | } |
4881 | 4881 | ||
4882 | __tcp_ack_snd_check(sk, 0); | 4882 | if (!copied_early || tp->rcv_nxt != tp->rcv_wup) |
4883 | __tcp_ack_snd_check(sk, 0); | ||
4883 | no_ack: | 4884 | no_ack: |
4884 | #ifdef CONFIG_NET_DMA | 4885 | #ifdef CONFIG_NET_DMA |
4885 | if (copied_early) | 4886 | if (copied_early) |