| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* Tom Kelly's Scalable TCP |
|---|
| 2 | 3 | * |
|---|
| 3 | 4 | * See http://www.deneholme.net/tom/scalable/ |
|---|
| .. | .. |
|---|
| 9 | 10 | #include <net/tcp.h> |
|---|
| 10 | 11 | |
|---|
| 11 | 12 | /* These factors derived from the recommended values in the aer: |
|---|
| 12 | | - * .01 and and 7/8. We use 50 instead of 100 to account for |
|---|
| 13 | | - * delayed ack. |
|---|
| 13 | + * .01 and 7/8. |
|---|
| 14 | 14 | */ |
|---|
| 15 | | -#define TCP_SCALABLE_AI_CNT 50U |
|---|
| 15 | +#define TCP_SCALABLE_AI_CNT 100U |
|---|
| 16 | 16 | #define TCP_SCALABLE_MD_SCALE 3 |
|---|
| 17 | 17 | |
|---|
| 18 | 18 | static void tcp_scalable_cong_avoid(struct sock *sk, u32 ack, u32 acked) |
|---|
| .. | .. |
|---|
| 22 | 22 | if (!tcp_is_cwnd_limited(sk)) |
|---|
| 23 | 23 | return; |
|---|
| 24 | 24 | |
|---|
| 25 | | - if (tcp_in_slow_start(tp)) |
|---|
| 26 | | - tcp_slow_start(tp, acked); |
|---|
| 27 | | - else |
|---|
| 28 | | - tcp_cong_avoid_ai(tp, min(tp->snd_cwnd, TCP_SCALABLE_AI_CNT), |
|---|
| 29 | | - 1); |
|---|
| 25 | + if (tcp_in_slow_start(tp)) { |
|---|
| 26 | + acked = tcp_slow_start(tp, acked); |
|---|
| 27 | + if (!acked) |
|---|
| 28 | + return; |
|---|
| 29 | + } |
|---|
| 30 | + tcp_cong_avoid_ai(tp, min(tp->snd_cwnd, TCP_SCALABLE_AI_CNT), |
|---|
| 31 | + acked); |
|---|
| 30 | 32 | } |
|---|
| 31 | 33 | |
|---|
| 32 | 34 | static u32 tcp_scalable_ssthresh(struct sock *sk) |
|---|