diff options
author | Eric Dumazet <edumazet@google.com> | 2017-05-16 17:00:06 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-05-17 16:06:01 -0400 |
commit | ac35f562203a45a04f79f412509df48857f928be (patch) | |
tree | c7b159887508408d8b65ecaf3725ac00f351b552 | |
parent | 2660bfa84e9236016f3a4f21b7864431d9663338 (diff) |
tcp: bic, cubic: use tcp_jiffies32 instead of tcp_time_stamp
Use tcp_jiffies32 instead of tcp_time_stamp, since
tcp_time_stamp will soon be only used for TCP TS option.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv4/tcp_bic.c | 6 | ||||
-rw-r--r-- | net/ipv4/tcp_cubic.c | 12 |
2 files changed, 9 insertions, 9 deletions
diff --git a/net/ipv4/tcp_bic.c b/net/ipv4/tcp_bic.c index 36087bca9f48..609965f0e298 100644 --- a/net/ipv4/tcp_bic.c +++ b/net/ipv4/tcp_bic.c | |||
@@ -84,14 +84,14 @@ static void bictcp_init(struct sock *sk) | |||
84 | static inline void bictcp_update(struct bictcp *ca, u32 cwnd) | 84 | static inline void bictcp_update(struct bictcp *ca, u32 cwnd) |
85 | { | 85 | { |
86 | if (ca->last_cwnd == cwnd && | 86 | if (ca->last_cwnd == cwnd && |
87 | (s32)(tcp_time_stamp - ca->last_time) <= HZ / 32) | 87 | (s32)(tcp_jiffies32 - ca->last_time) <= HZ / 32) |
88 | return; | 88 | return; |
89 | 89 | ||
90 | ca->last_cwnd = cwnd; | 90 | ca->last_cwnd = cwnd; |
91 | ca->last_time = tcp_time_stamp; | 91 | ca->last_time = tcp_jiffies32; |
92 | 92 | ||
93 | if (ca->epoch_start == 0) /* record the beginning of an epoch */ | 93 | if (ca->epoch_start == 0) /* record the beginning of an epoch */ |
94 | ca->epoch_start = tcp_time_stamp; | 94 | ca->epoch_start = tcp_jiffies32; |
95 | 95 | ||
96 | /* start off normal */ | 96 | /* start off normal */ |
97 | if (cwnd <= low_window) { | 97 | if (cwnd <= low_window) { |
diff --git a/net/ipv4/tcp_cubic.c b/net/ipv4/tcp_cubic.c index 2052ca740916..57ae5b5ae643 100644 --- a/net/ipv4/tcp_cubic.c +++ b/net/ipv4/tcp_cubic.c | |||
@@ -231,21 +231,21 @@ static inline void bictcp_update(struct bictcp *ca, u32 cwnd, u32 acked) | |||
231 | ca->ack_cnt += acked; /* count the number of ACKed packets */ | 231 | ca->ack_cnt += acked; /* count the number of ACKed packets */ |
232 | 232 | ||
233 | if (ca->last_cwnd == cwnd && | 233 | if (ca->last_cwnd == cwnd && |
234 | (s32)(tcp_time_stamp - ca->last_time) <= HZ / 32) | 234 | (s32)(tcp_jiffies32 - ca->last_time) <= HZ / 32) |
235 | return; | 235 | return; |
236 | 236 | ||
237 | /* The CUBIC function can update ca->cnt at most once per jiffy. | 237 | /* The CUBIC function can update ca->cnt at most once per jiffy. |
238 | * On all cwnd reduction events, ca->epoch_start is set to 0, | 238 | * On all cwnd reduction events, ca->epoch_start is set to 0, |
239 | * which will force a recalculation of ca->cnt. | 239 | * which will force a recalculation of ca->cnt. |
240 | */ | 240 | */ |
241 | if (ca->epoch_start && tcp_time_stamp == ca->last_time) | 241 | if (ca->epoch_start && tcp_jiffies32 == ca->last_time) |
242 | goto tcp_friendliness; | 242 | goto tcp_friendliness; |
243 | 243 | ||
244 | ca->last_cwnd = cwnd; | 244 | ca->last_cwnd = cwnd; |
245 | ca->last_time = tcp_time_stamp; | 245 | ca->last_time = tcp_jiffies32; |
246 | 246 | ||
247 | if (ca->epoch_start == 0) { | 247 | if (ca->epoch_start == 0) { |
248 | ca->epoch_start = tcp_time_stamp; /* record beginning */ | 248 | ca->epoch_start = tcp_jiffies32; /* record beginning */ |
249 | ca->ack_cnt = acked; /* start counting */ | 249 | ca->ack_cnt = acked; /* start counting */ |
250 | ca->tcp_cwnd = cwnd; /* syn with cubic */ | 250 | ca->tcp_cwnd = cwnd; /* syn with cubic */ |
251 | 251 | ||
@@ -276,7 +276,7 @@ static inline void bictcp_update(struct bictcp *ca, u32 cwnd, u32 acked) | |||
276 | * if the cwnd < 1 million packets !!! | 276 | * if the cwnd < 1 million packets !!! |
277 | */ | 277 | */ |
278 | 278 | ||
279 | t = (s32)(tcp_time_stamp - ca->epoch_start); | 279 | t = (s32)(tcp_jiffies32 - ca->epoch_start); |
280 | t += msecs_to_jiffies(ca->delay_min >> 3); | 280 | t += msecs_to_jiffies(ca->delay_min >> 3); |
281 | /* change the unit from HZ to bictcp_HZ */ | 281 | /* change the unit from HZ to bictcp_HZ */ |
282 | t <<= BICTCP_HZ; | 282 | t <<= BICTCP_HZ; |
@@ -448,7 +448,7 @@ static void bictcp_acked(struct sock *sk, const struct ack_sample *sample) | |||
448 | return; | 448 | return; |
449 | 449 | ||
450 | /* Discard delay samples right after fast recovery */ | 450 | /* Discard delay samples right after fast recovery */ |
451 | if (ca->epoch_start && (s32)(tcp_time_stamp - ca->epoch_start) < HZ) | 451 | if (ca->epoch_start && (s32)(tcp_jiffies32 - ca->epoch_start) < HZ) |
452 | return; | 452 | return; |
453 | 453 | ||
454 | delay = (sample->rtt_us << 3) / USEC_PER_MSEC; | 454 | delay = (sample->rtt_us << 3) / USEC_PER_MSEC; |