diff options
| author | Siluxsept <ronny.horn.rh@gmail.com> | 2024-02-06 04:37:40 +0100 |
|---|---|---|
| committer | Siluxsept <ronny.horn.rh@gmail.com> | 2024-02-06 04:38:56 +0100 |
| commit | 8e8137ac800bdc27181743ec73d0e90e28b4e8af (patch) | |
| tree | 7e2fbc9d9e305e46414c21d08eeaeb1d56ccb0f0 /net/ipv4/tcp_output.c | |
| parent | 9c2f9bfc860f0cd6f2d3320b5f72a0f4adf24b25 (diff) | |
merge branch lineage-20 into t13.0t13.0
https: //github.com/LineageOS/android_kernel_google_redbull
Change-Id: I4a450eb794cc99abf711ad3b5b82946092be84ba
Diffstat (limited to 'net/ipv4/tcp_output.c')
| -rw-r--r-- | net/ipv4/tcp_output.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 9a6be252390e..405f729bdc08 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -1638,15 +1638,20 @@ static void tcp_cwnd_validate(struct sock *sk, bool is_cwnd_limited) const struct tcp_congestion_ops *ca_ops = inet_csk(sk)->icsk_ca_ops; struct tcp_sock *tp = tcp_sk(sk); - /* Track the maximum number of outstanding packets in each - * window, and remember whether we were cwnd-limited then. + /* Track the strongest available signal of the degree to which the cwnd + * is fully utilized. If cwnd-limited then remember that fact for the + * current window. If not cwnd-limited then track the maximum number of + * outstanding packets in the current window. (If cwnd-limited then we + * chose to not update tp->max_packets_out to avoid an extra else + * clause with no functional impact.) */ - if (!before(tp->snd_una, tp->max_packets_seq) || - tp->packets_out > tp->max_packets_out || - is_cwnd_limited) { - tp->max_packets_out = tp->packets_out; - tp->max_packets_seq = tp->snd_nxt; + if (!before(tp->snd_una, tp->cwnd_usage_seq) || + is_cwnd_limited || + (!tp->is_cwnd_limited && + tp->packets_out > tp->max_packets_out)) { tp->is_cwnd_limited = is_cwnd_limited; + tp->max_packets_out = tp->packets_out; + tp->cwnd_usage_seq = tp->snd_nxt; } if (tcp_is_cwnd_limited(sk)) { |
