• Home
  • Raw
  • Download

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()
196 const struct tcp_congestion_ops *ca) in tcp_reinit_congestion_control() argument
201 icsk->icsk_ca_ops = ca; in tcp_reinit_congestion_control()
221 struct tcp_congestion_ops *ca; in tcp_set_default_congestion_control() local
225 ca = tcp_ca_find(name); in tcp_set_default_congestion_control()
227 if (!ca && capable(CAP_NET_ADMIN)) { in tcp_set_default_congestion_control()
232 ca = tcp_ca_find(name); in tcp_set_default_congestion_control()
236 if (ca) { in tcp_set_default_congestion_control()
237 ca->flags |= TCP_CONG_NON_RESTRICTED; /* default is always allowed */ in tcp_set_default_congestion_control()
238 list_move(&ca->list, &tcp_cong_list); in tcp_set_default_congestion_control()
256 struct tcp_congestion_ops *ca; in tcp_get_available_congestion_control() local
260 list_for_each_entry_rcu(ca, &tcp_cong_list, list) { in tcp_get_available_congestion_control()
263 offs == 0 ? "" : " ", ca->name); in tcp_get_available_congestion_control()
271 struct tcp_congestion_ops *ca; in tcp_get_default_congestion_control() local
276 ca = list_entry(tcp_cong_list.next, struct tcp_congestion_ops, list); in tcp_get_default_congestion_control()
277 strncpy(name, ca->name, TCP_CA_NAME_MAX); in tcp_get_default_congestion_control()
284 struct tcp_congestion_ops *ca; in tcp_get_allowed_congestion_control() local
289 list_for_each_entry_rcu(ca, &tcp_cong_list, list) { in tcp_get_allowed_congestion_control()
290 if (!(ca->flags & TCP_CONG_NON_RESTRICTED)) in tcp_get_allowed_congestion_control()
294 offs == 0 ? "" : " ", ca->name); in tcp_get_allowed_congestion_control()
302 struct tcp_congestion_ops *ca; in tcp_set_allowed_congestion_control() local
313 ca = tcp_ca_find(name); in tcp_set_allowed_congestion_control()
314 if (!ca) { in tcp_set_allowed_congestion_control()
321 list_for_each_entry_rcu(ca, &tcp_cong_list, list) in tcp_set_allowed_congestion_control()
322 ca->flags &= ~TCP_CONG_NON_RESTRICTED; in tcp_set_allowed_congestion_control()
326 ca = tcp_ca_find(name); in tcp_set_allowed_congestion_control()
327 WARN_ON(!ca); in tcp_set_allowed_congestion_control()
328 if (ca) in tcp_set_allowed_congestion_control()
329 ca->flags |= TCP_CONG_NON_RESTRICTED; in tcp_set_allowed_congestion_control()
342 const struct tcp_congestion_ops *ca; in tcp_set_congestion_control() local
349 ca = __tcp_ca_find_autoload(name); in tcp_set_congestion_control()
351 if (ca == icsk->icsk_ca_ops) { in tcp_set_congestion_control()
355 if (!ca) in tcp_set_congestion_control()
357 else if (!((ca->flags & TCP_CONG_NON_RESTRICTED) || in tcp_set_congestion_control()
360 else if (!try_module_get(ca->owner)) in tcp_set_congestion_control()
363 tcp_reinit_congestion_control(sk, ca); in tcp_set_congestion_control()