Lines Matching refs:sk

63 static void ccid3_hc_tx_set_state(struct sock *sk,  in ccid3_hc_tx_set_state()  argument
66 struct ccid3_hc_tx_sock *hc = ccid3_hc_tx_sk(sk); in ccid3_hc_tx_set_state()
70 dccp_role(sk), sk, ccid3_tx_state_name(oldstate), in ccid3_hc_tx_set_state()
85 static inline u64 rfc3390_initial_rate(struct sock *sk) in rfc3390_initial_rate() argument
87 const struct ccid3_hc_tx_sock *hc = ccid3_hc_tx_sk(sk); in rfc3390_initial_rate()
124 static void ccid3_hc_tx_update_x(struct sock *sk, ktime_t *stamp) in ccid3_hc_tx_update_x() argument
126 struct ccid3_hc_tx_sock *hc = ccid3_hc_tx_sk(sk); in ccid3_hc_tx_update_x()
138 min_rate = rfc3390_initial_rate(sk); in ccid3_hc_tx_update_x()
200 struct sock *sk = (struct sock *)data; in ccid3_hc_tx_no_feedback_timer() local
201 struct ccid3_hc_tx_sock *hc = ccid3_hc_tx_sk(sk); in ccid3_hc_tx_no_feedback_timer()
204 bh_lock_sock(sk); in ccid3_hc_tx_no_feedback_timer()
205 if (sock_owned_by_user(sk)) { in ccid3_hc_tx_no_feedback_timer()
211 ccid3_pr_debug("%s(%p, state=%s) - entry\n", dccp_role(sk), sk, in ccid3_hc_tx_no_feedback_timer()
215 if ((1 << sk->sk_state) & ~(DCCPF_OPEN | DCCPF_PARTOPEN)) in ccid3_hc_tx_no_feedback_timer()
220 ccid3_hc_tx_set_state(sk, TFRC_SSTATE_NO_FBACK); in ccid3_hc_tx_no_feedback_timer()
251 ccid3_hc_tx_update_x(sk, NULL); in ccid3_hc_tx_no_feedback_timer()
266 sk_reset_timer(sk, &hc->tx_no_feedback_timer, in ccid3_hc_tx_no_feedback_timer()
269 bh_unlock_sock(sk); in ccid3_hc_tx_no_feedback_timer()
270 sock_put(sk); in ccid3_hc_tx_no_feedback_timer()
280 static int ccid3_hc_tx_send_packet(struct sock *sk, struct sk_buff *skb) in ccid3_hc_tx_send_packet() argument
282 struct dccp_sock *dp = dccp_sk(sk); in ccid3_hc_tx_send_packet()
283 struct ccid3_hc_tx_sock *hc = ccid3_hc_tx_sk(sk); in ccid3_hc_tx_send_packet()
296 sk_reset_timer(sk, &hc->tx_no_feedback_timer, (jiffies + in ccid3_hc_tx_send_packet()
314 hc->tx_x = rfc3390_initial_rate(sk); in ccid3_hc_tx_send_packet()
329 ccid3_hc_tx_set_state(sk, TFRC_SSTATE_NO_FBACK); in ccid3_hc_tx_send_packet()
357 static void ccid3_hc_tx_packet_sent(struct sock *sk, unsigned int len) in ccid3_hc_tx_packet_sent() argument
359 struct ccid3_hc_tx_sock *hc = ccid3_hc_tx_sk(sk); in ccid3_hc_tx_packet_sent()
363 if (tfrc_tx_hist_add(&hc->tx_hist, dccp_sk(sk)->dccps_gss)) in ccid3_hc_tx_packet_sent()
367 static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb) in ccid3_hc_tx_packet_recv() argument
369 struct ccid3_hc_tx_sock *hc = ccid3_hc_tx_sk(sk); in ccid3_hc_tx_packet_recv()
395 r_sample = dccp_sample_rtt(sk, ktime_us_delta(now, acked->stamp)); in ccid3_hc_tx_packet_recv()
402 ccid3_hc_tx_set_state(sk, TFRC_SSTATE_FBACK); in ccid3_hc_tx_packet_recv()
408 hc->tx_x = rfc3390_initial_rate(sk); in ccid3_hc_tx_packet_recv()
425 ccid3_hc_tx_update_x(sk, &now); in ccid3_hc_tx_packet_recv()
430 dccp_role(sk), sk, hc->tx_rtt, r_sample, in ccid3_hc_tx_packet_recv()
436 sk_stop_timer(sk, &hc->tx_no_feedback_timer); in ccid3_hc_tx_packet_recv()
442 sk->sk_write_space(sk); in ccid3_hc_tx_packet_recv()
450 USEC_PER_SEC/HZ * tcp_rto_min(sk)); in ccid3_hc_tx_packet_recv()
459 dccp_role(sk), sk, usecs_to_jiffies(t_nfb), t_nfb); in ccid3_hc_tx_packet_recv()
461 sk_reset_timer(sk, &hc->tx_no_feedback_timer, in ccid3_hc_tx_packet_recv()
465 static int ccid3_hc_tx_parse_options(struct sock *sk, u8 packet_type, in ccid3_hc_tx_parse_options() argument
468 struct ccid3_hc_tx_sock *hc = ccid3_hc_tx_sk(sk); in ccid3_hc_tx_parse_options()
479 dccp_role(sk), sk, optlen, option); in ccid3_hc_tx_parse_options()
490 dccp_role(sk), sk, opt_val); in ccid3_hc_tx_parse_options()
496 dccp_role(sk), sk, opt_val); in ccid3_hc_tx_parse_options()
502 static int ccid3_hc_tx_init(struct ccid *ccid, struct sock *sk) in ccid3_hc_tx_init() argument
509 ccid3_hc_tx_no_feedback_timer, (unsigned long)sk); in ccid3_hc_tx_init()
513 static void ccid3_hc_tx_exit(struct sock *sk) in ccid3_hc_tx_exit() argument
515 struct ccid3_hc_tx_sock *hc = ccid3_hc_tx_sk(sk); in ccid3_hc_tx_exit()
517 sk_stop_timer(sk, &hc->tx_no_feedback_timer); in ccid3_hc_tx_exit()
521 static void ccid3_hc_tx_get_info(struct sock *sk, struct tcp_info *info) in ccid3_hc_tx_get_info() argument
523 info->tcpi_rto = ccid3_hc_tx_sk(sk)->tx_t_rto; in ccid3_hc_tx_get_info()
524 info->tcpi_rtt = ccid3_hc_tx_sk(sk)->tx_rtt; in ccid3_hc_tx_get_info()
527 static int ccid3_hc_tx_getsockopt(struct sock *sk, const int optname, int len, in ccid3_hc_tx_getsockopt() argument
530 const struct ccid3_hc_tx_sock *hc = ccid3_hc_tx_sk(sk); in ccid3_hc_tx_getsockopt()
583 static void ccid3_hc_rx_set_state(struct sock *sk, in ccid3_hc_rx_set_state() argument
586 struct ccid3_hc_rx_sock *hc = ccid3_hc_rx_sk(sk); in ccid3_hc_rx_set_state()
590 dccp_role(sk), sk, ccid3_rx_state_name(oldstate), in ccid3_hc_rx_set_state()
596 static void ccid3_hc_rx_send_feedback(struct sock *sk, in ccid3_hc_rx_send_feedback() argument
600 struct ccid3_hc_rx_sock *hc = ccid3_hc_rx_sk(sk); in ccid3_hc_rx_send_feedback()
601 struct dccp_sock *dp = dccp_sk(sk); in ccid3_hc_rx_send_feedback()
643 dccp_send_ack(sk); in ccid3_hc_rx_send_feedback()
646 static int ccid3_hc_rx_insert_options(struct sock *sk, struct sk_buff *skb) in ccid3_hc_rx_insert_options() argument
648 const struct ccid3_hc_rx_sock *hc = ccid3_hc_rx_sk(sk); in ccid3_hc_rx_insert_options()
651 if (!(sk->sk_state == DCCP_OPEN || sk->sk_state == DCCP_PARTOPEN)) in ccid3_hc_rx_insert_options()
679 static u32 ccid3_first_li(struct sock *sk) in ccid3_first_li() argument
681 struct ccid3_hc_rx_sock *hc = ccid3_hc_rx_sk(sk); in ccid3_first_li()
706 "loss rate=%u\n", dccp_role(sk), sk, x_recv, p); in ccid3_first_li()
711 static void ccid3_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb) in ccid3_hc_rx_packet_recv() argument
713 struct ccid3_hc_rx_sock *hc = ccid3_hc_rx_sk(sk); in ccid3_hc_rx_packet_recv()
715 const u64 ndp = dccp_sk(sk)->dccps_options_received.dccpor_ndp; in ccid3_hc_rx_packet_recv()
722 ccid3_hc_rx_set_state(sk, TFRC_RSTATE_DATA); in ccid3_hc_rx_packet_recv()
749 skb, ndp, ccid3_first_li, sk)) { in ccid3_hc_rx_packet_recv()
792 ccid3_hc_rx_send_feedback(sk, skb, do_feedback); in ccid3_hc_rx_packet_recv()
795 static int ccid3_hc_rx_init(struct ccid *ccid, struct sock *sk) in ccid3_hc_rx_init() argument
804 static void ccid3_hc_rx_exit(struct sock *sk) in ccid3_hc_rx_exit() argument
806 struct ccid3_hc_rx_sock *hc = ccid3_hc_rx_sk(sk); in ccid3_hc_rx_exit()
812 static void ccid3_hc_rx_get_info(struct sock *sk, struct tcp_info *info) in ccid3_hc_rx_get_info() argument
814 info->tcpi_ca_state = ccid3_hc_rx_sk(sk)->rx_state; in ccid3_hc_rx_get_info()
816 info->tcpi_rcv_rtt = ccid3_hc_rx_sk(sk)->rx_rtt; in ccid3_hc_rx_get_info()
819 static int ccid3_hc_rx_getsockopt(struct sock *sk, const int optname, int len, in ccid3_hc_rx_getsockopt() argument
822 const struct ccid3_hc_rx_sock *hc = ccid3_hc_rx_sk(sk); in ccid3_hc_rx_getsockopt()