| 1 |
.\" -*- nroff -*- |
| 2 |
.\" Licensed under the OpenIB.org BSD license (FreeBSD Variant) - See COPYING.md |
| 3 |
.\" |
| 4 |
.TH IBV_MODIFY_QP 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" |
| 5 |
.SH "NAME" |
| 6 |
ibv_modify_qp \- modify the attributes of a queue pair (QP) |
| 7 |
.SH "SYNOPSIS" |
| 8 |
.nf |
| 9 |
.B #include <infiniband/verbs.h> |
| 10 |
.sp |
| 11 |
.BI "int ibv_modify_qp(struct ibv_qp " "*qp" ", struct ibv_qp_attr " "*attr" , |
| 12 |
.BI " int " "attr_mask" ); |
| 13 |
.fi |
| 14 |
.SH "DESCRIPTION" |
| 15 |
.B ibv_modify_qp() |
| 16 |
modifies the attributes of QP |
| 17 |
.I qp |
| 18 |
with the attributes in |
| 19 |
.I attr |
| 20 |
according to the mask |
| 21 |
.I attr_mask\fR. |
| 22 |
The argument \fIattr\fR is an ibv_qp_attr struct, as defined in <infiniband/verbs.h>. |
| 23 |
.PP |
| 24 |
.nf |
| 25 |
struct ibv_qp_attr { |
| 26 |
.in +8 |
| 27 |
enum ibv_qp_state qp_state; /* Move the QP to this state */ |
| 28 |
enum ibv_qp_state cur_qp_state; /* Assume this is the current QP state */ |
| 29 |
enum ibv_mtu path_mtu; /* Path MTU (valid only for RC/UC QPs) */ |
| 30 |
enum ibv_mig_state path_mig_state; /* Path migration state (valid if HCA supports APM) */ |
| 31 |
uint32_t qkey; /* Q_Key for the QP (valid only for UD QPs) */ |
| 32 |
uint32_t rq_psn; /* PSN for receive queue (valid only for RC/UC QPs) */ |
| 33 |
uint32_t sq_psn; /* PSN for send queue */ |
| 34 |
uint32_t dest_qp_num; /* Destination QP number (valid only for RC/UC QPs) */ |
| 35 |
unsigned int qp_access_flags; /* Mask of enabled remote access operations (valid only for RC/UC QPs) */ |
| 36 |
struct ibv_qp_cap cap; /* QP capabilities (valid if HCA supports QP resizing) */ |
| 37 |
struct ibv_ah_attr ah_attr; /* Primary path address vector (valid only for RC/UC QPs) */ |
| 38 |
struct ibv_ah_attr alt_ah_attr; /* Alternate path address vector (valid only for RC/UC QPs) */ |
| 39 |
uint16_t pkey_index; /* Primary P_Key index */ |
| 40 |
uint16_t alt_pkey_index; /* Alternate P_Key index */ |
| 41 |
uint8_t en_sqd_async_notify; /* Enable SQD.drained async notification (Valid only if qp_state is SQD) */ |
| 42 |
uint8_t sq_draining; /* Is the QP draining? Irrelevant for ibv_modify_qp() */ |
| 43 |
uint8_t max_rd_atomic; /* Number of outstanding RDMA reads & atomic operations on the destination QP (valid only for RC QPs) */ |
| 44 |
uint8_t max_dest_rd_atomic; /* Number of responder resources for handling incoming RDMA reads & atomic operations (valid only for RC QPs) */ |
| 45 |
uint8_t min_rnr_timer; /* Minimum RNR NAK timer (valid only for RC QPs) */ |
| 46 |
uint8_t port_num; /* Primary port number */ |
| 47 |
uint8_t timeout; /* Local ack timeout for primary path (valid only for RC QPs) */ |
| 48 |
uint8_t retry_cnt; /* Retry count (valid only for RC QPs) */ |
| 49 |
uint8_t rnr_retry; /* RNR retry (valid only for RC QPs) */ |
| 50 |
uint8_t alt_port_num; /* Alternate port number */ |
| 51 |
uint8_t alt_timeout; /* Local ack timeout for alternate path (valid only for RC QPs) */ |
| 52 |
uint32_t rate_limit; /* Rate limit in kbps for packet pacing */ |
| 53 |
.in -8 |
| 54 |
}; |
| 55 |
.fi |
| 56 |
.PP |
| 57 |
For details on struct ibv_qp_cap see the description of |
| 58 |
.B ibv_create_qp()\fR. |
| 59 |
For details on struct ibv_ah_attr see the description of |
| 60 |
.B ibv_create_ah()\fR. |
| 61 |
.PP |
| 62 |
The argument |
| 63 |
.I attr_mask |
| 64 |
specifies the QP attributes to be modified. |
| 65 |
The argument is either 0 or the bitwise OR of one or more of the following flags: |
| 66 |
.PP |
| 67 |
.TP |
| 68 |
.B IBV_QP_STATE \fR Modify qp_state |
| 69 |
.TP |
| 70 |
.B IBV_QP_CUR_STATE \fR Set cur_qp_state |
| 71 |
.TP |
| 72 |
.B IBV_QP_EN_SQD_ASYNC_NOTIFY \fR Set en_sqd_async_notify |
| 73 |
.TP |
| 74 |
.B IBV_QP_ACCESS_FLAGS \fR Set qp_access_flags |
| 75 |
.TP |
| 76 |
.B IBV_QP_PKEY_INDEX \fR Set pkey_index |
| 77 |
.TP |
| 78 |
.B IBV_QP_PORT \fR Set port_num |
| 79 |
.TP |
| 80 |
.B IBV_QP_QKEY \fR Set qkey |
| 81 |
.TP |
| 82 |
.B IBV_QP_AV \fR Set ah_attr |
| 83 |
.TP |
| 84 |
.B IBV_QP_PATH_MTU \fR Set path_mtu |
| 85 |
.TP |
| 86 |
.B IBV_QP_TIMEOUT \fR Set timeout |
| 87 |
.TP |
| 88 |
.B IBV_QP_RETRY_CNT \fR Set retry_cnt |
| 89 |
.TP |
| 90 |
.B IBV_QP_RNR_RETRY \fR Set rnr_retry |
| 91 |
.TP |
| 92 |
.B IBV_QP_RQ_PSN \fR Set rq_psn |
| 93 |
.TP |
| 94 |
.B IBV_QP_MAX_QP_RD_ATOMIC \fR Set max_rd_atomic |
| 95 |
.TP |
| 96 |
.B IBV_QP_ALT_PATH \fR Set the alternative path via: alt_ah_attr, alt_pkey_index, alt_port_num, alt_timeout |
| 97 |
.TP |
| 98 |
.B IBV_QP_MIN_RNR_TIMER \fR Set min_rnr_timer |
| 99 |
.TP |
| 100 |
.B IBV_QP_SQ_PSN \fR Set sq_psn |
| 101 |
.TP |
| 102 |
.B IBV_QP_MAX_DEST_RD_ATOMIC \fR Set max_dest_rd_atomic |
| 103 |
.TP |
| 104 |
.B IBV_QP_PATH_MIG_STATE \fR Set path_mig_state |
| 105 |
.TP |
| 106 |
.B IBV_QP_CAP \fR Set cap |
| 107 |
.TP |
| 108 |
.B IBV_QP_DEST_QPN \fR Set dest_qp_num |
| 109 |
.TP |
| 110 |
.B IBV_QP_RATE_LIMIT \fR Set rate_limit |
| 111 |
.SH "RETURN VALUE" |
| 112 |
.B ibv_modify_qp() |
| 113 |
returns 0 on success, or the value of errno on failure (which indicates the failure reason). |
| 114 |
.SH "NOTES" |
| 115 |
If any of the modify attributes or the modify mask are invalid, none |
| 116 |
of the attributes will be modified (including the QP state). |
| 117 |
.PP |
| 118 |
Not all devices support resizing QPs. To check if a device supports it, check if the |
| 119 |
.B IBV_DEVICE_RESIZE_MAX_WR |
| 120 |
bit is set in the device capabilities flags. |
| 121 |
.PP |
| 122 |
Not all devices support alternate paths. To check if a device supports it, check if the |
| 123 |
.B IBV_DEVICE_AUTO_PATH_MIG |
| 124 |
bit is set in the device capabilities flags. |
| 125 |
.PP |
| 126 |
The following tables indicate for each QP Transport Service Type, the |
| 127 |
minimum list of attributes that must be changed upon transitioning QP |
| 128 |
state from: Reset \-\-> Init \-\-> RTR \-\-> RTS. |
| 129 |
.PP |
| 130 |
.nf |
| 131 |
For QP Transport Service Type \fB IBV_QPT_UD\fR: |
| 132 |
.sp |
| 133 |
Next state Required attributes |
| 134 |
\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- |
| 135 |
Init \fB IBV_QP_STATE, IBV_QP_PKEY_INDEX, IBV_QP_PORT, \fR |
| 136 |
\fB IBV_QP_QKEY \fR |
| 137 |
RTR \fB IBV_QP_STATE \fR |
| 138 |
RTS \fB IBV_QP_STATE, IBV_QP_SQ_PSN \fR |
| 139 |
.fi |
| 140 |
.PP |
| 141 |
.nf |
| 142 |
For QP Transport Service Type \fB IBV_QPT_UC\fR: |
| 143 |
.sp |
| 144 |
Next state Required attributes |
| 145 |
\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- |
| 146 |
Init \fB IBV_QP_STATE, IBV_QP_PKEY_INDEX, IBV_QP_PORT, \fR |
| 147 |
\fB IBV_QP_ACCESS_FLAGS \fR |
| 148 |
RTR \fB IBV_QP_STATE, IBV_QP_AV, IBV_QP_PATH_MTU, \fR |
| 149 |
\fB IBV_QP_DEST_QPN, IBV_QP_RQ_PSN \fR |
| 150 |
RTS \fB IBV_QP_STATE, IBV_QP_SQ_PSN \fR |
| 151 |
.fi |
| 152 |
.PP |
| 153 |
.nf |
| 154 |
For QP Transport Service Type \fB IBV_QPT_RC\fR: |
| 155 |
.sp |
| 156 |
Next state Required attributes |
| 157 |
\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- |
| 158 |
Init \fB IBV_QP_STATE, IBV_QP_PKEY_INDEX, IBV_QP_PORT, \fR |
| 159 |
\fB IBV_QP_ACCESS_FLAGS \fR |
| 160 |
RTR \fB IBV_QP_STATE, IBV_QP_AV, IBV_QP_PATH_MTU, \fR |
| 161 |
\fB IBV_QP_DEST_QPN, IBV_QP_RQ_PSN, \fR |
| 162 |
\fB IBV_QP_MAX_DEST_RD_ATOMIC, IBV_QP_MIN_RNR_TIMER \fR |
| 163 |
RTS \fB IBV_QP_STATE, IBV_QP_SQ_PSN, IBV_QP_MAX_QP_RD_ATOMIC, \fR |
| 164 |
\fB IBV_QP_RETRY_CNT, IBV_QP_RNR_RETRY, IBV_QP_TIMEOUT \fR |
| 165 |
.fi |
| 166 |
.PP |
| 167 |
.nf |
| 168 |
For QP Transport Service Type \fB IBV_QPT_RAW_PACKET\fR: |
| 169 |
.sp |
| 170 |
Next state Required attributes |
| 171 |
\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- |
| 172 |
Init \fB IBV_QP_STATE, IBV_QP_PORT\fR |
| 173 |
RTR \fB IBV_QP_STATE\fR |
| 174 |
RTS \fB IBV_QP_STATE\fR |
| 175 |
.fi |
| 176 |
.PP |
| 177 |
If port flag IBV_QPF_GRH_REQUIRED is set then |
| 178 |
ah_attr and alt_ah_attr |
| 179 |
must be passed with definition of 'struct ibv_ah_attr { .is_global = 1; .grh = {...}; }'. |
| 180 |
.PP |
| 181 |
.SH "SEE ALSO" |
| 182 |
.BR ibv_create_qp (3), |
| 183 |
.BR ibv_destroy_qp (3), |
| 184 |
.BR ibv_query_qp (3), |
| 185 |
.BR ibv_create_ah (3) |
| 186 |
.SH "AUTHORS" |
| 187 |
.TP |
| 188 |
Dotan Barak <[email protected]> |