Lines Matching refs:msk
345 static inline void msk_owned_by_me(const struct mptcp_sock *msk) in msk_owned_by_me() argument
347 sock_owned_by_me((const struct sock *)msk); in msk_owned_by_me()
372 const struct mptcp_sock *msk = mptcp_sk(sk); in mptcp_send_head() local
374 return READ_ONCE(msk->first_pending); in mptcp_send_head()
379 struct mptcp_sock *msk = mptcp_sk(sk); in mptcp_send_next() local
382 cur = msk->first_pending; in mptcp_send_next()
383 return list_is_last(&cur->list, &msk->rtx_queue) ? NULL : in mptcp_send_next()
389 const struct mptcp_sock *msk = mptcp_sk(sk); in mptcp_pending_tail() local
391 if (!msk->first_pending) in mptcp_pending_tail()
394 if (WARN_ON_ONCE(list_empty(&msk->rtx_queue))) in mptcp_pending_tail()
397 return list_last_entry(&msk->rtx_queue, struct mptcp_data_frag, list); in mptcp_pending_tail()
402 struct mptcp_sock *msk = mptcp_sk(sk); in mptcp_rtx_head() local
404 if (msk->snd_una == READ_ONCE(msk->snd_nxt)) in mptcp_rtx_head()
407 return list_first_entry_or_null(&msk->rtx_queue, struct mptcp_data_frag, list); in mptcp_rtx_head()
434 struct mptcp_sock *msk; member
631 void __mptcp_subflow_fully_established(struct mptcp_sock *msk,
646 struct sock *__mptcp_nmpc_sk(struct mptcp_sock *msk);
669 int mptcp_init_sched(struct mptcp_sock *msk,
671 void mptcp_release_sched(struct mptcp_sock *msk);
674 struct sock *mptcp_subflow_get_send(struct mptcp_sock *msk);
675 struct sock *mptcp_subflow_get_retrans(struct mptcp_sock *msk);
676 int mptcp_sched_get_send(struct mptcp_sock *msk);
677 int mptcp_sched_get_retrans(struct mptcp_sock *msk);
679 static inline u64 mptcp_data_avail(const struct mptcp_sock *msk) in mptcp_data_avail() argument
681 return READ_ONCE(msk->bytes_received) - READ_ONCE(msk->bytes_consumed); in mptcp_data_avail()
743 void mptcp_reset_tout_timer(struct mptcp_sock *msk, unsigned long fail_tout);
772 void mptcp_rcv_space_init(struct mptcp_sock *msk, const struct sock *ssk);
792 bool mptcp_update_rcv_data_fin(struct mptcp_sock *msk, u64 data_fin_seq, bool use_64bit);
793 static inline bool mptcp_data_fin_enabled(const struct mptcp_sock *msk) in mptcp_data_fin_enabled() argument
795 return READ_ONCE(msk->snd_data_fin_enable) && in mptcp_data_fin_enabled()
796 READ_ONCE(msk->write_seq) == READ_ONCE(msk->snd_nxt); in mptcp_data_fin_enabled()
858 void mptcp_destroy_common(struct mptcp_sock *msk, unsigned int flags);
872 struct mptcp_sock *msk);
877 void mptcp_token_destroy(struct mptcp_sock *msk);
885 void mptcp_pm_data_init(struct mptcp_sock *msk);
886 void mptcp_pm_data_reset(struct mptcp_sock *msk);
895 void mptcp_pm_subflow_chk_stale(const struct mptcp_sock *msk, struct sock *ssk);
896 void mptcp_pm_nl_subflow_chk_stale(const struct mptcp_sock *msk, struct sock *ssk);
897 void mptcp_pm_new_connection(struct mptcp_sock *msk, const struct sock *ssk, int server_side);
898 void mptcp_pm_fully_established(struct mptcp_sock *msk, const struct sock *ssk);
899 bool mptcp_pm_allow_new_subflow(struct mptcp_sock *msk);
900 void mptcp_pm_connection_closed(struct mptcp_sock *msk);
901 void mptcp_pm_subflow_established(struct mptcp_sock *msk);
902 bool mptcp_pm_nl_check_work_pending(struct mptcp_sock *msk);
903 void mptcp_pm_subflow_check_next(struct mptcp_sock *msk, const struct sock *ssk,
907 void mptcp_pm_add_addr_echoed(struct mptcp_sock *msk,
909 void mptcp_pm_add_addr_send_ack(struct mptcp_sock *msk);
910 void mptcp_pm_nl_addr_send_ack(struct mptcp_sock *msk);
911 void mptcp_pm_rm_addr_received(struct mptcp_sock *msk,
915 int mptcp_pm_nl_mp_prio_send_ack(struct mptcp_sock *msk,
919 bool mptcp_pm_alloc_anno_list(struct mptcp_sock *msk,
921 void mptcp_pm_free_anno_list(struct mptcp_sock *msk);
922 bool mptcp_pm_sport_in_anno_list(struct mptcp_sock *msk, const struct sock *sk);
924 mptcp_pm_del_add_timer(struct mptcp_sock *msk,
927 mptcp_lookup_anno_list_by_saddr(const struct mptcp_sock *msk,
929 int mptcp_pm_get_flags_and_ifindex_by_id(struct mptcp_sock *msk,
932 int mptcp_pm_nl_get_flags_and_ifindex_by_id(struct mptcp_sock *msk, unsigned int id,
934 int mptcp_userspace_pm_get_flags_and_ifindex_by_id(struct mptcp_sock *msk,
944 int mptcp_pm_announce_addr(struct mptcp_sock *msk,
947 int mptcp_pm_remove_addr(struct mptcp_sock *msk, const struct mptcp_rm_list *rm_list);
948 void mptcp_pm_remove_addrs(struct mptcp_sock *msk, struct list_head *rm_list);
949 void mptcp_pm_remove_addrs_and_subflows(struct mptcp_sock *msk,
952 void mptcp_free_local_addr_list(struct mptcp_sock *msk);
958 void mptcp_event(enum mptcp_event_type type, const struct mptcp_sock *msk,
961 void mptcp_event_addr_removed(const struct mptcp_sock *msk, u8 id);
964 bool mptcp_userspace_pm_active(const struct mptcp_sock *msk);
966 void __mptcp_fastopen_gen_msk_ackseq(struct mptcp_sock *msk, struct mptcp_subflow_context *subflow,
971 static inline bool mptcp_pm_should_add_signal(struct mptcp_sock *msk) in mptcp_pm_should_add_signal() argument
973 return READ_ONCE(msk->pm.addr_signal) & in mptcp_pm_should_add_signal()
977 static inline bool mptcp_pm_should_add_signal_addr(struct mptcp_sock *msk) in mptcp_pm_should_add_signal_addr() argument
979 return READ_ONCE(msk->pm.addr_signal) & BIT(MPTCP_ADD_ADDR_SIGNAL); in mptcp_pm_should_add_signal_addr()
982 static inline bool mptcp_pm_should_add_signal_echo(struct mptcp_sock *msk) in mptcp_pm_should_add_signal_echo() argument
984 return READ_ONCE(msk->pm.addr_signal) & BIT(MPTCP_ADD_ADDR_ECHO); in mptcp_pm_should_add_signal_echo()
987 static inline bool mptcp_pm_should_rm_signal(struct mptcp_sock *msk) in mptcp_pm_should_rm_signal() argument
989 return READ_ONCE(msk->pm.addr_signal) & BIT(MPTCP_RM_ADDR_SIGNAL); in mptcp_pm_should_rm_signal()
992 static inline bool mptcp_pm_is_userspace(const struct mptcp_sock *msk) in mptcp_pm_is_userspace() argument
994 return READ_ONCE(msk->pm.pm_type) == MPTCP_PM_TYPE_USERSPACE; in mptcp_pm_is_userspace()
997 static inline bool mptcp_pm_is_kernel(const struct mptcp_sock *msk) in mptcp_pm_is_kernel() argument
999 return READ_ONCE(msk->pm.pm_type) == MPTCP_PM_TYPE_KERNEL; in mptcp_pm_is_kernel()
1025 bool mptcp_pm_add_addr_signal(struct mptcp_sock *msk, const struct sk_buff *skb,
1029 bool mptcp_pm_rm_addr_signal(struct mptcp_sock *msk, unsigned int remaining,
1031 int mptcp_pm_get_local_id(struct mptcp_sock *msk, struct sock_common *skc);
1032 int mptcp_pm_nl_get_local_id(struct mptcp_sock *msk, struct mptcp_addr_info *skc);
1033 int mptcp_userspace_pm_get_local_id(struct mptcp_sock *msk, struct mptcp_addr_info *skc);
1034 bool mptcp_pm_is_backup(struct mptcp_sock *msk, struct sock_common *skc);
1035 bool mptcp_pm_nl_is_backup(struct mptcp_sock *msk, struct mptcp_addr_info *skc);
1036 bool mptcp_userspace_pm_is_backup(struct mptcp_sock *msk, struct mptcp_addr_info *skc);
1048 void mptcp_pm_nl_work(struct mptcp_sock *msk);
1049 unsigned int mptcp_pm_get_add_addr_signal_max(const struct mptcp_sock *msk);
1050 unsigned int mptcp_pm_get_add_addr_accept_max(const struct mptcp_sock *msk);
1051 unsigned int mptcp_pm_get_subflows_max(const struct mptcp_sock *msk);
1052 unsigned int mptcp_pm_get_local_addr_max(const struct mptcp_sock *msk);
1055 static inline void __mptcp_pm_close_subflow(struct mptcp_sock *msk) in __mptcp_pm_close_subflow() argument
1057 if (--msk->pm.subflows < mptcp_pm_get_subflows_max(msk)) in __mptcp_pm_close_subflow()
1058 WRITE_ONCE(msk->pm.accept_subflow, true); in __mptcp_pm_close_subflow()
1061 static inline void mptcp_pm_close_subflow(struct mptcp_sock *msk) in mptcp_pm_close_subflow() argument
1063 spin_lock_bh(&msk->pm.lock); in mptcp_pm_close_subflow()
1064 __mptcp_pm_close_subflow(msk); in mptcp_pm_close_subflow()
1065 spin_unlock_bh(&msk->pm.lock); in mptcp_pm_close_subflow()
1068 void mptcp_sockopt_sync(struct mptcp_sock *msk, struct sock *ssk);
1069 void mptcp_sockopt_sync_locked(struct mptcp_sock *msk, struct sock *ssk);
1078 static inline bool __mptcp_check_fallback(const struct mptcp_sock *msk) in __mptcp_check_fallback() argument
1080 return test_bit(MPTCP_FALLBACK_DONE, &msk->flags); in __mptcp_check_fallback()
1086 struct mptcp_sock *msk = mptcp_sk(subflow->conn); in mptcp_check_fallback() local
1088 return __mptcp_check_fallback(msk); in mptcp_check_fallback()
1091 static inline void __mptcp_do_fallback(struct mptcp_sock *msk) in __mptcp_do_fallback() argument
1093 if (test_bit(MPTCP_FALLBACK_DONE, &msk->flags)) { in __mptcp_do_fallback()
1094 pr_debug("TCP fallback already done (msk=%p)", msk); in __mptcp_do_fallback()
1097 set_bit(MPTCP_FALLBACK_DONE, &msk->flags); in __mptcp_do_fallback()
1104 struct mptcp_sock *msk; in mptcp_do_fallback() local
1106 msk = mptcp_sk(sk); in mptcp_do_fallback()
1107 __mptcp_do_fallback(msk); in mptcp_do_fallback()
1108 if (READ_ONCE(msk->snd_data_fin_enable) && !(ssk->sk_shutdown & SEND_SHUTDOWN)) { in mptcp_do_fallback()