Lines Matching +full:ulp +full:- +full:0

1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright (c) 2016-2017, Mellanox Technologies. All rights reserved.
6 * Copyright (c) 2016-2017, Dave Watson <davejwatson@fb.com>. All rights reserved.
27 if (strcmp(e->name, name) == 0) in tcp_ulp_find()
36 const struct tcp_ulp_ops *ulp = NULL; in __tcp_ulp_find_autoload() local
39 ulp = tcp_ulp_find(name); in __tcp_ulp_find_autoload()
42 if (!ulp && capable(CAP_NET_ADMIN)) { in __tcp_ulp_find_autoload()
44 request_module("tcp-ulp-%s", name); in __tcp_ulp_find_autoload()
46 ulp = tcp_ulp_find(name); in __tcp_ulp_find_autoload()
49 if (!ulp || !try_module_get(ulp->owner)) in __tcp_ulp_find_autoload()
50 ulp = NULL; in __tcp_ulp_find_autoload()
53 return ulp; in __tcp_ulp_find_autoload()
59 int tcp_register_ulp(struct tcp_ulp_ops *ulp) in tcp_register_ulp() argument
61 int ret = 0; in tcp_register_ulp()
64 if (tcp_ulp_find(ulp->name)) in tcp_register_ulp()
65 ret = -EEXIST; in tcp_register_ulp()
67 list_add_tail_rcu(&ulp->list, &tcp_ulp_list); in tcp_register_ulp()
74 void tcp_unregister_ulp(struct tcp_ulp_ops *ulp) in tcp_unregister_ulp() argument
77 list_del_rcu(&ulp->list); in tcp_unregister_ulp()
88 size_t offs = 0; in tcp_get_available_ulp()
90 *buf = '\0'; in tcp_get_available_ulp()
93 offs += snprintf(buf + offs, maxlen - offs, in tcp_get_available_ulp()
95 offs == 0 ? "" : " ", ulp_ops->name); in tcp_get_available_ulp()
108 if (icsk->icsk_ulp_ops->update) in tcp_update_ulp()
109 icsk->icsk_ulp_ops->update(sk, proto, write_space); in tcp_update_ulp()
120 if (!icsk->icsk_ulp_ops) in tcp_cleanup_ulp()
123 if (icsk->icsk_ulp_ops->release) in tcp_cleanup_ulp()
124 icsk->icsk_ulp_ops->release(sk); in tcp_cleanup_ulp()
125 module_put(icsk->icsk_ulp_ops->owner); in tcp_cleanup_ulp()
127 icsk->icsk_ulp_ops = NULL; in tcp_cleanup_ulp()
135 err = -EEXIST; in __tcp_set_ulp()
136 if (icsk->icsk_ulp_ops) in __tcp_set_ulp()
139 if (sk->sk_socket) in __tcp_set_ulp()
140 clear_bit(SOCK_SUPPORT_ZC, &sk->sk_socket->flags); in __tcp_set_ulp()
142 err = -ENOTCONN; in __tcp_set_ulp()
143 if (!ulp_ops->clone && sk->sk_state == TCP_LISTEN) in __tcp_set_ulp()
146 err = ulp_ops->init(sk); in __tcp_set_ulp()
150 icsk->icsk_ulp_ops = ulp_ops; in __tcp_set_ulp()
151 return 0; in __tcp_set_ulp()
153 module_put(ulp_ops->owner); in __tcp_set_ulp()
165 return -ENOENT; in tcp_set_ulp()