nxp-archive / openil_linuxptp

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

ptp4l works with P2P, but doesn't work with E2E #44

Open noufalc opened 1 year ago

noufalc commented 1 year ago

I am trying to synchronize my linux system with PTP grand master clock using ptp4l. The clock is getting synchronized when I use P2P delay mechanism. But when I switch to E2E it is showing delay timeout.

My network setup is as follows:

PTP Grandmaster <--> PTP unaware switch <--> linux machine(slave).

I am using a linux machine with Intel I211 Gigabit Network adapter

#ethtool -T enp2s0
Time stamping parameters for enp2s0:
Capabilities:
        hardware-transmit     (SOF_TIMESTAMPING_TX_HARDWARE)
        software-transmit     (SOF_TIMESTAMPING_TX_SOFTWARE)
        hardware-receive      (SOF_TIMESTAMPING_RX_HARDWARE)
        software-receive      (SOF_TIMESTAMPING_RX_SOFTWARE)
        software-system-clock (SOF_TIMESTAMPING_SOFTWARE)
        hardware-raw-clock    (SOF_TIMESTAMPING_RAW_HARDWARE)
PTP Hardware Clock: 1
Hardware Transmit Timestamp Modes:
        off                   (HWTSTAMP_TX_OFF)
        on                    (HWTSTAMP_TX_ON)
Hardware Receive Filter Modes:
        none                  (HWTSTAMP_FILTER_NONE)
        all                   (HWTSTAMP_FILTER_ALL)

With the following Grandmaster clock settings:

Domain Number : 0
Network protocol : UDP
Operation mode : One step
Delay mechanism : Peer-to-Peer
Grandmaster priority #1 : 128
Grandmaster priority #2 : 128
Delay request interval  : 1 second (0)
Announce interval   : 2 seconds (1)
Sync interval       : 2 seconds (1)
Announce receipt timeout: 3

With this settings I am getting the clock synced.

sudo ptp4l -i enp2s0 -mq -s  -P -H
ptp4l[602058.405]: selected /dev/ptp1 as PTP clock
ptp4l[602058.407]: port 1: INITIALIZING to LISTENING on INIT_COMPLETE
ptp4l[602058.407]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE
ptp4l[602058.770]: port 1: new foreign master f80278.fffe.10280a-1
ptp4l[602062.770]: selected best master clock f80278.fffe.10280a
ptp4l[602062.770]: updating UTC offset to 37
ptp4l[602062.770]: port 1: LISTENING to UNCALIBRATED on RS_SLAVE
ptp4l[602066.111]: master offset       4045 s0 freq  -40125 path delay     34997
ptp4l[602068.111]: master offset       5838 s2 freq  -39229 path delay     34997
ptp4l[602068.111]: port 1: UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED
ptp4l[602070.111]: master offset       7399 s2 freq  -35529 path delay     34879
ptp4l[602072.111]: master offset      -4219 s2 freq  -40228 path delay     34879
ptp4l[602074.111]: master offset      -2625 s2 freq  -40064 path delay     34879
ptp4l[602076.111]: master offset        765 s2 freq  -38763 path delay     34604
ptp4l[602078.111]: master offset      -4994 s2 freq  -41528 path delay     34329
ptp4l[602080.111]: master offset       1201 s2 freq  -39179 path delay     34329
ptp4l[602082.111]: master offset       -724 s2 freq  -39961 path delay     34329
ptp4l[602084.111]: master offset      -1887 s2 freq  -40652 path delay     34329
ptp4l[602086.111]: master offset       1113 s2 freq  -39435 path delay     34329
ptp4l[602088.111]: master offset      -1344 s2 freq  -40496 path delay     34329
ptp4l[602090.111]: master offset       1131 s2 freq  -39460 path delay     34329
ptp4l[602092.111]: master offset       2154 s2 freq  -38779 path delay     34329

But when I change the delay mechanism to E2E I am getting timeout messages.

Domain Number : 0
Network protocol : UDP
Operation mode : One step
Delay mechanism : End-to-End
Grandmaster priority #1 : 128
Grandmaster priority #2 : 128
Delay request interval  : 1 second (0)
Announce interval   : 2 seconds (1)
Sync interval       : 2 seconds (1)
Announce receipt timeout: 3
sudo ptp4l -i enp2s0 -mq -s  -H -l 7
ptp4l[602575.422]: config item (null).assume_two_step is 0
ptp4l[602575.422]: config item (null).check_fup_sync is 0
ptp4l[602575.422]: config item (null).tx_timestamp_timeout is 1
ptp4l[602575.422]: config item (null).clock_servo is 0
ptp4l[602575.422]: config item (null).clock_servo is 0
ptp4l[602575.422]: config item (null).clockClass is 248
ptp4l[602575.422]: config item (null).clockAccuracy is 254
ptp4l[602575.422]: config item (null).offsetScaledLogVariance is 65535
ptp4l[602575.422]: config item (null).productDescription is ';;'
ptp4l[602575.423]: config item (null).revisionData is ';;'
ptp4l[602575.423]: config item (null).userDescription is ''
ptp4l[602575.424]: config item (null).manufacturerIdentity is '00:00:00'
ptp4l[602575.424]: config item (null).domainNumber is 0
ptp4l[602575.424]: config item (null).slaveOnly is 1
ptp4l[602575.424]: config item (null).gmCapable is 1
ptp4l[602575.425]: config item (null).gmCapable is 1
ptp4l[602575.425]: config item (null).time_stamping is 1
ptp4l[602575.425]: config item (null).twoStepFlag is 1
ptp4l[602575.425]: config item (null).twoStepFlag is 1
ptp4l[602575.425]: config item (null).time_stamping is 1
ptp4l[602575.426]: config item (null).priority1 is 128
ptp4l[602575.426]: config item (null).priority2 is 128
ptp4l[602575.426]: interface index 3 is up
ptp4l[602575.427]: config item (null).free_running is 0
ptp4l[602575.427]: selected /dev/ptp1 as PTP clock
ptp4l[602575.427]: config item (null).uds_address is '/var/run/ptp4l'
ptp4l[602575.428]: section item /var/run/ptp4l.announceReceiptTimeout now 0
ptp4l[602575.428]: section item /var/run/ptp4l.delay_mechanism now 0
ptp4l[602575.428]: section item /var/run/ptp4l.network_transport now 0
ptp4l[602575.428]: section item /var/run/ptp4l.delay_filter_length now 1
ptp4l[602575.429]: config item (null).free_running is 0
ptp4l[602575.429]: config item (null).freq_est_interval is 1
ptp4l[602575.429]: config item (null).gmCapable is 1
ptp4l[602575.429]: config item (null).kernel_leap is 1
ptp4l[602575.429]: config item (null).utc_offset is 37
ptp4l[602575.430]: config item (null).timeSource is 160
ptp4l[602575.430]: config item (null).pi_proportional_const is 0.000000
ptp4l[602575.430]: config item (null).pi_integral_const is 0.000000
ptp4l[602575.431]: config item (null).pi_proportional_scale is 0.000000
ptp4l[602575.431]: config item (null).pi_proportional_exponent is -0.300000
ptp4l[602575.431]: config item (null).pi_proportional_norm_max is 0.700000
ptp4l[602575.432]: config item (null).pi_integral_scale is 0.000000
ptp4l[602575.432]: config item (null).pi_integral_exponent is 0.400000
ptp4l[602575.432]: config item (null).pi_integral_norm_max is 0.300000
ptp4l[602575.432]: config item (null).step_threshold is 0.000000
ptp4l[602575.433]: config item (null).first_step_threshold is 0.000020
ptp4l[602575.433]: config item (null).max_frequency is 900000000
ptp4l[602575.433]: config item (null).delay_filter_length is 10
ptp4l[602575.434]: config item (null).delay_filter is 1
ptp4l[602575.434]: config item (null).tsproc_mode is 0
ptp4l[602575.434]: config item (null).initial_delay is 0
ptp4l[602575.434]: config item (null).summary_interval is 0
ptp4l[602575.434]: config item (null).sanity_freq_limit is 200000000
ptp4l[602575.434]: PI servo: sync interval 1.000 kp 0.700 ki 0.300000
ptp4l[602575.435]: config item /var/run/ptp4l.boundary_clock_jbod is 0
ptp4l[602575.435]: config item /var/run/ptp4l.network_transport is 0
ptp4l[602575.435]: config item /var/run/ptp4l.delayAsymmetry is 0
ptp4l[602575.435]: config item /var/run/ptp4l.follow_up_info is 0
ptp4l[602575.435]: config item /var/run/ptp4l.freq_est_interval is 1
ptp4l[602575.435]: config item /var/run/ptp4l.hybrid_e2e is 0
ptp4l[602575.435]: config item /var/run/ptp4l.net_sync_monitor is 0
ptp4l[602575.435]: config item /var/run/ptp4l.path_trace_enabled is 0
ptp4l[602575.435]: config item /var/run/ptp4l.ingressLatency is 0
ptp4l[602575.435]: config item /var/run/ptp4l.egressLatency is 0
ptp4l[602575.435]: config item /var/run/ptp4l.delay_mechanism is 0
ptp4l[602575.435]: config item /var/run/ptp4l.fault_badpeernet_interval is 16
ptp4l[602575.435]: config item /var/run/ptp4l.fault_reset_interval is 4
ptp4l[602575.435]: config item /var/run/ptp4l.delay_filter_length is 1
ptp4l[602575.436]: config item /var/run/ptp4l.delay_filter is 1
ptp4l[602575.436]: config item /var/run/ptp4l.tsproc_mode is 0
ptp4l[602575.436]: config item enp2s0.boundary_clock_jbod is 0
ptp4l[602575.436]: config item enp2s0.network_transport is 1
ptp4l[602575.436]: config item enp2s0.delayAsymmetry is 0
ptp4l[602575.436]: config item enp2s0.follow_up_info is 0
ptp4l[602575.436]: config item enp2s0.freq_est_interval is 1
ptp4l[602575.436]: config item enp2s0.hybrid_e2e is 0
ptp4l[602575.436]: config item enp2s0.net_sync_monitor is 0
ptp4l[602575.436]: config item enp2s0.path_trace_enabled is 0
ptp4l[602575.436]: config item enp2s0.ingressLatency is 0
ptp4l[602575.436]: config item enp2s0.egressLatency is 0
ptp4l[602575.436]: config item enp2s0.delay_mechanism is 1
ptp4l[602575.437]: config item enp2s0.fault_badpeernet_interval is 16
ptp4l[602575.437]: config item enp2s0.fault_reset_interval is 4
ptp4l[602575.437]: config item enp2s0.delay_filter_length is 10
ptp4l[602575.437]: config item enp2s0.delay_filter is 1
ptp4l[602575.437]: config item enp2s0.tsproc_mode is 0
ptp4l[602575.437]: config item enp2s0.logMinDelayReqInterval is 0
ptp4l[602575.437]: config item enp2s0.logAnnounceInterval is 1
ptp4l[602575.437]: config item enp2s0.announceReceiptTimeout is 3
ptp4l[602575.437]: config item enp2s0.syncReceiptTimeout is 0
ptp4l[602575.437]: config item enp2s0.transportSpecific is 0
ptp4l[602575.437]: config item enp2s0.ignore_transport_specific is 0
ptp4l[602575.437]: config item enp2s0.logSyncInterval is 0
ptp4l[602575.437]: config item enp2s0.logMinPdelayReqInterval is 0
ptp4l[602575.437]: config item enp2s0.neighborPropDelayThresh is 20000000
ptp4l[602575.437]: config item enp2s0.min_neighbor_prop_delay is -20000000
ptp4l[602575.438]: config item enp2s0.udp_ttl is 1
ptp4l[602575.438]: driver changed our HWTSTAMP options
ptp4l[602575.439]: tx_type   1 not 1
ptp4l[602575.439]: rx_filter 1 not 12
ptp4l[602575.440]: config item (null).dscp_event is 0
ptp4l[602575.440]: config item (null).dscp_general is 0
ptp4l[602575.440]: port 1: INITIALIZING to LISTENING on INIT_COMPLETE
ptp4l[602575.441]: config item /var/run/ptp4l.logMinDelayReqInterval is 0
ptp4l[602575.441]: config item /var/run/ptp4l.logAnnounceInterval is 1
ptp4l[602575.441]: config item /var/run/ptp4l.announceReceiptTimeout is 0
ptp4l[602575.441]: config item /var/run/ptp4l.syncReceiptTimeout is 0
ptp4l[602575.441]: config item /var/run/ptp4l.transportSpecific is 0
ptp4l[602575.441]: config item /var/run/ptp4l.ignore_transport_specific is 0
ptp4l[602575.441]: config item /var/run/ptp4l.logSyncInterval is 0
ptp4l[602575.442]: config item /var/run/ptp4l.logMinPdelayReqInterval is 0
ptp4l[602575.442]: config item /var/run/ptp4l.neighborPropDelayThresh is 20000000
ptp4l[602575.442]: config item /var/run/ptp4l.min_neighbor_prop_delay is -20000000
ptp4l[602575.442]: config item (null).uds_address is '/var/run/ptp4l'
ptp4l[602575.442]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE
ptp4l[602575.442]: port 1: received link status notification
ptp4l[602575.442]: interface index 3 is up
ptp4l[602576.020]: port 1: setting asCapable
ptp4l[602576.020]: port 1: new foreign master f80278.fffe.10280a-1
ptp4l[602580.021]: selected best master clock f80278.fffe.10280a
ptp4l[602580.021]: updating UTC offset to 37
ptp4l[602580.021]: port 1: LISTENING to UNCALIBRATED on RS_SLAVE
ptp4l[602580.343]: port 1: delay timeout
ptp4l[602581.351]: PI servo: sync interval 2.000 kp 0.350 ki 0.150000
ptp4l[602582.055]: port 1: delay timeout
ptp4l[602583.735]: port 1: delay timeout
ptp4l[602584.247]: port 1: delay timeout
ptp4l[602585.798]: port 1: delay timeout
ptp4l[602587.362]: port 1: delay timeout
ptp4l[602588.668]: port 1: delay timeout
ptp4l[602589.239]: port 1: delay timeout
ptp4l[602589.941]: port 1: delay timeout
ptp4l[602590.045]: port 1: delay timeout
ptp4l[602590.331]: port 1: delay timeout
ptp4l[602591.177]: port 1: delay timeout
ptp4l[602593.134]: port 1: delay timeout
ptp4l[602593.346]: port 1: delay timeout
ptp4l[602595.160]: port 1: delay timeout
ptp4l[602595.702]: port 1: delay timeout
ptp4l[602596.175]: port 1: delay timeout
ptp4l[602597.552]: port 1: delay timeout
ptp4l[602598.489]: port 1: delay timeout
ptp4l[602598.911]: port 1: delay timeout
ptp4l[602598.983]: port 1: delay timeout
ptp4l[602599.165]: port 1: delay timeout
ptp4l[602599.909]: port 1: delay timeout
ptp4l[602601.693]: port 1: delay timeout
ptp4l[602602.116]: port 1: delay timeout
ptp4l[602602.967]: port 1: delay timeout
ptp4l[602604.941]: port 1: delay timeout
ptp4l[602605.510]: port 1: delay timeout

What will be the reason for this issue?

Is there any settings I need to add to get it work when using E2E?