From: Octavian Purdila <opurdila@ixiacom.com>
To: Patrick Ohly <patrick.ohly@intel.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Stephen Hemminger <shemminger@vyatta.com>,
Ingo Oeser <netdev@axxeo.de>, Andi Kleen <ak@linux.intel.com>,
"Ronciak, John" <john.ronciak@intel.com>
Subject: Re: hardware time stamps + existing time stamp usage
Date: Mon, 20 Oct 2008 16:07:04 +0300 [thread overview]
Message-ID: <200810201607.05758.opurdila@ixiacom.com> (raw)
In-Reply-To: <1224505645.17450.299.camel@ecld0pohly>
From: Patrick Ohly <patrick.ohly@intel.com>
Date: Mon, 20 Oct 2008 14:27:25 +0200
> I think it would be best to transform back to raw time stamps at the
> socket level if requested by the application: SO_TIMESTAMPNS would
> always return the transformed time stamp and a new SO_TIMESTAMP_HARDWARE
> the corresponding hardware time stamp, if one exists.
This is better, indeed.
> If that value is
> not needed and computing it is considered to costly, a
> SO_TIMESTAME_IS_HARDWARE could also be added.
I didn't get this part.
> My proposal is to implement as much of this in generic code. A specific
> driver then only has to provide access to its clock and alert the
> generic code of special circumstances (like reseting the clock). It can
> also choose between an advanced method (see below) and a simple delta,
> as needed.
Agreed.
> > The problem here is that we want to distinguish between system and
> > hardware timestamps. A possible approach would be to use a slightly
> > coarser precision (say Xns instead of 1ns) and then use the modulo X to
> > encode state into the timestamp.
> >
> > For example, we could say that hardware timestamp = (hwtimestamp/X)*X and
> > software timestamp = ((system time/X)*X) +1
>
> My expectation is that the lower bits of both software and hardware time
> stamps are unused anyway. But I would reverse the logic and return the
> more common software time stamps with the lower bits cleared, so that
> ideally they are identical to time stamps without the additional
> semantic.
>
Right, its better this way.
> Perhaps it would be acceptable to add a single bit flag to sk_buff
> itself instead, but I'm not sure about that.
>
Last time I've checked, sk_buff didn't had any holes, thus adding one bit will
enlarge it. And I think that this approach gives use more room for any
enhancements we may need in the future.
> > Than, in the hwtimestamp_ioctl we can check if a received time is
> > software or hardware, and we can let the application know.
>
> As I said above, I think this should be done in recv_msg() as configured
> by socket flags.
>
Agreed.
> > We can even compute the delta periodically now, to maintain better system
> > - hardware timestamps synchronization, as we can keep and multiple deltas
> > (each one associated with a modulo number).
>
> The transformation that I used was "system time = hardware time + delta
> + skew * time since last measurement". Perhaps this is overkill: the
> last summand often was small (a few nanoseconds), but that depends on
> the skew. Although it complicates the implementation, I would prefer to
> implement that mapping function, just to be on the safe side.
Sure, we can use multiple sync methods as you've said, one being the simple
delta and then this one as the more advanced method.
Thanks,
tavi
next prev parent reply other threads:[~2008-10-20 13:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-17 14:23 hardware time stamps + existing time stamp usage Patrick Ohly
2008-10-18 5:02 ` Eric Dumazet
2008-10-18 7:38 ` Oliver Hartkopp
2008-10-18 8:54 ` Eric Dumazet
2008-10-18 10:10 ` Oliver Hartkopp
2008-10-20 7:35 ` Patrick Ohly
2008-10-20 18:01 ` Oliver Hartkopp
2008-10-21 7:29 ` Patrick Ohly
2008-10-18 19:37 ` Octavian Purdila
2008-10-20 12:27 ` Patrick Ohly
2008-10-20 13:07 ` Octavian Purdila [this message]
2008-10-20 13:37 ` Patrick Ohly
2008-10-21 7:04 ` Andi Kleen
2008-10-21 7:40 ` Patrick Ohly
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=200810201607.05758.opurdila@ixiacom.com \
--to=opurdila@ixiacom.com \
--cc=ak@linux.intel.com \
--cc=john.ronciak@intel.com \
--cc=netdev@axxeo.de \
--cc=netdev@vger.kernel.org \
--cc=patrick.ohly@intel.com \
--cc=shemminger@vyatta.com \
/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;
as well as URLs for NNTP newsgroup(s).