Lines Matching refs:ca
38 const struct tcp_congestion_ops *ca = tcp_ca_find(name); in __tcp_ca_find_autoload() local
40 if (!ca && capable(CAP_NET_ADMIN)) { in __tcp_ca_find_autoload()
44 ca = tcp_ca_find(name); in __tcp_ca_find_autoload()
47 return ca; in __tcp_ca_find_autoload()
67 int tcp_register_congestion_control(struct tcp_congestion_ops *ca) in tcp_register_congestion_control() argument
72 if (!ca->ssthresh || !ca->cong_avoid) { in tcp_register_congestion_control()
73 pr_err("%s does not implement required ops\n", ca->name); in tcp_register_congestion_control()
77 ca->key = jhash(ca->name, sizeof(ca->name), strlen(ca->name)); in tcp_register_congestion_control()
80 if (ca->key == TCP_CA_UNSPEC || tcp_ca_find_key(ca->key)) { in tcp_register_congestion_control()
82 ca->name); in tcp_register_congestion_control()
85 list_add_tail_rcu(&ca->list, &tcp_cong_list); in tcp_register_congestion_control()
86 pr_debug("%s registered\n", ca->name); in tcp_register_congestion_control()
100 void tcp_unregister_congestion_control(struct tcp_congestion_ops *ca) in tcp_unregister_congestion_control() argument
103 list_del_rcu(&ca->list); in tcp_unregister_congestion_control()
119 const struct tcp_congestion_ops *ca; in tcp_ca_get_key_by_name() local
125 ca = __tcp_ca_find_autoload(name); in tcp_ca_get_key_by_name()
126 key = ca ? ca->key : TCP_CA_UNSPEC; in tcp_ca_get_key_by_name()
135 const struct tcp_congestion_ops *ca; in tcp_ca_get_name_by_key() local
139 ca = tcp_ca_find_key(key); in tcp_ca_get_name_by_key()
140 if (ca) in tcp_ca_get_name_by_key()
141 ret = strncpy(buffer, ca->name, in tcp_ca_get_name_by_key()
153 struct tcp_congestion_ops *ca; in tcp_assign_congestion_control() local
156 list_for_each_entry_rcu(ca, &tcp_cong_list, list) { in tcp_assign_congestion_control()
157 if (likely(try_module_get(ca->owner))) { in tcp_assign_congestion_control()
158 icsk->icsk_ca_ops = ca; in tcp_assign_congestion_control()
171 if (ca->get_info) in tcp_assign_congestion_control()
184 const struct tcp_congestion_ops *ca) in tcp_reinit_congestion_control() argument
189 icsk->icsk_ca_ops = ca; in tcp_reinit_congestion_control()
209 struct tcp_congestion_ops *ca; in tcp_set_default_congestion_control() local
213 ca = tcp_ca_find(name); in tcp_set_default_congestion_control()
215 if (!ca && capable(CAP_NET_ADMIN)) { in tcp_set_default_congestion_control()
220 ca = tcp_ca_find(name); in tcp_set_default_congestion_control()
224 if (ca) { in tcp_set_default_congestion_control()
225 ca->flags |= TCP_CONG_NON_RESTRICTED; /* default is always allowed */ in tcp_set_default_congestion_control()
226 list_move(&ca->list, &tcp_cong_list); in tcp_set_default_congestion_control()
244 struct tcp_congestion_ops *ca; in tcp_get_available_congestion_control() local
248 list_for_each_entry_rcu(ca, &tcp_cong_list, list) { in tcp_get_available_congestion_control()
251 offs == 0 ? "" : " ", ca->name); in tcp_get_available_congestion_control()
259 struct tcp_congestion_ops *ca; in tcp_get_default_congestion_control() local
264 ca = list_entry(tcp_cong_list.next, struct tcp_congestion_ops, list); in tcp_get_default_congestion_control()
265 strncpy(name, ca->name, TCP_CA_NAME_MAX); in tcp_get_default_congestion_control()
272 struct tcp_congestion_ops *ca; in tcp_get_allowed_congestion_control() local
277 list_for_each_entry_rcu(ca, &tcp_cong_list, list) { in tcp_get_allowed_congestion_control()
278 if (!(ca->flags & TCP_CONG_NON_RESTRICTED)) in tcp_get_allowed_congestion_control()
282 offs == 0 ? "" : " ", ca->name); in tcp_get_allowed_congestion_control()
290 struct tcp_congestion_ops *ca; in tcp_set_allowed_congestion_control() local
301 ca = tcp_ca_find(name); in tcp_set_allowed_congestion_control()
302 if (!ca) { in tcp_set_allowed_congestion_control()
309 list_for_each_entry_rcu(ca, &tcp_cong_list, list) in tcp_set_allowed_congestion_control()
310 ca->flags &= ~TCP_CONG_NON_RESTRICTED; in tcp_set_allowed_congestion_control()
314 ca = tcp_ca_find(name); in tcp_set_allowed_congestion_control()
315 WARN_ON(!ca); in tcp_set_allowed_congestion_control()
316 if (ca) in tcp_set_allowed_congestion_control()
317 ca->flags |= TCP_CONG_NON_RESTRICTED; in tcp_set_allowed_congestion_control()
330 const struct tcp_congestion_ops *ca; in tcp_set_congestion_control() local
337 ca = __tcp_ca_find_autoload(name); in tcp_set_congestion_control()
339 if (ca == icsk->icsk_ca_ops) { in tcp_set_congestion_control()
343 if (!ca) in tcp_set_congestion_control()
345 else if (!((ca->flags & TCP_CONG_NON_RESTRICTED) || in tcp_set_congestion_control()
348 else if (!try_module_get(ca->owner)) in tcp_set_congestion_control()
351 tcp_reinit_congestion_control(sk, ca); in tcp_set_congestion_control()