ibv_impo...import_dm(3)

✨ ibv_impo...import_dm(3) ✨

okay so bestie, welcome to the Libibverbs Programmer’s Manual 🫢 this little page is all about sharing one Device Memory (DM) between your RDMA contexts, and honestly? it's giving "teamwork makes the dream work" energy πŸ’…


🌸 NAME 🌸

ibv_import_dm β€” imports a DM from a given ibv_context πŸ‘‘

ibv_unimport_dm β€” unimports a DM πŸšͺ


πŸŽ€ SYNOPSIS πŸŽ€

#include <infiniband/verbs.h>

struct ibv_dm *ibv_import_dm(struct ibv_context *context, uint32_t dm_handle);
void ibv_unimport_dm(struct ibv_dm *dm)

πŸ¦‹ DESCRIPTION πŸ¦‹

so ibv_import_dm() returns a Device memory (DM) that is associated with the given dm_handle in the RDMA context. literally just handing you the DM, no cap ✨

the input dm_handle value must be a valid kernel handle for a DM object in the associated RDMA context, okay? no random numbers, bestie πŸ™ˆ you get it from the original DM by grabbing its ibv_dm->handle member value. that's the whole trick, iykyk.

ibv_unimport_dm() unimports the DM. once you're done using the DM, ibv_free_dm() or ibv_unimport_dm() should be called πŸ’« and here's the tea on the difference:

  • the first one, ibv_free_dm(), will go to the kernel to destroy the object
  • the second one, ibv_unimport_dm(), does the cleanup of whatever is needed / the opposite of the import, without calling the kernel
lowkey important: it is the responsibility of the application to coordinate between all ibv_context(s) that use this DM. once destroy is done, no other process can touch the object except for unimport. all users of the context must collaborate to ensure this β€” fr fr, this is a group project where everyone actually has to pull their weight 😭

🧚 RETURN VALUE 🧚

ibv_import_dm() returns a pointer to the allocated DM, or NULL if the request fails and errno is set πŸ’€


🌈 NOTES 🌈

genuinely nothing here y'all, this section is empty and we respect that πŸŽ€


⭐ SEE ALSO ⭐

ibv_alloc_dm(3), ibv_free_dm(3),


πŸ‘‘ AUTHOR πŸ‘‘

Maor Gottlieb <maorg@nvidia.com>


and that's the whole page bestie, you ate that πŸ’… this was libibverbs, dated 2021-1-17, and the title was ibv_impo...import_dm(3) β€” go forth and import responsibly πŸ¦‹βœ¨

πŸ“¦ where this page comes from