| 1 |
.\" -*- nroff -*- |
| 2 |
.\" Licensed under the OpenIB.org BSD license (FreeBSD Variant) - See COPYING.md |
| 3 |
.\" |
| 4 |
.TH IBV_QUERY_QP 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" |
| 5 |
.SH "NAME" |
| 6 |
ibv_query_qp \- get the attributes of a queue pair (QP) |
| 7 |
.SH "SYNOPSIS" |
| 8 |
.nf |
| 9 |
.B #include <infiniband/verbs.h> |
| 10 |
.sp |
| 11 |
.BI "int ibv_query_qp(struct ibv_qp " "*qp" ", struct ibv_qp_attr " "*attr" , |
| 12 |
.BI " int " "attr_mask" , |
| 13 |
.BI " struct ibv_qp_init_attr " "*init_attr" ); |
| 14 |
.fi |
| 15 |
.SH "DESCRIPTION" |
| 16 |
.B ibv_query_qp() |
| 17 |
gets the attributes specified in |
| 18 |
.I attr_mask |
| 19 |
for the QP |
| 20 |
.I qp |
| 21 |
and returns them through the pointers |
| 22 |
.I attr |
| 23 |
and |
| 24 |
.I init_attr\fR. |
| 25 |
The argument |
| 26 |
.I attr |
| 27 |
is an ibv_qp_attr struct, as defined in <infiniband/verbs.h>. |
| 28 |
.PP |
| 29 |
.nf |
| 30 |
struct ibv_qp_attr { |
| 31 |
.in +8 |
| 32 |
enum ibv_qp_state qp_state; /* Current QP state */ |
| 33 |
enum ibv_qp_state cur_qp_state; /* Current QP state - irrelevant for ibv_query_qp */ |
| 34 |
enum ibv_mtu path_mtu; /* Path MTU (valid only for RC/UC QPs) */ |
| 35 |
enum ibv_mig_state path_mig_state; /* Path migration state (valid if HCA supports APM) */ |
| 36 |
uint32_t qkey; /* Q_Key of the QP (valid only for UD QPs) */ |
| 37 |
uint32_t rq_psn; /* PSN for receive queue (valid only for RC/UC QPs) */ |
| 38 |
uint32_t sq_psn; /* PSN for send queue */ |
| 39 |
uint32_t dest_qp_num; /* Destination QP number (valid only for RC/UC QPs) */ |
| 40 |
unsigned int qp_access_flags; /* Mask of enabled remote access operations (valid only for RC/UC QPs) */ |
| 41 |
struct ibv_qp_cap cap; /* QP capabilities */ |
| 42 |
struct ibv_ah_attr ah_attr; /* Primary path address vector (valid only for RC/UC QPs) */ |
| 43 |
struct ibv_ah_attr alt_ah_attr; /* Alternate path address vector (valid only for RC/UC QPs) */ |
| 44 |
uint16_t pkey_index; /* Primary P_Key index */ |
| 45 |
uint16_t alt_pkey_index; /* Alternate P_Key index */ |
| 46 |
uint8_t en_sqd_async_notify; /* Enable SQD.drained async notification - irrelevant for ibv_query_qp */ |
| 47 |
uint8_t sq_draining; /* Is the QP draining? (Valid only if qp_state is SQD) */ |
| 48 |
uint8_t max_rd_atomic; /* Number of outstanding RDMA reads & atomic operations on the destination QP (valid only for RC QPs) */ |
| 49 |
uint8_t max_dest_rd_atomic; /* Number of responder resources for handling incoming RDMA reads & atomic operations (valid only for RC QPs) */ |
| 50 |
uint8_t min_rnr_timer; /* Minimum RNR NAK timer (valid only for RC QPs) */ |
| 51 |
uint8_t port_num; /* Primary port number */ |
| 52 |
uint8_t timeout; /* Local ack timeout for primary path (valid only for RC QPs) */ |
| 53 |
uint8_t retry_cnt; /* Retry count (valid only for RC QPs) */ |
| 54 |
uint8_t rnr_retry; /* RNR retry (valid only for RC QPs) */ |
| 55 |
uint8_t alt_port_num; /* Alternate port number */ |
| 56 |
uint8_t alt_timeout; /* Local ack timeout for alternate path (valid only for RC QPs) */ |
| 57 |
.in -8 |
| 58 |
}; |
| 59 |
.fi |
| 60 |
.PP |
| 61 |
For details on struct ibv_qp_cap see the description of |
| 62 |
.B ibv_create_qp()\fR. |
| 63 |
For details on struct ibv_ah_attr see the description of |
| 64 |
.B ibv_create_ah()\fR. |
| 65 |
.SH "RETURN VALUE" |
| 66 |
.B ibv_query_qp() |
| 67 |
returns 0 on success, or the value of errno on failure (which indicates the failure reason). |
| 68 |
.SH "NOTES" |
| 69 |
The argument |
| 70 |
.I attr_mask |
| 71 |
is a hint that specifies the minimum list of attributes to retrieve. |
| 72 |
Some RDMA devices may return extra attributes not requested, for |
| 73 |
example if the value can be returned cheaply. This has the same |
| 74 |
form as in |
| 75 |
.B ibv_modify_qp()\fR. |
| 76 |
.PP |
| 77 |
Attribute values are valid if they have been set using |
| 78 |
.B ibv_modify_qp()\fR. |
| 79 |
The exact list of valid attributes depends on the QP state. |
| 80 |
.PP |
| 81 |
Multiple calls to |
| 82 |
.B ibv_query_qp() |
| 83 |
may yield some differences in the values returned for the following attributes: qp_state, path_mig_state, sq_draining, ah_attr (if APM is enabled). |
| 84 |
.SH "SEE ALSO" |
| 85 |
.BR ibv_create_qp (3), |
| 86 |
.BR ibv_destroy_qp (3), |
| 87 |
.BR ibv_modify_qp (3), |
| 88 |
.BR ibv_create_ah (3) |
| 89 |
.SH "AUTHORS" |
| 90 |
.TP |
| 91 |
Dotan Barak <[email protected]> |