Skip to content

Commit 9957b38

Browse files
edumazetdavem330
authored andcommitted
tcp_cubic: make hystart_ack_delay() aware of BIG TCP
hystart_ack_delay() had the assumption that a TSO packet would not be bigger than GSO_MAX_SIZE. This will no longer be true. We should use sk->sk_gso_max_size instead. This reduces chances of spurious Hystart ACK train detections. Signed-off-by: Eric Dumazet <[email protected]> Acked-by: Alexander Duyck <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 34b92e8 commit 9957b38

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/ipv4/tcp_cubic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,15 +372,15 @@ static void cubictcp_state(struct sock *sk, u8 new_state)
372372
* We apply another 100% factor because @rate is doubled at this point.
373373
* We cap the cushion to 1ms.
374374
*/
375-
static u32 hystart_ack_delay(struct sock *sk)
375+
static u32 hystart_ack_delay(const struct sock *sk)
376376
{
377377
unsigned long rate;
378378

379379
rate = READ_ONCE(sk->sk_pacing_rate);
380380
if (!rate)
381381
return 0;
382382
return min_t(u64, USEC_PER_MSEC,
383-
div64_ul((u64)GSO_MAX_SIZE * 4 * USEC_PER_SEC, rate));
383+
div64_ul((u64)sk->sk_gso_max_size * 4 * USEC_PER_SEC, rate));
384384
}
385385

386386
static void hystart_update(struct sock *sk, u32 delay)

0 commit comments

Comments
 (0)