]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: fix TCP_SYNCNT flakes
authorEric Dumazet <edumazet@google.com>
Tue, 23 May 2017 19:38:35 +0000 (12:38 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 May 2017 20:29:57 +0000 (16:29 -0400)
commita44730c93915b4eb1427f418c9ba6967595cfa6a
tree771905210d14b2a9fdecfb27c4f2f4f8ecbb2743
parent6e8569eb1ef02edc0dbd25fc06f88193b47bfa1e
tcp: fix TCP_SYNCNT flakes

After the mentioned commit, some of our packetdrill tests became flaky.

TCP_SYNCNT socket option can limit the number of SYN retransmits.

retransmits_timed_out() has to compare times computations based on
local_clock() while timers are based on jiffies. With NTP adjustments
and roundings we can observe 999 ms delay for 1000 ms timers.
We end up sending one extra SYN packet.

Gimmick added in commit 75f736cd71eb ("Revert Backoff [v3]: Calculate
TCP's connection close threshold as a time value") makes no
real sense for TCP_SYN_SENT sockets where no RTO backoff can happen at
all.

Lets use a simpler logic for TCP_SYN_SENT sockets and remove @syn_set
parameter from retransmits_timed_out()

Fixes: dafcda9f5d0c ("tcp: switch TCP TS option (RFC 7323) to 1ms clock")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_timer.c