diff options
Diffstat (limited to 'net/dccp/ccids/ccid3.c')
-rw-r--r-- | net/dccp/ccids/ccid3.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c index 63051eb1779d..1a0c5edb7b35 100644 --- a/net/dccp/ccids/ccid3.c +++ b/net/dccp/ccids/ccid3.c | |||
@@ -729,20 +729,21 @@ static void ccid3_hc_rx_send_feedback(struct sock *sk) | |||
729 | struct ccid3_hc_rx_sock *hcrx = ccid3_hc_rx_sk(sk); | 729 | struct ccid3_hc_rx_sock *hcrx = ccid3_hc_rx_sk(sk); |
730 | struct dccp_sock *dp = dccp_sk(sk); | 730 | struct dccp_sock *dp = dccp_sk(sk); |
731 | struct dccp_rx_hist_entry *packet; | 731 | struct dccp_rx_hist_entry *packet; |
732 | struct timeval now; | 732 | struct timeval tnow; |
733 | ktime_t now; | ||
733 | suseconds_t delta; | 734 | suseconds_t delta; |
734 | 735 | ||
735 | ccid3_pr_debug("%s(%p) - entry \n", dccp_role(sk), sk); | 736 | ccid3_pr_debug("%s(%p) - entry \n", dccp_role(sk), sk); |
736 | 737 | ||
737 | dccp_timestamp(sk, &now); | 738 | now = ktime_get_real(); |
738 | 739 | ||
739 | switch (hcrx->ccid3hcrx_state) { | 740 | switch (hcrx->ccid3hcrx_state) { |
740 | case TFRC_RSTATE_NO_DATA: | 741 | case TFRC_RSTATE_NO_DATA: |
741 | hcrx->ccid3hcrx_x_recv = 0; | 742 | hcrx->ccid3hcrx_x_recv = 0; |
742 | break; | 743 | break; |
743 | case TFRC_RSTATE_DATA: | 744 | case TFRC_RSTATE_DATA: |
744 | delta = timeval_delta(&now, | 745 | delta = ktime_us_delta(now, |
745 | &hcrx->ccid3hcrx_tstamp_last_feedback); | 746 | hcrx->ccid3hcrx_tstamp_last_feedback); |
746 | DCCP_BUG_ON(delta < 0); | 747 | DCCP_BUG_ON(delta < 0); |
747 | hcrx->ccid3hcrx_x_recv = | 748 | hcrx->ccid3hcrx_x_recv = |
748 | scaled_div32(hcrx->ccid3hcrx_bytes_recv, delta); | 749 | scaled_div32(hcrx->ccid3hcrx_bytes_recv, delta); |
@@ -764,7 +765,8 @@ static void ccid3_hc_rx_send_feedback(struct sock *sk) | |||
764 | hcrx->ccid3hcrx_bytes_recv = 0; | 765 | hcrx->ccid3hcrx_bytes_recv = 0; |
765 | 766 | ||
766 | /* Elapsed time information [RFC 4340, 13.2] in units of 10 * usecs */ | 767 | /* Elapsed time information [RFC 4340, 13.2] in units of 10 * usecs */ |
767 | delta = timeval_delta(&now, &packet->dccphrx_tstamp); | 768 | tnow = ktime_to_timeval(now); |
769 | delta = timeval_delta(&tnow, &packet->dccphrx_tstamp); | ||
768 | DCCP_BUG_ON(delta < 0); | 770 | DCCP_BUG_ON(delta < 0); |
769 | hcrx->ccid3hcrx_elapsed_time = delta / 10; | 771 | hcrx->ccid3hcrx_elapsed_time = delta / 10; |
770 | 772 | ||
@@ -835,11 +837,13 @@ static int ccid3_hc_rx_detect_loss(struct sock *sk, | |||
835 | 837 | ||
836 | while (dccp_delta_seqno(hcrx->ccid3hcrx_seqno_nonloss, seqno) | 838 | while (dccp_delta_seqno(hcrx->ccid3hcrx_seqno_nonloss, seqno) |
837 | > TFRC_RECV_NUM_LATE_LOSS) { | 839 | > TFRC_RECV_NUM_LATE_LOSS) { |
840 | struct timeval tstamp = | ||
841 | ktime_to_timeval(hcrx->ccid3hcrx_tstamp_last_feedback); | ||
838 | loss = 1; | 842 | loss = 1; |
839 | dccp_li_update_li(sk, | 843 | dccp_li_update_li(sk, |
840 | &hcrx->ccid3hcrx_li_hist, | 844 | &hcrx->ccid3hcrx_li_hist, |
841 | &hcrx->ccid3hcrx_hist, | 845 | &hcrx->ccid3hcrx_hist, |
842 | &hcrx->ccid3hcrx_tstamp_last_feedback, | 846 | &tstamp, |
843 | hcrx->ccid3hcrx_s, | 847 | hcrx->ccid3hcrx_s, |
844 | hcrx->ccid3hcrx_bytes_recv, | 848 | hcrx->ccid3hcrx_bytes_recv, |
845 | hcrx->ccid3hcrx_x_recv, | 849 | hcrx->ccid3hcrx_x_recv, |
@@ -989,9 +993,8 @@ static int ccid3_hc_rx_init(struct ccid *ccid, struct sock *sk) | |||
989 | hcrx->ccid3hcrx_state = TFRC_RSTATE_NO_DATA; | 993 | hcrx->ccid3hcrx_state = TFRC_RSTATE_NO_DATA; |
990 | INIT_LIST_HEAD(&hcrx->ccid3hcrx_hist); | 994 | INIT_LIST_HEAD(&hcrx->ccid3hcrx_hist); |
991 | INIT_LIST_HEAD(&hcrx->ccid3hcrx_li_hist); | 995 | INIT_LIST_HEAD(&hcrx->ccid3hcrx_li_hist); |
992 | hcrx->ccid3hcrx_tstamp_last_ack = ktime_get_real(); | ||
993 | hcrx->ccid3hcrx_tstamp_last_feedback = | 996 | hcrx->ccid3hcrx_tstamp_last_feedback = |
994 | ktime_to_timeval(hcrx->ccid3hcrx_tstamp_last_ack); | 997 | hcrx->ccid3hcrx_tstamp_last_ack = ktime_get_real(); |
995 | hcrx->ccid3hcrx_s = 0; | 998 | hcrx->ccid3hcrx_s = 0; |
996 | hcrx->ccid3hcrx_rtt = 0; | 999 | hcrx->ccid3hcrx_rtt = 0; |
997 | return 0; | 1000 | return 0; |