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