Lines Matching refs:ca

52 	struct tcp_congestion_ops *ca = tcp_ca_find(name);
55 if (!ca && capable(CAP_NET_ADMIN)) {
59 ca = tcp_ca_find(name);
62 return ca;
78 int tcp_validate_congestion_control(struct tcp_congestion_ops *ca)
81 if (!ca->ssthresh || !ca->undo_cwnd ||
82 !(ca->cong_avoid || ca->cong_control)) {
83 pr_err("%s does not implement required ops\n", ca->name);
93 int tcp_register_congestion_control(struct tcp_congestion_ops *ca)
97 ret = tcp_validate_congestion_control(ca);
101 ca->key = jhash(ca->name, sizeof(ca->name), strlen(ca->name));
104 if (ca->key == TCP_CA_UNSPEC || tcp_ca_find_key(ca->key)) {
106 ca->name);
109 list_add_tail_rcu(&ca->list, &tcp_cong_list);
110 pr_debug("%s registered\n", ca->name);
124 void tcp_unregister_congestion_control(struct tcp_congestion_ops *ca)
127 list_del_rcu(&ca->list);
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)
151 ca->key = jhash(ca->name, sizeof(ca->name), strlen(ca->name));
155 if (ca->key == TCP_CA_UNSPEC || !existing || strcmp(existing->name, ca->name)) {
157 ca->name);
166 list_add_tail_rcu(&ca->list, &tcp_cong_list);
168 pr_debug("%s updated\n", ca->name);
183 const struct tcp_congestion_ops *ca;
189 ca = tcp_ca_find_autoload(net, name);
190 if (ca) {
191 key = ca->key;
192 *ecn_ca = ca->flags & TCP_CONG_NEEDS_ECN;
201 const struct tcp_congestion_ops *ca;
205 ca = tcp_ca_find_key(key);
206 if (ca)
207 ret = strncpy(buffer, ca->name,
219 const struct tcp_congestion_ops *ca;
222 ca = rcu_dereference(net->ipv4.tcp_congestion_control);
223 if (unlikely(!bpf_try_module_get(ca, ca->owner)))
224 ca = &tcp_reno;
225 icsk->icsk_ca_ops = ca;
229 if (ca->flags & TCP_CONG_NEEDS_ECN)
250 const struct tcp_congestion_ops *ca)
255 icsk->icsk_ca_ops = ca;
259 if (ca->flags & TCP_CONG_NEEDS_ECN)
281 struct tcp_congestion_ops *ca;
286 ca = tcp_ca_find_autoload(net, name);
287 if (!ca) {
289 } else if (!bpf_try_module_get(ca, ca->owner)) {
292 !(ca->flags & TCP_CONG_NON_RESTRICTED)) {
296 prev = xchg(&net->ipv4.tcp_congestion_control, ca);
300 ca->flags |= TCP_CONG_NON_RESTRICTED;
319 struct tcp_congestion_ops *ca;
323 list_for_each_entry_rcu(ca, &tcp_cong_list, list) {
326 offs == 0 ? "" : " ", ca->name);
337 const struct tcp_congestion_ops *ca;
340 ca = rcu_dereference(net->ipv4.tcp_congestion_control);
341 strncpy(name, ca->name, TCP_CA_NAME_MAX);
348 struct tcp_congestion_ops *ca;
353 list_for_each_entry_rcu(ca, &tcp_cong_list, list) {
354 if (!(ca->flags & TCP_CONG_NON_RESTRICTED))
358 offs == 0 ? "" : " ", ca->name);
369 struct tcp_congestion_ops *ca;
380 ca = tcp_ca_find(name);
381 if (!ca) {
388 list_for_each_entry_rcu(ca, &tcp_cong_list, list)
389 ca->flags &= ~TCP_CONG_NON_RESTRICTED;
393 ca = tcp_ca_find(name);
394 WARN_ON(!ca);
395 if (ca)
396 ca->flags |= TCP_CONG_NON_RESTRICTED;
414 const struct tcp_congestion_ops *ca;
422 ca = tcp_ca_find(name);
424 ca = tcp_ca_find_autoload(sock_net(sk), name);
427 if (ca == icsk->icsk_ca_ops) {
432 if (!ca)
434 else if (!((ca->flags & TCP_CONG_NON_RESTRICTED) || cap_net_admin))
436 else if (!bpf_try_module_get(ca, ca->owner))
439 tcp_reinit_congestion_control(sk, ca);