User Manual
Rev 2.3-1.0.1
Mellanox Technologies
157
To check which operations are supported for a given transport, the capabilities field need to be
masked with one of the following masks:
enum ibv_odp_transport_cap_bits {
IBV_EXP_ODP_SUPPORT_SEND = 1 << 0,
IBV_EXP_ODP_SUPPORT_RECV = 1 << 1,
IBV_EXP_ODP_SUPPORT_WRITE = 1 << 2,
IBV_EXP_ODP_SUPPORT_READ = 1 << 3,
IBV_EXP_ODP_SUPPORT_ATOMIC = 1 << 4,
IBV_EXP_ODP_SUPPORT_SRQ_RECV = 1 << 5,
};
For example to check if RC supports send:
If (dattr.odp_caps.per_transport_caps.rc_odp_caps & IBV_EXP_ODP_SUPPORT_SEND)
//RC supports send operations with ODP MR
For further information, please refer to the ibv_exp_query_device manual page.
3.2.7.6.2 Registering ODP Explicit MR
ODP Explicit MR is registered after allocating the necessary resources (e.g., PD, buffer):
struct ibv_exp_reg_mr_in in;
struct ibv_mr *mr;
in.pd = pd;
in.addr = buf;
in.length = size;
in.exp_access = IBV_EXP_ACCESS_ON_DEMAND| … ;
in.comp_mask = 0;
mr = ibv_exp_reg_mr(&in);
Please be aware that the exp_access differs from one operation to the other, but the
IBV_EXP_ACCESS_ON_DEMAND is set for all ODP MRs.
For further information, please refer to the
ibv_exp_reg_mr manual page.
3.2.7.6.3 Registering ODP Implicit MR
Registering an Implicit ODP MR provides you with an implicit lkey that represents the complete
address space. Implicit ODP MR is limited to local access permissions (local read or write). It
only has a valid lkey, whereas its rkey is invalid. The size of operations that can use this lkey is
limited to 128MB.
To register an Implicit ODP MR, in addition to the
IBV_EXP_ACCESS_ON_DEMAND access flag, use
in->addr = 0 and in->length = IBV_EXP_IMPLICIT_MR_SIZE.
For further information, please refer to the
ibv_exp_reg_mr manual page.
3.2.7.6.4 De-registering ODP MR
ODP MR is deregistered the same way a regular MR is deregistered:
ibv_dereg_mr(mr);
3.2.7.6.5 Pre-fetching Verb
The driver can pre-fetch a given range of pages and map them for access from the HCA. The pre-
fetched verb is applicable for ODP MRs only, and it is done on a best effort basis, and may
silently ignore errors.