1IBV_GET_PKEY_INDEX(3) Libibverbs Programmer’s Manual IBV_GET_PKEY_INDEX(3)
2
3
4
6 ibv_get_pkey_index - obtain the index in the P_Key table of a P_Key
7
9 #include <infiniband/verbs.h>
10
11 int ibv_get_pkey_index(struct ibv_context *context,
12 uint8_t port_num,
13 __be16 pkey);
14
16 Every InfiniBand HCA maintains a P_Key table for each of its ports that
17 is indexed by an integer and with a P_Key in each element. Certain In‐
18 finiBand data structures that work with P_Keys expect a P_Key index,
19 e.g. struct ibv_qp_attr and struct ib_mad_addr. Hence the function
20 ibv_get_pkey_index() that accepts a P_Key in network byte order and
21 that returns an index in the P_Key table as result.
22
24 ibv_get_pkey_index() returns the P_Key index on success, and -1 on er‐
25 ror.
26
28 ibv_open_device(3), ibv_query_device(3), ibv_query_gid(3),
29 ibv_query_pkey(3), ibv_query_port(3)
30
32 Bart Van Assche <bvanassche@acm.org>
33
34
35
36libibverbs 2018-07-16 IBV_GET_PKEY_INDEX(3)