Message ID | 1421055040-8732-1-git-send-email-sebastien.barre@uclouvain.be |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
On Mon, 2015-01-12 at 10:30 +0100, Sébastien Barré wrote: > With TLP, the peer may reply to a probe with an > ACK+D-SACK, with ack value set to tlp_high_seq. In the current code, > such ACK+DSACK will be missed and only at next, higher ack will the TLP > episode be considered done. Since the DSACK is not present anymore, > this will cost a cwnd reduction. Acked-by: Eric Dumazet <edumazet@google.com> Thanks guys. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Mon, 2015-01-12 at 10:30 +0100, Sébastien Barré wrote: > With TLP, the peer may reply to a probe with an > ACK+D-SACK, with ack value set to tlp_high_seq. In the current code, > such ACK+DSACK will be missed and only at next, higher ack will the TLP > episode be considered done. Since the DSACK is not present anymore, > this will cost a cwnd reduction. Acked-by: Neal Cardwell <ncardwell@google.com> Thanks! neal -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Sébastien Barré <sebastien.barre@uclouvain.be> Date: Mon, 12 Jan 2015 10:30:40 +0100 > With TLP, the peer may reply to a probe with an > ACK+D-SACK, with ack value set to tlp_high_seq. In the current code, > such ACK+DSACK will be missed and only at next, higher ack will the TLP > episode be considered done. Since the DSACK is not present anymore, > this will cost a cwnd reduction. > > This patch ensures that this scenario does not cause a cwnd reduction, since > receiving an ACK+DSACK indicates that both the initial segment and the probe > have been received by the peer. > > The following packetdrill test, from Neal Cardwell, validates this patch: ... > Credits: > -Gregory helped in finding that tcp_process_tlp_ack was where the cwnd > got reduced in our MPTCP tests. > -Neal wrote the packetdrill test above > -Yuchung reworked the patch to make it more readable. > > Cc: Gregory Detal <gregory.detal@uclouvain.be> > Cc: Nandita Dukkipati <nanditad@google.com> > Tested-by: Neal Cardwell <ncardwell@google.com> > Reviewed-by: Yuchung Cheng <ycheng@google.com> > Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com> > Signed-off-by: Sébastien Barré <sebastien.barre@uclouvain.be> Applied, thanks everyone. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 075ab4d..71fb37c 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -3358,34 +3358,34 @@ static void tcp_replace_ts_recent(struct tcp_sock *tp, u32 seq) } /* This routine deals with acks during a TLP episode. + * We mark the end of a TLP episode on receiving TLP dupack or when + * ack is after tlp_high_seq. * Ref: loss detection algorithm in draft-dukkipati-tcpm-tcp-loss-probe. */ static void tcp_process_tlp_ack(struct sock *sk, u32 ack, int flag) { struct tcp_sock *tp = tcp_sk(sk); - bool is_tlp_dupack = (ack == tp->tlp_high_seq) && - !(flag & (FLAG_SND_UNA_ADVANCED | - FLAG_NOT_DUP | FLAG_DATA_SACKED)); - /* Mark the end of TLP episode on receiving TLP dupack or when - * ack is after tlp_high_seq. - */ - if (is_tlp_dupack) { - tp->tlp_high_seq = 0; + if (before(ack, tp->tlp_high_seq)) return; - } - if (after(ack, tp->tlp_high_seq)) { + if (flag & FLAG_DSACKING_ACK) { + /* This DSACK means original and TLP probe arrived; no loss */ + tp->tlp_high_seq = 0; + } else if (after(ack, tp->tlp_high_seq)) { + /* ACK advances: there was a loss, so reduce cwnd. Reset + * tlp_high_seq in tcp_init_cwnd_reduction() + */ + tcp_init_cwnd_reduction(sk); + tcp_set_ca_state(sk, TCP_CA_CWR); + tcp_end_cwnd_reduction(sk); + tcp_try_keep_open(sk); + NET_INC_STATS_BH(sock_net(sk), + LINUX_MIB_TCPLOSSPROBERECOVERY); + } else if (!(flag & (FLAG_SND_UNA_ADVANCED | + FLAG_NOT_DUP | FLAG_DATA_SACKED))) { + /* Pure dupack: original and TLP probe arrived; no loss */ tp->tlp_high_seq = 0; - /* Don't reduce cwnd if DSACK arrives for TLP retrans. */ - if (!(flag & FLAG_DSACKING_ACK)) { - tcp_init_cwnd_reduction(sk); - tcp_set_ca_state(sk, TCP_CA_CWR); - tcp_end_cwnd_reduction(sk); - tcp_try_keep_open(sk); - NET_INC_STATS_BH(sock_net(sk), - LINUX_MIB_TCPLOSSPROBERECOVERY); - } } }