Licensed under the OpenIB.org BSD license (FreeBSD Variant) - See COPYING.md
#include <infiniband/verbs.h> "int ibv_bind_mw(struct ibv_qp " "*qp" ", struct ibv_mw " "*mw" ", " struct ibv_mw_bind " "*mw_bind" ");
The argument mw_bind is an ibv_mw_bind struct, as defined in <infiniband/verbs.h>.
struct ibv_mw_bind { uint64_t wr_id; /* User defined WR ID */ int send_flags; /* Use ibv_send_flags */ struct ibv_mw_bind_info bind_info; /* MW bind information */ }
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 */ int mw_access_flags; /* Access flags to the MW. Use ibv_access_flags */ };
The QP Transport Service Type must be either UC, RC or XRC_SEND for bind operations.
The attribute send_flags describes the properties of the \s-1WR\s0. It is either 0 or the bitwise \s-1OR\s0 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 QP was created with sq_sig_all=0
The mw_access_flags define the allowed access to the MW after the bind completes successfully. It is either 0 or the bitwise \s-1OR\s0 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.
Note that for type 2 MW, one should directly post bind WR to the QP, using ibv_post_send.
Majd Dibbiny <majd@mellanox.com>
Yishai Hadas <yishaih@mellanox.com>