rdma_create_qp

Allocates a 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 QP associated with a specified rdma_cm_id, and transitions it for sending and receiving.

Notes:
  • The rdma_cm_id must be bound to a local RDMA device before calling the rdma_create_qp function, and the protection domain must be for that same device.
  • QPs allocated to an rdma_cm_id are automatically transitioned by the librdmacm through their states. After being allocated, the QP is ready to handle posting of receives. If the QP is unconnected, it will be ready to post sends.

Parameters

id Specifies the communication identifier to destroy.
pd Specifies the protection domain for the QP.
qp_init_attr Specifies the initial QP attributes.

Return Values

The rdma_create_qp function returns the following values:
0 On success.
-1 Error, see errno.
-EINVAL If the id, pd, or qp_init_attr parameter is NULL or bad parameter in ibv_qp_init_attr such as, cap.max_inline_data limited to 64 for Chelsio Boards.
-ENOMEM There is not enough space to allocate by malloc.
[ Feedback ]