rpma_write_atomic - initiate the atomic write operation (deprecated)
#include <librpma.h>
struct rpma_conn;
struct rpma_mr_local;
struct rpma_mr_remote;
int rpma_write_atomic(struct rpma_conn *conn,
struct rpma_mr_remote *dst, size_t dst_offset,
const struct rpma_mr_local *src, size_t src_offset,
int flags, const void *op_context);
rpma_write_atomic() initiates the atomic write operation (transferring data from the local memory to the remote memory). The atomic write operation allows transferring 8 bytes of data (RPMA_ATOMIC_WRITE_ALIGNMENT) and storing them atomically in the remote memory.
The attribute flags set the completion notification indicator:
RPMA_F_COMPLETION_ON_ERROR - generate the completion on error
RPMA_F_COMPLETION_ALWAYS - generate the completion regardless of result of the operation.
op_context is returned in the wr_id field of the completion (struct ibv_wc).
The rpma_write_atomic() function returns 0 on success or a negative error code on failure.
rpma_write_atomic() can fail with the following errors:
RPMA_E_INVAL - conn, dst or src is NULL
RPMA_E_INVAL - dst_offset is not aligned to 8 bytes
RPMA_E_INVAL - flags are not set
RPMA_E_PROVIDER - ibv_post_send(3) failed
This API call should be replaced with rpma_atomic_write(). This is an example snippet of code using the old API:
struct rpma_conn *conn;
struct rpma_mr_remote *dst;
struct rpma_mr_local *src;
ret = rpma_write_atomic(conn, dst, dst_offset, src, src_offset,
RPMA_F_COMPLETION_ON_ERROR, NULL)
if (ret) { error_handling_code() }
The above snippet should be replaced with the following one using the new API:
struct rpma_conn *conn;
struct rpma_mr_remote *dst;
char src[8];
ret = rpma_atomic_write(conn, dst, dst_offset, src,
RPMA_F_COMPLETION_ON_ERROR, NULL)
if (ret) { error_handling_code() }
rpma_conn_req_connect(3), rpma_mr_reg(3), rpma_mr_remote_from_descriptor(3), librpma(7) and https://pmem.io/rpma/
The contents of this web site and the associated GitHub repositories are BSD-licensed open source.