Commit 9957b38b authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

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: default avatarEric Dumazet <edumazet@google.com>
Acked-by: default avatarAlexander Duyck <alexanderduyck@fb.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 34b92e8d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -372,7 +372,7 @@ 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;

@@ -380,7 +380,7 @@ static u32 hystart_ack_delay(struct sock *sk)
	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)