MLX5DV_GET_CLOCK_INFO(3)
π MLX5DV_GET_CLOCK_INFO π
okay bestie, gather round, because we're talking about mlx5dv_get_clock_info(3) β a lil' library function from the Library Functions Manual section, and honestly? she's doing the most important job nobody talks about. π°οΈβ¨
β¨ 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 π¦
so basically, this function goes and grabs the updated core clock_info straight from the device driver. like, fresh off the press. and why do we care? because later on, you're gonna use that info to translate a completion timestamp from the HCA core clock into nanoseconds. that's the whole glow-up. π
now, real talk: the values of the clock get updated from the driver's PTP clock. which means β and this is the part where I need you to lock in β if there is no running PTP client on the machine, then the wall clock conversion will not be accurate. no cap. it's just not gonna be right, and that's not a bug, that's just physics being dramatic. π
so here's the move: pass the latest struct mlx5dv_clock_info into mlx5dv_ts_to_ns(3) and that's how you translate the completion timestamp from HCA core clock to nanoseconds. iconic combo, honestly. π«Ά
β οΈ and if theclock_infogets too old? the time conversion will return wrong conversion results. periodt. so you, yes you, must make sure thatmlx5dv_get_clock_info(3)is called at least once everymax_clock_info_update_nsecβ that value comes back from themlx5dv_query_device(3)function. set a lil reminder, bestie, your future self will thank you. β°π
π RETURN VALUE π
0on success π- or the value of
errnoon failure β which is the universe telling you why it went wrong π
π SEE ALSO π
π AUTHORS π
- Feras Daoud
<ferasda@mellanox.com>
and that's the whole page, bestie!! this one's from version 1.0.0 and it's dated 2017-11-08 β so yeah, vintage but still eating. mwah, go keep those clocks updated ππβ¨
π¦ where this page comes from
- alpine 3.24: rdma-core-doc 61.0-r0 Β· GPL-2.0-only OR BSD-2-Clause
- arch rolling: rdma-core 65.0-1 Β· GPL-2.0-or-later OR LicenseRef-OpenIB.org-BSD-MIT AND GPL-2.0-or-later OR LicenseRef-OpenIB.org-BSD-FreeBSD AND GPL-2.0-or-later OR LicenseRef-Intel-BSD-3-Clause AND GPL-2.0-or-later OR LicenseRef-PathScale-BSD-Patent-License AND CC0-1.0 AND MIT AND BSD-2-Clause AND CPL-1.0 OR BSD-2-Clause OR GPL-2.0-or-later
- centos-stream 10: rdma-core-devel 62.0-3.el10 Β· GPLv2 or BSD
- centos-stream 9: rdma-core-devel 61.0-3.el9 Β· GPLv2 or BSD
- centos-stream 9: rdma-core-devel 61.0-3.el9 Β· GPLv2 or BSD
- debian bookworm: libibverbs-dev 44.0-2 Β· BSD-MIT OR GPL-2.0-only
- debian trixie: libibverbs-dev 56.1-1 Β· BSD-MIT OR GPL-2.0-only
- fedora 43: rdma-core-devel 58.0-4.fc43 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- fedora 43: rdma-core-devel 58.0-4.fc43 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- fedora 44: rdma-core-devel 61.0-2.fc44 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- fedora 44: rdma-core-devel 61.0-2.fc44 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- fedora 44: rdma-core-devel 61.1^20260812git975bdaf-1.fc44 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- fedora 44: rdma-core-devel 61.1^20260812git975bdaf-1.fc44 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- nixos 26.05: rdma-core 62.0
- nixpkgs unstable: rdma-core 65.0
- opensuse-leap 16.0: rdma-core-devel 56.1-160000.2.2 Β· BSD-2-Clause OR GPL-2.0-only
- opensuse-leap 16.0: rdma-core-devel 56.1-160000.2.2 Β· BSD-2-Clause OR GPL-2.0-only
- opensuse-leap 16.0: rdma-core-devel 56.1-160000.2.2 Β· BSD-2-Clause OR GPL-2.0-only
- opensuse-leap 16.0: rdma-core-devel 56.1-160000.2.2 Β· BSD-2-Clause OR GPL-2.0-only
- ubuntu jammy: libibverbs-dev 39.0-1 Β· BSD-MIT OR GPL-2.0-only
- ubuntu noble: libibverbs-dev 50.0-2build2 Β· BSD-MIT OR GPL-2.0-only
- ubuntu noble: libibverbs-dev 50.0-2ubuntu0.2 Β· BSD-MIT OR GPL-2.0-only
- ubuntu questing: libibverbs-dev 56.1-1ubuntu1
- ubuntu resolute: libibverbs-dev 61.0-2ubuntu3 Β· BSD-MIT OR GPL-2.0-only
- ubuntu stonking: libibverbs-dev 64.0-1ubuntu1 Β· BSD-MIT OR GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms