rdma_post_write

Posts a work request for RDMA write operation.

Syntax

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

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 local data buffer are written into the remote memory region.

Notes: The remote and local data buffers must be registered before you run the write operation. The buffers must be registered until the write operation is complete. The write operation does not post the work request to an rdma_cm_id identifier or the corresponding queue pair until it is connected. The user-defined context that is associated with the write request is returned by using the work completion wr_id identifier, the work request identifier, and the work request identifier field.

Parameters

Item Description
addr Specifies the local address of the source that is related to the write request.
context Specifies the user-defined context that is associated with the request.
flags Specifies the optional flags that are used to control the write operation.
id Specifies a reference to a communication identifier where the request is posted.
rkey Specifies the registered memory key that is associated with the remote address.
length Specifies the length of the write operation.
mr Specifies the optional memory region that is associated with the local buffer.
remote_addr Specifies the address of the remote registered memory to write the data.

Return Values

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