ibv_alloc_pd, ibv_dealloc_pd

Allocates or deallocates a protection domain (PD).

Syntax

#include <rdma/verbs.h>
struct ibv_pd *ibv_alloc_pd(struct ibv_context *context)
int ibv_dealloc_pd(struct ibv_pd *pd)

Description

The ibv_alloc_pd() function allocates a PD for the remote device memory access (RDMA) device context, the context parameter. The ibv_dealloc_pd() function deallocates PD, the pd parameter.

Note: The ibv_dealloc_pd() function fails if any other RDMA resource is still associated with the PD that must be freed.

Parameters

Item Descriptor
context The ibv_context struct for the ibv_open_device() function.

Return Value

The ibv_alloc_pd() function returns a pointer to the allocated PD, or NULL if the request fails. The ibv_dealloc_pd() function returns 0 on success, or the value of errno on failure (which indicates the reason for failure).