• Home
  • Raw
  • Download

Lines Matching full:ca

52 	struct tcp_congestion_ops *ca = tcp_ca_find(name);  in tcp_ca_find_autoload()  local
55 if (!ca && capable(CAP_NET_ADMIN)) { in tcp_ca_find_autoload()
59 ca = tcp_ca_find(name); in tcp_ca_find_autoload()
62 return ca; in tcp_ca_find_autoload()
78 int tcp_validate_congestion_control(struct tcp_congestion_ops *ca) in tcp_validate_congestion_control() argument
81 if (!ca->ssthresh || !ca->undo_cwnd || in tcp_validate_congestion_control()
82 !(ca->cong_avoid || ca->cong_control)) { in tcp_validate_congestion_control()
83 pr_err("%s does not implement required ops\n", ca->name); in tcp_validate_congestion_control()
93 int tcp_register_congestion_control(struct tcp_congestion_ops *ca) in tcp_register_congestion_control() argument
97 ret = tcp_validate_congestion_control(ca); in tcp_register_congestion_control()
101 ca->key = jhash(ca->name, sizeof(ca->name), strlen(ca->name)); in tcp_register_congestion_control()
104 if (ca->key == TCP_CA_UNSPEC || tcp_ca_find_key(ca->key)) { in tcp_register_congestion_control()
106 ca->name); in tcp_register_congestion_control()
109 list_add_tail_rcu(&ca->list, &tcp_cong_list); in tcp_register_congestion_control()
110 pr_debug("%s registered\n", ca->name); in tcp_register_congestion_control()
124 void tcp_unregister_congestion_control(struct tcp_congestion_ops *ca) in tcp_unregister_congestion_control() argument
127 list_del_rcu(&ca->list); in tcp_unregister_congestion_control()
141 /* Replace a registered old ca with a new one.
143 * The new ca must have the same name as the old one, that has been
146 int tcp_update_congestion_control(struct tcp_congestion_ops *ca, struct tcp_congestion_ops *old_ca) in tcp_update_congestion_control() argument
151 ret = tcp_validate_congestion_control(ca); in tcp_update_congestion_control()
155 ca->key = jhash(ca->name, sizeof(ca->name), strlen(ca->name)); in tcp_update_congestion_control()
159 if (ca->key == TCP_CA_UNSPEC || !existing || strcmp(existing->name, ca->name)) { in tcp_update_congestion_control()
161 ca->name); in tcp_update_congestion_control()
170 list_add_tail_rcu(&ca->list, &tcp_cong_list); in tcp_update_congestion_control()
172 pr_debug("%s updated\n", ca->name); in tcp_update_congestion_control()
187 const struct tcp_congestion_ops *ca; in tcp_ca_get_key_by_name() local
193 ca = tcp_ca_find_autoload(net, name); in tcp_ca_get_key_by_name()
194 if (ca) { in tcp_ca_get_key_by_name()
195 key = ca->key; in tcp_ca_get_key_by_name()
196 *ecn_ca = ca->flags & TCP_CONG_NEEDS_ECN; in tcp_ca_get_key_by_name()
205 const struct tcp_congestion_ops *ca; in tcp_ca_get_name_by_key() local
209 ca = tcp_ca_find_key(key); in tcp_ca_get_name_by_key()
210 if (ca) in tcp_ca_get_name_by_key()
211 ret = strncpy(buffer, ca->name, in tcp_ca_get_name_by_key()
223 const struct tcp_congestion_ops *ca; in tcp_assign_congestion_control() local
226 ca = rcu_dereference(net->ipv4.tcp_congestion_control); in tcp_assign_congestion_control()
227 if (unlikely(!bpf_try_module_get(ca, ca->owner))) in tcp_assign_congestion_control()
228 ca = &tcp_reno; in tcp_assign_congestion_control()
229 icsk->icsk_ca_ops = ca; in tcp_assign_congestion_control()
233 if (ca->flags & TCP_CONG_NEEDS_ECN) in tcp_assign_congestion_control()
254 const struct tcp_congestion_ops *ca) in tcp_reinit_congestion_control() argument
259 icsk->icsk_ca_ops = ca; in tcp_reinit_congestion_control()
263 if (ca->flags & TCP_CONG_NEEDS_ECN) in tcp_reinit_congestion_control()
285 struct tcp_congestion_ops *ca; in tcp_set_default_congestion_control() local
290 ca = tcp_ca_find_autoload(net, name); in tcp_set_default_congestion_control()
291 if (!ca) { in tcp_set_default_congestion_control()
293 } else if (!bpf_try_module_get(ca, ca->owner)) { in tcp_set_default_congestion_control()
296 !(ca->flags & TCP_CONG_NON_RESTRICTED)) { in tcp_set_default_congestion_control()
300 prev = xchg(&net->ipv4.tcp_congestion_control, ca); in tcp_set_default_congestion_control()
304 ca->flags |= TCP_CONG_NON_RESTRICTED; in tcp_set_default_congestion_control()
323 struct tcp_congestion_ops *ca; in tcp_get_available_congestion_control() local
327 list_for_each_entry_rcu(ca, &tcp_cong_list, list) { in tcp_get_available_congestion_control()
330 offs == 0 ? "" : " ", ca->name); in tcp_get_available_congestion_control()
341 const struct tcp_congestion_ops *ca; in tcp_get_default_congestion_control() local
344 ca = rcu_dereference(net->ipv4.tcp_congestion_control); in tcp_get_default_congestion_control()
345 strncpy(name, ca->name, TCP_CA_NAME_MAX); in tcp_get_default_congestion_control()
352 struct tcp_congestion_ops *ca; in tcp_get_allowed_congestion_control() local
357 list_for_each_entry_rcu(ca, &tcp_cong_list, list) { in tcp_get_allowed_congestion_control()
358 if (!(ca->flags & TCP_CONG_NON_RESTRICTED)) in tcp_get_allowed_congestion_control()
362 offs == 0 ? "" : " ", ca->name); in tcp_get_allowed_congestion_control()
373 struct tcp_congestion_ops *ca; in tcp_set_allowed_congestion_control() local
384 ca = tcp_ca_find(name); in tcp_set_allowed_congestion_control()
385 if (!ca) { in tcp_set_allowed_congestion_control()
392 list_for_each_entry_rcu(ca, &tcp_cong_list, list) in tcp_set_allowed_congestion_control()
393 ca->flags &= ~TCP_CONG_NON_RESTRICTED; in tcp_set_allowed_congestion_control()
397 ca = tcp_ca_find(name); in tcp_set_allowed_congestion_control()
398 WARN_ON(!ca); in tcp_set_allowed_congestion_control()
399 if (ca) in tcp_set_allowed_congestion_control()
400 ca->flags |= TCP_CONG_NON_RESTRICTED; in tcp_set_allowed_congestion_control()
418 const struct tcp_congestion_ops *ca; in tcp_set_congestion_control() local
426 ca = tcp_ca_find(name); in tcp_set_congestion_control()
428 ca = tcp_ca_find_autoload(sock_net(sk), name); in tcp_set_congestion_control()
431 if (ca == icsk->icsk_ca_ops) { in tcp_set_congestion_control()
436 if (!ca) in tcp_set_congestion_control()
438 else if (!((ca->flags & TCP_CONG_NON_RESTRICTED) || cap_net_admin)) in tcp_set_congestion_control()
440 else if (!bpf_try_module_get(ca, ca->owner)) in tcp_set_congestion_control()
443 tcp_reinit_congestion_control(sk, ca); in tcp_set_congestion_control()