On Mon, May 20, 2019 at 10:29:49AM -0400, Sanjay Bhandari wrote: > I see in the phc2sys code that when not using PPS, it uses ioctls to get > time offsets (PTP_SYS_OFFSET_PRECISE etc.). I suppose you are saying that > this a more accurate mechanism than the one based on PPS. How close can you > get with the ioctls? What kind of accuracy can we expect?
Interrupts are slow and I think a typical error would be few microseconds. The accuracy of the ioctls depends on the HW and the driver. With a typical x86_64 machine it's very difficult or maybe not even possible to measure the offset between the PHC and the CPU directly, but at least we can determine the maximum error (due to asymmetries on PCIe, etc) from the delay reported by phc2sys. With the virtual PHC provided by the ptp-kvm driver there should be no error, except the nanosecond resolution. The NICs supported by the e1000e driver using ART for cross timestamping seem to be better than 1 microsecond and are possibly much better than that, but there doesn't seem to be any documentation that would explain how exactly it works and what would be the maximum error. In Linux 5.0 there were improvements in some drivers that should reduce the maximum error to a half or third. With fast PCIe, direct link to the CPU and good HW the maximum error may be well below one microsecond. Here are some examples from different machines (not directly comparable): I210 850 ns I350 380 ns X520 220 ns X540 400 ns X550 380 ns XXV710 250 ns BCM5720 600 ns MT27800 250 ns If someone could figure out the minimum possible time a PCIe message of a specific length needs to get from the CPU to the NIC, that could be subtracted from those maximums. -- Miroslav Lichvar _______________________________________________ Linuxptp-users mailing list Linuxptp-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-users