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 an IP address to an Remote Direct Memory Access (RDMA) address. If successful, the specified rdma_cm_id identifier is associated with a local device.

Notes:
  • The rdma_resolve_addr operation is used to map a specified destination IP address to a usable RDMA address. The IP- RDMA address mapping is done by using the local routing table, or by using ARP.
  • If the source address is specified, the rdma_cm_id identifier is associated with the source address, and the situation is similar to running the rdma_bind_addr operation. If no source address is specified, the rdma_cm_id identifier is not associated with a device, and the identifier gets associated with a source address based on the local routing tables.
  • The rdma_resolve_addr operation is run from the active side of a connection, before running the rdma_resolve_route and rdma_connect operations.

Parameters

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

Return Values

The rdma_resolve_addr function returns 0 on success, or -1 on error. If an error occurs, errno indicates the reason for failure.