rdma_create_qp
Allocates a queue pair (QP).
Syntax
#include <rdma/rdma_cma.h>
int rdma_create_qp(struct rdma_cm_id *id, struct ibv_pd *pd, struct ibv_qp_init_attr *qp_init_attr);Description
The rdma_create_qp function
allocates a queue pair (QP) that is associated with a specified rdma_cm_id identifier,
and transitions it for sending and receiving.
Notes: 
- The rdma_cm_ididentifier must be associated with a local RDMA device before running the rdma_create_qp function, and the protection domain must be for the same device.
- QPs that are allocated to an rdma_cm_ididentifier are automatically transitioned by thelibrdmacmlibrary through their states. The QP is ready to handle posting of received data after the QP is allocated. If the QP is not connected, it is ready to post send data.
- If a protection domain is not specified then the - pdparameter is NULL, then therdma_cm_ididentifer is created by using a default protection domain. One default protection domain is allocated per RDMA device. The initial QP attributes are specified by using theqp_init_attrparameter. Thesend_cqandrecv_cqfields in theibv_qp_init_attrare optional. If a send or receive completion queue (CQ) is not specified, then a CQ is allocated by therdma_cmfor the QP, along with corresponding completion channels. Completion channels and CQ data created by therdma_cmcan be accessed by user by using therdma_cm_idstructure. The actual capabilities and properties of the QP that is created is returned to the user through theqp_init_attrparameter.
Parameters
| Item | Description | 
|---|---|
| id | Specifies the communication identifier to create. | 
| pd | Specifies the optional protection domain for the QP. | 
| qp_init_attr | Specifies the initial QP attributes. | 
Return Values
The rdma_destroy_event_channel function returns 0 on success, or -1 on error. If an error occurs, errno indicates the reason for failure.