[RFC] support for IEEE 1588

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <netdev@...>
Date: Thursday, July 3, 2008 - 6:47 pm

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. 

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

Thanks,
tavi
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC] support for IEEE 1588, Octavian Purdila, (Thu Jul 3, 6:47 pm)
Re: [RFC] support for IEEE 1588, Lennart Sorensen, (Wed Jul 9, 11:31 am)
Re: [RFC] support for IEEE 1588, Patrick Ohly, (Fri Jul 4, 9:37 am)
Re: [RFC] support for IEEE 1588, Octavian Purdila, (Fri Jul 4, 8:21 pm)
Re: [RFC] support for IEEE 1588, Patrick Ohly, (Mon Jul 7, 8:34 am)
Re: [RFC] support for IEEE 1588, Stephen Hemminger, (Thu Jul 3, 7:24 pm)
Re: [RFC] support for IEEE 1588, Octavian Purdila, (Thu Jul 3, 7:40 pm)
Re: [RFC] support for IEEE 1588, Rick Jones, (Thu Jul 3, 8:15 pm)
Re: [RFC] support for IEEE 1588, Andi Kleen, (Fri Jul 4, 7:24 am)
Re: [RFC] support for IEEE 1588, Octavian Purdila, (Thu Jul 3, 8:42 pm)