nxp-archive / openil_linuxptp

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

Question about attaching to the same phc #33

Open ibpswyz opened 2 years ago

ibpswyz commented 2 years ago

Hi,

I have 2 computers A and B, both of them have 4 interfaces and 4 phc(eno1-ptp0, eno2-ptp1 and so on). A: "sudo ptp4l -i eno2 -f configs/gPTP.cfg --step_threshold=1 -m" is done. B will be a relay instance, so "sudo ptp4l -i eno2 -i eno3 -f configs/gPTP.cfg --step_threshold=1 -m" is done. but

ptp4l[11336.974]: selected /dev/ptp1 as PTP clock
ptp4l[11336.974]: port 2 (eno3): PHC device mismatch
ptp4l[11336.974]: port 2 (eno3): /dev/ptp1 requested, ptp2 attached
ptp4l[11336.974]: failed to open port eno3 
failed to create a clock

I try to specify a phc, B: "sudo ptp4l -i eno2 -i eno3 -p /dev/ptp2 -f configs/gPTP.cfg --step_threshold=1 -m", ptp4l can run, but the clock can not be synchronized. I guess that the timestamp is based on /dev/ptp1(eno2) but the adjustment works on /dev/ptp2. How can I solve the problem?

Any pointer or suggestion will be great. I look forward to your reply. Thanks a lot.

ibpswyz commented 2 years ago

How to run ptp4l correctly on multiple ports while each port has a ptp hardware clock?

vladimiroltean commented 2 years ago

man ptp4l:

       boundary_clock_jbod
              When running as a boundary clock (that is, when more than one network interface is configured), ptp4l performs a sanity check to make sure that all of the ports share the same  hardware     
              clock  device. This option allows ptp4l to work as a boundary clock using "just a bunch of devices" that are not synchronized to each other. For this mode, the collection of clocks must     
              be synchronized by an external program, for example phc2sys(8) in "automatic" mode.  The default is 0 (disabled).