linuxptp
linuxptp copied to clipboard
Use precise frequency for TX SYNC messages
The actual ptp4l implementation rearms timers after the expiration. This approach doesn't permit to have a precise TX SYNC message scheduling. During my test the TX SYNC frequency is slightly lower the expectation (eg 15.99Hz vs 16Hz).
The following patchset uses non blocking timers and only for TX SYNC timer implements a precise periodic timer. Before to enable the periodic timer we have to:
- read the timer file descriptors after the expiration in order to have the expirations counter (useful for debug also);
- avoid to touch timers with a timerfd_settime() before the read() call, this required to rearrange the fd array and split the announce and rx sync code;
- remove timerfd_settime() on tx sync expiration.
History: v4 Pass sanity test v3 Small review