Queries the P_Key table of an 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() routine
returns the P_Key value in the entry index of port port_num for
device context context through the pointer pkey.
 
Input Parameters
| context | 
Valid context pointer returned by ibv_open_device(). | 
| port_num | 
Valid port number for the device returned by ibv_query_device(). | 
| index | 
Valid index for port_num from attributes returned
by ibv_query_port(). | 
 
 
Output Parameter
| pkey | 
Valid pointer to store protection key. | 
 
 
Return Values
| 0 | 
On success. | 
| -1 | 
If the request fails because, the context or pkey parameter
is NULL or the open or write operation failed on the OFED admin device /dev/rdma/ofed_adm. |