Skip to content

Commit 4e1fddc

Browse files
edumazetkuba-moo
authored andcommitted
tcp_cubic: fix spurious Hystart ACK train detections for not-cwnd-limited flows
While testing BIG TCP patch series, I was expecting that TCP_RR workloads with 80KB requests/answers would send one 80KB TSO packet, then being received as a single GRO packet. It turns out this was not happening, and the root cause was that cubic Hystart ACK train was triggering after a few (2 or 3) rounds of RPC. Hystart was wrongly setting CWND/SSTHRESH to 30, while my RPC needed a budget of ~20 segments. Ideally these TCP_RR flows should not exit slow start. Cubic Hystart should reset itself at each round, instead of assuming every TCP flow is a bulk one. Note that even after this patch, Hystart can still trigger, depending on scheduling artifacts, but at a higher CWND/SSTHRESH threshold, keeping optimal TSO packet sizes. Tested: ip link set dev eth0 gro_ipv6_max_size 131072 gso_ipv6_max_size 131072 nstat -n; netperf -H ... -t TCP_RR -l 5 -- -r 80000,80000 -K cubic; nstat|egrep "Ip6InReceives|Hystart|Ip6OutRequests" Before: 8605 Ip6InReceives 87541 0.0 Ip6OutRequests 129496 0.0 TcpExtTCPHystartTrainDetect 1 0.0 TcpExtTCPHystartTrainCwnd 30 0.0 After: 8760 Ip6InReceives 88514 0.0 Ip6OutRequests 87975 0.0 Fixes: ae27e98 ("[TCP] CUBIC v2.3") Co-developed-by: Neal Cardwell <[email protected]> Signed-off-by: Neal Cardwell <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Cc: Stephen Hemminger <[email protected]> Cc: Yuchung Cheng <[email protected]> Cc: Soheil Hassas Yeganeh <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 550b8e1 commit 4e1fddc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

net/ipv4/tcp_cubic.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,6 @@ static void cubictcp_cong_avoid(struct sock *sk, u32 ack, u32 acked)
330330
return;
331331

332332
if (tcp_in_slow_start(tp)) {
333-
if (hystart && after(ack, ca->end_seq))
334-
bictcp_hystart_reset(sk);
335333
acked = tcp_slow_start(tp, acked);
336334
if (!acked)
337335
return;
@@ -391,6 +389,9 @@ static void hystart_update(struct sock *sk, u32 delay)
391389
struct bictcp *ca = inet_csk_ca(sk);
392390
u32 threshold;
393391

392+
if (after(tp->snd_una, ca->end_seq))
393+
bictcp_hystart_reset(sk);
394+
394395
if (hystart_detect & HYSTART_ACK_TRAIN) {
395396
u32 now = bictcp_clock_us(sk);
396397

0 commit comments

Comments
 (0)