netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* hardware time stamping with extra skb->hwtstamp
@ 2008-11-19 12:08 Patrick Ohly
  2008-11-19 12:08 ` [RFC PATCH 01/11] put_cmsg_compat + SO_TIMESTAMP[NS]: use same name for value as caller Patrick Ohly
  2008-11-27  6:14 ` hardware time stamping with extra skb->hwtstamp Oliver Hartkopp
  0 siblings, 2 replies; 31+ messages in thread
From: Patrick Ohly @ 2008-11-19 12:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: netdev, David Miller

This patch series was discussed before on linux-netdev ("hardware
time stamping + igb example implementation"). Since then I have
rebased against net-next and addressed all comments sent so far,
except Octavian's suggestion to include more information in the
packet which is bounced back to the application.

As suggested by David, I'm now also including linux-kernel because:
 * patch 2 adds a new user space API (documentation and example
   program included, but no man page patch yet)
 * patch 8 extends the clocksource struct (mostly adds code, but
   also adds one branch to reading the clock, which may affect
   gettimeofday)
 * patch 10 adds generic code for time synchronization (not
   network specific, so people not subscribed to linux-netdev
   might have comments)

The open question on linux-netdev was whether struct sk_buff
should be extended to hold the additional hardware time
stamp. The previous patch avoided that at the cost of much more
complicated code and side effects on normal time stamping.

This patch now adds a 8 byte field unconditionally. The
implementation is a lot more straight-forward. The user space
API was already designed to cover this case, so it remained
unchanged.

There's one unsolved problem, though: time synchronization with
PTP (the use case I'm working on) requires a transformation of
raw hardware time stamps into system time. Currently this is done
at the socket level by finding the device which created the time
stamp and letting it do the transformation. This fails for
incoming packets because skb->rt points to the "lo" device.

Perhaps the interface number can be used to find the real
hardware device. Alternatively the conversion could be done when
generating the time stamp (might also be more accurate), but then
another 8 byte field is needed. Delta encoding won't help because
one cannot assume that hardware time stamps track system time
closely enough.

I'm posting the patch despite this problem so that the discussion
can move forward. There are other TODOs anyway; in particular the
igb extension is just a proof-of-concept.

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2008-12-12  8:50 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-19 12:08 hardware time stamping with extra skb->hwtstamp Patrick Ohly
2008-11-19 12:08 ` [RFC PATCH 01/11] put_cmsg_compat + SO_TIMESTAMP[NS]: use same name for value as caller Patrick Ohly
2008-11-19 12:08   ` [RFC PATCH 02/11] net: new user space API for time stamping of incoming and outgoing packets Patrick Ohly
2008-11-19 12:08     ` [RFC PATCH 03/11] net: infrastructure for hardware time stamping Patrick Ohly
2008-11-19 12:08       ` [RFC PATCH 04/11] net: socket infrastructure for SO_TIMESTAMPING Patrick Ohly
2008-11-19 12:08         ` [RFC PATCH 05/11] ip: support for TX timestamps on UDP and RAW sockets Patrick Ohly
2008-11-19 12:08           ` [RFC PATCH 06/11] net: pass new SIOCSHWTSTAMP through to device drivers Patrick Ohly
2008-11-19 12:08             ` [RFC PATCH 07/11] igb: stub support for SIOCSHWTSTAMP Patrick Ohly
2008-11-19 12:08               ` [RFC PATCH 08/11] clocksource: allow usage independent of timekeeping.c Patrick Ohly
2008-11-19 12:08                 ` [RFC PATCH 09/11] igb: infrastructure for hardware time stamping Patrick Ohly
2008-11-19 12:08                   ` [RFC PATCH 10/11] time sync: generic infrastructure to map between time stamps generated by a clock source and system time Patrick Ohly
2008-11-19 12:08                     ` [RFC PATCH 11/11] igb: use clocksync to implement hardware time stamping Patrick Ohly
2008-11-20  1:14                     ` [RFC PATCH 10/11] time sync: generic infrastructure to map between time stamps generated by a clock source and system time Andrew Morton
2008-11-20  7:08                       ` Ohly, Patrick
2008-12-05 21:05                 ` [RFC PATCH 08/11] clocksource: allow usage independent of timekeeping.c john stultz
2008-12-11 12:11                   ` Patrick Ohly
2008-12-11 22:23                     ` john stultz
2008-12-12  8:50                       ` Patrick Ohly
2008-11-19 15:21       ` [RFC PATCH 03/11] net: infrastructure for hardware time stamping Patrick Ohly
2008-11-27  6:14 ` hardware time stamping with extra skb->hwtstamp Oliver Hartkopp
2008-11-27 10:07   ` Patrick Ohly
2008-11-27 14:02     ` Octavian Purdila
2008-11-27 15:31       ` Patrick Ohly
2008-11-27 18:53         ` Octavian Purdila
2008-11-27 22:13           ` Oliver Hartkopp
2008-11-28 12:55             ` Octavian Purdila
2008-11-28 15:38               ` Oliver Hartkopp
2008-11-28 16:00                 ` Octavian Purdila
2008-12-01 10:37           ` Patrick Ohly
2008-12-01 16:31             ` Patrick Ohly
2008-12-01 16:45             ` Oliver Hartkopp

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).