diff options
-rw-r--r-- | net/dccp/ccids/ccid3.c | 22 | ||||
-rw-r--r-- | net/dccp/ccids/ccid3.h | 2 |
2 files changed, 15 insertions, 9 deletions
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c index 42d3dbc1874e..63051eb1779d 100644 --- a/net/dccp/ccids/ccid3.c +++ b/net/dccp/ccids/ccid3.c | |||
@@ -876,7 +876,6 @@ static void ccid3_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb) | |||
876 | struct ccid3_hc_rx_sock *hcrx = ccid3_hc_rx_sk(sk); | 876 | struct ccid3_hc_rx_sock *hcrx = ccid3_hc_rx_sk(sk); |
877 | const struct dccp_options_received *opt_recv; | 877 | const struct dccp_options_received *opt_recv; |
878 | struct dccp_rx_hist_entry *packet; | 878 | struct dccp_rx_hist_entry *packet; |
879 | struct timeval now; | ||
880 | u32 p_prev, r_sample, rtt_prev; | 879 | u32 p_prev, r_sample, rtt_prev; |
881 | int loss, payload_size; | 880 | int loss, payload_size; |
882 | 881 | ||
@@ -888,7 +887,9 @@ static void ccid3_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb) | |||
888 | case DCCP_PKT_ACK: | 887 | case DCCP_PKT_ACK: |
889 | if (hcrx->ccid3hcrx_state == TFRC_RSTATE_NO_DATA) | 888 | if (hcrx->ccid3hcrx_state == TFRC_RSTATE_NO_DATA) |
890 | return; | 889 | return; |
891 | case DCCP_PKT_DATAACK: | 890 | case DCCP_PKT_DATAACK: { |
891 | struct timeval now; | ||
892 | |||
892 | if (opt_recv->dccpor_timestamp_echo == 0) | 893 | if (opt_recv->dccpor_timestamp_echo == 0) |
893 | break; | 894 | break; |
894 | rtt_prev = hcrx->ccid3hcrx_rtt; | 895 | rtt_prev = hcrx->ccid3hcrx_rtt; |
@@ -906,6 +907,7 @@ static void ccid3_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb) | |||
906 | dccp_role(sk), sk, hcrx->ccid3hcrx_rtt, | 907 | dccp_role(sk), sk, hcrx->ccid3hcrx_rtt, |
907 | opt_recv->dccpor_elapsed_time); | 908 | opt_recv->dccpor_elapsed_time); |
908 | break; | 909 | break; |
910 | } | ||
909 | case DCCP_PKT_DATA: | 911 | case DCCP_PKT_DATA: |
910 | break; | 912 | break; |
911 | default: /* We're not interested in other packet types, move along */ | 913 | default: /* We're not interested in other packet types, move along */ |
@@ -936,18 +938,21 @@ static void ccid3_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb) | |||
936 | ccid3_hc_rx_send_feedback(sk); | 938 | ccid3_hc_rx_send_feedback(sk); |
937 | ccid3_hc_rx_set_state(sk, TFRC_RSTATE_DATA); | 939 | ccid3_hc_rx_set_state(sk, TFRC_RSTATE_DATA); |
938 | return; | 940 | return; |
939 | case TFRC_RSTATE_DATA: | 941 | case TFRC_RSTATE_DATA: { |
942 | ktime_t now; | ||
943 | |||
940 | hcrx->ccid3hcrx_bytes_recv += payload_size; | 944 | hcrx->ccid3hcrx_bytes_recv += payload_size; |
941 | if (loss) | 945 | if (loss) |
942 | break; | 946 | break; |
943 | 947 | ||
944 | dccp_timestamp(sk, &now); | 948 | now = ktime_get_real(); |
945 | if ((timeval_delta(&now, &hcrx->ccid3hcrx_tstamp_last_ack) - | 949 | if ((ktime_us_delta(now, hcrx->ccid3hcrx_tstamp_last_ack) - |
946 | (suseconds_t)hcrx->ccid3hcrx_rtt) >= 0) { | 950 | (s64)hcrx->ccid3hcrx_rtt) >= 0) { |
947 | hcrx->ccid3hcrx_tstamp_last_ack = now; | 951 | hcrx->ccid3hcrx_tstamp_last_ack = now; |
948 | ccid3_hc_rx_send_feedback(sk); | 952 | ccid3_hc_rx_send_feedback(sk); |
949 | } | 953 | } |
950 | return; | 954 | return; |
955 | } | ||
951 | case TFRC_RSTATE_TERM: | 956 | case TFRC_RSTATE_TERM: |
952 | DCCP_BUG("%s(%p) - Illegal state TERM", dccp_role(sk), sk); | 957 | DCCP_BUG("%s(%p) - Illegal state TERM", dccp_role(sk), sk); |
953 | return; | 958 | return; |
@@ -984,8 +989,9 @@ static int ccid3_hc_rx_init(struct ccid *ccid, struct sock *sk) | |||
984 | hcrx->ccid3hcrx_state = TFRC_RSTATE_NO_DATA; | 989 | hcrx->ccid3hcrx_state = TFRC_RSTATE_NO_DATA; |
985 | INIT_LIST_HEAD(&hcrx->ccid3hcrx_hist); | 990 | INIT_LIST_HEAD(&hcrx->ccid3hcrx_hist); |
986 | INIT_LIST_HEAD(&hcrx->ccid3hcrx_li_hist); | 991 | INIT_LIST_HEAD(&hcrx->ccid3hcrx_li_hist); |
987 | dccp_timestamp(sk, &hcrx->ccid3hcrx_tstamp_last_ack); | 992 | hcrx->ccid3hcrx_tstamp_last_ack = ktime_get_real(); |
988 | hcrx->ccid3hcrx_tstamp_last_feedback = hcrx->ccid3hcrx_tstamp_last_ack; | 993 | hcrx->ccid3hcrx_tstamp_last_feedback = |
994 | ktime_to_timeval(hcrx->ccid3hcrx_tstamp_last_ack); | ||
989 | hcrx->ccid3hcrx_s = 0; | 995 | hcrx->ccid3hcrx_s = 0; |
990 | hcrx->ccid3hcrx_rtt = 0; | 996 | hcrx->ccid3hcrx_rtt = 0; |
991 | return 0; | 997 | return 0; |
diff --git a/net/dccp/ccids/ccid3.h b/net/dccp/ccids/ccid3.h index dcb6b677348b..a69cf887e3e3 100644 --- a/net/dccp/ccids/ccid3.h +++ b/net/dccp/ccids/ccid3.h | |||
@@ -153,7 +153,7 @@ struct ccid3_hc_rx_sock { | |||
153 | enum ccid3_hc_rx_states ccid3hcrx_state:8; | 153 | enum ccid3_hc_rx_states ccid3hcrx_state:8; |
154 | u32 ccid3hcrx_bytes_recv; | 154 | u32 ccid3hcrx_bytes_recv; |
155 | struct timeval ccid3hcrx_tstamp_last_feedback; | 155 | struct timeval ccid3hcrx_tstamp_last_feedback; |
156 | struct timeval ccid3hcrx_tstamp_last_ack; | 156 | ktime_t ccid3hcrx_tstamp_last_ack; |
157 | struct list_head ccid3hcrx_hist; | 157 | struct list_head ccid3hcrx_hist; |
158 | struct list_head ccid3hcrx_li_hist; | 158 | struct list_head ccid3hcrx_li_hist; |
159 | u16 ccid3hcrx_s; | 159 | u16 ccid3hcrx_s; |