Skip to content

Commit

Permalink
tcp: fix tcp_should_expand_sndbuf() to use tcp_packets_in_flight()
Browse files Browse the repository at this point in the history
tcp_should_expand_sndbuf() does not expand the send buffer if we have
filled the congestion window.

However, it should use tcp_packets_in_flight() instead of
tp->packets_out to make this check.

Testing has established that the difference matters a lot if there are
many SACKed packets, causing a needless performance shortfall.

Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Nandita Dukkipati <nanditad@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Neal Cardwell authored and David S. Miller committed Feb 23, 2015
1 parent 52d6c8c commit 6514890
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv4/tcp_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -4770,7 +4770,7 @@ static bool tcp_should_expand_sndbuf(const struct sock *sk)
return false;

/* If we filled the congestion window, do not expand. */
if (tp->packets_out >= tp->snd_cwnd)
if (tcp_packets_in_flight(tp) >= tp->snd_cwnd)
return false;

return true;
Expand Down

0 comments on commit 6514890

Please sign in to comment.