diff --git a/CHANGELOG.md b/CHANGELOG.md index d8cf662e2..5f1556481 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog -## [unreleased] +## [0.2.0] - 2024-03-07 -[unreleased]: https://github.com/pendulum-project/statime/compare/v0.1.0...main +### Added +- Take into account delay asymmetry +- Metrics exporter +- Implement forwaring of TLVs +- Support for peer delay +- udev rules for better permissions + +### Changed +- Updated dependencies +- Implement kalman filter for incoming timestamps +- Simplified state management of ports + +### Fixed +- Fixed race condition during startup + +[0.2.0]: https://github.com/pendulum-project/statime/compare/v0.1.0...v0.2.0 +[0.1.0]: https://github.com/pendulum-project/statime/releases/tag/v0.1.0 diff --git a/Cargo.lock b/Cargo.lock index 6bb9882ab..533f35316 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -517,7 +517,7 @@ dependencies = [ [[package]] name = "statime" -version = "0.1.0" +version = "0.2.0" dependencies = [ "arrayvec", "atomic_refcell", @@ -532,7 +532,7 @@ dependencies = [ [[package]] name = "statime-linux" -version = "0.1.0" +version = "0.2.0" dependencies = [ "arrayvec", "clap", diff --git a/Cargo.toml b/Cargo.toml index 0545bea32..37d02add6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ exclude = [ resolver = "2" [workspace.package] -version = "0.1.0" +version = "0.2.0" edition = "2021" license = "Apache-2.0 OR MIT" repository = "https://github.com/pendulum-project/statime" @@ -52,7 +52,7 @@ timestamped-socket = "0.2.0" # our own crates used as dependencies, same version as the workspace version # NOTE: keep this part at the bottom of the file, do not change this line -statime = { version = "0.1.0", path = "./statime" } +statime = { version = "0.2.0", path = "./statime" } [profile.release] debug = 2 diff --git a/docs/man/statime.8.md b/docs/man/statime.8.md index 60c917ead..a74468897 100644 --- a/docs/man/statime.8.md +++ b/docs/man/statime.8.md @@ -1,5 +1,5 @@ # NAME diff --git a/docs/man/statime.toml.5.md b/docs/man/statime.toml.5.md index 6d924f820..92cb9973d 100644 --- a/docs/man/statime.toml.5.md +++ b/docs/man/statime.toml.5.md @@ -1,5 +1,5 @@ # NAME diff --git a/docs/precompiled/man/statime.8 b/docs/precompiled/man/statime.8 index 188ebbc51..015d34b29 100644 --- a/docs/precompiled/man/statime.8 +++ b/docs/precompiled/man/statime.8 @@ -14,7 +14,7 @@ . ftr VB CB . ftr VBI CBI .\} -.TH "STATIME" "8" "" "statime 0.1.0" "statime" +.TH "STATIME" "8" "" "statime 0.2.0" "statime" .hy .SH NAME .PP diff --git a/docs/precompiled/man/statime.toml.5 b/docs/precompiled/man/statime.toml.5 index 7b3ec6462..d5821546f 100644 --- a/docs/precompiled/man/statime.toml.5 +++ b/docs/precompiled/man/statime.toml.5 @@ -14,7 +14,7 @@ . ftr VB CB . ftr VBI CBI .\} -.TH "STATIME.TOML" "5" "" "statime 0.1.0" "statime" +.TH "STATIME.TOML" "5" "" "statime 0.2.0" "statime" .hy .SH NAME .PP @@ -28,7 +28,7 @@ extensions allowing a json-like syntax. .PP The statime configuration file consists of several sections, each of which configures a separate part of the ptp-daemon process. -Each of the secions is described in the rest of this document. +Each of the sections is described in the rest of this document. Many settings will have defaults, which will be indicated by each configuration setting shown. .SH CONFIGURATION @@ -45,7 +45,7 @@ All instances in domain are synchronized to the Grandmaster Clock of the domain, but are not necessarily synchronized to PTP clocks in another domain. .TP -\f[V]sdo_id\f[R] = \f[I]u12\f[R] (\f[B]0\f[R]) +\f[V]sdo-id\f[R] = \f[I]u12\f[R] (\f[B]0\f[R]) The \[lq]source domain identity\[rq] of this PTP instance. Together with the \f[V]domain\f[R] it identifies a domain. .TP @@ -62,42 +62,47 @@ A tie breaker for the best master clock algorithm in the range The network interface of this PTP port. For instance \f[V]\[dq]lo\[dq]\f[R] or \f[V]\[dq]enp0s31f6\[dq]\f[R] .TP -\f[V]announce_interval\f[R] = \f[I]interval\f[R] (\f[B]1\f[R]) +\f[V]announce-interval\f[R] = \f[I]interval\f[R] (\f[B]1\f[R]) How often an announce message is sent by a master. Defined as an exponent of 2, so a value of 1 means every 2\[ha]1 = 2 seconds. .TP -\f[V]sync_interval\f[R] = \f[I]interval\f[R] (\f[B]0\f[R]) +\f[V]sync-interval\f[R] = \f[I]interval\f[R] (\f[B]0\f[R]) How often sync message is sent by a master. Defined as an exponent of 2, so a value of 0 means every 2\[ha]0 = 1 seconds. .TP -\f[V]announce_receipt_timeout\f[R] = \f[I]number of announce intervals\f[R] (\f[B]3\f[R]) +\f[V]announce-receipt-timeout\f[R] = \f[I]number of announce intervals\f[R] (\f[B]3\f[R]) Number of announce intervals to wait for announce messages from other masters before the port becomes master itself. .TP -\f[V]delay_asymmetry\f[R] = \f[I]nanoseconds\f[R] (\f[B]0\f[R]) +\f[V]delay-asymmetry\f[R] = \f[I]nanoseconds\f[R] (\f[B]0\f[R]) Correct for a difference between slave-to-master and master-to-slave propagation time. The value is positive when the slave-to-master propagation time is longer than the master-to-slave propagation time. .TP -\f[V]delay_mechanism\f[R] = \f[I]interval\f[R] (\f[B]0\f[R]) +\f[V]delay-mechanism\f[R] = \f[I]mechanism\f[R] (\f[B]E2E\f[R]) +Which delay mechanism to use on the port. +Either \f[V]\[dq]E2E\[dq]\f[R] for end-to-end delay determination, or +\f[V]\[dq]P2P\[dq]\f[R] for the peer to peer delay mechanism. +.TP +\f[V]delay-interval\f[R] = \f[I]interval\f[R] (\f[B]0\f[R]) How often delay request messages are sent by a slave in end-to-end mode. Currently the only supported delay mechanism is end-to-end (E2E). Defined as an exponent of 2, so a value of 0 means every 2\[ha]0 = 1 seconds .TP -\f[V]master_only\f[R] = \f[I]bool\f[R] (\f[B]false\f[R]) +\f[V]master-only\f[R] = \f[I]bool\f[R] (\f[B]false\f[R]) The port is always a master instance, and will never become a slave instance. .TP -\f[V]hardware_clock\f[R] = \f[I]path\f[R] (\f[B]unset\f[R]) +\f[V]hardware-clock\f[R] = \f[I]path\f[R] (\f[B]unset\f[R]) Path to a hardware clock device, for instance \f[V]\[dq]/dev/ptp0\[dq]\f[R]. .TP -\f[V]acceptable_master_list\f[R] = [ \f[I]clock identity\f[R], .. ] (\f[B]unset\f[R]) +\f[V]acceptable-master-list\f[R] = [ \f[I]clock identity\f[R], .. ] (\f[B]unset\f[R]) List of clock identities that this port will accept as its master. A clock identity is encoded as a 16-character hexadecimal string, for -example \f[V]acceptable_master_list = [\[dq]00FFFFFFFFFFFFFB\[dq]]\f[R]. +example \f[V]acceptable-master-list = [\[dq]00FFFFFFFFFFFFFB\[dq]]\f[R]. The default is to accept all clock identities. diff --git a/statime-linux/Cargo.toml b/statime-linux/Cargo.toml index 8470f66cb..32ad2abe5 100644 --- a/statime-linux/Cargo.toml +++ b/statime-linux/Cargo.toml @@ -66,6 +66,7 @@ assets = [ ] conf-files = [ "/etc/statime/statime.toml", + "/etc/udev/41-statime.rules", ] [package.metadata.generate-rpm] @@ -80,7 +81,7 @@ assets = [ { source = "docs/examples/conf/statime.toml.default", dest = "/etc/statime/statime.toml", mode = "644", config = true }, { source = "docs/examples/conf/statime.preset", dest = "/lib/systemd/system-preset/50-statime.preset", mode = "644" }, { source = "docs/examples/conf/statime.service", dest = "/lib/systemd/system/statime.service", mode = "644" }, - { source = "docs/examples/conf/41-statime.rules", dest = "/etc/udev/41-statime.rules", mode = "644" }, + { source = "docs/examples/conf/41-statime.rules", dest = "/etc/udev/41-statime.rules", mode = "644", config = true }, { source = "../COPYRIGHT", dest = "/usr/share/doc/statime/COPYRIGHT", mode = "644", doc = true }, { source = "../LICENSE-APACHE", dest = "/usr/share/doc/statime/LICENSE-APACHE", mode = "644", doc = true }, { source = "../LICENSE-MIT", dest = "/usr/share/doc/statime/LICENSE-MIT", mode = "644", doc = true },