diff options
| author | Eric Dumazet <edumazet@google.com> | 2014-03-09 20:36:02 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2014-03-10 16:15:54 -0400 |
| commit | 431a91242d8d7876d33ab91b1f3ccdcd56b14f66 (patch) | |
| tree | 3469a5bca9cc5ee4c3397eb9b19fe2ca2e8f6c18 | |
| parent | 99d3016de4f2a29635f5382b0e9bd0e5f2151487 (diff) | |
tcp: timestamp SYN+DATA messages
All skb in socket write queue should be properly timestamped.
In case of FastOpen, we special case the SYN+DATA 'message' as we
queue in socket wrote queue the two fallback skbs:
1) SYN message by itself.
2) DATA segment by itself.
We should make sure these skbs have proper timestamps.
Add a WARN_ON_ONCE() to eventually catch future violations.
Fixes: 740b0f1841f6 ("tcp: switch rtt estimations to usec resolution")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | net/ipv4/tcp_input.c | 1 | ||||
| -rw-r--r-- | net/ipv4/tcp_output.c | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index b99003f556d8..e1661f46fd19 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
| @@ -3067,6 +3067,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets, | |||
| 3067 | flag |= FLAG_RETRANS_DATA_ACKED; | 3067 | flag |= FLAG_RETRANS_DATA_ACKED; |
| 3068 | } else { | 3068 | } else { |
| 3069 | last_ackt = skb->skb_mstamp; | 3069 | last_ackt = skb->skb_mstamp; |
| 3070 | WARN_ON_ONCE(last_ackt.v64 == 0); | ||
| 3070 | if (!first_ackt.v64) | 3071 | if (!first_ackt.v64) |
| 3071 | first_ackt = last_ackt; | 3072 | first_ackt = last_ackt; |
| 3072 | 3073 | ||
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index bc0fb0fc7552..5a163de5e142 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
| @@ -2972,6 +2972,12 @@ static int tcp_send_syn_data(struct sock *sk, struct sk_buff *syn) | |||
| 2972 | tcp_connect_queue_skb(sk, data); | 2972 | tcp_connect_queue_skb(sk, data); |
| 2973 | fo->copied = data->len; | 2973 | fo->copied = data->len; |
| 2974 | 2974 | ||
| 2975 | /* syn_data is about to be sent, we need to take current time stamps | ||
| 2976 | * for the packets that are in write queue : SYN packet and DATA | ||
| 2977 | */ | ||
| 2978 | skb_mstamp_get(&syn->skb_mstamp); | ||
| 2979 | data->skb_mstamp = syn->skb_mstamp; | ||
| 2980 | |||
| 2975 | if (tcp_transmit_skb(sk, syn_data, 0, sk->sk_allocation) == 0) { | 2981 | if (tcp_transmit_skb(sk, syn_data, 0, sk->sk_allocation) == 0) { |
| 2976 | tp->syn_data = (fo->copied > 0); | 2982 | tp->syn_data = (fo->copied > 0); |
| 2977 | NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPORIGDATASENT); | 2983 | NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPORIGDATASENT); |
