Blame view
net/ipv4/tcp_scalable.c
1.45 KB
09c434b8a
|
1 |
// SPDX-License-Identifier: GPL-2.0-only |
0e57976b6
|
2 3 |
/* Tom Kelly's Scalable TCP * |
a52b8bd33
|
4 |
* See http://www.deneholme.net/tom/scalable/ |
0e57976b6
|
5 6 7 |
* * John Heffner <jheffner@sc.edu> */ |
0e57976b6
|
8 9 10 11 12 13 14 15 16 |
#include <linux/module.h> #include <net/tcp.h> /* These factors derived from the recommended values in the aer: * .01 and and 7/8. We use 50 instead of 100 to account for * delayed ack. */ #define TCP_SCALABLE_AI_CNT 50U #define TCP_SCALABLE_MD_SCALE 3 |
249015515
|
17 |
static void tcp_scalable_cong_avoid(struct sock *sk, u32 ack, u32 acked) |
0e57976b6
|
18 |
{ |
6687e988d
|
19 |
struct tcp_sock *tp = tcp_sk(sk); |
f4805eded
|
20 |
|
249015515
|
21 |
if (!tcp_is_cwnd_limited(sk)) |
0e57976b6
|
22 |
return; |
071d5080e
|
23 |
if (tcp_in_slow_start(tp)) |
9f9843a75
|
24 |
tcp_slow_start(tp, acked); |
758ce5c8d
|
25 |
else |
e73ebb088
|
26 27 |
tcp_cong_avoid_ai(tp, min(tp->snd_cwnd, TCP_SCALABLE_AI_CNT), 1); |
0e57976b6
|
28 |
} |
6687e988d
|
29 |
static u32 tcp_scalable_ssthresh(struct sock *sk) |
0e57976b6
|
30 |
{ |
6687e988d
|
31 |
const struct tcp_sock *tp = tcp_sk(sk); |
688d1945b
|
32 |
|
0e57976b6
|
33 34 |
return max(tp->snd_cwnd - (tp->snd_cwnd>>TCP_SCALABLE_MD_SCALE), 2U); } |
a252bebe2
|
35 |
static struct tcp_congestion_ops tcp_scalable __read_mostly = { |
0e57976b6
|
36 |
.ssthresh = tcp_scalable_ssthresh, |
f1722a1be
|
37 |
.undo_cwnd = tcp_reno_undo_cwnd, |
0e57976b6
|
38 |
.cong_avoid = tcp_scalable_cong_avoid, |
0e57976b6
|
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
.owner = THIS_MODULE, .name = "scalable", }; static int __init tcp_scalable_register(void) { return tcp_register_congestion_control(&tcp_scalable); } static void __exit tcp_scalable_unregister(void) { tcp_unregister_congestion_control(&tcp_scalable); } module_init(tcp_scalable_register); module_exit(tcp_scalable_unregister); MODULE_AUTHOR("John Heffner"); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Scalable TCP"); |