On Wed, Jan 4, 2017 at 11:19 AM, Soheil Hassas Yeganeh <soheil.k...@gmail.com> wrote: > From: Soheil Hassas Yeganeh <soh...@google.com> > > For TCP sockets, TX timestamps are only captured when the user data > is successfully and fully written to the socket. In many cases, > however, TCP writes can be partial for which no timestamp is > collected. > > Collect timestamps whenever any user data is (fully or partially) > copied into the socket. Pass tcp_write_queue_tail to tcp_tx_timestamp > instead of the local skb pointer since it can be set to NULL on > the error path. > > Note that tcp_write_queue_tail can be NULL, even if bytes have been > copied to the socket. This is because acknowledgements are being > processed in tcp_sendmsg(), and by the time tcp_tx_timestamp is > called tcp_write_queue_tail can be NULL. For such cases, this patch > does not collect any timestamps (i.e., it is best-effort). > > This patch is written with suggestions from Willem de Bruijn and > Eric Dumazet. > > Change-log V1 -> V2: > - Use sockc.tsflags instead of sk->sk_tsflags. > - Use the same code path for normal writes and errors. > > Signed-off-by: Soheil Hassas Yeganeh <soh...@google.com> > Acked-by: Yuchung Cheng <ych...@google.com> > Cc: Willem de Bruijn <will...@google.com> > Cc: Eric Dumazet <eduma...@google.com> > Cc: Neal Cardwell <ncardw...@google.com> > Cc: Martin KaFai Lau <ka...@fb.com>
Acked-by: Willem de Bruijn <will...@google.com>