rdma_resolve_addr

Resolves the destination and optional source addresses.

Syntax

#include <rdma/rdma_cma.h>
int rdma_resolve_addr(struct rdma_cm_id *id, struct sockaddr *src_addr, struct sockaddr *dst_addr, int timeout_ms);

Description

The rdma_resolve_addr function resolves the destination and optional source addresses from IP address to an RDMA address. If successful, the specified rdma_cm_id is bound to a local device.

Notes:
  • The rdma_resolve_addr routine is used to map a given destination IP address to a usable RDMA address. The IP to RDMA address mapping is done using the local routing tables, or via ARP.
  • If a source address is given, the rdma_cm_id is bound to that address, and the situation is same as if rdma_bind_addr was called. If no source address is given, and the rdma_cm_id has not yet been bound to a device, then the rdma_cm_id will be bound to a source address based on the local routing tables.
  • The rdma_resolve_addr routine is run from the active side of a connection, before calling rdma_resolve_route and rdma_connect.

Parameters

id Specifies the RDMA identifier.
src_addr Specifies the source address information and this parameter might be NULL.
dst_addr Specifies the destination address information.
timeout_ms Specifies the time of resolution.

Return Values

The rdma_resolve_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.
[ Feedback ]