Hi Miroslav,

I compiled and tested your patch.

Unfortunately it did not change / improve the behaviour.


I added some debug output that may give a little more insight:

LIST_FOREACH(clock id: 0, device: CLOCK_REALTIME, &node->clocks, list)
node->master->clkid: ffffffd3, device: eth1
phc2sys[4637.685]: [0:eth1+eth2] phc offset      1468 s0 freq      +0
delay    680

LIST_FOREACH(clock id: ffffffcb, device: eth2, &node->clocks, list)
node->master->clkid: ffffffd3, device: eth1
phc2sys[4637.685]: [0:eth1+eth2] phc offset         5 s0 freq      +0
delay   2130

LIST_FOREACH(clock id: ffffffd3, device: eth1, &node->clocks, list)
node->master->clkid: ffffffd3, device: eth1
!update_needed

As you wrote:

"I think the interleaving of the offset explains what is happening
here. phc2sys is synchronizing the system clock to eth1 via SHM and
at the same time it is synchronizing eth2 to eth1 via the same SHM.
The eth1-sys sample is immediately overwritten by the eth1-eth2
sample, which is what ntpd sees and complains about timestamps from
future.

I guess phc2sys needs to be improved to detect interfaces sharing the
same clock."


It seems your patch does not work because eth1 and eth2 have a different 
clockid (which is not ideal since both actually use the same physical clock).

Debugging showed that the if-query
"if (node->master->clkid == clock->clkid)"
is not entered at all, respectively caught by the previous 
"if (!update_needed(clock))".


Not sure if there is an elegant way to solve this without affecting too much of 
the basic linuxptp source code..

Best regards,
Stefan


Am 24.03.2017 um 16:25 schrieb Miroslav Lichvar:
> Stefan, could you please try the patch I just sent to the list?
> I don't have a HW I could test this on. Considering how long this bug
> survived, I guess very few people actually do :).
>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to