ibv_query_pkey

Queries the P_Key table of an remote direct memory access (RDMA) port.

Syntax

#include <rdma/verbs.h>
int ibv_query_pkey(struct ibv_context *context, uint8_t port_num, int index, uint16_t *pkey)

Description

The ibv_query_pkey() function returns the P_Key value in the entry index of port port_num for device context context through the pointer pkey.

Input Parameters

Item Description
context Specifies the valid context pointer that is returned by the ibv_open_device() function.
port_num Specifies the valid port number for the device that is returned by the ibv_query_device() function.
index Specifies the valid index for the port_num parameter from attributes that are returned by the ibv_query_port() function.

Output Parameter

Item Description
pkey Specifies the valid pointer to store protection key.

Return Values

Item Description
0 On success.
-1 The request fails because of the following reasons:
  • The context or pkey parameter is NULL
  • The open or write operation failed on the /dev/rdma/ofed_adm administrator device.