Running TimeKeeper with ConnectX-4

Version 10

    This is a quick overview of TimeKeeper by FSMLabs for time synchronization of Linux server with ConnectX-4 HW timestamping and GM Clock. The below is a description of PTP, TimeKeeper and its usages.

    In this post, the setup includes a GrandMaster clock connected to GPS Antenna, and a server with ConnectX-4 supporting HW timestamping that will act only as a PTP slave. Both are connected to a Mellanox SX6036 switch.

    TimeKeeper installation instructions can be found in TimeKeeper User Manual.

     

    References

     

    Setup

     

    TimeKeeper Installation

    1. Follow the installation procedure in the following TimeKeeper Manual.

     

    2. Here is an example of /etc/timekeeper.conf configuration file assuming the interface is cx4p2.

    SOURCE0() { PTPCLIENTVERSION=2; IFACE=cx4p2;};

    SET_TIME_ON_STARTUP=1

    ENABLE_WEB_MANAGEMENT=1

    WEB_MANAGEMENT_PORT=8080

     

    3. Make sure PTP support is enabled on the interface:

    #ethtool -T cx4p2

    Time stamping parameters for cx4p2:

    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: 0

    Hardware Transmit Timestamp Modes:

            off                   (HWTSTAMP_TX_OFF)

            on                    (HWTSTAMP_TX_ON)

    Hardware Receive Filter Modes:

            none                  (HWTSTAMP_FILTER_NONE)

            all                   (HWTSTAMP_FILTER_ALL)

     

     

    4. Start the TimeKeeper:

    # sudo /etc/init.d/timekeeper start

     

    5. Make sure that TimeKeeper runs correctly. Check the following log files:

     

    /var/log/timekeeper

    /var/log/timekeeper_<source>.data

     

    Note:

    • The first column states the time passed from every update since midnight January 1st, 1970.
    • The second column is the offset from the remote server in seconds.
    • /var/log/timekeeper_0.data -  0 stands for source 0 , 1 for source 1 etc. and it refers to the number of our card PTP device that you see in ethtool -T cx4p2:  "PTP Hardware Clock: 0".

     

    More detailed information about each column can be found in Timekeeper manual.