Lines Matching full:token

2 /* Multipath TCP token management
49 static struct token_bucket *token_bucket(u32 token) in token_bucket() argument
51 return &token_hash[token & token_mask]; in token_bucket()
56 __token_lookup_req(struct token_bucket *t, u32 token) in __token_lookup_req() argument
62 if (req->token == token) in __token_lookup_req()
69 __token_lookup_msk(struct token_bucket *t, u32 token) in __token_lookup_msk() argument
75 if (mptcp_sk(sk)->token == token) in __token_lookup_msk()
80 static bool __token_bucket_busy(struct token_bucket *t, u32 token) in __token_bucket_busy() argument
82 return !token || t->chain_len >= TOKEN_MAX_CHAIN_LEN || in __token_bucket_busy()
83 __token_lookup_req(t, token) || __token_lookup_msk(t, token); in __token_bucket_busy()
86 static void mptcp_crypto_key_gen_sha(u64 *key, u32 *token, u64 *idsn) in mptcp_crypto_key_gen_sha() argument
95 mptcp_crypto_key_sha(*key, token, idsn); in mptcp_crypto_key_gen_sha()
99 * mptcp_token_new_request - create new key/idsn/token for subflow_request
104 * It creates a unique token to identify the new mptcp connection,
113 u32 token; in mptcp_token_new_request() local
116 &subflow_req->token, in mptcp_token_new_request()
118 pr_debug("req=%p local_key=%llu, token=%u, idsn=%llu\n", in mptcp_token_new_request()
119 req, subflow_req->local_key, subflow_req->token, in mptcp_token_new_request()
122 token = subflow_req->token; in mptcp_token_new_request()
123 bucket = token_bucket(token); in mptcp_token_new_request()
125 if (__token_bucket_busy(bucket, token)) { in mptcp_token_new_request()
137 * mptcp_token_new_connect - create new key/idsn/token for subflow
143 * It creates a unique token to identify the new mptcp connection,
147 * the computed token at a later time, this is needed to process
159 pr_debug("ssk=%p, local_key=%llu, token=%u, idsn=%llu\n", in mptcp_token_new_connect()
160 sk, subflow->local_key, subflow->token, subflow->idsn); in mptcp_token_new_connect()
163 mptcp_crypto_key_gen_sha(&subflow->local_key, &subflow->token, in mptcp_token_new_connect()
166 bucket = token_bucket(subflow->token); in mptcp_token_new_connect()
168 if (__token_bucket_busy(bucket, subflow->token)) { in mptcp_token_new_connect()
175 WRITE_ONCE(msk->token, subflow->token); in mptcp_token_new_connect()
183 * mptcp_token_accept - replace a req sk with full sock in token hash
196 bucket = token_bucket(req->token); in mptcp_token_accept()
199 /* pedantic lookup check for the moved token */ in mptcp_token_accept()
200 pos = __token_lookup_req(bucket, req->token); in mptcp_token_accept()
207 bool mptcp_token_exists(u32 token) in mptcp_token_exists() argument
215 bucket = token_bucket(token); in mptcp_token_exists()
220 if (READ_ONCE(msk->token) == token) in mptcp_token_exists()
223 if (get_nulls_value(pos) != (token & token_mask)) in mptcp_token_exists()
234 * mptcp_token_get_sock - retrieve mptcp connection sock using its token
235 * @token: token of the mptcp connection to retrieve
237 * This function returns the mptcp connection structure with the given token.
240 * returns NULL if no connection with the given token value exists.
242 struct mptcp_sock *mptcp_token_get_sock(u32 token) in mptcp_token_get_sock() argument
250 bucket = token_bucket(token); in mptcp_token_get_sock()
255 if (READ_ONCE(msk->token) != token) in mptcp_token_get_sock()
259 if (READ_ONCE(msk->token) != token) { in mptcp_token_get_sock()
265 if (get_nulls_value(pos) != (token & token_mask)) in mptcp_token_get_sock()
278 * mptcp_token_iter_next - iterate over the token container from given pos
284 * token container starting from the specified position, or NULL.
337 * mptcp_token_destroy_request - remove mptcp connection/token
338 * @req: mptcp request socket dropping the token
340 * Remove the token associated to @req.
351 bucket = token_bucket(subflow_req->token); in mptcp_token_destroy_request()
353 pos = __token_lookup_req(bucket, subflow_req->token); in mptcp_token_destroy_request()
362 * mptcp_token_destroy - remove mptcp connection/token
363 * @msk: mptcp connection dropping the token
365 * Remove the token associated to @msk
375 bucket = token_bucket(msk->token); in mptcp_token_destroy()
377 pos = __token_lookup_msk(bucket, msk->token); in mptcp_token_destroy()
389 token_hash = alloc_large_system_hash("MPTCP token", in mptcp_token_init()