Skip to content

Commit da2132e

Browse files
damodhar-airleon
authored andcommitted
RDMA/bnxt_re: Fix setting mandatory attributes for modify_qp
Firmware expects "min_rnr_timer" as a mandatory attribute in MODIFY_QP command during the RTR-RTS transition. This needs to be enforced by the driver which is missing while setting bnxt_set_mandatory_attributes that sends these flags as part of modify_qp optimization. Fixes: 82c32d2 ("RDMA/bnxt_re: Add support for optimized modify QP") Reviewed-by: Rukhsana Ansari <[email protected]> Reviewed-by: Kalesh AP <[email protected]> Signed-off-by: Damodharam Ammepalli <[email protected]> Signed-off-by: Selvin Xavier <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
1 parent 798653a commit da2132e

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

drivers/infiniband/hw/bnxt_re/qplib_fp.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,8 @@ static void __filter_modify_flags(struct bnxt_qplib_qp *qp)
12851285
}
12861286
}
12871287

1288-
static void bnxt_set_mandatory_attributes(struct bnxt_qplib_qp *qp,
1288+
static void bnxt_set_mandatory_attributes(struct bnxt_qplib_res *res,
1289+
struct bnxt_qplib_qp *qp,
12891290
struct cmdq_modify_qp *req)
12901291
{
12911292
u32 mandatory_flags = 0;
@@ -1300,6 +1301,14 @@ static void bnxt_set_mandatory_attributes(struct bnxt_qplib_qp *qp,
13001301
mandatory_flags |= CMDQ_MODIFY_QP_MODIFY_MASK_PKEY;
13011302
}
13021303

1304+
if (_is_min_rnr_in_rtr_rts_mandatory(res->dattr->dev_cap_flags2) &&
1305+
(qp->cur_qp_state == CMDQ_MODIFY_QP_NEW_STATE_RTR &&
1306+
qp->state == CMDQ_MODIFY_QP_NEW_STATE_RTS)) {
1307+
if (qp->type == CMDQ_MODIFY_QP_QP_TYPE_RC)
1308+
mandatory_flags |=
1309+
CMDQ_MODIFY_QP_MODIFY_MASK_MIN_RNR_TIMER;
1310+
}
1311+
13031312
if (qp->type == CMDQ_MODIFY_QP_QP_TYPE_UD ||
13041313
qp->type == CMDQ_MODIFY_QP_QP_TYPE_GSI)
13051314
mandatory_flags |= CMDQ_MODIFY_QP_MODIFY_MASK_QKEY;
@@ -1340,7 +1349,7 @@ int bnxt_qplib_modify_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp)
13401349
/* Set mandatory attributes for INIT -> RTR and RTR -> RTS transition */
13411350
if (_is_optimize_modify_qp_supported(res->dattr->dev_cap_flags2) &&
13421351
is_optimized_state_transition(qp))
1343-
bnxt_set_mandatory_attributes(qp, &req);
1352+
bnxt_set_mandatory_attributes(res, qp, &req);
13441353
}
13451354
bmask = qp->modify_flags;
13461355
req.modify_mask = cpu_to_le32(qp->modify_flags);

drivers/infiniband/hw/bnxt_re/qplib_res.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,11 @@ static inline bool _is_optimize_modify_qp_supported(u16 dev_cap_ext_flags2)
584584
return dev_cap_ext_flags2 & CREQ_QUERY_FUNC_RESP_SB_OPTIMIZE_MODIFY_QP_SUPPORTED;
585585
}
586586

587+
static inline bool _is_min_rnr_in_rtr_rts_mandatory(u16 dev_cap_ext_flags2)
588+
{
589+
return !!(dev_cap_ext_flags2 & CREQ_QUERY_FUNC_RESP_SB_MIN_RNR_RTR_RTS_OPT_SUPPORTED);
590+
}
591+
587592
static inline bool _is_cq_coalescing_supported(u16 dev_cap_ext_flags2)
588593
{
589594
return dev_cap_ext_flags2 & CREQ_QUERY_FUNC_RESP_SB_CQ_COALESCING_SUPPORTED;

drivers/infiniband/hw/bnxt_re/roce_hsi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2215,6 +2215,7 @@ struct creq_query_func_resp_sb {
22152215
#define CREQ_QUERY_FUNC_RESP_SB_REQ_RETRANSMISSION_SUPPORT_IQM_MSN_TABLE (0x2UL << 4)
22162216
#define CREQ_QUERY_FUNC_RESP_SB_REQ_RETRANSMISSION_SUPPORT_LAST \
22172217
CREQ_QUERY_FUNC_RESP_SB_REQ_RETRANSMISSION_SUPPORT_IQM_MSN_TABLE
2218+
#define CREQ_QUERY_FUNC_RESP_SB_MIN_RNR_RTR_RTS_OPT_SUPPORTED 0x1000UL
22182219
__le16 max_xp_qp_size;
22192220
__le16 create_qp_batch_size;
22202221
__le16 destroy_qp_batch_size;

0 commit comments

Comments
 (0)