Lines Matching refs:sk

79 static int ccid2_hc_tx_send_packet(struct sock *sk, struct sk_buff *skb)  in ccid2_hc_tx_send_packet()  argument
81 if (ccid2_cwnd_network_limited(ccid2_hc_tx_sk(sk))) in ccid2_hc_tx_send_packet()
86 static void ccid2_change_l_ack_ratio(struct sock *sk, u32 val) in ccid2_change_l_ack_ratio() argument
88 u32 max_ratio = DIV_ROUND_UP(ccid2_hc_tx_sk(sk)->tx_cwnd, 2); in ccid2_change_l_ack_ratio()
100 dccp_feat_signal_nn_change(sk, DCCPF_ACK_RATIO, in ccid2_change_l_ack_ratio()
104 static void ccid2_check_l_ack_ratio(struct sock *sk) in ccid2_check_l_ack_ratio() argument
106 struct ccid2_hc_tx_sock *hc = ccid2_hc_tx_sk(sk); in ccid2_check_l_ack_ratio()
118 if (dccp_feat_nn_get(sk, DCCPF_ACK_RATIO) > hc->tx_cwnd) in ccid2_check_l_ack_ratio()
119 ccid2_change_l_ack_ratio(sk, hc->tx_cwnd/2 ? : 1U); in ccid2_check_l_ack_ratio()
122 static void ccid2_change_l_seq_window(struct sock *sk, u64 val) in ccid2_change_l_seq_window() argument
124 dccp_feat_signal_nn_change(sk, DCCPF_SEQUENCE_WINDOW, in ccid2_change_l_seq_window()
131 struct sock *sk = (struct sock *)data; in ccid2_hc_tx_rto_expire() local
132 struct ccid2_hc_tx_sock *hc = ccid2_hc_tx_sk(sk); in ccid2_hc_tx_rto_expire()
135 bh_lock_sock(sk); in ccid2_hc_tx_rto_expire()
136 if (sock_owned_by_user(sk)) { in ccid2_hc_tx_rto_expire()
137 sk_reset_timer(sk, &hc->tx_rtotimer, jiffies + HZ / 5); in ccid2_hc_tx_rto_expire()
162 ccid2_change_l_ack_ratio(sk, 1); in ccid2_hc_tx_rto_expire()
166 tasklet_schedule(&dccp_sk(sk)->dccps_xmitlet); in ccid2_hc_tx_rto_expire()
168 sk_reset_timer(sk, &hc->tx_rtotimer, jiffies + hc->tx_rto); in ccid2_hc_tx_rto_expire()
170 bh_unlock_sock(sk); in ccid2_hc_tx_rto_expire()
171 sock_put(sk); in ccid2_hc_tx_rto_expire()
194 static void ccid2_cwnd_application_limited(struct sock *sk, const u32 now) in ccid2_cwnd_application_limited() argument
196 struct ccid2_hc_tx_sock *hc = ccid2_hc_tx_sk(sk); in ccid2_cwnd_application_limited()
198 u32 init_win = rfc3390_bytes_to_packets(dccp_sk(sk)->dccps_mss_cache), in ccid2_cwnd_application_limited()
209 ccid2_check_l_ack_ratio(sk); in ccid2_cwnd_application_limited()
213 static void ccid2_cwnd_restart(struct sock *sk, const u32 now) in ccid2_cwnd_restart() argument
215 struct ccid2_hc_tx_sock *hc = ccid2_hc_tx_sk(sk); in ccid2_cwnd_restart()
217 iwnd = rfc3390_bytes_to_packets(dccp_sk(sk)->dccps_mss_cache); in ccid2_cwnd_restart()
229 ccid2_check_l_ack_ratio(sk); in ccid2_cwnd_restart()
232 static void ccid2_hc_tx_packet_sent(struct sock *sk, unsigned int len) in ccid2_hc_tx_packet_sent() argument
234 struct dccp_sock *dp = dccp_sk(sk); in ccid2_hc_tx_packet_sent()
235 struct ccid2_hc_tx_sock *hc = ccid2_hc_tx_sk(sk); in ccid2_hc_tx_packet_sent()
242 ccid2_cwnd_restart(sk, now); in ccid2_hc_tx_packet_sent()
259 ccid2_cwnd_application_limited(sk, now); in ccid2_hc_tx_packet_sent()
320 ccid2_change_l_ack_ratio(sk, dp->dccps_l_ack_ratio - 1); in ccid2_hc_tx_packet_sent()
330 sk_reset_timer(sk, &hc->tx_rtotimer, jiffies + hc->tx_rto); in ccid2_hc_tx_packet_sent()
356 static void ccid2_rtt_estimator(struct sock *sk, const long mrtt) in ccid2_rtt_estimator() argument
358 struct ccid2_hc_tx_sock *hc = ccid2_hc_tx_sk(sk); in ccid2_rtt_estimator()
366 hc->tx_mdev_max = max(hc->tx_mdev, tcp_rto_min(sk)); in ccid2_rtt_estimator()
369 hc->tx_rtt_seq = dccp_sk(sk)->dccps_gss; in ccid2_rtt_estimator()
404 if (after48(dccp_sk(sk)->dccps_gar, hc->tx_rtt_seq)) { in ccid2_rtt_estimator()
408 hc->tx_rtt_seq = dccp_sk(sk)->dccps_gss; in ccid2_rtt_estimator()
409 hc->tx_mdev_max = tcp_rto_min(sk); in ccid2_rtt_estimator()
426 static void ccid2_new_ack(struct sock *sk, struct ccid2_seq *seqp, in ccid2_new_ack() argument
429 struct ccid2_hc_tx_sock *hc = ccid2_hc_tx_sk(sk); in ccid2_new_ack()
430 struct dccp_sock *dp = dccp_sk(sk); in ccid2_new_ack()
452 ccid2_change_l_ack_ratio(sk, dp->dccps_l_ack_ratio * 2); in ccid2_new_ack()
454 ccid2_change_l_ack_ratio(sk, dp->dccps_l_ack_ratio / 2 ? : 1U); in ccid2_new_ack()
457 ccid2_change_l_seq_window(sk, dp->dccps_l_seq_win * 2); in ccid2_new_ack()
459 ccid2_change_l_seq_window(sk, dp->dccps_l_seq_win / 2); in ccid2_new_ack()
469 ccid2_rtt_estimator(sk, ccid2_time_stamp - seqp->ccid2s_sent); in ccid2_new_ack()
472 static void ccid2_congestion_event(struct sock *sk, struct ccid2_seq *seqp) in ccid2_congestion_event() argument
474 struct ccid2_hc_tx_sock *hc = ccid2_hc_tx_sk(sk); in ccid2_congestion_event()
486 ccid2_check_l_ack_ratio(sk); in ccid2_congestion_event()
489 static int ccid2_hc_tx_parse_options(struct sock *sk, u8 packet_type, in ccid2_hc_tx_parse_options() argument
492 struct ccid2_hc_tx_sock *hc = ccid2_hc_tx_sk(sk); in ccid2_hc_tx_parse_options()
503 static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb) in ccid2_hc_tx_packet_recv() argument
505 struct dccp_sock *dp = dccp_sk(sk); in ccid2_hc_tx_packet_recv()
506 struct ccid2_hc_tx_sock *hc = ccid2_hc_tx_sk(sk); in ccid2_hc_tx_packet_recv()
545 ccid2_change_l_ack_ratio(sk, 2 * dp->dccps_l_ack_ratio); in ccid2_hc_tx_packet_recv()
615 ccid2_congestion_event(sk, in ccid2_hc_tx_packet_recv()
618 ccid2_new_ack(sk, seqp, in ccid2_hc_tx_packet_recv()
679 ccid2_congestion_event(sk, seqp); in ccid2_hc_tx_packet_recv()
700 sk_stop_timer(sk, &hc->tx_rtotimer); in ccid2_hc_tx_packet_recv()
702 sk_reset_timer(sk, &hc->tx_rtotimer, jiffies + hc->tx_rto); in ccid2_hc_tx_packet_recv()
706 tasklet_schedule(&dccp_sk(sk)->dccps_xmitlet); in ccid2_hc_tx_packet_recv()
710 static int ccid2_hc_tx_init(struct ccid *ccid, struct sock *sk) in ccid2_hc_tx_init() argument
713 struct dccp_sock *dp = dccp_sk(sk); in ccid2_hc_tx_init()
737 (unsigned long)sk); in ccid2_hc_tx_init()
742 static void ccid2_hc_tx_exit(struct sock *sk) in ccid2_hc_tx_exit() argument
744 struct ccid2_hc_tx_sock *hc = ccid2_hc_tx_sk(sk); in ccid2_hc_tx_exit()
747 sk_stop_timer(sk, &hc->tx_rtotimer); in ccid2_hc_tx_exit()
754 static void ccid2_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb) in ccid2_hc_rx_packet_recv() argument
756 struct ccid2_hc_rx_sock *hc = ccid2_hc_rx_sk(sk); in ccid2_hc_rx_packet_recv()
761 if (++hc->rx_num_data_pkts >= dccp_sk(sk)->dccps_r_ack_ratio) { in ccid2_hc_rx_packet_recv()
762 dccp_send_ack(sk); in ccid2_hc_rx_packet_recv()