diff options
Diffstat (limited to 'net/dccp')
-rw-r--r-- | net/dccp/ccids/ccid3.c | 12 | ||||
-rw-r--r-- | net/dccp/ccids/ccid3.h | 3 |
2 files changed, 6 insertions, 9 deletions
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c index d0763adbce26..42d3dbc1874e 100644 --- a/net/dccp/ccids/ccid3.c +++ b/net/dccp/ccids/ccid3.c | |||
@@ -154,12 +154,10 @@ static void ccid3_hc_tx_update_x(struct sock *sk) | |||
154 | TFRC_T_MBI); | 154 | TFRC_T_MBI); |
155 | 155 | ||
156 | } else { | 156 | } else { |
157 | struct timeval now; | 157 | const ktime_t now = ktime_get_real(); |
158 | 158 | ||
159 | dccp_timestamp(sk, &now); | 159 | if ((ktime_us_delta(now, hctx->ccid3hctx_t_ld) - |
160 | 160 | (s64)hctx->ccid3hctx_rtt) >= 0) { | |
161 | if ((timeval_delta(&now, &hctx->ccid3hctx_t_ld) - | ||
162 | (suseconds_t)hctx->ccid3hctx_rtt) >= 0) { | ||
163 | 161 | ||
164 | hctx->ccid3hctx_x = | 162 | hctx->ccid3hctx_x = |
165 | max(min(2 * hctx->ccid3hctx_x, min_rate), | 163 | max(min(2 * hctx->ccid3hctx_x, min_rate), |
@@ -343,7 +341,7 @@ static int ccid3_hc_tx_send_packet(struct sock *sk, struct sk_buff *skb) | |||
343 | ccid3_pr_debug("SYN RTT = %uus\n", dp->dccps_syn_rtt); | 341 | ccid3_pr_debug("SYN RTT = %uus\n", dp->dccps_syn_rtt); |
344 | hctx->ccid3hctx_rtt = dp->dccps_syn_rtt; | 342 | hctx->ccid3hctx_rtt = dp->dccps_syn_rtt; |
345 | hctx->ccid3hctx_x = rfc3390_initial_rate(sk); | 343 | hctx->ccid3hctx_x = rfc3390_initial_rate(sk); |
346 | hctx->ccid3hctx_t_ld = ktime_to_timeval(now); | 344 | hctx->ccid3hctx_t_ld = now; |
347 | } else { | 345 | } else { |
348 | /* Sender does not have RTT sample: X = MSS/second */ | 346 | /* Sender does not have RTT sample: X = MSS/second */ |
349 | hctx->ccid3hctx_x = dp->dccps_mss_cache; | 347 | hctx->ccid3hctx_x = dp->dccps_mss_cache; |
@@ -477,7 +475,7 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb) | |||
477 | */ | 475 | */ |
478 | hctx->ccid3hctx_rtt = r_sample; | 476 | hctx->ccid3hctx_rtt = r_sample; |
479 | hctx->ccid3hctx_x = rfc3390_initial_rate(sk); | 477 | hctx->ccid3hctx_x = rfc3390_initial_rate(sk); |
480 | hctx->ccid3hctx_t_ld = now; | 478 | hctx->ccid3hctx_t_ld = timeval_to_ktime(now); |
481 | 479 | ||
482 | ccid3_update_send_interval(hctx); | 480 | ccid3_update_send_interval(hctx); |
483 | 481 | ||
diff --git a/net/dccp/ccids/ccid3.h b/net/dccp/ccids/ccid3.h index 51d4b804e334..dcb6b677348b 100644 --- a/net/dccp/ccids/ccid3.h +++ b/net/dccp/ccids/ccid3.h | |||
@@ -38,7 +38,6 @@ | |||
38 | 38 | ||
39 | #include <linux/ktime.h> | 39 | #include <linux/ktime.h> |
40 | #include <linux/list.h> | 40 | #include <linux/list.h> |
41 | #include <linux/time.h> | ||
42 | #include <linux/types.h> | 41 | #include <linux/types.h> |
43 | #include <linux/tfrc.h> | 42 | #include <linux/tfrc.h> |
44 | #include "../ccid.h" | 43 | #include "../ccid.h" |
@@ -111,7 +110,7 @@ struct ccid3_hc_tx_sock { | |||
111 | u8 ccid3hctx_idle; | 110 | u8 ccid3hctx_idle; |
112 | ktime_t ccid3hctx_t_last_win_count; | 111 | ktime_t ccid3hctx_t_last_win_count; |
113 | struct timer_list ccid3hctx_no_feedback_timer; | 112 | struct timer_list ccid3hctx_no_feedback_timer; |
114 | struct timeval ccid3hctx_t_ld; | 113 | ktime_t ccid3hctx_t_ld; |
115 | ktime_t ccid3hctx_t_nom; | 114 | ktime_t ccid3hctx_t_nom; |
116 | u32 ccid3hctx_delta; | 115 | u32 ccid3hctx_delta; |
117 | struct list_head ccid3hctx_hist; | 116 | struct list_head ccid3hctx_hist; |