rdma_reg_msgs

Registers the data buffer for sending or receiving messages.

Syntax

#include <rdma/rdma_cma.h>
struct ibv_mr * rdma_reg_msgs (struct rdma_cm_id *id, void *addr, size_t length);   

Description

Registers an array of memory buffers that are used for sending and receiving messages or for RDMA operations. Memory buffers that are registered by using the rdma_reg_msgs function can be posted to an rdma_cm_id identifier by using one of the following operations:
  • Run the rdma_post_send operation
  • Run the rdma_post_recv operation
  • Specify the buffer as the target of an RDMA read operation
  • Specify the buffer as the source of an RDMA write request

Note: The rdma_reg_msgs operation registers an array of data buffers that are used to send and receive messages on a queue pair that is associated with an rdma_cm_id identifier. The memory buffer is registered with the protection domain that is associated with the identifier. The start of the data buffer array is specified by using the addr parameter, and the total size of the array is specified by the length parameter. All data buffers must be registered before being posted as a work request. You must unregister all the registered memory by using the rdma_dereg_mr operation.

Parameters

Item Description
addr Specifies the address of the memory buffer to register.
id Specifies a reference to a communication identifier where the message buffer must be used.
length Specifies the total length of the memory to register.

Return Values

Returns a reference to the registered memory region on success, or NULL on error. If an error occurs, errno is set to indicate the reason for failure.