Netdev List
 help / color / mirror / Atom feed
From: Yuchung Cheng <ycheng@google.com>
To: davem@davemloft.net, edumazet@google.com
Cc: netdev@vger.kernel.org, ncardwell@google.com, soheil@google.com,
	Yuchung Cheng <ycheng@google.com>
Subject: [PATCH net-next 6/8] tcp: undo cwnd on Fast Open spurious SYNACK retransmit
Date: Mon, 29 Apr 2019 15:46:18 -0700	[thread overview]
Message-ID: <20190429224620.151064-7-ycheng@google.com> (raw)
In-Reply-To: <20190429224620.151064-1-ycheng@google.com>

This patch makes passive Fast Open reverts the cwnd to default
initial cwnd (10 packets) if the SYNACK timeout is spurious.

Passive Fast Open uses a full socket during handshake so it can
use the existing undo logic to detect spurious retransmission
by recording the first SYNACK timeout in key state variable
retrans_stamp. Upon receiving the ACK of the SYNACK, if the socket
has sent some data before the timeout, the spurious timeout
is detected by tcp_try_undo_recovery() in tcp_process_loss()
in tcp_ack().

But if the socket has not send any data yet, tcp_ack() does not
execute the undo code since no data is acknowledged. The fix is to
check such case explicitly after tcp_ack() during the ACK processing
in SYN_RECV state. In addition this is checked in FIN_WAIT_1 state
in case the server closes the socket before handshake completes.

Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/ipv4/tcp_input.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 53b4c5a3113b..3a40584cb473 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -6089,6 +6089,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
 		 * so release it.
 		 */
 		if (req) {
+			tcp_try_undo_loss(sk, false);
 			inet_csk(sk)->icsk_retransmits = 0;
 			reqsk_fastopen_remove(sk, req, false);
 			/* Re-arm the timer because data may have been sent out.
@@ -6143,6 +6144,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
 		 * our SYNACK so stop the SYNACK timer.
 		 */
 		if (req) {
+			tcp_try_undo_loss(sk, false);
+			inet_csk(sk)->icsk_retransmits = 0;
 			/* We no longer need the request sock. */
 			reqsk_fastopen_remove(sk, req, false);
 			tcp_rearm_rto(sk);
-- 
2.21.0.593.g511ec345e18-goog


  parent reply	other threads:[~2019-04-29 22:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-29 22:46 [PATCH net-next 0/8] undo congestion window on spurious SYN or SYNACK timeout Yuchung Cheng
2019-04-29 22:46 ` [PATCH net-next 1/8] tcp: avoid unconditional congestion window undo on SYN retransmit Yuchung Cheng
2019-04-29 22:46 ` [PATCH net-next 2/8] tcp: undo initial congestion window on false SYN timeout Yuchung Cheng
2019-04-29 22:46 ` [PATCH net-next 3/8] tcp: better SYNACK sent timestamp Yuchung Cheng
2019-04-29 22:46 ` [PATCH net-next 4/8] tcp: undo init congestion window on false SYNACK timeout Yuchung Cheng
2019-06-19 15:54   ` Eric Dumazet
2019-04-29 22:46 ` [PATCH net-next 5/8] tcp: lower congestion window on Fast Open " Yuchung Cheng
2019-04-29 22:46 ` Yuchung Cheng [this message]
2019-04-29 22:46 ` [PATCH net-next 7/8] tcp: refactor to consolidate TFO passive open code Yuchung Cheng
2019-04-29 22:46 ` [PATCH net-next 8/8] tcp: refactor setting the initial congestion window Yuchung Cheng
2019-05-01 15:55 ` [PATCH net-next 0/8] undo congestion window on spurious SYN or SYNACK timeout David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190429224620.151064-7-ycheng@google.com \
    --to=ycheng@google.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=soheil@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox