On Tue, May 26, 2020 at 12:00 PM Slava Ovsiienko <viachesl...@mellanox.com> wrote: >> Hi, Patrick > > ConnectX HW timestamp is the captured value of internal 64-bit counter running at the frequency, > reported in the device_frequency_khz field of struct mlx5_ifc_cmd_hca_cap_bits{}. > This structure is queried in mlx5_devx_cmd_query_hca_attr() routine. > So, with known frequency it is possible to recalculate timestamp ticks to desired units.
Hello Slava, Assuming that the NIC clock is already synced thanks to a PTP client, does the bit counter give an absolute time value (0 => 1 January 1970 00:00:00)? Or do I need to calculate a time duration from the process start time? I just want to validate the path from mlx5 eth dev(Rx) to eth pcap (Tx) : - query the oscillator frequency at the mlx5_eth_dev init step (mlx5_devx_cmd_query_hca_attr()) - store the freq with other hca_attr, carried by dev config which should be shared with the secondary process - in eth_pcap_tx_dumper(), retrieve the freq from the dev given by mbuf->port - convert all the incoming mbuf->timestamp using this freq whose variation should be negligible over the capture duration Last question: what is your opinion about this other method? https://github.com/linux-rdma/rdma-core/blob/7af01c79e00555207dee6132d72e7bfc1bb5485e/providers/mlx5/mlx5dv.h#L1201 Thanks a lot!