rdma_post_send

Posts a work request to send a message.

Syntax

#include <rdma/rdma_cma.h>
int rdma_post_send (struct rdma_cm_id *id, void *context, void *addr, size_t length, struct ibv_mr *mr, 
int flags);        

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 posted buffer are sent to the remote peer of a connection.

Notes: You must make sure that the remote peer posts a receive request before processing the send operations. If the send request is using inline data, the message buffer must be registered before being posted with the mr parameter by specifying the registration. The buffer must remain registered until the send operation is completed. The send operation cannot be posted to an rdma_cm_id identifier or the corresponding queue pair until the send operation is connected. The user-defined context that is associated with the send request is returned to the user by using the work completion wr_id identifier, the work request identifier, and the work request identifier field.

Parameters

Item Description
addr Specifies the address of the memory buffer to post the work request.
context Specifies the user-defined context that is associated with the request.
flags Specifies the optional flags that are used to control the send operation.
id Specifies a reference to a communication identifier where the message buffer is posted.
length Specifies the length of the memory buffer.
mr Specifies the optional registered memory region that is associated with the posted buffer.

Return Values

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