tcp: consolidate SYNACK RTT sampling

The first patch consolidates SYNACK and other RTT measurement to use a
central function tcp_ack_update_rtt(). A (small) bonus is now SYNACK
RTT measurement happens after PAWS check, potentially reducing the
impact of RTO seeding on bad TCP timestamps values.

Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Yuchung Cheng
2013-07-22 16:20:45 -07:00
committed by David S. Miller
parent c3f51d5f38
commit 375fe02c91
5 changed files with 14 additions and 21 deletions

View File

@@ -1094,15 +1094,6 @@ static inline void tcp_openreq_init(struct request_sock *req,
ireq->loc_port = tcp_hdr(skb)->dest;
}
/* Compute time elapsed between SYNACK and the ACK completing 3WHS */
static inline void tcp_synack_rtt_meas(struct sock *sk,
struct request_sock *req)
{
if (tcp_rsk(req)->snt_synack)
tcp_valid_rtt_meas(sk,
tcp_time_stamp - tcp_rsk(req)->snt_synack);
}
extern void tcp_enter_memory_pressure(struct sock *sk);
static inline int keepalive_intvl_when(const struct tcp_sock *tp)