rdma_bind_addr

Binds an RDMA identifier to a source address.

Syntax

#include <rdma/rdma_cma.h>
int rdma_bind_addr(struct rdma_cm_id *id, struct sockaddr *addr);

Description

The rdma_bind_addr function associates a source address with an rdma_cm_id. The address might be a wildcard value. If an rdma_cm_id is bound to a local address, the identifier is also bound to a local RDMA device.

Notes:
  • The rdma_bind_addr routine is called before calling the rdma_listen routine to bind to a specific port number. It might also be called on the active side of a connection before calling the rdma_resolve_addr routine to bind to a specific address.
  • If the rdma_bind_addr routine is used to bind to port 0, the rdma_cm selects an available port that can be retrieved with rdma_get_src_port.

Parameters

id Specifies the RDMA identifier.
addr Specifies the local address information. Wildcard values are permitted.

Return Values

The rdma_bind_addr function returns the following values:
0 On success.
-1 Error, see errno.
-EINVAL If the id parameter is NULL or the family is a Bad Protocol family.
-ENODATA The write operation on id->channel->fd failed.
-ENOMEM The memory is not enough to allocate by malloc.
[ Feedback ]