rdma_post_recvv

Posts a work request to the send queue for RDMA read operation.

Syntax

#include <rdma/rdma_cma.h>
int rdma_post_recvv (struct rdma_cm_id *id, void *context, struct ibv_sge *sgl, int nsge);      

Description

Posts a work request to the send queue of the queue pair that is associated with the rdma_cm_id identifier. The contents of the remote memory region is read into the local data buffer.

Notes: You must make sure that a receive buffer is posted. The receive buffer must be large enough to contain all the sent data before the peer posts the corresponding send message. You must register the message buffer before it is posted by using the mr parameter by specifying the registration. The buffer must be registered until the receive operation is completed. The messages can be posted to an rdma_cm_id identifier after a queue pair is associated with the message. A queue pair is bound to an rdma_cm_id identifier after calling therdma_create_ep operation or rdma_create_qp operation, if the rdma_cm_id identifier is allocated by using the rdma_create_id identifier. The user-defined context that is associated with the receive request is returned by using the work completion wr_id identifier, the work request identifier, and the work request identifier field.

Parameters

Item Description
context Specifies the user-defined context that is associated with the request.
id Specifies a reference to a communication identifier where the request is posted.
nsge Specifies the number of scatter-gather array entries that are present.
sgl Specifies a scatter-gather list of the destination buffers that is associated with the read operation.

Return Values

Returns 0 on success, or -1 on error. If an error occurs, the errno is set to indicate the reason for failure.