* [PATCH net-next] tcp: timestamp SYN+DATA messages
@ 2014-03-10 0:36 Eric Dumazet
2014-03-10 16:22 ` Neal Cardwell
2014-03-10 20:17 ` David Miller
0 siblings, 2 replies; 4+ messages in thread
From: Eric Dumazet @ 2014-03-10 0:36 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Neal Cardwell, Yuchung Cheng
From: Eric Dumazet <edumazet@google.com>
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>
---
net/ipv4/tcp_input.c | 1 +
net/ipv4/tcp_output.c | 6 ++++++
2 files changed, 7 insertions(+)
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,
flag |= FLAG_RETRANS_DATA_ACKED;
} else {
last_ackt = skb->skb_mstamp;
+ WARN_ON_ONCE(last_ackt.v64 == 0);
if (!first_ackt.v64)
first_ackt = last_ackt;
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index bc0fb0fc7552..a64c51d6f9b6 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)
tcp_connect_queue_skb(sk, data);
fo->copied = data->len;
+ /* syn_data is about to be sent, we need to take current time stamps
+ * for the packets that are in write queue : SYN packet and DATA
+ */
+ skb_mstamp_get(&syn->skb_mstamp);
+ data->skb_mstamp = syn->skb_mstamp;
+
if (tcp_transmit_skb(sk, syn_data, 0, sk->sk_allocation) == 0) {
tp->syn_data = (fo->copied > 0);
NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPORIGDATASENT);
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] tcp: timestamp SYN+DATA messages
2014-03-10 0:36 [PATCH net-next] tcp: timestamp SYN+DATA messages Eric Dumazet
@ 2014-03-10 16:22 ` Neal Cardwell
2014-03-10 18:49 ` Yuchung Cheng
2014-03-10 20:17 ` David Miller
1 sibling, 1 reply; 4+ messages in thread
From: Neal Cardwell @ 2014-03-10 16:22 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, netdev, Yuchung Cheng
On Sun, Mar 9, 2014 at 8:36 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> 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>
neal
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] tcp: timestamp SYN+DATA messages
2014-03-10 16:22 ` Neal Cardwell
@ 2014-03-10 18:49 ` Yuchung Cheng
0 siblings, 0 replies; 4+ messages in thread
From: Yuchung Cheng @ 2014-03-10 18:49 UTC (permalink / raw)
To: Neal Cardwell; +Cc: Eric Dumazet, David Miller, netdev
On Mon, Mar 10, 2014 at 9:22 AM, Neal Cardwell <ncardwell@google.com> wrote:
> On Sun, Mar 9, 2014 at 8:36 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>> From: Eric Dumazet <edumazet@google.com>
>>
>> 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>
>
> neal
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] tcp: timestamp SYN+DATA messages
2014-03-10 0:36 [PATCH net-next] tcp: timestamp SYN+DATA messages Eric Dumazet
2014-03-10 16:22 ` Neal Cardwell
@ 2014-03-10 20:17 ` David Miller
1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2014-03-10 20:17 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, ncardwell, ycheng
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sun, 09 Mar 2014 17:36:02 -0700
> From: Eric Dumazet <edumazet@google.com>
>
> 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>
Applied, thanks Eric.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-03-10 20:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-10 0:36 [PATCH net-next] tcp: timestamp SYN+DATA messages Eric Dumazet
2014-03-10 16:22 ` Neal Cardwell
2014-03-10 18:49 ` Yuchung Cheng
2014-03-10 20:17 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).