IBV_ALLOC_MW(3)
π IBV_ALLOC_MW β the manual page, but make it cute
okay bestie, welcome to ibv_alloc_mw(3), straight out of the Libibverbs Programmer's Manual. it's the page about memory windows, and honestly? it's giving "small but mighty". let's get into it π
β¨ NAME β¨
ibv_alloc_mw, ibv_dealloc_mw β allocate or deallocate a memory window (MW)
π SYNOPSIS π
#include <infiniband/verbs.h>
struct ibv_mw *ibv_alloc_mw(struct ibv_pd *pd,
enum ibv_mw_type type);
int ibv_dealloc_mw(struct ibv_mw *mw);
πΈ DESCRIPTION πΈ
so ibv_alloc_mw() allocates a memory window (MW) that's associated with the protection domain pd. and the MW's type β which is either 1 or 2A/2B β is type. that's it, that's the whole vibe β¨
ngl the important part: the MW gets created not bound. it's like, a blank canvas, a fresh face, no commitments. for it to actually be useful, the MW has to be bound, and you do that through either ibv_bind_mw (type 1) or a special WR (type 2). once it's bound, the memory window lets RDMA (remote) access happen to a subset of the MR it was bound to β queen behaviour honestly π
and it stays valid until it gets invalidated by one of these three things:
- the
ibv_bind_mwverb with zero length for type 1 - the
IBV_WR_LOCAL_INV/IBV_WR_SEND_WITH_INVWR opcode for type 2 - deallocation
then ibv_dealloc_mw() β it unbinds in case it was previously bound, and deallocates the MW mw. two jobs, one function, we love a multitasker π«Ά
β RETURN VALUE β
ibv_alloc_mw() returns a pointer to the allocated MW, or NULL if the request fails. π
and bestie, listen β the remote key (R_Key) field rkey is used by remote processes to perform Atomic and RDMA operations. this key will be changed during bind operations, no cap. the remote process places this rkey as the rkey field of struct ibv_send_wr passed to the ibv_post_send function. iykyk π
ibv_dealloc_mw() returns 0 on success, or the value of errno on failure (which indicates the failure reason). classic errno moment π
π NOTES π
ibv_dereg_mr() fails if any memory window is still bound to this MR. so clean up your windows first, okay? don't leave them open like unread texts π΅
π SEE ALSO π
π AUTHORS π
- Majd Dibbiny
<majd@mellanox.com> - Yishai Hadas
<yishaih@mellanox.com>
and that's the whole page, bestie!! this one shipped under libibverbs and it's dated 2016-02-02 β vintage, iconic, still slaying. go bind a memory window, you've got this π¦π
π¦ 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
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- 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