1IBV_MODIFY_QP(3)        Libibverbs Programmer's Manual        IBV_MODIFY_QP(3)
2
3
4

NAME

6       ibv_modify_qp - modify the attributes of a queue pair (QP)
7

SYNOPSIS

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

DESCRIPTION

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 (valid only for RC/UC QPs) */
27               uint32_t                dest_qp_num;            /* Destination QP number (valid only for RC/UC QPs) */
28               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              IBV_QP_RATE_LIMIT  Set rate_limit
99

RETURN VALUE

101       ibv_modify_qp() returns 0 on success, or the value of errno on  failure
102       (which indicates the failure reason).
103

NOTES

105       If any of the modify attributes or the modify mask are invalid, none of
106       the attributes will be modified (including the QP state).
107
108       Not all devices support resizing QPs.  To check if  a  device  supports
109       it,  check  if  the  IBV_DEVICE_RESIZE_MAX_WR  bit is set in the device
110       capabilities flags.
111
112       Not all devices support alternate paths.  To check if a device supports
113       it,  check  if  the  IBV_DEVICE_AUTO_PATH_MIG  bit is set in the device
114       capabilities flags.
115
116       The following tables indicate for each QP Transport Service  Type,  the
117       minimum  list  of attributes that must be changed upon transitioning QP
118       state from: Reset --> Init --> RTR --> RTS.
119
120       For QP Transport Service Type  IBV_QPT_UD:
121
122       Next state     Required attributes
123       ----------     ----------------------------------------
124       Init           IBV_QP_STATE, IBV_QP_PKEY_INDEX, IBV_QP_PORT,
125                      IBV_QP_QKEY
126       RTR            IBV_QP_STATE
127       RTS            IBV_QP_STATE, IBV_QP_SQ_PSN
128
129       For QP Transport Service Type  IBV_QPT_UC:
130
131       Next state     Required attributes
132       ----------     ----------------------------------------
133       Init           IBV_QP_STATE, IBV_QP_PKEY_INDEX, IBV_QP_PORT,
134                      IBV_QP_ACCESS_FLAGS
135       RTR            IBV_QP_STATE, IBV_QP_AV, IBV_QP_PATH_MTU,
136                      IBV_QP_DEST_QPN, IBV_QP_RQ_PSN
137       RTS            IBV_QP_STATE, IBV_QP_SQ_PSN
138
139       For QP Transport Service Type  IBV_QPT_RC:
140
141       Next state     Required attributes
142       ----------     ----------------------------------------
143       Init           IBV_QP_STATE, IBV_QP_PKEY_INDEX, IBV_QP_PORT,
144                      IBV_QP_ACCESS_FLAGS
145       RTR            IBV_QP_STATE, IBV_QP_AV, IBV_QP_PATH_MTU,
146                      IBV_QP_DEST_QPN, IBV_QP_RQ_PSN,
147                      IBV_QP_MAX_DEST_RD_ATOMIC, IBV_QP_MIN_RNR_TIMER
148       RTS            IBV_QP_STATE, IBV_QP_SQ_PSN, IBV_QP_MAX_QP_RD_ATOMIC,
149                      IBV_QP_RETRY_CNT, IBV_QP_RNR_RETRY, IBV_QP_TIMEOUT
150
151       For QP Transport Service Type  IBV_QPT_RAW_PACKET:
152
153       Next state     Required attributes
154       ----------     ----------------------------------------
155       Init           IBV_QP_STATE, IBV_QP_PORT
156       RTR            IBV_QP_STATE
157       RTS            IBV_QP_STATE
158
159       If port flag IBV_QPF_GRH_REQUIRED is set then ah_attr  and  alt_ah_attr
160       must be passed with definition of 'struct ibv_ah_attr { .is_global = 1;
161       .grh = {...}; }'.
162

SEE ALSO

164       ibv_create_qp(3), ibv_destroy_qp(3), ibv_query_qp(3), ibv_create_ah(3)
165

AUTHORS

167       Dotan Barak <dotanba@gmail.com>
168
169
170
171libibverbs                        2006-10-31                  IBV_MODIFY_QP(3)
Impressum