• Home
  • Raw
  • Download

Lines Matching refs:ssk

264 static bool __mptcp_move_skb(struct mptcp_sock *msk, struct sock *ssk,  in __mptcp_move_skb()  argument
268 struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(ssk); in __mptcp_move_skb()
272 __skb_unlink(skb, &ssk->sk_receive_queue); in __mptcp_move_skb()
281 if (ssk->sk_forward_alloc < amount) in __mptcp_move_skb()
284 ssk->sk_forward_alloc -= amount; in __mptcp_move_skb()
383 static void mptcp_set_timeout(const struct sock *sk, const struct sock *ssk) in mptcp_set_timeout() argument
385 long tout = ssk && inet_csk(ssk)->icsk_pending ? in mptcp_set_timeout()
386 inet_csk(ssk)->icsk_timeout - jiffies : 0; in mptcp_set_timeout()
443 struct sock *ssk = mptcp_subflow_tcp_sock(subflow); in mptcp_check_data_fin() local
445 lock_sock(ssk); in mptcp_check_data_fin()
446 tcp_send_ack(ssk); in mptcp_check_data_fin()
447 release_sock(ssk); in mptcp_check_data_fin()
461 struct sock *ssk, in __mptcp_move_skbs_from_subflow() argument
464 struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(ssk); in __mptcp_move_skbs_from_subflow()
472 pr_debug("msk=%p ssk=%p", msk, ssk); in __mptcp_move_skbs_from_subflow()
473 tp = tcp_sk(ssk); in __mptcp_move_skbs_from_subflow()
485 skb = skb_peek(&ssk->sk_receive_queue); in __mptcp_move_skbs_from_subflow()
518 if (__mptcp_move_skb(msk, ssk, skb, offset, len)) in __mptcp_move_skbs_from_subflow()
526 sk_eat_skb(ssk, skb); in __mptcp_move_skbs_from_subflow()
531 more_data_avail = mptcp_subflow_data_available(ssk); in __mptcp_move_skbs_from_subflow()
541 tcp_cleanup_rbuf(ssk, 1); in __mptcp_move_skbs_from_subflow()
592 static bool move_skbs_to_msk(struct mptcp_sock *msk, struct sock *ssk) in move_skbs_to_msk() argument
605 __mptcp_move_skbs_from_subflow(msk, ssk, &moved); in move_skbs_to_msk()
623 void mptcp_data_ready(struct sock *sk, struct sock *ssk) in mptcp_data_ready() argument
625 struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(ssk); in mptcp_data_ready()
638 move_skbs_to_msk(msk, ssk)) in mptcp_data_ready()
653 move_skbs_to_msk(msk, ssk); in mptcp_data_ready()
891 static int mptcp_sendmsg_frag(struct sock *sk, struct sock *ssk, in mptcp_sendmsg_frag() argument
922 mss_now = tcp_send_mss(ssk, &size_goal, msg->msg_flags); in mptcp_sendmsg_frag()
926 skb = tcp_write_queue_tail(ssk); in mptcp_sendmsg_frag()
980 ret = do_tcp_sendpages(ssk, page, offset, psize, in mptcp_sendmsg_frag()
1016 tail = tcp_write_queue_tail(ssk); in mptcp_sendmsg_frag()
1023 skb = tcp_write_queue_tail(ssk); in mptcp_sendmsg_frag()
1029 mpext->subflow_seq = mptcp_subflow_ctx(ssk)->rel_write_seq; in mptcp_sendmsg_frag()
1042 mptcp_subflow_ctx(ssk)->rel_write_seq += ret; in mptcp_sendmsg_frag()
1055 struct sock *ssk = mptcp_subflow_tcp_sock(subflow); in mptcp_nospace() local
1056 struct socket *sock = READ_ONCE(ssk->sk_socket); in mptcp_nospace()
1066 struct sock *ssk = mptcp_subflow_tcp_sock(subflow); in mptcp_subflow_active() local
1073 return ((1 << ssk->sk_state) & (TCPF_ESTABLISHED | TCPF_CLOSE_WAIT)); in mptcp_subflow_active()
1083 struct sock *ssk; member
1093 struct sock *ssk; in mptcp_subflow_get_send() local
1115 ssk = mptcp_subflow_tcp_sock(subflow); in mptcp_subflow_get_send()
1116 *sndbuf = max(tcp_sk(ssk)->snd_wnd, *sndbuf); in mptcp_subflow_get_send()
1123 send_info[i].ssk = NULL; in mptcp_subflow_get_send()
1127 ssk = mptcp_subflow_tcp_sock(subflow); in mptcp_subflow_get_send()
1132 *sndbuf = max(tcp_sk(ssk)->snd_wnd, *sndbuf); in mptcp_subflow_get_send()
1136 pace = READ_ONCE(ssk->sk_pacing_rate); in mptcp_subflow_get_send()
1140 ratio = div_u64((u64)READ_ONCE(ssk->sk_wmem_queued) << 32, in mptcp_subflow_get_send()
1143 send_info[subflow->backup].ssk = ssk; in mptcp_subflow_get_send()
1149 msk, nr_active, send_info[0].ssk, send_info[0].ratio, in mptcp_subflow_get_send()
1150 send_info[1].ssk, send_info[1].ratio); in mptcp_subflow_get_send()
1154 send_info[0].ssk = send_info[1].ssk; in mptcp_subflow_get_send()
1156 if (send_info[0].ssk) { in mptcp_subflow_get_send()
1157 msk->last_snd = send_info[0].ssk; in mptcp_subflow_get_send()
1177 struct sock *ssk; in mptcp_sendmsg() local
1205 ssk = mptcp_subflow_get_send(msk, &sndbuf); in mptcp_sendmsg()
1207 !ssk || in mptcp_sendmsg()
1208 !mptcp_page_frag_refill(ssk, pfrag)) { in mptcp_sendmsg()
1209 if (ssk) { in mptcp_sendmsg()
1217 mptcp_set_timeout(sk, ssk); in mptcp_sendmsg()
1229 ssk = mptcp_subflow_get_send(msk, &sndbuf); in mptcp_sendmsg()
1241 pr_debug("conn_list->subflow=%p", ssk); in mptcp_sendmsg()
1243 lock_sock(ssk); in mptcp_sendmsg()
1246 ret = mptcp_sendmsg_frag(sk, ssk, msg, NULL, &timeo, &mss_now, in mptcp_sendmsg()
1250 mptcp_set_timeout(sk, ssk); in mptcp_sendmsg()
1251 release_sock(ssk); in mptcp_sendmsg()
1267 if (!sk_stream_memory_free(ssk) || in mptcp_sendmsg()
1268 !mptcp_page_frag_refill(ssk, pfrag) || in mptcp_sendmsg()
1270 tcp_push(ssk, msg->msg_flags, mss_now, in mptcp_sendmsg()
1271 tcp_sk(ssk)->nonagle, size_goal); in mptcp_sendmsg()
1272 mptcp_set_timeout(sk, ssk); in mptcp_sendmsg()
1273 release_sock(ssk); in mptcp_sendmsg()
1291 tcp_push(ssk, msg->msg_flags, mss_now, in mptcp_sendmsg()
1292 tcp_sk(ssk)->nonagle, size_goal); in mptcp_sendmsg()
1300 mptcp_set_timeout(sk, ssk); in mptcp_sendmsg()
1301 release_sock(ssk); in mptcp_sendmsg()
1307 mptcp_set_timeout(sk, ssk); in mptcp_sendmsg()
1309 tcp_push(ssk, msg->msg_flags, mss_now, tcp_sk(ssk)->nonagle, in mptcp_sendmsg()
1317 release_sock(ssk); in mptcp_sendmsg()
1456 struct sock *ssk; in mptcp_rcv_space_adjust() local
1459 ssk = mptcp_subflow_tcp_sock(subflow); in mptcp_rcv_space_adjust()
1460 slow = lock_sock_fast(ssk); in mptcp_rcv_space_adjust()
1461 WRITE_ONCE(ssk->sk_rcvbuf, rcvbuf); in mptcp_rcv_space_adjust()
1462 tcp_sk(ssk)->window_clamp = window_clamp; in mptcp_rcv_space_adjust()
1463 tcp_cleanup_rbuf(ssk, 1); in mptcp_rcv_space_adjust()
1464 unlock_sock_fast(ssk, slow); in mptcp_rcv_space_adjust()
1486 struct sock *ssk = mptcp_subflow_recv_lookup(msk); in __mptcp_move_skbs() local
1488 if (!ssk) in __mptcp_move_skbs()
1491 lock_sock(ssk); in __mptcp_move_skbs()
1492 done = __mptcp_move_skbs_from_subflow(msk, ssk, &moved); in __mptcp_move_skbs()
1493 release_sock(ssk); in __mptcp_move_skbs()
1653 struct sock *ssk = mptcp_subflow_tcp_sock(subflow); in mptcp_subflow_get_retrans() local
1659 if (!tcp_write_queue_empty(ssk)) { in mptcp_subflow_get_retrans()
1660 if (inet_csk(ssk)->icsk_ca_state >= TCP_CA_Loss) in mptcp_subflow_get_retrans()
1667 backup = ssk; in mptcp_subflow_get_retrans()
1671 return ssk; in mptcp_subflow_get_retrans()
1685 void __mptcp_close_ssk(struct sock *sk, struct sock *ssk, in __mptcp_close_ssk() argument
1689 struct socket *sock = READ_ONCE(ssk->sk_socket); in __mptcp_close_ssk()
1698 tcp_close(ssk, timeout); in __mptcp_close_ssk()
1739 struct sock *ssk = mptcp_subflow_tcp_sock(subflow); in __mptcp_close_subflow() local
1741 if (inet_sk_state_load(ssk) != TCP_CLOSE) in __mptcp_close_subflow()
1744 __mptcp_close_ssk((struct sock *)msk, ssk, subflow, 0); in __mptcp_close_subflow()
1751 struct sock *ssk, *sk = &msk->sk.icsk_inet.sk; in mptcp_worker() local
1788 ssk = mptcp_subflow_get_retrans(msk); in mptcp_worker()
1789 if (!ssk) in mptcp_worker()
1792 lock_sock(ssk); in mptcp_worker()
1798 int ret = mptcp_sendmsg_frag(sk, ssk, &msg, dfrag, &timeo, in mptcp_worker()
1812 tcp_push(ssk, msg.msg_flags, mss_now, tcp_sk(ssk)->nonagle, in mptcp_worker()
1819 mptcp_set_timeout(sk, ssk); in mptcp_worker()
1820 release_sock(ssk); in mptcp_worker()
1900 void mptcp_subflow_shutdown(struct sock *sk, struct sock *ssk, int how) in mptcp_subflow_shutdown() argument
1902 lock_sock(ssk); in mptcp_subflow_shutdown()
1904 switch (ssk->sk_state) { in mptcp_subflow_shutdown()
1910 tcp_disconnect(ssk, O_NONBLOCK); in mptcp_subflow_shutdown()
1915 ssk->sk_shutdown |= how; in mptcp_subflow_shutdown()
1916 tcp_shutdown(ssk, how); in mptcp_subflow_shutdown()
1918 pr_debug("Sending DATA_FIN on subflow %p", ssk); in mptcp_subflow_shutdown()
1919 mptcp_set_timeout(sk, ssk); in mptcp_subflow_shutdown()
1920 tcp_send_ack(ssk); in mptcp_subflow_shutdown()
1925 release_sock(ssk); in mptcp_subflow_shutdown()
2004 struct sock *ssk = mptcp_subflow_tcp_sock(subflow); in mptcp_close() local
2005 __mptcp_close_ssk(sk, ssk, subflow, timeout); in mptcp_close()
2015 static void mptcp_copy_inaddrs(struct sock *msk, const struct sock *ssk) in mptcp_copy_inaddrs() argument
2018 const struct ipv6_pinfo *ssk6 = inet6_sk(ssk); in mptcp_copy_inaddrs()
2021 msk->sk_v6_daddr = ssk->sk_v6_daddr; in mptcp_copy_inaddrs()
2022 msk->sk_v6_rcv_saddr = ssk->sk_v6_rcv_saddr; in mptcp_copy_inaddrs()
2030 inet_sk(msk)->inet_num = inet_sk(ssk)->inet_num; in mptcp_copy_inaddrs()
2031 inet_sk(msk)->inet_dport = inet_sk(ssk)->inet_dport; in mptcp_copy_inaddrs()
2032 inet_sk(msk)->inet_sport = inet_sk(ssk)->inet_sport; in mptcp_copy_inaddrs()
2033 inet_sk(msk)->inet_daddr = inet_sk(ssk)->inet_daddr; in mptcp_copy_inaddrs()
2034 inet_sk(msk)->inet_saddr = inet_sk(ssk)->inet_saddr; in mptcp_copy_inaddrs()
2035 inet_sk(msk)->inet_rcv_saddr = inet_sk(ssk)->inet_rcv_saddr; in mptcp_copy_inaddrs()
2104 void mptcp_rcv_space_init(struct mptcp_sock *msk, const struct sock *ssk) in mptcp_rcv_space_init() argument
2106 const struct tcp_sock *tp = tcp_sk(ssk); in mptcp_rcv_space_init()
2142 struct sock *ssk = newsk; in mptcp_accept() local
2164 mptcp_copy_inaddrs(newsk, ssk); in mptcp_accept()
2167 mptcp_rcv_space_init(msk, ssk); in mptcp_accept()
2304 struct sock *ssk; in mptcp_setsockopt() local
2321 ssk = __mptcp_tcp_fallback(msk); in mptcp_setsockopt()
2323 if (ssk) in mptcp_setsockopt()
2324 return tcp_setsockopt(ssk, level, optname, optval, optlen); in mptcp_setsockopt()
2336 struct sock *ssk; in mptcp_getsockopt() local
2347 ssk = __mptcp_tcp_fallback(msk); in mptcp_getsockopt()
2349 if (ssk) in mptcp_getsockopt()
2350 return tcp_getsockopt(ssk, level, optname, optval, option); in mptcp_getsockopt()
2376 struct sock *ssk; in mptcp_release_cb() local
2378 ssk = mptcp_subflow_recv_lookup(msk); in mptcp_release_cb()
2379 if (!ssk || !schedule_work(&msk->work)) in mptcp_release_cb()
2416 void mptcp_finish_connect(struct sock *ssk) in mptcp_finish_connect() argument
2423 subflow = mptcp_subflow_ctx(ssk); in mptcp_finish_connect()
2446 mptcp_rcv_space_init(msk, ssk); in mptcp_finish_connect()
2679 struct sock *ssk = mptcp_subflow_tcp_sock(subflow); in mptcp_stream_accept() local
2681 if (!ssk->sk_socket) in mptcp_stream_accept()
2682 mptcp_sock_graft(ssk, newsock); in mptcp_stream_accept()