Skip to content

Commit 3acf3ec

Browse files
Lawrence Brakmodavem330
authored andcommitted
tcp: Change txhash on every SYN and RTO retransmit
The current code changes txhash (flowlables) on every retransmitted SYN/ACK, but only after the 2nd retransmitted SYN and only after tcp_retries1 RTO retransmits. With this patch: 1) txhash is changed with every SYN retransmits 2) txhash is changed with every RTO. The result is that we can start re-routing around failed (or very congested paths) as soon as possible. Otherwise application health checks may fail and the connection may be terminated before we start to change txhash. v4: Removed sysctl, txhash is changed for all RTOs v3: Removed text saying default value of sysctl is 0 (it is 100) v2: Added sysctl documentation and cleaned code Tested with packetdrill tests Signed-off-by: Lawrence Brakmo <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent fa5effe commit 3acf3ec

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

net/ipv4/tcp_timer.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ static int tcp_write_timeout(struct sock *sk)
192192
if (tp->syn_data && icsk->icsk_retransmits == 1)
193193
NET_INC_STATS(sock_net(sk),
194194
LINUX_MIB_TCPFASTOPENACTIVEFAIL);
195+
} else if (!tp->syn_data && !tp->syn_fastopen) {
196+
sk_rethink_txhash(sk);
195197
}
196198
retry_until = icsk->icsk_syn_retries ? : net->ipv4.sysctl_tcp_syn_retries;
197199
syn_set = true;
@@ -213,6 +215,8 @@ static int tcp_write_timeout(struct sock *sk)
213215
tcp_mtu_probing(icsk, sk);
214216

215217
dst_negative_advice(sk);
218+
} else {
219+
sk_rethink_txhash(sk);
216220
}
217221

218222
retry_until = net->ipv4.sysctl_tcp_retries2;

0 commit comments

Comments
 (0)