ibv_import_device(3)

πŸŽ€ NAME πŸŽ€

okay so bestie, this is ibv_import_device from the Libibverbs Programmer’s Manual β€” it imports a device from a given command FD. periodt. πŸ’…

✨ SYNOPSIS ✨

#include <infiniband/verbs.h>

struct ibv_context *ibv_import_device(int cmd_fd);

πŸ’– DESCRIPTION πŸ’–

So ibv_import_device() returns an ibv_context pointer that is associated with the given cmd_fd. slay.

The cmd_fd is obtained from the ibv_context cmd_fd member, and it must be dup’d (eg by dup(), SCM_RIGHTS, etc) before being passed to ibv_import_device(). no cap, that part is literally mandatory. 🫢

Once the ibv_context usage has been ended, ibv_close_device() should be called. This call may cleanup whatever is needed/opposite of the import, including closing the command FD. it’s giving responsible cleanup energy ✨

πŸ”₯ RETURN VALUE πŸ”₯

ibv_import_device() returns a pointer to the allocated RDMA context, or NULL if the request fails. simple as that, bestie πŸ’€

πŸ‘€ SEE ALSO πŸ‘€

🫢 AUTHOR 🫢

Yishai Hadas <yishaih@mellanox.com>


that’s the whole vibe πŸ’– this page comes from libibverbs, dated 2020-5-3 β€” go import that device and slay, bestie βœ¨πŸ‘‘πŸŒΈ

πŸ“¦ where this page comes from