Hi,
PTP accuracy is increased when the HW time-stamp is taken as close to
the network wire as possible. In an effort to improve the time-stamp
accuracy, we consider extending the ptp4l. I would like to receive your
feed-back on the suggested below:
I would like to push an infra structure hook to the ptp4l. This hook
allows vendors to estimate the HW time-stamp closer to the actual
transmission and reach better accuracy. The hook will receive the HW
timestamp as an input and will be able to manipulate it.
I am no expert in ptp4l source code, but from a quick look in the source
I think the below point is a good place for the hook.
int sk_receive(int fd, void *buf, int buflen,
struct address *addr, struct hw_timestamp *hwts,
int flags)
{
...
if (addr)
addr->len = msg.msg_namelen;
if (!ts) {
memset(&hwts->ts, 0, sizeof(hwts->ts));
return cnt < 1 ? -errno : cnt;
}
=> Add hook here
switch (hwts->type) {
case TS_SOFTWARE:
hwts->ts = timespec_to_tmv(ts[0]);
break;
case TS_HARDWARE:
case TS_ONESTEP:
case TS_P2P1STEP:
hwts->ts = timespec_to_tmv(ts[2]);
break;
case TS_LEGACY_HW:
hwts->ts = timespec_to_tmv(ts[1]);
break;
}
...
}
Thanks,
Aya
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel