* [PATCH net-next] Avoid reducing cwnd when ACK+DSACK is received
@ 2014-12-11 19:58 Sébastien Barré
2014-12-11 20:14 ` David Miller
2014-12-12 15:54 ` Neal Cardwell
0 siblings, 2 replies; 4+ messages in thread
From: Sébastien Barré @ 2014-12-11 19:58 UTC (permalink / raw)
To: David Miller
Cc: Sébastien Barré, netdev, Gregory Detal,
Nandita Dukkipati, Yuchung Cheng
When the peer has delayed ack enabled, it 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.
Cc: Gregory Detal <gregory.detal@uclouvain.be>
Cc: Nandita Dukkipati <nanditad@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Sébastien Barré <sebastien.barre@uclouvain.be>
---
net/ipv4/tcp_input.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 075ab4d..fb007cc 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3369,23 +3369,23 @@ static void tcp_process_tlp_ack(struct sock *sk, u32 ack, int flag)
/* Mark the end of TLP episode on receiving TLP dupack or when
* ack is after tlp_high_seq.
+ * With delayed acks, we may also get a regular ACK+DSACK, in which
+ * case we don't want to reduce the cwnd either.
*/
- if (is_tlp_dupack) {
+ if (is_tlp_dupack ||
+ !before(ack, tp->tlp_high_seq) && (flag & FLAG_DSACKING_ACK)) {
tp->tlp_high_seq = 0;
return;
}
if (after(ack, tp->tlp_high_seq)) {
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);
- }
+ 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);
}
}
--
tg: (52c9b12..) net-next/tlp-dsack-handling (depends on: net-next/master)
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] Avoid reducing cwnd when ACK+DSACK is received
2014-12-11 19:58 [PATCH net-next] Avoid reducing cwnd when ACK+DSACK is received Sébastien Barré
@ 2014-12-11 20:14 ` David Miller
2014-12-12 7:43 ` Sébastien Barré
2014-12-12 15:54 ` Neal Cardwell
1 sibling, 1 reply; 4+ messages in thread
From: David Miller @ 2014-12-11 20:14 UTC (permalink / raw)
To: sebastien.barre; +Cc: netdev, gregory.detal, nanditad, ycheng
The net-next tree is closed, therefore it is not appropriate to submit net-next
changes at this time.
Thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] Avoid reducing cwnd when ACK+DSACK is received
2014-12-11 20:14 ` David Miller
@ 2014-12-12 7:43 ` Sébastien Barré
0 siblings, 0 replies; 4+ messages in thread
From: Sébastien Barré @ 2014-12-12 7:43 UTC (permalink / raw)
To: David Miller; +Cc: netdev, gregory.detal, nanditad, ycheng
Le 11/12/2014 21:14, David Miller a écrit :
> The net-next tree is closed, therefore it is not appropriate to submit net-next
> changes at this time.
Sorry for that, I missed your mail announcing that next-next was closed.
Will resubmit when it is open again.
regards,
Sébastien.
>
> Thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] Avoid reducing cwnd when ACK+DSACK is received
2014-12-11 19:58 [PATCH net-next] Avoid reducing cwnd when ACK+DSACK is received Sébastien Barré
2014-12-11 20:14 ` David Miller
@ 2014-12-12 15:54 ` Neal Cardwell
1 sibling, 0 replies; 4+ messages in thread
From: Neal Cardwell @ 2014-12-12 15:54 UTC (permalink / raw)
To: Sébastien Barré
Cc: David Miller, Netdev, Gregory Detal, Nandita Dukkipati,
Yuchung Cheng
On Thu, Dec 11, 2014 at 2:58 PM, Sébastien Barré
<sebastien.barre@uclouvain.be> wrote:
> When the peer has delayed ack enabled, it 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.
>
> Cc: Gregory Detal <gregory.detal@uclouvain.be>
> Cc: Nandita Dukkipati <nanditad@google.com>
> Cc: Yuchung Cheng <ycheng@google.com>
> Signed-off-by: Sébastien Barré <sebastien.barre@uclouvain.be>
BTW, I like this idea, and I'll test it.
Two suggestions for the next iteration:
(1) for TCP patch style, I'd suggest a commit first-line like:
tcp: avoid reducing cwnd when ACK+DSACK is received
(2) Your patch is essentially a reworking of the is_tlp_dupack
computation. So rather than splitting the logic between the
is_tlp_dupack computation and the new expression inside the if
condition, I'd suggest moving and centralizing all the logic in the if
condition. There is no real need for the is_tlp_dupack variable.
neal
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-12-12 15:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-11 19:58 [PATCH net-next] Avoid reducing cwnd when ACK+DSACK is received Sébastien Barré
2014-12-11 20:14 ` David Miller
2014-12-12 7:43 ` Sébastien Barré
2014-12-12 15:54 ` Neal Cardwell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).