Skip to content

Commit c64b16a

Browse files
chandramohan-akularleon
authored andcommitted
RDMA/bnxt_re: Support different traffic class
Adding support for different traffic class passed to driver. Fix the traffic class setting in modify_qp by skipping the ECN bits. Pass the service level received from applications to the firmware. Signed-off-by: Chandramohan Akula <[email protected]> Reviewed-by: Kalesh AP <[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 fc0856c commit c64b16a

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

drivers/infiniband/hw/bnxt_re/ib_verbs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2136,7 +2136,7 @@ int bnxt_re_modify_qp(struct ib_qp *ib_qp, struct ib_qp_attr *qp_attr,
21362136
qp->qplib_qp.ah.sgid_index = ctx->idx;
21372137
qp->qplib_qp.ah.host_sgid_index = grh->sgid_index;
21382138
qp->qplib_qp.ah.hop_limit = grh->hop_limit;
2139-
qp->qplib_qp.ah.traffic_class = grh->traffic_class;
2139+
qp->qplib_qp.ah.traffic_class = grh->traffic_class >> 2;
21402140
qp->qplib_qp.ah.sl = rdma_ah_get_sl(&qp_attr->ah_attr);
21412141
ether_addr_copy(qp->qplib_qp.ah.dmac,
21422142
qp_attr->ah_attr.roce.dmac);

drivers/infiniband/hw/bnxt_re/qplib_fp.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1318,6 +1318,7 @@ int bnxt_qplib_modify_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp)
13181318
struct creq_modify_qp_resp resp = {};
13191319
struct bnxt_qplib_cmdqmsg msg = {};
13201320
struct cmdq_modify_qp req = {};
1321+
u16 vlan_pcp_vlan_dei_vlan_id;
13211322
u32 temp32[4];
13221323
u32 bmask;
13231324
int rc;
@@ -1414,7 +1415,16 @@ int bnxt_qplib_modify_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp)
14141415
if (bmask & CMDQ_MODIFY_QP_MODIFY_MASK_DEST_QP_ID)
14151416
req.dest_qp_id = cpu_to_le32(qp->dest_qpn);
14161417

1417-
req.vlan_pcp_vlan_dei_vlan_id = cpu_to_le16(qp->vlan_id);
1418+
if (bmask & CMDQ_MODIFY_QP_MODIFY_MASK_VLAN_ID) {
1419+
vlan_pcp_vlan_dei_vlan_id =
1420+
((res->sgid_tbl.tbl[qp->ah.sgid_index].vlan_id <<
1421+
CMDQ_MODIFY_QP_VLAN_ID_SFT) &
1422+
CMDQ_MODIFY_QP_VLAN_ID_MASK);
1423+
vlan_pcp_vlan_dei_vlan_id |=
1424+
((qp->ah.sl << CMDQ_MODIFY_QP_VLAN_PCP_SFT) &
1425+
CMDQ_MODIFY_QP_VLAN_PCP_MASK);
1426+
req.vlan_pcp_vlan_dei_vlan_id = cpu_to_le16(vlan_pcp_vlan_dei_vlan_id);
1427+
}
14181428

14191429
bnxt_qplib_fill_cmdqmsg(&msg, &req, &resp, NULL, sizeof(req), sizeof(resp), 0);
14201430
rc = bnxt_qplib_rcfw_send_message(rcfw, &msg);

0 commit comments

Comments
 (0)