From: lsorense@csclub.uwaterloo.ca (Lennart Sorensen)
To: Octavian Purdila <opurdila@ixiacom.com>
Cc: netdev@vger.kernel.org
Subject: Re: [RFC] support for IEEE 1588
Date: Wed, 9 Jul 2008 11:31:03 -0400 [thread overview]
Message-ID: <20080709153103.GC31127@csclub.uwaterloo.ca> (raw)
In-Reply-To: <200807040147.11148.opurdila@ixiacom.com>
On Fri, Jul 04, 2008 at 01:47:11AM +0300, Octavian Purdila wrote:
>
> Hi everybody,
>
> IEEE 1588 Precision Time Protocol [1] requires hardware timestamping support
> for both RX and TX frames. It seems that in Linux we do not have the support
> required for this protocol to be implemented.
ptpd in user space plus some specialized hardware is doing it for us.
No kernel changes were required. Of course the specialized hardware
maintains time and receives it from GPS, so I guess that's only one
possible use.
As a client the hardware deals with the 1588 packets and generates NMEA
style messages on a serial port and makes it look to ntp as if it is
receiving time from a standard GPS with PPS on the CD pin.
To support receiving 1588 on one port and forwarding it out another
would certainly need more support both from hardware and probably
software.
> Any feedback on the approach we are planing to take is greatly appreciated. We
> will follow with a patch at some point, but I just want to check with you
> gurus early, to avoid potential design flaws. If a patch is preferred for
> commenting on, then please ignore this and will come back later with the
> patch.
>
> 1. RX path
> - add a new field in skb to keep the hardware stamp (hwstamp)
> - add a new socket flag to enable RX stamping
> - add a new control message to retrieve the hwstamp from the skb to user-space
> application (for UDP and maybe PF_PACKET)
>
> 2. TX path - this is a bit more complicated since we need a new mechanism to
> wait for a packet transmission on wire, from users-space.
> - add a new flag for the skb to request TX stamping
> - add a new control message to propagate the TX stamping request from
> userspace to the skb
> - when the driver will send the packet will get the stamp from the TX
> completion ring; the driver will then propagate the stamp either to
> (a) the skb stamp field, or (b) some special structure - this to avoid keeping
> the skb around
> - the special structure or the skb will be linked to a special queue in the
> socket and a POLLPRI event will be generated
> - the application will use recvmsg and will receive a new control message
> which contains the timestamp from the socket special queue
>
> We will probably need to associate a cookie with each TX stamping control
> message which will be retrieve in the later control message, so that the
> application can match send packets with timestamps.
>
> [1] http://ieee1588.nist.gov/tutorial-basic.pdf
--
Len Sorensen
prev parent reply other threads:[~2008-07-09 15:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-03 22:47 [RFC] support for IEEE 1588 Octavian Purdila
2008-07-03 23:24 ` Stephen Hemminger
2008-07-03 23:40 ` Octavian Purdila
2008-07-04 0:15 ` Rick Jones
2008-07-04 0:42 ` Octavian Purdila
2008-07-04 11:24 ` Andi Kleen
2008-07-04 13:37 ` Patrick Ohly
2008-07-05 0:21 ` Octavian Purdila
2008-07-07 12:34 ` Patrick Ohly
2008-07-09 15:31 ` Lennart Sorensen [this message]
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=20080709153103.GC31127@csclub.uwaterloo.ca \
--to=lsorense@csclub.uwaterloo.ca \
--cc=netdev@vger.kernel.org \
--cc=opurdila@ixiacom.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).