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 if (ca) { in tcp_ca_get_key_by_name()
127 key = ca->key; in tcp_ca_get_key_by_name()
128 *ecn_ca = ca->flags & TCP_CONG_NEEDS_ECN; in tcp_ca_get_key_by_name()
138 const struct tcp_congestion_ops *ca; in tcp_ca_get_name_by_key() local
142 ca = tcp_ca_find_key(key); in tcp_ca_get_name_by_key()
143 if (ca) in tcp_ca_get_name_by_key()
144 ret = strncpy(buffer, ca->name, in tcp_ca_get_name_by_key()
156 struct tcp_congestion_ops *ca; in tcp_assign_congestion_control() local
159 list_for_each_entry_rcu(ca, &tcp_cong_list, list) { in tcp_assign_congestion_control()
160 if (likely(try_module_get(ca->owner))) { in tcp_assign_congestion_control()
161 icsk->icsk_ca_ops = ca; in tcp_assign_congestion_control()
174 if (ca->get_info) in tcp_assign_congestion_control()
176 if (ca->flags & TCP_CONG_NEEDS_ECN) in tcp_assign_congestion_control()
195 const struct tcp_congestion_ops *ca) in tcp_reinit_congestion_control() argument
200 icsk->icsk_ca_ops = ca; in tcp_reinit_congestion_control()
220 struct tcp_congestion_ops *ca; in tcp_set_default_congestion_control() local
224 ca = tcp_ca_find(name); in tcp_set_default_congestion_control()
226 if (!ca && capable(CAP_NET_ADMIN)) { in tcp_set_default_congestion_control()
231 ca = tcp_ca_find(name); in tcp_set_default_congestion_control()
235 if (ca) { in tcp_set_default_congestion_control()
236 ca->flags |= TCP_CONG_NON_RESTRICTED; /* default is always allowed */ in tcp_set_default_congestion_control()
237 list_move(&ca->list, &tcp_cong_list); in tcp_set_default_congestion_control()
255 struct tcp_congestion_ops *ca; in tcp_get_available_congestion_control() local
259 list_for_each_entry_rcu(ca, &tcp_cong_list, list) { in tcp_get_available_congestion_control()
262 offs == 0 ? "" : " ", ca->name); in tcp_get_available_congestion_control()
270 struct tcp_congestion_ops *ca; in tcp_get_default_congestion_control() local
275 ca = list_entry(tcp_cong_list.next, struct tcp_congestion_ops, list); in tcp_get_default_congestion_control()
276 strncpy(name, ca->name, TCP_CA_NAME_MAX); in tcp_get_default_congestion_control()
283 struct tcp_congestion_ops *ca; in tcp_get_allowed_congestion_control() local
288 list_for_each_entry_rcu(ca, &tcp_cong_list, list) { in tcp_get_allowed_congestion_control()
289 if (!(ca->flags & TCP_CONG_NON_RESTRICTED)) in tcp_get_allowed_congestion_control()
293 offs == 0 ? "" : " ", ca->name); in tcp_get_allowed_congestion_control()
301 struct tcp_congestion_ops *ca; in tcp_set_allowed_congestion_control() local
312 ca = tcp_ca_find(name); in tcp_set_allowed_congestion_control()
313 if (!ca) { in tcp_set_allowed_congestion_control()
320 list_for_each_entry_rcu(ca, &tcp_cong_list, list) in tcp_set_allowed_congestion_control()
321 ca->flags &= ~TCP_CONG_NON_RESTRICTED; in tcp_set_allowed_congestion_control()
325 ca = tcp_ca_find(name); in tcp_set_allowed_congestion_control()
326 WARN_ON(!ca); in tcp_set_allowed_congestion_control()
327 if (ca) in tcp_set_allowed_congestion_control()
328 ca->flags |= TCP_CONG_NON_RESTRICTED; in tcp_set_allowed_congestion_control()
341 const struct tcp_congestion_ops *ca; in tcp_set_congestion_control() local
348 ca = __tcp_ca_find_autoload(name); in tcp_set_congestion_control()
350 if (ca == icsk->icsk_ca_ops) { in tcp_set_congestion_control()
354 if (!ca) in tcp_set_congestion_control()
356 else if (!((ca->flags & TCP_CONG_NON_RESTRICTED) || in tcp_set_congestion_control()
359 else if (!try_module_get(ca->owner)) in tcp_set_congestion_control()
362 tcp_reinit_congestion_control(sk, ca); in tcp_set_congestion_control()