---
name: "mlx5dv_get_clock_info"
section: "3"
platform: "linux"
package: "rdma-core"
version: "65.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/mlx5dv_get_clock_info"
---

# mlx5dv\_get\_clock\_info(3)

Get device clock information

## NAME

mlx5dv\_get\_clock\_info - Get device clock information

## SYNOPSIS

```
#include <infiniband/mlx5dv.h>

int mlx5dv_get_clock_info(struct ibv_context *ctx_in,
                          struct mlx5dv_clock_info *clock_info);
```

## DESCRIPTION

Get the updated core *clock\_info* from the device driver. This information will be used later to translate the completion timestamp from HCA core clock to nanoseconds. The values of the clock are updated from the driver's PTP clock, therefore, without a running PTP client on the machine, the wall clock conversion will not be accurate.

Pass the latest **struct mlx5dv\_clock\_info** to **[mlx5dv\_ts\_to\_ns(3)](/mlx5dv_ts_to_ns/3.md)** in order to translate the completion timestamp from HCA core clock to nanoseconds.

If the clock\_info becomes too old then time conversion will return wrong conversion results. The user must ensure that  **[mlx5dv\_get\_clock\_info(3)](/mlx5dv_get_clock_info/3.md)** is called at least once every **max\_clock\_info\_update\_nsec** as returned by the **[mlx5dv\_query\_device(3)](/mlx5dv_query_device/3.md)** function.

## RETURN VALUE

0 on success or the value of errno on failure (which indicates the failure reason).

## SEE ALSO

[**mlx5dv**(7)](/mlx5dv/7.md), [**mlx5dv\_ts\_to\_ns**(3)](/mlx5dv_ts_to_ns/3.md)

## AUTHORS

- Feras Daoud \<ferasda@mellanox.com\>
