• Home
  • Raw
  • Download

Lines Matching refs:msk

45 	if (subflow_req->msk)  in subflow_req_destructor()
46 sock_put((struct sock *)subflow_req->msk); in subflow_req_destructor()
62 static bool mptcp_can_accept_new_subflow(const struct mptcp_sock *msk) in mptcp_can_accept_new_subflow() argument
64 return mptcp_is_fully_established((void *)msk) && in mptcp_can_accept_new_subflow()
65 ((mptcp_pm_is_userspace(msk) && in mptcp_can_accept_new_subflow()
66 mptcp_userspace_pm_active(msk)) || in mptcp_can_accept_new_subflow()
67 READ_ONCE(msk->pm.accept_subflow)); in mptcp_can_accept_new_subflow()
73 struct mptcp_sock *msk = subflow_req->msk; in subflow_req_create_thmac() local
78 subflow_generate_hmac(msk->local_key, msk->remote_key, in subflow_req_create_thmac()
88 struct mptcp_sock *msk; in subflow_token_join_request() local
91 msk = mptcp_token_get_sock(sock_net(req_to_sk(req)), subflow_req->token); in subflow_token_join_request()
92 if (!msk) { in subflow_token_join_request()
97 local_id = mptcp_pm_get_local_id(msk, (struct sock_common *)req); in subflow_token_join_request()
99 sock_put((struct sock *)msk); in subflow_token_join_request()
103 subflow_req->request_bkup = mptcp_pm_is_backup(msk, (struct sock_common *)req); in subflow_token_join_request()
105 return msk; in subflow_token_join_request()
116 subflow_req->msk = NULL; in subflow_init_req()
120 static bool subflow_use_different_sport(struct mptcp_sock *msk, const struct sock *sk) in subflow_use_different_sport() argument
122 return inet_sk(sk)->inet_sport != inet_sk((struct sock *)msk)->inet_sport; in subflow_use_different_sport()
213 subflow_req->msk = subflow_token_join_request(req); in subflow_check_req()
216 if (!subflow_req->msk) { in subflow_check_req()
221 if (subflow_use_different_sport(subflow_req->msk, sk_listener)) { in subflow_check_req()
224 ntohs(inet_sk((struct sock *)subflow_req->msk)->inet_sport)); in subflow_check_req()
225 if (!mptcp_pm_sport_in_anno_list(subflow_req->msk, sk_listener)) { in subflow_check_req()
235 if (mptcp_can_accept_new_subflow(subflow_req->msk)) in subflow_check_req()
242 subflow_req->remote_nonce, subflow_req->msk); in subflow_check_req()
421 static bool subflow_use_different_dport(struct mptcp_sock *msk, const struct sock *sk) in subflow_use_different_dport() argument
423 return inet_sk(sk)->inet_dport != inet_sk((struct sock *)msk)->inet_dport; in subflow_use_different_dport()
429 struct mptcp_sock *msk = mptcp_sk(sk); in __mptcp_sync_state() local
430 struct sock *ssk = msk->first; in __mptcp_sync_state()
434 if (!msk->rcvspace_init) in __mptcp_sync_state()
435 mptcp_rcv_space_init(msk, ssk); in __mptcp_sync_state()
441 WRITE_ONCE(msk->write_seq, subflow->idsn + 1); in __mptcp_sync_state()
442 WRITE_ONCE(msk->snd_nxt, msk->write_seq); in __mptcp_sync_state()
448 static void subflow_set_remote_key(struct mptcp_sock *msk, in subflow_set_remote_key() argument
463 WRITE_ONCE(msk->remote_key, subflow->remote_key); in subflow_set_remote_key()
464 WRITE_ONCE(msk->ack_seq, subflow->iasn); in subflow_set_remote_key()
465 WRITE_ONCE(msk->can_ack, true); in subflow_set_remote_key()
466 atomic64_set(&msk->rcv_wnd_sent, subflow->iasn); in subflow_set_remote_key()
473 struct mptcp_sock *msk = mptcp_sk(sk); in mptcp_propagate_state() local
480 WRITE_ONCE(msk->snd_una, subflow->idsn + 1); in mptcp_propagate_state()
481 WRITE_ONCE(msk->wnd_end, subflow->idsn + 1 + tcp_sk(ssk)->snd_wnd); in mptcp_propagate_state()
482 subflow_set_remote_key(msk, subflow, mp_opt); in mptcp_propagate_state()
488 msk->pending_state = ssk->sk_state; in mptcp_propagate_state()
489 __set_bit(MPTCP_SYNC_STATE, &msk->cb_flags); in mptcp_propagate_state()
499 struct mptcp_sock *msk; in subflow_finish_connect() local
507 msk = mptcp_sk(parent); in subflow_finish_connect()
519 pr_fallback(msk); in subflow_finish_connect()
524 WRITE_ONCE(msk->csum_enabled, true); in subflow_finish_connect()
526 WRITE_ONCE(msk->pm.remote_deny_join_id0, true); in subflow_finish_connect()
568 if (subflow_use_different_dport(msk, sk)) { in subflow_finish_connect()
594 struct mptcp_sock *msk = mptcp_sk(subflow->conn); in subflow_chk_local_id() local
600 err = mptcp_pm_get_local_id(msk, (struct sock_common *)sk); in subflow_chk_local_id()
605 subflow->request_bkup = mptcp_pm_is_backup(msk, (struct sock_common *)sk); in subflow_chk_local_id()
719 struct mptcp_sock *msk; in subflow_hmac_valid() local
722 msk = subflow_req->msk; in subflow_hmac_valid()
723 if (!msk) in subflow_hmac_valid()
726 subflow_generate_hmac(msk->remote_key, msk->local_key, in subflow_hmac_valid()
763 void __mptcp_subflow_fully_established(struct mptcp_sock *msk, in __mptcp_subflow_fully_established() argument
767 subflow_set_remote_key(msk, subflow, mp_opt); in __mptcp_subflow_fully_established()
769 WRITE_ONCE(msk->fully_established, true); in __mptcp_subflow_fully_established()
772 __mptcp_fastopen_gen_msk_ackseq(msk, subflow, mp_opt); in __mptcp_subflow_fully_established()
822 !mptcp_can_accept_new_subflow(subflow_req->msk)) { in subflow_syn_recv_sock()
869 owner = subflow_req->msk; in subflow_syn_recv_sock()
876 subflow_req->msk = NULL; in subflow_syn_recv_sock()
1055 struct mptcp_sock *msk) in get_mapping_status() argument
1058 bool csum_reqd = READ_ONCE(msk->csum_enabled); in get_mapping_status()
1105 bool updated = mptcp_update_rcv_data_fin(msk, mpext->data_seq, in get_mapping_status()
1118 mptcp_schedule_work((struct sock *)msk); in get_mapping_status()
1131 mptcp_update_rcv_data_fin(msk, data_fin_seq, mpext->dsn64); in get_mapping_status()
1140 map_seq = mptcp_expand_seq(READ_ONCE(msk->ack_seq), mpext->data_seq, mpext->dsn64); in get_mapping_status()
1227 static void subflow_sched_work_if_closed(struct mptcp_sock *msk, struct sock *ssk) in subflow_sched_work_if_closed() argument
1233 !test_and_set_bit(MPTCP_WORK_CLOSE_SUBFLOW, &msk->flags)) in subflow_sched_work_if_closed()
1234 mptcp_schedule_work((struct sock *)msk); in subflow_sched_work_if_closed()
1239 struct mptcp_sock *msk = mptcp_sk(subflow->conn); in subflow_can_fallback() local
1243 else if (READ_ONCE(msk->csum_enabled)) in subflow_can_fallback()
1249 static void mptcp_subflow_fail(struct mptcp_sock *msk, struct sock *ssk) in mptcp_subflow_fail() argument
1255 if (WARN_ON_ONCE(ssk != READ_ONCE(msk->first))) in mptcp_subflow_fail()
1261 if (sock_flag((struct sock *)msk, SOCK_DEAD)) in mptcp_subflow_fail()
1273 mptcp_reset_tout_timer(msk, subflow->fail_tout); in mptcp_subflow_fail()
1280 struct mptcp_sock *msk; in subflow_check_data_avail() local
1288 msk = mptcp_sk(subflow->conn); in subflow_check_data_avail()
1293 status = get_mapping_status(ssk, msk); in subflow_check_data_avail()
1306 if (unlikely(!READ_ONCE(msk->can_ack))) in subflow_check_data_avail()
1309 old_ack = READ_ONCE(msk->ack_seq); in subflow_check_data_avail()
1324 subflow_sched_work_if_closed(msk, ssk); in subflow_check_data_avail()
1328 if (!__mptcp_check_fallback(msk)) { in subflow_check_data_avail()
1334 if (!READ_ONCE(msk->allow_infinite_fallback)) { in subflow_check_data_avail()
1339 mptcp_subflow_fail(msk, ssk); in subflow_check_data_avail()
1366 subflow->map_seq = READ_ONCE(msk->ack_seq); in subflow_check_data_avail()
1433 struct mptcp_sock *msk; in subflow_data_ready() local
1437 msk = mptcp_sk(parent); in subflow_data_ready()
1449 WARN_ON_ONCE(!__mptcp_check_fallback(msk) && !subflow->mp_capable && in subflow_data_ready()
1458 if (mptcp_data_avail(msk) < parent->sk_rcvlowat && in subflow_data_ready()
1538 struct mptcp_sock *msk = mptcp_sk(sk); in __mptcp_subflow_connect() local
1567 mptcp_pm_get_flags_and_ifindex_by_id(msk, local_id, in __mptcp_subflow_connect()
1570 subflow->remote_key = msk->remote_key; in __mptcp_subflow_connect()
1571 subflow->local_key = msk->local_key; in __mptcp_subflow_connect()
1572 subflow->token = msk->token; in __mptcp_subflow_connect()
1580 mptcp_sockopt_sync(msk, ssk); in __mptcp_subflow_connect()
1588 pr_debug("msk=%p remote_token=%u local_id=%d remote_id=%d", msk, in __mptcp_subflow_connect()
1594 subflow->subflow_id = msk->subflow_id++; in __mptcp_subflow_connect()
1598 list_add_tail(&subflow->node, &msk->conn_list); in __mptcp_subflow_connect()
1606 WRITE_ONCE(msk->allow_infinite_fallback, false); in __mptcp_subflow_connect()
1622 mptcp_pm_close_subflow(msk); in __mptcp_subflow_connect()
1778 struct mptcp_sock *msk; in subflow_state_change() local
1782 msk = mptcp_sk(parent); in subflow_state_change()
1785 pr_fallback(msk); in subflow_state_change()
1804 if (__mptcp_check_fallback(msk) && subflow_is_done(sk) && msk->first == sk && in subflow_state_change()
1805 mptcp_update_rcv_data_fin(msk, READ_ONCE(msk->ack_seq), true)) in subflow_state_change()