This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

EVMK2H: Timestamping Problem

I follow the below document to test timestamps on EVMK2H board. But the result doesn't match.

http://processors.wiki.ti.com/images/c/cb/Testing_timestamp_using_timestamping_app.pdf

For example,

To test TX Hardware timestamp, run the below command.

#./timestamping eth0 SOF_TIMESTAMPING_TX_HARDWARE SOF_TIMESTAMPING_SYS_HARDWARE SOF_TIMESTAMPING_RAW_HARDWARE

The result is as below

...

cmsg len 36: SOL_SOCKET SO_TIMESTAMPING SW 0.000000000 HW transformed 0.000000000 HW raw 63.795312305

...

 

From the document, it should be ...

cmsg len 36: SOL_SOCKET SO_TIMESTAMPING SW 0.000000000 HW transformed 1352911185.728678786 HW raw 68210.643672961

"HW transformed" value one is 0.000000000, the other is 1352911185.728678786. Why?

 

 

  • Hi Tony,

    Would you please send the parent wiki link which shows attachment(doc) for EVMK2H?

    I believe, the attached document is not for K2H.

    Thank you.

  • Hi Rajasekaran,

    Search "Please refer to this document for testing PA timestamps in MCSDK3.0" in the below link.

    http://processors.wiki.ti.com/index.php/MCSDK_UG_Chapter_Exploring

     

    Tony

  • Hi Tony,

    Thank you for the link. We will re-produce and get back to you on this.

  • Hi Rajasekaran,

    Any status update?

     

    Tony

  • Hi Tony,

    I am able to re-produce the issue reported. I will check with factory team and update here.

    Thank you.

  • Hi, Tony,

    The document says:

    Who Is Timestamping What?

    Notice that PA timestamping and CPTS timestamping are running simultaneously. This is desirable in some use cases because, for example, NTP timestamping is also needed in some systems and CPTS timestamping is only for PTP. However, CPTS has priority over PA to timestamp PTP messages. When CPTS timestamps a PTP message, PA will not timestamp it. See the section PA Timestamping for more details about PA timestamping.

    The timestamping software is to timestamp PTP, not NTP. So, the logs shows HW Transformed being 0 is the CPTS timestamping, not PA timestamping. You need to disable CPTS timestamping in dts file as described in the document. Below are my results with CPTS disabled:

    root@keystone-evm:~#
    TAMPING_SYS_HARDWARE SOF_TIMESTAMPING_RAW_HARDWARESTAMPING_TX_HARDWARE SOF_TIMEST
    SIOCSHWTSTAMP: tx_type 1 requested, got 1; rx_filter 0 requested, got 0
    SO_TIMESTAMP 0
    SO_TIMESTAMPNS 0
    SO_TIMESTAMPING 97
    1385332624.193437: select 806563us
    1385332625.000520: select returned: 0, success
    1385332625.000579: sent 124 bytes
    1385332625.000590: select 4999410us
    1385332625.001005: select returned: 1, success
    ready for reading
    recvmsg regular: Resource temporarily unavailable
    1385332625.001076: received error data, 166 bytes from 69.0.0.152, 80 bytes control messages
       cmsg len 36: SOL_SOCKET SO_TIMESTAMPING SW 0.000000000 HW transformed 1385332625.000571422 HW raw 198.068122436
       cmsg len 44: IPPROTO_IP IP_RECVERR ee_errno 'No message of desired type' ee_origin 4 => bounced packet => GOT OUR DATA BACK (HURRAY!)
    1385332625.001145: select 4998855us
    1385332630.005027: select returned: 0, success
    1385332630.005077: sent 124 bytes
    1385332630.005088: select 4994912us
    1385332630.005350: select returned: 1, success
    ready for reading
    recvmsg regular: Resource temporarily unavailable
    1385332630.005385: received error data, 166 bytes from 69.0.0.152, 80 bytes control messages
       cmsg len 36: SOL_SOCKET SO_TIMESTAMPING SW 0.000000000 HW transformed 1385332630.005070439 HW raw 203.072621453
       cmsg len 44: IPPROTO_IP IP_RECVERR ee_errno 'No message of desired type' ee_origin 4 => bounced packet => GOT OUR DATA BACK (HURRAY!)

    Rex

  • Hi Rex,

    Yes. After disabling CPTS, it works fine.

    Bu I find another problem. Re-produce steps as below.

    1.disable CPTS.

    2.To test TX timestamp

    #././timestamping eth0 SOF_TIMESTAMPING_TX_HARDWARE SOF_TIMESTAMPING_SYS_HARDWARE SOF_TIMESTAMPING_RAW_HARDWARE...........works fine.

    3.To test RX timestamp

    <i>start a PTP server.

    <ii>#./timestamping eth0 SOF_TIMESTAMPING_RX_HARDWARE SOF_TIMESTAMPING_SYS_HARDWARE SOF_TIMESTAMPING_RAW_HARDWARE.................works fine.

    4. goto steps 2 To test TX timestamp...........the output log is as blow

    root@keystone-evm:~#./timestamping eth0 SOF_TIMESTAMPING_TX_HARDWARE SOF_TIMESTAMPING_SYS_HARDWARE SOF_TIMESTAMPING_RAW_HARDWARE

    SIOCSHWTSTAMP: tx_type 1 requested, got 1; rx_filter 0 requested, got 0
    SO_TIMESTAMP 0
    SO_TIMESTAMPNS 0
    SO_TIMESTAMPING 97
    1407137364.945528: select 54472us
    1407137364.972615: select returned: 1, success
    ready for reading
    1407137364.972633: received regular data, 44 bytes from 140.96.82.207, 24 bytes control messages
       cmsg len 24: IPPROTO_IP IP_PKTINFO interface index 2
    recvmsg error: Resource temporarily unavailable
    1407137364.972696: select 27304us
    1407137365.000064: select returned: 0, success
    1407137365.000088: sent 124 bytes
    1407137365.000092: select 4999908us
    1407137365.003989: select returned: 1, success
    ready for reading
    recvmsg regular: Resource temporarily unavailable
    1407137365.004004: received error data, 166 bytes from 69.0.0.152, 80 bytes control messages
       cmsg len 36: SOL_SOCKET SO_TIMESTAMPING SW 0.000000000 HW transformed 1407137365.000087946 HW raw 1950.835009210
       cmsg len 44: IPPROTO_IP IP_RECVERR ee_errno 'No message of desired type' ee_origin 4 => bounced packet => GOT OUR DATA BACK (HURRAY!)
    1407137365.004024: select 4995976us
    1407137365.012414: select returned: 1, success
    ready for reading
    1407137365.012423: received regular data, 44 bytes from 192.168.1.202, 24 bytes control messages
       cmsg len 24: IPPROTO_IP IP_PKTINFO interface index 2
    recvmsg error: Resource temporarily unavailable
    1407137365.012435: select 4987565us
    1407137365.037626: select returned: 1, success
    ready for reading
    1407137365.037635: received regular data, 44 bytes from 140.96.82.207, 24 bytes control messages
       cmsg len 24: IPPROTO_IP IP_PKTINFO interface index 2
    recvmsg error: Resource temporarily unavailable
    1407137365.037648: select 4962352us
    1407137365.070002: select returned: 1, success

    Is it a correct result? Why is it different from the first TX timestamp test?

     

    Tony