Commit ac35f562 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

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: default avatarEric Dumazet <edumazet@google.com>
Acked-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2660bfa8
...@@ -84,14 +84,14 @@ static void bictcp_init(struct sock *sk) ...@@ -84,14 +84,14 @@ static void bictcp_init(struct sock *sk)
static inline void bictcp_update(struct bictcp *ca, u32 cwnd) static inline void bictcp_update(struct bictcp *ca, u32 cwnd)
{ {
if (ca->last_cwnd == cwnd && if (ca->last_cwnd == cwnd &&
(s32)(tcp_time_stamp - ca->last_time) <= HZ / 32) (s32)(tcp_jiffies32 - ca->last_time) <= HZ / 32)
return; return;
ca->last_cwnd = cwnd; ca->last_cwnd = cwnd;
ca->last_time = tcp_time_stamp; ca->last_time = tcp_jiffies32;
if (ca->epoch_start == 0) /* record the beginning of an epoch */ if (ca->epoch_start == 0) /* record the beginning of an epoch */
ca->epoch_start = tcp_time_stamp; ca->epoch_start = tcp_jiffies32;
/* start off normal */ /* start off normal */
if (cwnd <= low_window) { if (cwnd <= low_window) {
......
...@@ -231,21 +231,21 @@ static inline void bictcp_update(struct bictcp *ca, u32 cwnd, u32 acked) ...@@ -231,21 +231,21 @@ static inline void bictcp_update(struct bictcp *ca, u32 cwnd, u32 acked)
ca->ack_cnt += acked; /* count the number of ACKed packets */ ca->ack_cnt += acked; /* count the number of ACKed packets */
if (ca->last_cwnd == cwnd && if (ca->last_cwnd == cwnd &&
(s32)(tcp_time_stamp - ca->last_time) <= HZ / 32) (s32)(tcp_jiffies32 - ca->last_time) <= HZ / 32)
return; return;
/* The CUBIC function can update ca->cnt at most once per jiffy. /* The CUBIC function can update ca->cnt at most once per jiffy.
* On all cwnd reduction events, ca->epoch_start is set to 0, * On all cwnd reduction events, ca->epoch_start is set to 0,
* which will force a recalculation of ca->cnt. * which will force a recalculation of ca->cnt.
*/ */
if (ca->epoch_start && tcp_time_stamp == ca->last_time) if (ca->epoch_start && tcp_jiffies32 == ca->last_time)
goto tcp_friendliness; goto tcp_friendliness;
ca->last_cwnd = cwnd; ca->last_cwnd = cwnd;
ca->last_time = tcp_time_stamp; ca->last_time = tcp_jiffies32;
if (ca->epoch_start == 0) { if (ca->epoch_start == 0) {
ca->epoch_start = tcp_time_stamp; /* record beginning */ ca->epoch_start = tcp_jiffies32; /* record beginning */
ca->ack_cnt = acked; /* start counting */ ca->ack_cnt = acked; /* start counting */
ca->tcp_cwnd = cwnd; /* syn with cubic */ ca->tcp_cwnd = cwnd; /* syn with cubic */
...@@ -276,7 +276,7 @@ static inline void bictcp_update(struct bictcp *ca, u32 cwnd, u32 acked) ...@@ -276,7 +276,7 @@ static inline void bictcp_update(struct bictcp *ca, u32 cwnd, u32 acked)
* if the cwnd < 1 million packets !!! * if the cwnd < 1 million packets !!!
*/ */
t = (s32)(tcp_time_stamp - ca->epoch_start); t = (s32)(tcp_jiffies32 - ca->epoch_start);
t += msecs_to_jiffies(ca->delay_min >> 3); t += msecs_to_jiffies(ca->delay_min >> 3);
/* change the unit from HZ to bictcp_HZ */ /* change the unit from HZ to bictcp_HZ */
t <<= BICTCP_HZ; t <<= BICTCP_HZ;
...@@ -448,7 +448,7 @@ static void bictcp_acked(struct sock *sk, const struct ack_sample *sample) ...@@ -448,7 +448,7 @@ static void bictcp_acked(struct sock *sk, const struct ack_sample *sample)
return; return;
/* Discard delay samples right after fast recovery */ /* Discard delay samples right after fast recovery */
if (ca->epoch_start && (s32)(tcp_time_stamp - ca->epoch_start) < HZ) if (ca->epoch_start && (s32)(tcp_jiffies32 - ca->epoch_start) < HZ)
return; return;
delay = (sample->rtt_us << 3) / USEC_PER_MSEC; delay = (sample->rtt_us << 3) / USEC_PER_MSEC;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment