nxp-archive / openil_linuxptp

PTP IEEE 1588 stack for Linux
GNU General Public License v2.0
136 stars 60 forks source link

ptp4l:Master offset in Slave is not consistently less than 100 nanosecond #21

Open Raj123-tech opened 3 years ago

Raj123-tech commented 3 years ago

When slave is getting sync with Master , we are observing that Master offset in slave is not consistently < 100 ns. We are using Hardware times stamp & "p2p_dst_mac 01:80:C2:00:00:0E", We are using ptp on Layer2. I have adjusted "step_threshold" to 0.00002 in ptp4l slave config file , however Master offset in slave is not consistently < 100 ns.

slave phc2sys: "phc2sys -s eth0 -c CLOCK_REALTIME -O 0 --transportSpecific=1 -w &

How to get Master offset in slave less than 100 nanoseconds in ptp4l consistently?

Logs on Slave:

root@autotalks:~# ./ptp4l -i eth0 -f automotive-slave.cfg -m ptp4l[1309.347]: selected /dev/ptp0 as PTP clock ptp4l[1309.430]: port 1: INITIALIZING to SLAVE on INIT_COMPLETE ptp4l[1309.431]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE ptp4l[1309.860]: port 1: new foreign master 26cc35.fffe.82241b-1 ptp4l[1311.431]: rms 8877 max 11480 freq -9601 +/- 6103 delay 14980 +/- 0 ptp4l[1312.431]: rms 1612 max 2410 freq -4435 +/- 2251 delay 14990 +/- 0 ptp4l[1313.431]: rms 2555 max 2700 freq +397 +/- 667 delay 15000 +/- 0 ptp4l[1313.860]: selected best master clock 26cc35.fffe.82241b ptp4l[1315.079]: rms 1343 max 2167 freq +631 +/- 533 delay 14996 +/- 4 ptp4l[1316.129]: rms 448 max 640 freq +302 +/- 92 delay 15000 +/- 0 ptp4l[1317.079]: rms 147 max 300 freq +132 +/- 111 delay 15000 +/- 0 ptp4l[1318.089]: rms 103 max 160 freq -51 +/- 136 delay 15000 +/- 0 ptp4l[1319.089]: rms 64 max 100 freq -108 +/- 67 delay 15000 +/- 0 ptp4l[1320.089]: rms 62 max 97 freq -95 +/- 84 delay 15003 +/- 0 ptp4l[1321.089]: rms 54 max 87 freq -85 +/- 74 delay 15013 +/- 0 ptp4l[1322.089]: rms 58 max 133 freq -85 +/- 80 delay 15013 +/- 0 ptp4l[1322.209]: master offset 107 s3 freq +26 path delay 15013 ptp4l[1323.209]: master offset -74 s3 freq -123 path delay 15014 ptp4l[1324.209]: master offset -114 s3 freq -185 path delay 15014 ptp4l[1325.209]: master offset 46 s3 freq -59 path delay 15014 ptp4l[1326.209]: master offset -54 s3 freq -145 path delay 15014 ptp4l[1327.209]: master offset 86 s3 freq -22 path delay 15014 ptp4l[1328.209]: master offset -54 s3 freq -136 path delay 15014 ptp4l[1329.209]: master offset 26 s3 freq -72 path delay 15014 ptp4l[1330.209]: master offset 26 s3 freq -64 path delay 15014 ptp4l[1331.209]: master offset 136 s3 freq +54 path delay 15004 ptp4l[1332.209]: master offset -84 s3 freq -126 path delay 15004 ptp4l[1333.209]: master offset -24 s3 freq -91 path delay 15004 ptp4l[1334.219]: master offset -44 s3 freq -118 path delay 15004 ptp4l[1335.219]: master offset 41 s3 freq -46 path delay 14999 ptp4l[1336.219]: master offset -99 s3 freq -174 path delay 14999 ptp4l[1337.219]: master offset 41 s3 freq -64 path delay 14999 ptp4l[1338.219]: master offset -19 s3 freq -111 path delay 14999 ptp4l[1339.219]: master offset -39 s3 freq -137 path delay 14999 ptp4l[1340.170]: master offset 201 s3 freq +91 path delay 14999 ptp4l[1341.219]: master offset -99 s3 freq -148 path delay 14999 ptp4l[1342.219]: master offset 41 s3 freq -38 path delay 14999 ptp4l[1343.219]: master offset -194 s3 freq -261 path delay 15014 ptp4l[1344.219]: master offset 146 s3 freq +21 path delay 15014 ptp4l[1345.219]: master offset -14 s3 freq -95 path delay 15014 ptp4l[1346.195]: master offset 106 s3 freq +21 path delay 15014 ptp4l[1347.229]: master offset -59 s3 freq -113 path delay 14999 ptp4l[1348.219]: master offset 1 s3 freq -70 path delay 14999 ptp4l[1349.219]: master offset 21 s3 freq -50 path delay 14999 ptp4l[1350.219]: master offset -39 s3 freq -104 path delay 14999 ptp4l[1351.219]: master offset -99 s3 freq -175 path delay 14999 ptp4l[1352.219]: master offset 41 s3 freq -65 path delay 14999 ptp4l[1353.219]: master offset -19 s3 freq -113 path delay 14999 ptp4l[1354.219]: master offset 121 s3 freq +21 path delay 14999 ptp4l[1355.219]: master offset -179 s3 freq -242 path delay 14999 ptp4l[1356.219]: master offset 121 s3 freq +4 path delay 14999 ptp4l[1357.219]: master offset -79 s3 freq -160 path delay 14999 ptp4l[1358.219]: master offset 21 s3 freq -83 path delay 14999 ptp4l[1359.219]: master offset -84 s3 freq -182 path delay 15024 ptp4l[1360.219]: master offset 136 s3 freq +13 path delay 15024 ptp4l[1361.172]: master offset 96 s3 freq +14 path delay 15024 ptp4l[1362.219]: master offset -84 s3 freq -138 path delay 15024 ptp4l[1363.219]: master offset -179 s3 freq -258 path delay 15019 ptp4l[1364.219]: master offset 281 s3 freq +148 path delay 15019 ptp4l[1365.219]: master offset -79 s3 freq -127 path delay 15019

Could you please any one suggest is their any config changes required in slave config file to get master offset in slave less than 100 nanosecond in ptp4l consistently.

Thanks in Advance for Any help.

vladimiroltean commented 3 years ago

What platform is this? Is there any switch between the master and the slave? The path delay is large enough to denote that there is, and that the switch is not PTP-aware. If this question is not specific to OpenIL, please consider posting this question to linuxptp-users@lists.sourceforge.net. Thanks.

Raj123-tech commented 3 years ago

What platform is this? Is there any switch between the master and the slave? The path delay is large enough to denote that there is, and that the switch is not PTP-aware. If this question is not specific to OpenIL, please consider posting this question to linuxptp-users@lists.sourceforge.net. Thanks.

Hi, Please find the below Inline:

What platform is this? Ans: We are using Linux platform (linuxptp-3.1), SDMAC Ethernet driver.

Is there any switch between the master and the slave? Ans: There is no switch between Master & slave. We are using "slaveOnly 1" in slave config file so that it will act as only slave.

The path delay is large enough to denote that there is, and that the switch is not PTP-aware. Ans: We are not using any switch .

Could you please suggest is their any config changes required in slave config file to get master offset in slave less than 100 nanosecond in ptp4l consistently. Thanks.