Skip to contentSkip to conversation

RDMA/bnxt_re: Driver update for 6.13

PATCH Applied Selvin Xavier 2 participants 5 messages Nov 15, 2024 – Nov 17, 2024

Subsystems (2)
lore
Share & tools
lore

Selvin Xavier

author maintainer
#0 lore raw

cover RDMA/bnxt_re: Driver update for 6.13

Couple of minor updates and a bug fix for bnxt_re driver. Please review and apply.

Thanks,
Selvin Xavier

Chandramohan Akula (1):
RDMA/bnxt_re: Support different traffic class

Kalesh AP (2):
RDMA/bnxt_re: Use the default mode of congestion control RDMA/bnxt_re: Correct the sequence of device suspend

 drivers/infiniband/hw/bnxt_re/ib_verbs.c |  2 +-
 drivers/infiniband/hw/bnxt_re/main.c     | 33 +++++++-------------------------
 drivers/infiniband/hw/bnxt_re/qplib_fp.c | 12 +++++++++++-
 3 files changed, 19 insertions(+), 28 deletions(-)
Signature · 1 line
2.5.5
author maintainer
#1 lore raw

PATCH 1/3 RDMA/bnxt_re: Support different traffic class

From: Chandramohan Akula <[email protected]>

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.

---
 drivers/infiniband/hw/bnxt_re/ib_verbs.c |  2 +-
 drivers/infiniband/hw/bnxt_re/qplib_fp.c | 12 +++++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)
drivers/infiniband/hw/bnxt_re/ib_verbs.c +1 -1
index f6e9eef..481261f 100644
@@ -2136,7 +2136,7 @@ int bnxt_re_modify_qp(struct ib_qp *ib_qp, struct ib_qp_attr *qp_attr,
 		qp->qplib_qp.ah.sgid_index = ctx->idx;
 		qp->qplib_qp.ah.host_sgid_index = grh->sgid_index;
 		qp->qplib_qp.ah.hop_limit = grh->hop_limit;
-		qp->qplib_qp.ah.traffic_class = grh->traffic_class;
+		qp->qplib_qp.ah.traffic_class = grh->traffic_class >> 2;
 		qp->qplib_qp.ah.sl = rdma_ah_get_sl(&qp_attr->ah_attr);
 		ether_addr_copy(qp->qplib_qp.ah.dmac,
 				qp_attr->ah_attr.roce.dmac);
drivers/infiniband/hw/bnxt_re/qplib_fp.c +11 -1
index e56f42f..256c437 100644
@@ -1318,6 +1318,7 @@ int bnxt_qplib_modify_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp)
 	struct creq_modify_qp_resp resp = {};
 	struct bnxt_qplib_cmdqmsg msg = {};
 	struct cmdq_modify_qp req = {};
+	u16 vlan_pcp_vlan_dei_vlan_id;
 	u32 temp32[4];
 	u32 bmask;
 	int rc;
@@ -1414,7 +1415,16 @@ int bnxt_qplib_modify_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp)
 	if (bmask & CMDQ_MODIFY_QP_MODIFY_MASK_DEST_QP_ID)
 		req.dest_qp_id = cpu_to_le32(qp->dest_qpn);
 
-	req.vlan_pcp_vlan_dei_vlan_id = cpu_to_le16(qp->vlan_id);
+	if (bmask & CMDQ_MODIFY_QP_MODIFY_MASK_VLAN_ID) {
+		vlan_pcp_vlan_dei_vlan_id =
+			((res->sgid_tbl.tbl[qp->ah.sgid_index].vlan_id <<
+			  CMDQ_MODIFY_QP_VLAN_ID_SFT) &
+			 CMDQ_MODIFY_QP_VLAN_ID_MASK);
+		vlan_pcp_vlan_dei_vlan_id |=
+			((qp->ah.sl << CMDQ_MODIFY_QP_VLAN_PCP_SFT) &
+			 CMDQ_MODIFY_QP_VLAN_PCP_MASK);
+		req.vlan_pcp_vlan_dei_vlan_id = cpu_to_le16(vlan_pcp_vlan_dei_vlan_id);
+	}
 
 	bnxt_qplib_fill_cmdqmsg(&msg, &req, &resp, NULL, sizeof(req),  sizeof(resp), 0);
 	rc = bnxt_qplib_rcfw_send_message(rcfw, &msg);
Signature · 1 line
2.5.5
author maintainer
#2 lore raw

PATCH 2/3 RDMA/bnxt_re: Use the default mode of congestion control

In reply to Selvin Xavier

From: Kalesh AP <[email protected]>

Instead of driver setting the congestion mode, use the default values setup by Firmware. Enable the tos_ecn field in FW.

---
 drivers/infiniband/hw/bnxt_re/main.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/infiniband/hw/bnxt_re/main.c +2 -3
index 533b9f1..ac475a5 100644
@@ -2204,11 +2204,10 @@ static void bnxt_re_setup_cc(struct bnxt_re_dev *rdev, bool enable)
 
 	if (enable) {
 		cc_param.enable  = 1;
-		cc_param.cc_mode = CMDQ_MODIFY_ROCE_CC_CC_MODE_PROBABILISTIC_CC_MODE;
+		cc_param.tos_ecn = 1;
 	}
 
-	cc_param.mask = (CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_CC_MODE |
-			 CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_ENABLE_CC |
+	cc_param.mask = (CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_ENABLE_CC |
 			 CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TOS_ECN);
 
 	if (bnxt_qplib_modify_cc(&rdev->qplib_res, &cc_param))
Signature · 1 line
2.5.5
author maintainer
#3 lore raw

PATCH 3/3 RDMA/bnxt_re: Correct the sequence of device suspend

In reply to Selvin Xavier

From: Kalesh AP <[email protected]>

When in fatal error condition, mark device as detached first and then complete all pending HWRM commands as firmware is not going to process them and eventually time out. Move the device to error only if suspend is called when device is in Fatal state.

Also, remove some outdated comments. Remove the stop_irq call which is no longer required.

Fixes cc5b9b48d447 ("RDMA/bnxt_re: Recover the device when FW error is detected")
---
 drivers/infiniband/hw/bnxt_re/main.c | 28 +++++-----------------------
 1 file changed, 5 insertions(+), 23 deletions(-)
drivers/infiniband/hw/bnxt_re/main.c +5 -23
index ac475a5..298c848 100644
@@ -2347,12 +2347,6 @@ static int bnxt_re_suspend(struct auxiliary_device *adev, pm_message_t state)
 	rdev = en_info->rdev;
 	en_dev = en_info->en_dev;
 	mutex_lock(&bnxt_re_mutex);
-	/* L2 driver may invoke this callback during device error/crash or device
-	 * reset. Current RoCE driver doesn't recover the device in case of
-	 * error. Handle the error by dispatching fatal events to all qps
-	 * ie. by calling bnxt_re_dev_stop and release the MSIx vectors as
-	 * L2 driver want to modify the MSIx table.
-	 */
 
 	ibdev_info(&rdev->ibdev, "Handle device suspend call");
 	/* Check the current device state from bnxt_en_dev and move the
@@ -2360,17 +2354,12 @@ static int bnxt_re_suspend(struct auxiliary_device *adev, pm_message_t state)
 	 * This prevents more commands to HW during clean-up,
 	 * in case the device is already in error.
 	 */
-	if (test_bit(BNXT_STATE_FW_FATAL_COND, &rdev->en_dev->en_state))
+	if (test_bit(BNXT_STATE_FW_FATAL_COND, &rdev->en_dev->en_state)) {
 		set_bit(ERR_DEVICE_DETACHED, &rdev->rcfw.cmdq.flags);
-
-	bnxt_re_dev_stop(rdev);
-	bnxt_re_stop_irq(adev);
-	/* Move the device states to detached and  avoid sending any more
-	 * commands to HW
-	 */
-	set_bit(BNXT_RE_FLAG_ERR_DEVICE_DETACHED, &rdev->flags);
-	set_bit(ERR_DEVICE_DETACHED, &rdev->rcfw.cmdq.flags);
-	wake_up_all(&rdev->rcfw.cmdq.waitq);
+		set_bit(BNXT_RE_FLAG_ERR_DEVICE_DETACHED, &rdev->flags);
+		wake_up_all(&rdev->rcfw.cmdq.waitq);
+		bnxt_re_dev_stop(rdev);
+	}
 
 	if (rdev->pacing.dbr_pacing)
 		bnxt_re_set_pacing_dev_state(rdev);
@@ -2392,13 +2381,6 @@ static int bnxt_re_resume(struct auxiliary_device *adev)
 		return 0;
 
 	mutex_lock(&bnxt_re_mutex);
-	/* L2 driver may invoke this callback during device recovery, resume.
-	 * reset. Current RoCE driver doesn't recover the device in case of
-	 * error. Handle the error by dispatching fatal events to all qps
-	 * ie. by calling bnxt_re_dev_stop and release the MSIx vectors as
-	 * L2 driver want to modify the MSIx table.
-	 */
-
 	bnxt_re_add_device(adev, BNXT_RE_POST_RECOVERY_INIT);
 	rdev = en_info->rdev;
 	ibdev_info(&rdev->ibdev, "Device resume completed");
Signature · 1 line
2.5.5
#4 lore raw
In reply to Selvin Xavier
Quoted 10 lines · Selvin Xavier

Couple of minor updates and a bug fix for bnxt_re driver. Please review and apply.

Thanks,
Selvin Xavier

Chandramohan Akula (1):
RDMA/bnxt_re: Support different traffic class

[...]

Applied, thanks!

[1/3] RDMA/bnxt_re: Support different traffic class

      https://git.kernel.org/rdma/rdma/c/c64b16a37b6d24
[2/3] RDMA/bnxt_re: Use the default mode of congestion control
      https://git.kernel.org/rdma/rdma/c/bfb27ae6d0f9a1
[3/3] RDMA/bnxt_re: Correct the sequence of device suspend
      https://git.kernel.org/rdma/rdma/c/68b3bca2df00f0

Best regards,

Signature · 1 line
Leon Romanovsky <[email protected]>