Hi,

Any feedback on this patch would be appreciated. I believe this patch is useful
for improving the performance of the nullf servo, when write_phase_mode is
enabled. Provided below is demonstration of the performance benefits of the
patch. By transitioning to state s3 (SERVO_LOCKED_STABLE), we see improved
stability and a smaller drift below the 4000ns range.

Setup used in testing both cases
--------------------------------

* A ptp clock device with ADJ_OFFSET supported

Key configuration settings used
-------------------------------

  step_threshold 0.00002
  first_step_threshold 0.000000001
  clock_servo           nullf
  servo_offset_threshold  100000
  write_phase_mode        1

Using the nullf servo without the patch
---------------------------------------

ptp4l[1901.436]: selected /dev/ptp1 as PTP clock
ptp4l[1901.437]: port 1 (eth2): INITIALIZING to LISTENING on INIT_COMPLETE
ptp4l[1901.437]: port 0 (/var/run/ptp4l): INITIALIZING to LISTENING on 
INIT_COMPLETE
ptp4l[1901.437]: port 0 (/var/run/ptp4lro): INITIALIZING to LISTENING on 
INIT_COMPLETE
ptp4l[1908.273]: port 1 (eth2): LISTENING to MASTER on 
ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES
ptp4l[1908.273]: selected local clock 0c42a1.fffe.d1d0d4 as best master
ptp4l[1908.273]: port 1 (eth2): assuming the grand master role
ptp4l[1914.276]: port 1 (eth2): new foreign master 0c42a1.fffe.d1d084-1
ptp4l[1918.276]: selected best master clock 0c42a1.fffe.d1d084
ptp4l[1918.276]: port 1 (eth2): MASTER to UNCALIBRATED on RS_SLAVE
ptp4l[1920.275]: master offset    3880206 s1 freq      +0 path delay     -1304
ptp4l[1921.276]: master offset     -57638 s1 freq      +0 path delay     -1304
ptp4l[1922.275]: master offset       7514 s0 freq      +0 path delay     -1304
ptp4l[1923.275]: master offset      11241 s0 freq      +0 path delay     -1091
ptp4l[1924.275]: master offset      15193 s0 freq      +0 path delay     -1091
ptp4l[1925.275]: master offset      18924 s0 freq      +0 path delay      -878
ptp4l[1926.277]: master offset      22722 s1 freq      +0 path delay      -728
ptp4l[1927.276]: master offset       4434 s0 freq      +0 path delay      -728
ptp4l[1928.276]: master offset       8224 s0 freq      +0 path delay      -578
ptp4l[1929.276]: master offset      12468 s0 freq      +0 path delay      -878
ptp4l[1930.276]: master offset      16420 s0 freq      +0 path delay      -878
ptp4l[1931.277]: master offset      20360 s1 freq      +0 path delay      -878
ptp4l[1932.276]: master offset       4344 s0 freq      +0 path delay      -878
ptp4l[1933.276]: master offset       8423 s0 freq      +0 path delay     -1009
ptp4l[1934.276]: master offset      12367 s0 freq      +0 path delay     -1009
ptp4l[1935.276]: master offset      16487 s0 freq      +0 path delay     -1189
ptp4l[1936.277]: master offset      20431 s1 freq      +0 path delay     -1189
ptp4l[1937.276]: master offset       4347 s0 freq      +0 path delay     -1189
ptp4l[1938.276]: master offset       8287 s0 freq      +0 path delay     -1189
ptp4l[1939.276]: master offset      12215 s0 freq      +0 path delay     -1189
ptp4l[1940.276]: master offset      16050 s0 freq      +0 path delay     -1080
ptp4l[1941.276]: master offset      19716 s0 freq      +0 path delay      -806
ptp4l[1942.278]: master offset      23934 s1 freq      +0 path delay     -1080
ptp4l[1943.276]: master offset       4502 s0 freq      +0 path delay     -1080
ptp4l[1944.276]: master offset       8387 s0 freq      +0 path delay     -1025
ptp4l[1945.276]: master offset      12327 s0 freq      +0 path delay     -1025
ptp4l[1946.276]: master offset      16165 s0 freq      +0 path delay      -919
ptp4l[1947.278]: master offset      20093 s1 freq      +0 path delay      -919
ptp4l[1948.277]: master offset       4329 s0 freq      +0 path delay      -919
ptp4l[1949.277]: master offset       8371 s0 freq      +0 path delay     -1025
ptp4l[1950.277]: master offset      12311 s0 freq      +0 path delay     -1025
ptp4l[1951.277]: master offset      16247 s0 freq      +0 path delay     -1025
ptp4l[1952.278]: master offset      20191 s1 freq      +0 path delay     -1025
ptp4l[1953.277]: master offset       4323 s0 freq      +0 path delay     -1025
ptp4l[1954.277]: master offset       8382 s0 freq      +0 path delay     -1148
ptp4l[1955.277]: master offset      12322 s0 freq      +0 path delay     -1148
ptp4l[1956.277]: master offset      16262 s0 freq      +0 path delay     -1148
ptp4l[1957.278]: master offset      20194 s1 freq      +0 path delay     -1148
ptp4l[1958.277]: master offset       4338 s0 freq      +0 path delay     -1148
ptp4l[1959.277]: master offset       8180 s0 freq      +0 path delay     -1050
ptp4l[1960.277]: master offset      12329 s0 freq      +0 path delay     -1271

Using the nullf servo with the patch
------------------------------------

ptp4l[11138.115]: selected /dev/ptp1 as PTP clock
ptp4l[11138.116]: port 1 (eth2): INITIALIZING to LISTENING on INIT_COMPLETE
ptp4l[11138.116]: port 0 (/var/run/ptp4l): INITIALIZING to LISTENING on 
INIT_COMPLETE
ptp4l[11138.117]: port 0 (/var/run/ptp4lro): INITIALIZING to LISTENING on 
INIT_COMPLETE
ptp4l[11139.453]: port 1 (eth2): new foreign master 0c42a1.fffe.d1d084-1
ptp4l[11143.453]: selected best master clock 0c42a1.fffe.d1d084
ptp4l[11143.453]: port 1 (eth2): LISTENING to UNCALIBRATED on RS_SLAVE
ptp4l[11145.452]: master offset    1556400 s1 freq      +0 path delay      -722
ptp4l[11146.453]: master offset     -59008 s3 freq      +0 path delay      -722
ptp4l[11146.453]: port 1 (eth2): UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED
ptp4l[11147.454]: master offset      23604 s3 freq      +0 path delay    -16654
ptp4l[11148.454]: master offset     -11480 s3 freq      +0 path delay      -722
ptp4l[11149.454]: master offset       7411 s3 freq      +0 path delay     -4053
ptp4l[11150.454]: master offset        664 s3 freq      +0 path delay      -722
ptp4l[11151.454]: master offset       4213 s3 freq      +0 path delay     -1011
ptp4l[11152.454]: master offset       3656 s3 freq      +0 path delay      -722
ptp4l[11153.454]: master offset       2691 s3 freq      +0 path delay       531
ptp4l[11154.454]: master offset       3556 s3 freq      +0 path delay       910
ptp4l[11155.454]: master offset       3940 s3 freq      +0 path delay       910
ptp4l[11156.454]: master offset       3528 s3 freq      +0 path delay      1322
ptp4l[11157.454]: master offset       3952 s3 freq      +0 path delay      1322
ptp4l[11158.454]: master offset       3511 s3 freq      +0 path delay      1759
ptp4l[11159.454]: master offset       3947 s3 freq      +0 path delay      1759
ptp4l[11160.454]: master offset       3894 s3 freq      +0 path delay      1804
ptp4l[11161.454]: master offset       3987 s3 freq      +0 path delay      1759
ptp4l[11162.455]: master offset       3955 s3 freq      +0 path delay      1759
ptp4l[11163.454]: master offset       3976 s3 freq      +0 path delay      1722
ptp4l[11164.455]: master offset       3911 s3 freq      +0 path delay      1759
ptp4l[11165.455]: master offset       3972 s3 freq      +0 path delay      1722
ptp4l[11166.455]: master offset       3944 s3 freq      +0 path delay      1722
ptp4l[11167.455]: master offset       4356 s3 freq      +0 path delay      1310
ptp4l[11168.455]: master offset       3955 s3 freq      +0 path delay      1295
ptp4l[11169.455]: master offset       3943 s3 freq      +0 path delay      1295
ptp4l[11170.455]: master offset       4410 s3 freq      +0 path delay       832
ptp4l[11171.455]: master offset       3942 s3 freq      +0 path delay       832
ptp4l[11172.455]: master offset       3942 s3 freq      +0 path delay       832
ptp4l[11173.455]: master offset       3876 s3 freq      +0 path delay       906
ptp4l[11174.455]: master offset       3932 s3 freq      +0 path delay       906
ptp4l[11175.455]: master offset       3948 s3 freq      +0 path delay       906
ptp4l[11176.455]: master offset       3880 s3 freq      +0 path delay       962
ptp4l[11177.455]: master offset       3948 s3 freq      +0 path delay       962
ptp4l[11178.455]: master offset       3952 s3 freq      +0 path delay       962
ptp4l[11179.455]: master offset       3994 s3 freq      +0 path delay       908
ptp4l[11180.455]: master offset       3946 s3 freq      +0 path delay       908
ptp4l[11181.455]: master offset       3967 s3 freq      +0 path delay       883
ptp4l[11182.456]: master offset       3943 s3 freq      +0 path delay       883
ptp4l[11183.455]: master offset       3926 s3 freq      +0 path delay       908
ptp4l[11184.456]: master offset       3912 s3 freq      +0 path delay       938
ptp4l[11185.456]: master offset       3940 s3 freq      +0 path delay       938
ptp4l[11186.456]: master offset       3938 s3 freq      +0 path delay       956
ptp4l[11187.456]: master offset       3842 s3 freq      +0 path delay      1064
ptp4l[11188.456]: master offset       4050 s3 freq      +0 path delay       956
ptp4l[11189.456]: master offset       3781 s3 freq      +0 path delay      1121
ptp4l[11190.456]: master offset       3941 s3 freq      +0 path delay      1121
ptp4l[11191.456]: master offset       3949 s3 freq      +0 path delay      1121
ptp4l[11192.456]: master offset       3816 s3 freq      +0 path delay      1250

-- Rahul Rameshbabu

Rahul Rameshbabu <rrameshb...@nvidia.com> writes:

> In the upstream linuxptp tree, the nullf servo has no way to transition to
> the SERVO_LOCKED state except when the offset is zero. Transitioning to the
> SERVO_LOCKED state is important for a servo that makes no frequency
> adjustments because SERVO_LOCKED_STABLE is the only state that invokes
> write_phase_mode, a performant way of adjusting the clock offset. The goal
> of this change is to make it simple to configure entering the
> SERVO_LOCKED_STABLE state by setting the offset_threshold when using the
> nullf servo. In cases where the offset_threshold is not set but the
> step_threshold is, the SERVO_LOCKED state is entered when the offset is
> within the step_threshold.
>
> Signed-off-by: Rahul Rameshbabu <rrameshb...@nvidia.com>
>
> Rahul Rameshbabu (2):
>   Improve efficiency of nullf servo synchronization
>   Fix SERVO_JUMP docstring comment
>
>  nullf.c   |  9 ++++++---
>  phc2sys.8 | 12 ++++++------
>  ptp4l.8   | 14 +++++++-------
>  servo.h   |  2 +-
>  ts2phc.8  |  8 ++++----
>  5 files changed, 24 insertions(+), 21 deletions(-)


_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to