Skip to content

Commit

Permalink
Merge pull request #50 from mlichvar/hybrid_e2e
Browse files Browse the repository at this point in the history
Add hybrid_e2e option to PTP domain
  • Loading branch information
richm authored May 6, 2021
2 parents be0383a + 71d6ed6 commit 3f69039
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ timesync_ptp_domains:
# (default UDPv4)
udp_ttl: 1 # TTL for UDPv4 and UDPv6 transports
# (default 1)
hybrid_e2e: no # Flag enabling unicast end-to-end delay
# requests (default no)

# Flag enabling use of NTP servers provided by DHCP (default no)
timesync_dhcp_ntp_servers: no
Expand Down
3 changes: 3 additions & 0 deletions templates/ptp4l.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ network_transport {{ timesync_ptp_domains[0]['transport'] }}
{% if 'udp_ttl' in timesync_ptp_domains[0] %}
udp_ttl {{ timesync_ptp_domains[0]['udp_ttl'] }}
{% endif %}
{% if 'hybrid_e2e' in timesync_ptp_domains[0] and timesync_ptp_domains[0]['hybrid_e2e'] %}
hybrid_e2e 1
{% endif %}
{% if not timesync_mode2_hwts and timesync_step_threshold >= 0.0 %}
first_step_threshold {{ timesync_step_threshold }}
{% endif %}
3 changes: 3 additions & 0 deletions templates/timemaster.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ ptp4l_option network_transport {{ value['transport'] }}
{% if 'udp_ttl' in value %}
ptp4l_option udp_ttl {{ value['udp_ttl'] }}
{% endif %}
{% if 'hybrid_e2e' in value and value['hybrid_e2e'] %}
ptp4l_option hybrid_e2e 1
{% endif %}

{% endfor %}
[timemaster]
Expand Down
1 change: 1 addition & 0 deletions tests/tests_ptp_multi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
interfaces: "{{ [ ansible_default_ipv4['interface'] ] }}"
delay: 0.001
transport: UDPv4
hybrid_e2e: yes
udp_ttl: 2
timesync_step_threshold: 0.0001
timesync_min_sources: 2
Expand Down

0 comments on commit 3f69039

Please sign in to comment.