IBV_BIND_MW(3)
β¨ IBV_BIND_MW β¨
okay bestie, welcome to the ibv_bind_mw page from the Libibverbs Programmer's Manual π pull up a chair, we're binding type 1 memory windows today and honestly? it's giving main character energy.
πΈ NAME πΈ
ibv_bind_mw β post a request to bind a type 1 memory window to a memory region
π SYNOPSIS π
#include <infiniband/verbs.h>
int ibv_bind_mw(struct ibv_qp *qp, struct ibv_mw *mw,
struct ibv_mw_bind *mw_bind);
π DESCRIPTION π
so ibv_bind_mw() posts to the queue pair qp a request to bind the memory window mw according to the details in mw_bind. that's the whole vibe. you're telling the QP "hey, hook this window up like this" and then you move on with your life.
the argument mw_bind is an ibv_mw_bind struct, as defined in <infiniband/verbs.h>. and she looks like this:
struct ibv_mw_bind {
uint64_t wr_id; /* User defined WR ID */
unsigned int send_flags; /* Use ibv_send_flags */
struct ibv_mw_bind_info bind_info; /* MW bind information */
}
and nested inside her, the bind info:
struct ibv_mw_bind_info {
struct ibv_mr *mr; /* The MR to bind the MW to */
uint64_t addr; /* The address the MW should start at */
uint64_t length; /* The length (in bytes) the MW should span */
unsigned int mw_access_flags; /* Access flags to the MW. Use ibv_access_flags */
};
π¨ important: the QP Transport Service Type must be eitherUC,RCorXRC_SENDfor bind operations. no other type, no exceptions, don't even try it.
β the send_flags moment β
the attribute send_flags describes the properties of the WR. it is either 0 or the bitwise OR of one or more of the following flags:
IBV_SEND_FENCEβ set the fence indicator.IBV_SEND_SIGNALEDβ set the completion notification indicator. relevant only if the QP was created withsq_sig_all=0.
π¦ the mw_access_flags moment π¦
the mw_access_flags define the allowed access to the MW after the bind completes successfully. it is either 0 or the bitwise OR of one or more of the following flags:
IBV_ACCESS_REMOTE_WRITEβ enable Remote Write Access. requires local write access to the MR.IBV_ACCESS_REMOTE_READβ enable Remote Read Access.IBV_ACCESS_REMOTE_ATOMICβ enable Remote Atomic Operation Access (if supported). requires local write access to the MR.IBV_ACCESS_ZERO_BASEDβ if set, the address set on the'remote_addr'field on the WR will be an offset from the MW's start address.
π RETURN VALUE π
ibv_bind_mw() returns 0 on success, or the value of errno on failure (which indicates the failure reason).
and in case of a success, the R_key of the memory window after the bind is returned in the mw_bind->mw->rkey field. cute, right? that's your prize. π
π NOTES π
okay this part actually matters, listen up:
the bind does not complete when the function returns β it is merely posted to the QP. so do not go assuming it's done, bestie, it is not. π
the user should keep a copy of the old R_key, and fix the mw structure if the subsequent CQE for the bind operation indicates a failure.
the user may safely send the R_key using a send request on the same QP (based on QP ordering rules: a send after a bind request on the same QP are always ordered), but must not transfer it to the remote in any other manner before reading a successful CQE.
π¨ also: note that for type 2 MW, one should directly post bind WR to the QP, using ibv_post_send.
π SEE ALSO π
ibv_alloc_mw(3), ibv_post_send(3), ibv_poll_cq(3) ibv_reg_mr(3),
π«Ά AUTHORS π«Ά
Majd Dibbiny <majd@mellanox.com>
Yishai Hadas <yishaih@mellanox.com>
and that's the whole page, bestie π this one came straight out of libibverbs, dated 2016-02-02, and it's the IBV_BIND_MW(3) manual page β go bind something responsibly, mwah π
β¨
π¦ 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