Skip to content

Commit

Permalink
tcp_cubic: make hystart_ack_delay() aware of BIG TCP
Browse files Browse the repository at this point in the history
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 <edumazet@google.com>
Acked-by: Alexander Duyck <alexanderduyck@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed May 16, 2022
1 parent 34b92e8 commit 9957b38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/ipv4/tcp_cubic.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,15 +372,15 @@ static void cubictcp_state(struct sock *sk, u8 new_state)
* We apply another 100% factor because @rate is doubled at this point.
* We cap the cushion to 1ms.
*/
static u32 hystart_ack_delay(struct sock *sk)
static u32 hystart_ack_delay(const struct sock *sk)
{
unsigned long rate;

rate = READ_ONCE(sk->sk_pacing_rate);
if (!rate)
return 0;
return min_t(u64, USEC_PER_MSEC,
div64_ul((u64)GSO_MAX_SIZE * 4 * USEC_PER_SEC, rate));
div64_ul((u64)sk->sk_gso_max_size * 4 * USEC_PER_SEC, rate));
}

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

0 comments on commit 9957b38

Please sign in to comment.