Thread: [Linuxptp-users] Use NIC as PTP GM without external sync
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
From: Nils F. <nil...@sr...> - 2023-10-19 12:40:42
|
Hello everyone! I am trying to use a NIC as a PTP GM with any external sync sorce. I have a PC with a dual port NIC (82599ES 10-Gigabit SFI/SFP+) connected to an embedded device over Ethernet. I use a SFP-to-Ethernet adapter to translate from SFP+ to Ethernet. Both devices need to be synced but I cannot use GPS or other external clock sources. My idea is to use the NIC as a PTP GM and serve the embedded device with PTP. What I am not sure about is if I need to use phc2sys to sync NIC and the physical clock of the machine hosting the NIC? What quality of sync can I expect? With my current configuration I have some PTP coming in but the quality is really bad. On the embedded device I see the following: ptp4l[2023/10/19/12:28:03]: state=2 rms 901387699 max 1000000058 freq +1353 +/- 78 delay 20569 +/- 16 ptp4l[2023/10/19/12:28:04]: state=2 rms 1245 max 4879 freq +1213 +/- 4 delay 20539 +/- 32 ptp4l[2023/10/19/12:28:05]: state=2 rms 132 max 242 freq +1196 +/- 7 delay 20442 +/- 35 ptp4l[2023/10/19/12:28:06]: state=2 rms 1031 max 4050 freq +1158 +/- 53 delay 20427 +/- 20 ptp4l[2023/10/19/12:28:07]: state=2 rms 172 max 381 freq +1065 +/- 0 delay 20401 +/- 11 ptp4l[2023/10/19/12:28:08]: state=2 rms 69 max 153 freq +1020 +/- 13 delay 20400 +/- 16 ptp4l[2023/10/19/12:28:09]: state=2 rms 105 max 300 freq +1021 +/- 4 delay 20392 +/- 10 ptp4l[2023/10/19/12:28:10]: state=2 rms 222 max 518 freq +1020 +/- 0 delay 20436 +/- 13 ptp4l[2023/10/19/12:28:11]: state=2 rms 968245340 max 999999669 freq +992 +/- 0 delay 20507 +/- 36 ptp4l[2023/10/19/12:28:13]: state=2 rms 433012546 max 999999740 freq +921 +/- 28 delay 20559 +/- 31 ptp4l[2023/10/19/12:28:14]: state=2 rms 139 max 279 freq +919 +/- 2 delay 20586 +/- 34 ptp4l[2023/10/19/12:28:15]: state=2 rms 153 max 263 freq +922 +/- 4 delay 20671 +/- 22 ptp4l[2023/10/19/12:28:16]: state=2 rms 433012402 max 999999485 freq +976 +/- 87 delay 20681 +/- 3 ptp4l[2023/10/19/12:28:18]: state=2 rms 968245358 max 999999677 freq +1084 +/- 110 delay 20724 +/- 18 ptp4l[2023/10/19/12:28:19]: state=2 rms 313 max 566 freq +803 +/- 3 delay 20727 +/- 16 Is this because I don't have an external clock source or is it about how I have configured the PTP GM? I have uploaded both configs to pastebin, you'll find the pastes here: PTP GM: https://pastebin.com/9cRBEZZn PTP Clien emb. device: https://pastebin.com/RtECRXCe I cannot adjust the config on the embedded device but I can adjust the config on the PTP GM. But unfortunately, I am not sure what I am doing wrong. I would really appreciate any help! Thanks in advance! Best regards Nils |
From: Miroslav L. <mli...@re...> - 2023-10-19 12:52:19
|
On Thu, Oct 19, 2023 at 02:40:30PM +0200, Nils Fuerste wrote: > Hello everyone! > > I am trying to use a NIC as a PTP GM with any external sync sorce. I have a > PC with a dual port NIC (82599ES 10-Gigabit SFI/SFP+) connected to an > embedded device over Ethernet. I use a SFP-to-Ethernet adapter to translate > from SFP+ to Ethernet. Both devices need to be synced but I cannot use GPS > or other external clock sources. My idea is to use the NIC as a PTP GM and > serve the embedded device with PTP. What I am not sure about is if I need to > use phc2sys to sync NIC and the physical clock of the machine hosting the > NIC? What quality of sync can I expect? You can leave the clock of the NIC running free if you don't need the client's clock to be accurate, only synchronized to the server. > ptp4l[2023/10/19/12:28:10]: state=2 rms 222 max 518 freq +1020 +/- 0 > delay 20436 +/- 13 > ptp4l[2023/10/19/12:28:11]: state=2 rms 968245340 max 999999669 freq +992 > +/- 0 delay 20507 +/- 36 > ptp4l[2023/10/19/12:28:13]: state=2 rms 433012546 max 999999740 freq +921 > +/- 28 delay 20559 +/- 31 Those errors are almost exactly 1 second, which is very suspicious. It could be a driver bug. What kernel version do you use? It would help if you could get a third device and see if it works better as a server or client to determine on which side is the problem. -- Miroslav Lichvar |
From: Nils F. <nil...@sr...> - 2023-10-19 14:04:41
|
On 19/10/23 14:51, Miroslav Lichvar wrote: > On Thu, Oct 19, 2023 at 02:40:30PM +0200, Nils Fuerste wrote: > ptp4l[2023/10/19/12:28:10]: state=2 rms 222 max 518 freq +1020 +/- 0 > delay 20436 +/- 13 > ptp4l[2023/10/19/12:28:11]: state=2 rms 968245340 max 999999669 freq +992 > +/- 0 delay 20507 +/- 36 > ptp4l[2023/10/19/12:28:13]: state=2 rms 433012546 max 999999740 freq +921 > +/- 28 delay 20559 +/- 31 > Those errors are almost exactly 1 second, which is very suspicious. It > could be a driver bug. What kernel version do you use? It would help > if you could get a third device and see if it works better as a server > or client to determine on which side is the problem. > As proposed I have tested some other scenarios. During this process I have realized that the PTP version on the embedded device is probably not mainline. I have copied the config to another machine with mainline PTP and it was complaining about many parameters in the PTP client config of the embedded device. I have used some other configuration to narrow down the issue. These are the results: - Using other master, same client, same configs -> Same result - Using other master, other client with config from embedded device -> Results are worse than before (I had to comment out some config items that were not recognized by ptp4l. - Using a proper PTP GM (Qulsar Q2), original client (embedded device) -> Good sync, around rms 20 +- 5 - I have tested different SFP to Ethernet adapters in all of those tests above, sync quality stayed the same What can I do? Since a proper PTP GM can provide a good PTP sync to the client I guess my config is faulty? Or can it be something else? Can I maybe do some more tests? Many thanks! Nils |