linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: john stultz <johnstul@us.ibm.com>
To: Richard Cochran <richardcochran@gmail.com>
Cc: Rodolfo Giometti <giometti@linux.it>,
	Arnd Bergmann <arnd@arndb.de>,
	netdev@vger.kernel.org, devicetree-discuss@lists.ozlabs.org,
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	linux-arm-kernel@lists.infradead.org,
	Krzysztof Halasa <khc@pm.waw.pl>
Subject: Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.
Date: Tue, 17 Aug 2010 17:22:43 -0700	[thread overview]
Message-ID: <1282090963.1734.97.camel@localhost> (raw)
In-Reply-To: <20100817085324.GB3330@riccoc20.at.omicron.at>

On Tue, 2010-08-17 at 10:53 +0200, Richard Cochran wrote:
> On Mon, Aug 16, 2010 at 12:24:48PM -0700, john stultz wrote:
> > 3) I'm not sure I see the benefit of being able to have multiple
> > frequency corrected time domains.  In other words, what benefit would
> > you get from adjusting a PTP clock's frequency instead of just
> > adjusting the system's time freq? Having the PTP time as a reference
> > to correct the system time seems reasonable, but I'm not sure I see
> > why userland would want to adjust the PTP clock's freq.
> 
> For PTP enabled hardware, the timestamp on the network packet comes
> from from the PTP clock, not from the system time.
> 
> Of course, you can always just leave the PTP clock alone, figure the
> needed correction, and apply it whenever needed. But this has some
> disadvantages. First of all, the (one and only) open source PTPd does
> not do it that way. Also, only one program (the PTPd or equivalent)
> will know the correct time. Other programs will not be able to ask the
> operating system for time services. Instead, they would need to use
> IPC to the PTPd.

Why would system time not be adjusted to the PTP time?

This is my main concern, that we're presenting a fractured API to
userland. Suddenly there isn't just system time, but ptp time as well,
and possibly multiple different ptp times.

Forgive me, as I suspect I'm missing something key here.

> The PTP protocol (and some PTP hardware) offers a "one step" method,
> where the timestamps are inserted by the hardware on the fly. Here you
> really do need the PTP clock to be correctly adjusted.
> 
> All of the PTP hardware that I am familiar with provides a clock
> adjustment method, so it simpler and cleaner just to use this facility
> to tune the PTP clock.

Hmm. So trying to recap here to see if I'm understanding properly:

The PTP clock is a bit of hardware (usually on the NIC) that can put
timestamps on packets (both incoming or outgoing?).

The need to offset/freq correct the PTP clock is important so that the
timestamps (incoming and outgoing) are correct, which makes future
offset calculations simpler.

Hmm. So I'm actually starting to come around to the chardev interface.

In a way, it seems it has some similarities to how the RTC device is
used in NTPd. Granted, NTPd doesn't correct the RTC (the kernel does
when we're synced, but its not a perfect parallel), but it can be used
as an input the steer the clock.

So while to me, it think it would be more ideal (or maybe just less
different) to have a read-only interface (like the RTC), leaving PTPd to
manage offset calculations and use that to steer the system time. I can
acknowledge the need to have some way to correct the freq so the packet
timestamps are corrected.

I still feel a little concerned over the timer/alarm related interfaces.
Could you explain why the alarm interface is necessary? 

So really I think my initial negative gut reaction to this was mostly
out of the fact that you introduced a char dev that provides almost 100%
coverage of the posix-time interface. That is duplication we definitely
don't want. 

Also I think the documentation I've read about PTP (likely just due to
the engineering focus) has an odd inverted sense of priority, focusing
on keeping obscure hardware clocks on NIC cards in sync, rather then the
the more tangible feature of keeping the system time in sync.

This could be comically interpreted as trying to create a shadow-time on
the system that is the "real time" and "yea, maybe we'll let the system
know what time it is, but user-apps who want to know the score can send
a magic ioctl to /dev/something and get the real deal". ;)  I'm sure
that's not the case, but I'd like to keep any confusion in userland
about which time is the best time to a minimum (ie: use the system
time).

thanks
-john

  reply	other threads:[~2010-08-18  0:22 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-16 11:17 [PATCH v5 0/5] ptp: IEEE 1588 clock support Richard Cochran
2010-08-16 11:17 ` [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks Richard Cochran
2010-08-16 14:26   ` Arnd Bergmann
2010-08-16 19:00     ` Richard Cochran
2010-08-16 19:59       ` Arnd Bergmann
2010-08-17  8:32         ` Richard Cochran
2010-08-17  9:25           ` Arnd Bergmann
2010-08-17 10:52             ` Richard Cochran
2010-08-17 11:36               ` Arnd Bergmann
2010-08-18  0:40                 ` john stultz
2010-08-18 14:04                 ` Richard Cochran
2010-08-18 15:02                   ` Arnd Bergmann
2010-08-19  9:22                     ` Richard Cochran
2010-08-19 12:29                       ` Arnd Bergmann
2010-08-19 15:23                         ` Ira W. Snyder
2010-08-19 15:48                           ` Arnd Bergmann
2010-08-16 19:24   ` john stultz
2010-08-16 19:38     ` john stultz
2010-08-17  8:53     ` Richard Cochran
2010-08-18  0:22       ` john stultz [this message]
2010-08-18  7:19         ` Richard Cochran
2010-08-19  0:12           ` john stultz
2010-08-19  5:55             ` Richard Cochran
2010-08-19 12:28               ` Arnd Bergmann
2010-08-19 15:38                 ` Richard Cochran
2010-08-23 20:21                   ` john stultz
2010-08-27 11:08                     ` Richard Cochran
2010-08-27 12:03                       ` Arnd Bergmann
2010-08-27 20:56                         ` John Stultz
2010-08-27 12:45                       ` Alan Cox
2010-08-27 20:14                       ` John Stultz
2010-08-23 20:08               ` john stultz
2010-08-24 18:30                 ` Stephan Gatzka
2010-08-25  9:40                 ` Christian Riesch
2010-08-27  1:57                   ` john stultz
2010-08-27  7:57                     ` Richard Cochran
2010-08-27 12:41                       ` Alan Cox
2010-08-27 14:02                         ` Richard Cochran
2010-08-27 14:50                           ` Alan Cox
2010-08-27 15:35                           ` M. Warner Losh
2010-08-29 13:32                         ` Christian Riesch
2010-08-27 12:38                 ` Richard Cochran
2010-08-27 13:38                   ` Alan Cox
2010-08-27 14:34                     ` Richard Cochran
2010-08-27 15:06                       ` Alan Cox
2010-08-27 15:21                         ` Patrick Loschmidt
2010-08-27 16:17                           ` Jacob Keller
2010-08-27 22:30                   ` John Stultz
2010-09-06  6:33                     ` Richard Cochran
2010-09-21 16:54                       ` Stephan Gatzka
2010-09-21 20:47                     ` Kyle Moffett
2010-09-22 10:14                       ` Richard Cochran
2010-08-16 11:18 ` [PATCH 2/5] ptp: Added a clock that uses the Linux system time Richard Cochran
2010-08-16 11:18 ` [PATCH 3/5] ptp: Added a clock that uses the eTSEC found on the MPC85xx Richard Cochran
2010-08-16 11:18 ` [PATCH 4/5] ptp: Added a clock driver for the IXP46x Richard Cochran
2010-08-16 11:19 ` [PATCH 5/5] ptp: Added a clock driver for the National Semiconductor PHYTER Richard Cochran

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=1282090963.1734.97.camel@localhost \
    --to=johnstul@us.ibm.com \
    --cc=arnd@arndb.de \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=giometti@linux.it \
    --cc=khc@pm.waw.pl \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.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).