When a client connects, SYN would be sent to guest only once. If the guest is not connected or ready at that time, the connection will be reset in 10s. These patches introduce the SYN retry mechanism using the similar backoff timeout as linux kernel. Also update the data retransmission timeout using the backoff timeout. v9: - Squash the patch of adding parameter c to tcp_timer_ctl() into the later one - Fix the cppcheck error - Update the return values of read_file(), remove the error message of it and add check for buf_size - Rename RTO_INIT_ACK to RTO_INIT_AFTER_SYN_RETRIES - Round up rto_max, fix the conversion in subtraction - Some other minor fixes related to wording v8: - Remove the TCP_/tcp_ suffix from certain macro and struct member names - Add parameter struct ctx *c to tcp_timer_ctl() - Modify rto_max type from size_t to int - Clamp syn_retries and syn_linear_timeouts with MAX_SYNCNT(127) - Some other minor fixes related to wording and formatting v7: - Update read_file() and read_file_integer() - Rename tcp_syn_params_init() to tcp_get_rto_params() - Modify the implementation of the timeout assignment - Add a patch to clamp the retry timeout Yumei Huang (5): tcp: Rename "retrans" to "retries" util: Introduce read_file() and read_file_integer() function tcp: Resend SYN for inbound connections tcp: Update data retransmission timeout tcp: Clamp the retry timeout tcp.c | 107 +++++++++++++++++++++++++++++++++++++++-------------- tcp.h | 6 +++ tcp_conn.h | 13 ++++--- util.c | 90 ++++++++++++++++++++++++++++++++++++++++++++ util.h | 1 + 5 files changed, 184 insertions(+), 33 deletions(-) -- 2.51.1