Discussion:
[Linuxptp-devel] Hard- and or software timestamping in Linux
Axel Holzinger
2015-02-17 10:34:26 UTC
Permalink
Hello Richard et al,

as you Richard were the main force doing the work for adding hardware
timestamping to the Linux kernel, could you enlight me how the association
of a timestamp residing in kernel space (I guess in the ethernet device
driver's domain) and a PTP message is handled by the kernel? I'm asking
myself which PTP message fields actually are chosen to get the right
timestamp for a message. Or is every network packet timestamped and the
association is done by a hash or crc or something similar?

Thanks in advance
Axel
Richard Cochran
2015-02-17 16:31:07 UTC
Permalink
Post by Axel Holzinger
as you Richard were the main force doing the work for adding hardware
timestamping to the Linux kernel, could you enlight me how the association
of a timestamp residing in kernel space (I guess in the ethernet device
driver's domain) and a PTP message is handled by the kernel? I'm asking
myself which PTP message fields actually are chosen to get the right
timestamp for a message. Or is every network packet timestamped and the
association is done by a hash or crc or something similar?
This is done differently in every driver, depending on the hardware.

Some hardware provides the time stamp "in band", for example in the
frame's buffer descriptor or in the frame data. In this case, the
association is clear.

Other (worse) hardware provides the time stamp "out of band", separate
from the frame, in a time stamp fifo for example. Sometimes there is
no fifo but rather a single register! In these cases, the driver must
somehow match the time stamp with a frame. Some hardware provides
various matching fields with the time stamp, like sequence number,
message type, or a hash over multiple fields. It all depends on the
hardware. If you look into various drivers, you will find functions
called match(). There you can see exactly what fields are used.

HTH
Richard
Axel Holzinger
2015-02-17 17:15:59 UTC
Permalink
<snip>
Post by Richard Cochran
This is done differently in every driver, depending on the hardware.
Some hardware provides the time stamp "in band", for example in the
frame's buffer descriptor or in the frame data. In this case, the
association is clear.
Other (worse) hardware provides the time stamp "out of band", separate
from the frame, in a time stamp fifo for example. Sometimes there is
no fifo but rather a single register! In these cases, the driver must
somehow match the time stamp with a frame. Some hardware provides
various matching fields with the time stamp, like sequence number,
message type, or a hash over multiple fields. It all depends on the
hardware. If you look into various drivers, you will find functions
called match(). There you can see exactly what fields are used.
HTH
Richard
That helps a lot. Thank you very much!

I came across Windows implementations where only the sequence id is used and
IMHO this is not sufficient (thinking of different domains on the same
network).

Cheers
Axel
Richard Cochran
2015-02-17 19:03:45 UTC
Permalink
Post by Axel Holzinger
I came across Windows implementations where only the sequence id is used and
IMHO this is not sufficient (thinking of different domains on the same
network).
Yes, your are right, that is insufficient. Think of a master that
receives multiple Delay_Req events from different slaves.

Unfortunately, there are hardware implementations that also provide
sequenceId only.

Thanks,
Richard

Loading...