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       };
46
47       For  details  on  struct  ibv_qp_cap  see  the  description of ibv_cre‐
48       ate_qp().  For details on struct ibv_ah_attr  see  the  description  of
49       ibv_create_ah().
50
51       The argument attr_mask specifies the QP attributes to be modified.  The
52       argument is either 0 or the bitwise OR of one or more of the  following
53       flags:
54
55       IBV_QP_STATE  Modify qp_state
56
57       IBV_QP_CUR_STATE  Set cur_qp_state
58
59       IBV_QP_EN_SQD_ASYNC_NOTIFY  Set en_sqd_async_notify
60
61       IBV_QP_ACCESS_FLAGS  Set qp_access_flags
62
63       IBV_QP_PKEY_INDEX  Set pkey_index
64
65       IBV_QP_PORT  Set port_num
66
67       IBV_QP_QKEY  Set qkey
68
69       IBV_QP_AV  Set ah_attr
70
71       IBV_QP_PATH_MTU  Set path_mtu
72
73       IBV_QP_TIMEOUT  Set timeout
74
75       IBV_QP_RETRY_CNT  Set retry_cnt
76
77       IBV_QP_RNR_RETRY  Set rnr_retry
78
79       IBV_QP_RQ_PSN  Set rq_psn
80
81       IBV_QP_MAX_QP_RD_ATOMIC  Set max_rd_atomic
82
83       IBV_QP_ALT_PATH    Set   the   alternative   path   via:   alt_ah_attr,
84       alt_pkey_index, alt_port_num, alt_timeout
85
86       IBV_QP_MIN_RNR_TIMER  Set min_rnr_timer
87
88       IBV_QP_SQ_PSN  Set sq_psn
89
90       IBV_QP_MAX_DEST_RD_ATOMIC  Set max_dest_rd_atomic
91
92       IBV_QP_PATH_MIG_STATE  Set path_mig_state
93
94       IBV_QP_CAP  Set cap
95
96       IBV_QP_DEST_QPN  Set dest_qp_num
97

RETURN VALUE

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

NOTES

103       If any of the modify attributes or the modify mask are invalid, none of
104       the attributes will be modified (including the QP state).
105
106       Not all devices support resizing QPs.  To check if  a  device  supports
107       it,  check  if  the  IBV_DEVICE_RESIZE_MAX_WR  bit is set in the device
108       capabilities flags.
109
110       Not all devices support alternate paths.  To check if a device supports
111       it,  check  if  the  IBV_DEVICE_AUTO_PATH_MIG  bit is set in the device
112       capabilities flags.
113
114       The following tables indicate for each QP Transport Service  Type,  the
115       minimum  list  of attributes that must be changed upon transitioning QP
116       state from: Reset --> Init --> RTR --> RTS.
117
118       For QP Transport Service Type  IBV_QPT_UD:
119
120       Next state     Required attributes
121       ----------     ----------------------------------------
122       Init           IBV_QP_STATE, IBV_QP_PKEY_INDEX, IBV_QP_PORT,
123                      IBV_QP_QKEY
124       RTR            IBV_QP_STATE
125       RTS            IBV_QP_STATE, IBV_QP_SQ_PSN
126
127       For QP Transport Service Type  IBV_QPT_UC:
128
129       Next state     Required attributes
130       ----------     ----------------------------------------
131       Init           IBV_QP_STATE, IBV_QP_PKEY_INDEX, IBV_QP_PORT,
132                      IBV_QP_ACCESS_FLAGS
133       RTR            IBV_QP_STATE, IBV_QP_AV, IBV_QP_PATH_MTU,
134                      IBV_QP_DEST_QPN, IBV_QP_RQ_PSN
135       RTS            IBV_QP_STATE, IBV_QP_SQ_PSN
136
137       For QP Transport Service Type  IBV_QPT_RC:
138
139       Next state     Required attributes
140       ----------     ----------------------------------------
141       Init           IBV_QP_STATE, IBV_QP_PKEY_INDEX, IBV_QP_PORT,
142                      IBV_QP_ACCESS_FLAGS
143       RTR            IBV_QP_STATE, IBV_QP_AV, IBV_QP_PATH_MTU,
144                      IBV_QP_DEST_QPN, IBV_QP_RQ_PSN,
145                      IBV_QP_MAX_DEST_RD_ATOMIC, IBV_QP_MIN_RNR_TIMER
146       RTS            IBV_QP_STATE, IBV_QP_SQ_PSN, IBV_QP_MAX_QP_RD_ATOMIC,
147                      IBV_QP_RETRY_CNT, IBV_QP_RNR_RETRY, IBV_QP_TIMEOUT
148

SEE ALSO

150       ibv_create_qp(3), ibv_destroy_qp(3), ibv_query_qp(3), ibv_create_ah(3)
151

AUTHORS

153       Dotan Barak <dotanba@gmail.com>
154
155
156
157libibverbs                        2006-10-31                  IBV_MODIFY_QP(3)
Impressum