IBV_IMPORT_PD(3)
π ibv_import_pd β bestie edition
okay so first things first, the manual name is ibv_impor...import_pd(3) (yes it's truncated like that, it's giving "name too long for the header" energy) and it lives in the Libibverbs Programmer's Manual. two functions in this house: ibv_import_pd and ibv_unimport_pd. one imports a PD, the other un-imports it. iconic symmetry, no notes. β¨
πΈ NAME πΈ
ibv_import_pdβ import a PD from a givenibv_contextibv_unimport_pdβ unimport a PD
π SYNOPSIS π
#include <infiniband/verbs.h>
struct ibv_pd *ibv_import_pd(struct ibv_context *context, uint32_t pd_handle);
void ibv_unimport_pd(struct ibv_pd *pd)
(yes, the second one is missing a semicolon in the original and yes we are keeping it exactly like that π do not come for me, that's literally what it says)
π¦ DESCRIPTION π¦
so ibv_import_pd() returns a protection domain (PD) that's associated with the given pd_handle in the given context. that's the whole vibe. π«Ά
the input pd_handle value must be a valid kernel handle for a PD object in that given context β like, non-negotiable. and how do you get one? you grab it from the original PD by getting its ibv_pd->handle member value. that's the hookup, iykyk. π
the returned ibv_pd can be used in all verbs that get a protection domain. all of them. every single one. main character PD energy honestly π
now ibv_unimport_pd() β it unimports the PD. once the PD usage has ended, ibv_dealloc_pd() or ibv_unimport_pd() should be called. and here's the tea on the difference β:
- the first one (
ibv_dealloc_pd()) will go to the kernel to destroy the object once the second one does its thing - the second one (
ibv_unimport_pd()) just cleans up whatever is needed β literally the opposite of the import β without calling the kernel
π¨ bestie listen. it is the responsibility of the application to coordinate between all ibv_context(s) that use this PD. once destroy is done, no other process can touch the object except for unimport. all users of the context must collaborate to ensure this. collaborate. as a team. fr fr π€
β RETURN VALUE β
ibv_import_pd() returns a pointer to the allocated PD, or NULL if the request fails. that's it. that's the whole return value. simple, clean, slay π
π SEE ALSO π
ibv_alloc_pd(3), ibv_dealloc_pd(3),
π AUTHOR π
Yishai Hadas <yishaih@mellanox.com>
and that's the page bestie!! brought to you by libibverbs, dated 2020-5-3 β yes it's an oldie but a goodie π°οΈβ¨ go forth and import responsibly, mwah π
π¦ where this page comes from
- alpine 3.24: rdma-core-doc 61.0-r0 Β· GPL-2.0-only OR BSD-2-Clause
- 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
- ubuntu jammy: libibverbs-dev 39.0-1 Β· BSD-MIT OR GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms