9 #define pr_fmt(fmt) "TCP: " fmt
11 #include <linux/module.h>
13 #include <linux/types.h>
14 #include <linux/list.h>
28 list_for_each_entry_rcu(e, &tcp_cong_list,
list) {
46 pr_err(
"%s does not implement required ops\n", ca->
name);
50 spin_lock(&tcp_cong_list_lock);
51 if (tcp_ca_find(ca->
name)) {
55 list_add_tail_rcu(&ca->
list, &tcp_cong_list);
58 spin_unlock(&tcp_cong_list_lock);
72 spin_lock(&tcp_cong_list_lock);
73 list_del_rcu(&ca->
list);
74 spin_unlock(&tcp_cong_list_lock);
87 list_for_each_entry_rcu(ca, &tcp_cong_list,
list) {
88 if (try_module_get(ca->
owner)) {
118 spin_lock(&tcp_cong_list_lock);
119 ca = tcp_ca_find(name);
120 #ifdef CONFIG_MODULES
122 spin_unlock(&tcp_cong_list_lock);
124 request_module(
"tcp_%s", name);
125 spin_lock(&tcp_cong_list_lock);
126 ca = tcp_ca_find(name);
132 list_move(&ca->
list, &tcp_cong_list);
135 spin_unlock(&tcp_cong_list_lock);
141 static int __init tcp_congestion_default(
void)
155 list_for_each_entry_rcu(ca, &tcp_cong_list,
list) {
156 offs +=
snprintf(buf + offs, maxlen - offs,
158 offs == 0 ?
"" :
" ", ca->
name);
169 BUG_ON(list_empty(&tcp_cong_list));
185 list_for_each_entry_rcu(ca, &tcp_cong_list,
list) {
188 offs +=
snprintf(buf + offs, maxlen - offs,
190 offs == 0 ?
"" :
" ", ca->
name);
200 char *saved_clone, *clone, *
name;
207 spin_lock(&tcp_cong_list_lock);
209 while ((name =
strsep(&clone,
" ")) && *name) {
210 ca = tcp_ca_find(name);
218 list_for_each_entry_rcu(ca, &tcp_cong_list,
list)
222 while ((name =
strsep(&val,
" ")) && *name) {
223 ca = tcp_ca_find(name);
229 spin_unlock(&tcp_cong_list_lock);
244 ca = tcp_ca_find(name);
250 #ifdef CONFIG_MODULES
254 request_module(
"tcp_%s", name);
256 ca = tcp_ca_find(name);
265 else if (!try_module_get(ca->
owner))
285 const struct tcp_sock *tp = tcp_sk(sk);
292 if (sk_can_gso(sk) &&
293 left * sysctl_tcp_tso_win_divisor < tp->
snd_cwnd &&
295 left < sk->sk_gso_max_segs)
297 return left <= tcp_max_tso_deferred_mss(tp);
311 unsigned int delta = 0;
394 const struct tcp_sock *tp = tcp_sk(sk);
402 const struct tcp_sock *tp = tcp_sk(sk);