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

tcp: use tcp_jiffies32 for rcv_tstamp and lrcvtime

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 ac35f562
...@@ -1307,8 +1307,8 @@ static inline u32 keepalive_time_elapsed(const struct tcp_sock *tp) ...@@ -1307,8 +1307,8 @@ static inline u32 keepalive_time_elapsed(const struct tcp_sock *tp)
{ {
const struct inet_connection_sock *icsk = &tp->inet_conn; const struct inet_connection_sock *icsk = &tp->inet_conn;
return min_t(u32, tcp_time_stamp - icsk->icsk_ack.lrcvtime, return min_t(u32, tcp_jiffies32 - icsk->icsk_ack.lrcvtime,
tcp_time_stamp - tp->rcv_tstamp); tcp_jiffies32 - tp->rcv_tstamp);
} }
static inline int tcp_fin_time(const struct sock *sk) static inline int tcp_fin_time(const struct sock *sk)
......
...@@ -672,7 +672,7 @@ static void tcp_event_data_recv(struct sock *sk, struct sk_buff *skb) ...@@ -672,7 +672,7 @@ static void tcp_event_data_recv(struct sock *sk, struct sk_buff *skb)
tcp_rcv_rtt_measure(tp); tcp_rcv_rtt_measure(tp);
now = tcp_time_stamp; now = tcp_jiffies32;
if (!icsk->icsk_ack.ato) { if (!icsk->icsk_ack.ato) {
/* The _first_ data packet received, initialize /* The _first_ data packet received, initialize
...@@ -3636,7 +3636,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) ...@@ -3636,7 +3636,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
*/ */
sk->sk_err_soft = 0; sk->sk_err_soft = 0;
icsk->icsk_probes_out = 0; icsk->icsk_probes_out = 0;
tp->rcv_tstamp = tcp_time_stamp; tp->rcv_tstamp = tcp_jiffies32;
if (!prior_packets) if (!prior_packets)
goto no_queue; goto no_queue;
...@@ -5554,7 +5554,7 @@ void tcp_finish_connect(struct sock *sk, struct sk_buff *skb) ...@@ -5554,7 +5554,7 @@ void tcp_finish_connect(struct sock *sk, struct sk_buff *skb)
struct inet_connection_sock *icsk = inet_csk(sk); struct inet_connection_sock *icsk = inet_csk(sk);
tcp_set_state(sk, TCP_ESTABLISHED); tcp_set_state(sk, TCP_ESTABLISHED);
icsk->icsk_ack.lrcvtime = tcp_time_stamp; icsk->icsk_ack.lrcvtime = tcp_jiffies32;
if (skb) { if (skb) {
icsk->icsk_af_ops->sk_rx_dst_set(sk, skb); icsk->icsk_af_ops->sk_rx_dst_set(sk, skb);
......
...@@ -447,7 +447,7 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, ...@@ -447,7 +447,7 @@ struct sock *tcp_create_openreq_child(const struct sock *sk,
newtp->mdev_us = jiffies_to_usecs(TCP_TIMEOUT_INIT); newtp->mdev_us = jiffies_to_usecs(TCP_TIMEOUT_INIT);
minmax_reset(&newtp->rtt_min, tcp_time_stamp, ~0U); minmax_reset(&newtp->rtt_min, tcp_time_stamp, ~0U);
newicsk->icsk_rto = TCP_TIMEOUT_INIT; newicsk->icsk_rto = TCP_TIMEOUT_INIT;
newicsk->icsk_ack.lrcvtime = tcp_time_stamp; newicsk->icsk_ack.lrcvtime = tcp_jiffies32;
newtp->packets_out = 0; newtp->packets_out = 0;
newtp->retrans_out = 0; newtp->retrans_out = 0;
......
...@@ -3324,7 +3324,7 @@ static void tcp_connect_init(struct sock *sk) ...@@ -3324,7 +3324,7 @@ static void tcp_connect_init(struct sock *sk)
if (likely(!tp->repair)) if (likely(!tp->repair))
tp->rcv_nxt = 0; tp->rcv_nxt = 0;
else else
tp->rcv_tstamp = tcp_time_stamp; tp->rcv_tstamp = tcp_jiffies32;
tp->rcv_wup = tp->rcv_nxt; tp->rcv_wup = tp->rcv_nxt;
tp->copied_seq = tp->rcv_nxt; tp->copied_seq = tp->rcv_nxt;
......
...@@ -451,7 +451,7 @@ void tcp_retransmit_timer(struct sock *sk) ...@@ -451,7 +451,7 @@ void tcp_retransmit_timer(struct sock *sk)
tp->snd_una, tp->snd_nxt); tp->snd_una, tp->snd_nxt);
} }
#endif #endif
if (tcp_time_stamp - tp->rcv_tstamp > TCP_RTO_MAX) { if (tcp_jiffies32 - tp->rcv_tstamp > TCP_RTO_MAX) {
tcp_write_err(sk); tcp_write_err(sk);
goto out; goto out;
} }
......
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