• Home
  • Raw
  • Download

Lines Matching refs:ca

40 	struct tcp_congestion_ops *ca = tcp_ca_find(name);  in tcp_ca_find_autoload()  local
43 if (!ca && capable(CAP_NET_ADMIN)) { in tcp_ca_find_autoload()
47 ca = tcp_ca_find(name); in tcp_ca_find_autoload()
50 return ca; in tcp_ca_find_autoload()
70 int tcp_register_congestion_control(struct tcp_congestion_ops *ca) in tcp_register_congestion_control() argument
75 if (!ca->ssthresh || !ca->undo_cwnd || in tcp_register_congestion_control()
76 !(ca->cong_avoid || ca->cong_control)) { in tcp_register_congestion_control()
77 pr_err("%s does not implement required ops\n", ca->name); in tcp_register_congestion_control()
81 ca->key = jhash(ca->name, sizeof(ca->name), strlen(ca->name)); in tcp_register_congestion_control()
84 if (ca->key == TCP_CA_UNSPEC || tcp_ca_find_key(ca->key)) { in tcp_register_congestion_control()
86 ca->name); in tcp_register_congestion_control()
89 list_add_tail_rcu(&ca->list, &tcp_cong_list); in tcp_register_congestion_control()
90 pr_debug("%s registered\n", ca->name); in tcp_register_congestion_control()
104 void tcp_unregister_congestion_control(struct tcp_congestion_ops *ca) in tcp_unregister_congestion_control() argument
107 list_del_rcu(&ca->list); in tcp_unregister_congestion_control()
123 const struct tcp_congestion_ops *ca; in tcp_ca_get_key_by_name() local
129 ca = tcp_ca_find_autoload(net, name); in tcp_ca_get_key_by_name()
130 if (ca) { in tcp_ca_get_key_by_name()
131 key = ca->key; in tcp_ca_get_key_by_name()
132 *ecn_ca = ca->flags & TCP_CONG_NEEDS_ECN; in tcp_ca_get_key_by_name()
142 const struct tcp_congestion_ops *ca; in tcp_ca_get_name_by_key() local
146 ca = tcp_ca_find_key(key); in tcp_ca_get_name_by_key()
147 if (ca) in tcp_ca_get_name_by_key()
148 ret = strncpy(buffer, ca->name, in tcp_ca_get_name_by_key()
161 const struct tcp_congestion_ops *ca; in tcp_assign_congestion_control() local
164 ca = rcu_dereference(net->ipv4.tcp_congestion_control); in tcp_assign_congestion_control()
165 if (unlikely(!bpf_try_module_get(ca, ca->owner))) in tcp_assign_congestion_control()
166 ca = &tcp_reno; in tcp_assign_congestion_control()
167 icsk->icsk_ca_ops = ca; in tcp_assign_congestion_control()
171 if (ca->flags & TCP_CONG_NEEDS_ECN) in tcp_assign_congestion_control()
192 const struct tcp_congestion_ops *ca) in tcp_reinit_congestion_control() argument
197 icsk->icsk_ca_ops = ca; in tcp_reinit_congestion_control()
201 if (ca->flags & TCP_CONG_NEEDS_ECN) in tcp_reinit_congestion_control()
223 struct tcp_congestion_ops *ca; in tcp_set_default_congestion_control() local
228 ca = tcp_ca_find_autoload(net, name); in tcp_set_default_congestion_control()
229 if (!ca) { in tcp_set_default_congestion_control()
231 } else if (!bpf_try_module_get(ca, ca->owner)) { in tcp_set_default_congestion_control()
234 !(ca->flags & TCP_CONG_NON_RESTRICTED)) { in tcp_set_default_congestion_control()
238 prev = xchg(&net->ipv4.tcp_congestion_control, ca); in tcp_set_default_congestion_control()
242 ca->flags |= TCP_CONG_NON_RESTRICTED; in tcp_set_default_congestion_control()
261 struct tcp_congestion_ops *ca; in tcp_get_available_congestion_control() local
265 list_for_each_entry_rcu(ca, &tcp_cong_list, list) { in tcp_get_available_congestion_control()
268 offs == 0 ? "" : " ", ca->name); in tcp_get_available_congestion_control()
279 const struct tcp_congestion_ops *ca; in tcp_get_default_congestion_control() local
282 ca = rcu_dereference(net->ipv4.tcp_congestion_control); in tcp_get_default_congestion_control()
283 strncpy(name, ca->name, TCP_CA_NAME_MAX); in tcp_get_default_congestion_control()
290 struct tcp_congestion_ops *ca; in tcp_get_allowed_congestion_control() local
295 list_for_each_entry_rcu(ca, &tcp_cong_list, list) { in tcp_get_allowed_congestion_control()
296 if (!(ca->flags & TCP_CONG_NON_RESTRICTED)) in tcp_get_allowed_congestion_control()
300 offs == 0 ? "" : " ", ca->name); in tcp_get_allowed_congestion_control()
311 struct tcp_congestion_ops *ca; in tcp_set_allowed_congestion_control() local
322 ca = tcp_ca_find(name); in tcp_set_allowed_congestion_control()
323 if (!ca) { in tcp_set_allowed_congestion_control()
330 list_for_each_entry_rcu(ca, &tcp_cong_list, list) in tcp_set_allowed_congestion_control()
331 ca->flags &= ~TCP_CONG_NON_RESTRICTED; in tcp_set_allowed_congestion_control()
335 ca = tcp_ca_find(name); in tcp_set_allowed_congestion_control()
336 WARN_ON(!ca); in tcp_set_allowed_congestion_control()
337 if (ca) in tcp_set_allowed_congestion_control()
338 ca->flags |= TCP_CONG_NON_RESTRICTED; in tcp_set_allowed_congestion_control()
356 const struct tcp_congestion_ops *ca; in tcp_set_congestion_control() local
364 ca = tcp_ca_find(name); in tcp_set_congestion_control()
366 ca = tcp_ca_find_autoload(sock_net(sk), name); in tcp_set_congestion_control()
369 if (ca == icsk->icsk_ca_ops) { in tcp_set_congestion_control()
374 if (!ca) in tcp_set_congestion_control()
376 else if (!((ca->flags & TCP_CONG_NON_RESTRICTED) || cap_net_admin)) in tcp_set_congestion_control()
378 else if (!bpf_try_module_get(ca, ca->owner)) in tcp_set_congestion_control()
381 tcp_reinit_congestion_control(sk, ca); in tcp_set_congestion_control()