From: Eric Dumazet <eric.dumazet@gmail.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Network Development <netdev@vger.kernel.org>
Subject: Re: SO_TIMESTAMP on tcp sockets?
Date: Tue, 08 May 2012 06:37:11 +0200 [thread overview]
Message-ID: <1336451831.3752.2373.camel@edumazet-glaptop> (raw)
In-Reply-To: <CALCETrVUjLz63uzr+UTf-G1jq9QDcX6Gf9D6AWK8_GmunsJGnw@mail.gmail.com>
On Mon, 2012-05-07 at 18:39 -0700, Andy Lutomirski wrote:
> I've been using SO_TIMESTAMPNS to good effect on udp sockets. I'd
> like to do the same thing for tcp. I realize that this is
> semantically strange [1], but I don't think there's a real issue for
> my use case. We have very thin streams -- we are likely to process
> each incoming segment as it is received, and I want the most precise
> timestamp possible on each segment.
>
> A simple approach (I think) would be for a recvmsg on a tcp socket
> with SO_TIMESTAMP(NS) to return at most one skb worth of data along
> with the timestamp associated with that skb. This could be a little
> strange if multiple segments overlap or if lro is involved, but
> neither of those cases seems like a major problem.
>
> Is there any interest in something like this?
>
LRO/GRO is not really a problem, buffers are merged because they are
received in a very short time period. If you want nanosec timestamping
on TCP, just cancel the whole idea.
TCP can 'collapse' several buffers onto single ones (to reduce memory
overhead). Which timestamp would be chosen at collapse time ?
net-next also has tcp coalescing, wich also merge buffers as soon as
they enter receive or ofo queue.
Another problem with SO_TIMESTAMPNS is it globally enables time stamping
on all skbs on the host, adding some latencies. (ktime_get() can be
slowed down when time keeping triggers and hold xtime seqlock)
next prev parent reply other threads:[~2012-05-08 4:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-08 1:39 SO_TIMESTAMP on tcp sockets? Andy Lutomirski
2012-05-08 4:37 ` Eric Dumazet [this message]
2012-05-08 21:35 ` Andy Lutomirski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1336451831.3752.2373.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=luto@amacapital.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox