Skip to contentSkip to conversation

RDMA/bnxt_re: Driver update for updating congestion configs

PATCH In review Selvin Xavier 2 participants 9 messages Sep 3, 2024 – Sep 6, 2024

Subsystems (4)
lore
Share & tools
lore

Selvin Xavier

author maintainer
#0 lore raw

cover RDMA/bnxt_re: Driver update for updating congestion configs

Adds support for receiving the Async event from FW by registering a hook with L2 driver. Register for DCB change event. Updates the QP1 context with the modified DSCP values.

Also, update the missing configuration while enabling Congestion control settings.

Please review and apply.

Thanks,
Selvin Xavier

Kalesh AP (3):
RDMA/bnxt_re: Add FW async event support in driver RDMA/bnxt_re: Query firmware defaults of CC params during probe RDMA/bnxt_re: Add support to handle DCB_CONFIG_CHANGE event

Selvin Xavier (1):
RDMA/bnxt_re: Enable ECN marking by default

 drivers/infiniband/hw/bnxt_re/bnxt_re.h       |   3 +
 drivers/infiniband/hw/bnxt_re/main.c          | 158 ++++++++++++++++++++++++++
 drivers/infiniband/hw/bnxt_re/qplib_fp.h      |   2 +
 drivers/infiniband/hw/bnxt_re/qplib_sp.c      | 113 ++++++++++++++++++
 drivers/infiniband/hw/bnxt_re/qplib_sp.h      |   3 +
 drivers/net/ethernet/broadcom/bnxt/bnxt.c     |   1 +
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c |  31 +++++
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h |   1 +
 8 files changed, 312 insertions(+)
Signature · 1 line
2.5.5
author maintainer
#1 lore raw

PATCH 1/4 RDMA/bnxt_re: Add FW async event support in driver

From: Kalesh AP <[email protected]>

Using the option provided by L2 driver, register for FW Async event. Provide the ulp hook 'ulp_async_notifier' for receiving the events for L2 driver.

Async events will be handled in follow on patches.

---
 drivers/infiniband/hw/bnxt_re/bnxt_re.h       |  1 +
 drivers/infiniband/hw/bnxt_re/main.c          | 47 +++++++++++++++++++++++++++
 drivers/net/ethernet/broadcom/bnxt/bnxt.c     |  1 +
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 31 ++++++++++++++++++
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h |  1 +
 5 files changed, 81 insertions(+)
drivers/infiniband/hw/bnxt_re/bnxt_re.h +1 -0
index 2be9a62..b2ed557 100644
@@ -198,6 +198,7 @@ struct bnxt_re_dev {
 	struct delayed_work dbq_pacing_work;
 	DECLARE_HASHTABLE(cq_hash, MAX_CQ_HASH_BITS);
 	DECLARE_HASHTABLE(srq_hash, MAX_SRQ_HASH_BITS);
+	unsigned long			event_bitmap;
 };
 
 #define to_bnxt_re_dev(ptr, member)	\
drivers/infiniband/hw/bnxt_re/main.c +47 -0

77 lines not on this page · raw message

drivers/net/ethernet/broadcom/bnxt/bnxt.c +1 -0
index 04a623b3..2c82a2e 100644
@@ -2787,6 +2787,7 @@ static int bnxt_async_event_process(struct bnxt *bp,
 	}
 	__bnxt_queue_sp_work(bp);
 async_event_process_exit:
+	bnxt_ulp_async_events(bp, cmpl);
 	return 0;
 }
 
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c +31 -0
index b9e7d3e..9a55b06 100644
@@ -339,6 +339,37 @@ void bnxt_ulp_irq_restart(struct bnxt *bp, int err)
 	}
 }
 
+void bnxt_ulp_async_events(struct bnxt *bp, struct hwrm_async_event_cmpl *cmpl)
+{
+	u16 event_id = le16_to_cpu(cmpl->event_id);
+	struct bnxt_en_dev *edev = bp->edev;
+	struct bnxt_ulp_ops *ops;
+	struct bnxt_ulp *ulp;
+
+	if (!bnxt_ulp_registered(edev))
+		return;
+	ulp = edev->ulp_tbl;
+
+	rcu_read_lock();
+
+	ops = rcu_dereference(ulp->ulp_ops);
+	if (!ops || !ops->ulp_async_notifier)
+		goto exit_unlock_rcu;
+	if (!ulp->async_events_bmap || event_id > ulp->max_async_event_id)
+		goto exit_unlock_rcu;
+
+	/* Read max_async_event_id first before testing the bitmap. */
+	smp_rmb();
+	if (edev->flags & BNXT_EN_FLAG_ULP_STOPPED)
+		goto exit_unlock_rcu;
+
+	if (test_bit(event_id, ulp->async_events_bmap))
+		ops->ulp_async_notifier(ulp->handle, cmpl);
+exit_unlock_rcu:
+	rcu_read_unlock();
+}
+EXPORT_SYMBOL(bnxt_ulp_async_events);
+
 int bnxt_register_async_events(struct bnxt_en_dev *edev,
 			       unsigned long *events_bmap,
 			       u16 max_id)
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h +1 -0
index 4eafe6e..5bba0d7 100644
@@ -28,6 +28,7 @@ struct bnxt_msix_entry {
 };
 
 struct bnxt_ulp_ops {
+	void (*ulp_async_notifier)(void *, struct hwrm_async_event_cmpl *);
 	void (*ulp_irq_stop)(void *);
 	void (*ulp_irq_restart)(void *, struct bnxt_msix_entry *);
 };
Signature · 1 line
2.5.5
#2 lore raw

Re: [PATCH for-next 1/4] RDMA/bnxt_re: Add FW async event support in driver

Quoted 150 lines · Selvin Xavier

From: Kalesh AP <[email protected]>

Using the option provided by L2 driver, register for FW Async event. Provide the ulp hook 'ulp_async_notifier' for receiving the events for L2 driver.

Async events will be handled in follow on patches.

---
 drivers/infiniband/hw/bnxt_re/bnxt_re.h       |  1 +
 drivers/infiniband/hw/bnxt_re/main.c          | 47 +++++++++++++++++++++++++++
 drivers/net/ethernet/broadcom/bnxt/bnxt.c     |  1 +
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 31 ++++++++++++++++++
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h |  1 +
 5 files changed, 81 insertions(+)
drivers/infiniband/hw/bnxt_re/bnxt_re.h +1 -0
index 2be9a62..b2ed557 100644
@@ -198,6 +198,7 @@ struct bnxt_re_dev {
 	struct delayed_work dbq_pacing_work;
 	DECLARE_HASHTABLE(cq_hash, MAX_CQ_HASH_BITS);
 	DECLARE_HASHTABLE(srq_hash, MAX_SRQ_HASH_BITS);
+	unsigned long			event_bitmap;
 };
 
 #define to_bnxt_re_dev(ptr, member)	\
drivers/infiniband/hw/bnxt_re/main.c +47 -0
index 16a84ca..0f86a34 100644
@@ -300,6 +300,20 @@ static void bnxt_re_shutdown(struct auxiliary_device *adev)
 	bnxt_re_dev_uninit(rdev);
 }
 
+static void bnxt_re_async_notifier(void *handle, struct hwrm_async_event_cmpl *cmpl)
+{
+	struct bnxt_re_dev *rdev = (struct bnxt_re_dev *)handle;
+	u32 data1, data2;
+	u16 event_id;
+
+	event_id = le16_to_cpu(cmpl->event_id);
+	data1 = le32_to_cpu(cmpl->event_data1);
+	data2 = le32_to_cpu(cmpl->event_data2);
+
+	ibdev_dbg(&rdev->ibdev, "Async event_id = %d data1 = %d data2 = %d",
+		  event_id, data1, data2);
+}
+
 static void bnxt_re_stop_irq(void *handle)
 {
 	struct bnxt_re_dev *rdev = (struct bnxt_re_dev *)handle;
@@ -358,6 +372,7 @@ static void bnxt_re_start_irq(void *handle, struct bnxt_msix_entry *ent)
 }
 
 static struct bnxt_ulp_ops bnxt_re_ulp_ops = {
+	.ulp_async_notifier = bnxt_re_async_notifier,
 	.ulp_irq_stop = bnxt_re_stop_irq,
 	.ulp_irq_restart = bnxt_re_start_irq
 };
@@ -1518,6 +1533,34 @@ static int bnxt_re_setup_qos(struct bnxt_re_dev *rdev)
 	return 0;
 }
 
+static void bnxt_re_net_unregister_async_event(struct bnxt_re_dev *rdev)
+{
+	int rc;
+
+	if (rdev->is_virtfn)
+		return;
+
+	memset(&rdev->event_bitmap, 0, sizeof(rdev->event_bitmap));
+	rc = bnxt_register_async_events(rdev->en_dev, &rdev->event_bitmap,
+					ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE);
+	if (rc)
+		ibdev_err(&rdev->ibdev, "Failed to unregister async event");
+}
+
+static void bnxt_re_net_register_async_event(struct bnxt_re_dev *rdev)
+{
+	int rc;
+
+	if (rdev->is_virtfn)
+		return;
+
+	rdev->event_bitmap |= (1 << ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE);
+	rc = bnxt_register_async_events(rdev->en_dev, &rdev->event_bitmap,
+					ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE);
+	if (rc)
+		ibdev_err(&rdev->ibdev, "Failed to unregister async event");
+}
+
 static void bnxt_re_query_hwrm_intf_version(struct bnxt_re_dev *rdev)
 {
 	struct bnxt_en_dev *en_dev = rdev->en_dev;
@@ -1580,6 +1623,8 @@ static void bnxt_re_dev_uninit(struct bnxt_re_dev *rdev)
 	u8 type;
 	int rc;
 
+	bnxt_re_net_unregister_async_event(rdev);
+
 	if (test_and_clear_bit(BNXT_RE_FLAG_QOS_WORK_REG, &rdev->flags))
 		cancel_delayed_work_sync(&rdev->worker);
 
@@ -1776,6 +1821,8 @@ static int bnxt_re_dev_init(struct bnxt_re_dev *rdev)
 	if (rdev->chip_ctx->modes.toggle_bits & BNXT_QPLIB_SRQ_TOGGLE_BIT)
 		hash_init(rdev->srq_hash);
 
+	bnxt_re_net_register_async_event(rdev);
+
 	return 0;
 free_sctx:
 	bnxt_re_net_stats_ctx_free(rdev, rdev->qplib_ctx.stats.fw_id);
drivers/net/ethernet/broadcom/bnxt/bnxt.c +1 -0
index 04a623b3..2c82a2e 100644
@@ -2787,6 +2787,7 @@ static int bnxt_async_event_process(struct bnxt *bp,
 	}
 	__bnxt_queue_sp_work(bp);
 async_event_process_exit:
+	bnxt_ulp_async_events(bp, cmpl);
 	return 0;
 }
 
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c +13 -0
index b9e7d3e..9a55b06 100644
@@ -339,6 +339,37 @@ void bnxt_ulp_irq_restart(struct bnxt *bp, int err)
 	}
 }
 
+void bnxt_ulp_async_events(struct bnxt *bp, struct hwrm_async_event_cmpl *cmpl)
+{
+	u16 event_id = le16_to_cpu(cmpl->event_id);
+	struct bnxt_en_dev *edev = bp->edev;
+	struct bnxt_ulp_ops *ops;
+	struct bnxt_ulp *ulp;
+
+	if (!bnxt_ulp_registered(edev))
+		return;
+	ulp = edev->ulp_tbl;
+
+	rcu_read_lock();
+

drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c void bnxt_ulp_irq_restart(struct bnxt *bp, int err) · line 364

Quoted 10 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c +10 -0
+	ops = rcu_dereference(ulp->ulp_ops);
+	if (!ops || !ops->ulp_async_notifier)
+		goto exit_unlock_rcu;
+	if (!ulp->async_events_bmap || event_id > ulp->max_async_event_id)
+		goto exit_unlock_rcu;
+
+	/* Read max_async_event_id first before testing the bitmap. */
+	smp_rmb();
+	if (edev->flags & BNXT_EN_FLAG_ULP_STOPPED)
+		goto exit_unlock_rcu;

Isn't this racy with bnxt_ulp_stop()?

Quoted 26 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c +8 -0
+
+	if (test_bit(event_id, ulp->async_events_bmap))
+		ops->ulp_async_notifier(ulp->handle, cmpl);
+exit_unlock_rcu:
+	rcu_read_unlock();
+}
+EXPORT_SYMBOL(bnxt_ulp_async_events);
+
 int bnxt_register_async_events(struct bnxt_en_dev *edev,
 			       unsigned long *events_bmap,
 			       u16 max_id)
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h +1 -0
index 4eafe6e..5bba0d7 100644
@@ -28,6 +28,7 @@ struct bnxt_msix_entry {
 };
 
 struct bnxt_ulp_ops {
+	void (*ulp_async_notifier)(void *, struct hwrm_async_event_cmpl *);
 	void (*ulp_irq_stop)(void *);
 	void (*ulp_irq_restart)(void *, struct bnxt_msix_entry *);
 };
Signature · 1 line
2.5.5
author maintainer
#3 lore raw

Re: [PATCH for-next 1/4] RDMA/bnxt_re: Add FW async event support in driver

Quoted 156 lines · Leon Romanovsky
Quoted 154 lines · Selvin Xavier

From: Kalesh AP <[email protected]>

Using the option provided by L2 driver, register for FW Async event. Provide the ulp hook 'ulp_async_notifier' for receiving the events for L2 driver.

Async events will be handled in follow on patches.

---
 drivers/infiniband/hw/bnxt_re/bnxt_re.h       |  1 +
 drivers/infiniband/hw/bnxt_re/main.c          | 47 +++++++++++++++++++++++++++
 drivers/net/ethernet/broadcom/bnxt/bnxt.c     |  1 +
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 31 ++++++++++++++++++
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h |  1 +
 5 files changed, 81 insertions(+)
drivers/infiniband/hw/bnxt_re/bnxt_re.h +1 -0
index 2be9a62..b2ed557 100644
@@ -198,6 +198,7 @@ struct bnxt_re_dev {
      struct delayed_work dbq_pacing_work;
      DECLARE_HASHTABLE(cq_hash, MAX_CQ_HASH_BITS);
      DECLARE_HASHTABLE(srq_hash, MAX_SRQ_HASH_BITS);
+     unsigned long                   event_bitmap;
 };
 
 #define to_bnxt_re_dev(ptr, member)  \
drivers/infiniband/hw/bnxt_re/main.c +47 -0
index 16a84ca..0f86a34 100644
@@ -300,6 +300,20 @@ static void bnxt_re_shutdown(struct auxiliary_device *adev)
      bnxt_re_dev_uninit(rdev);
 }
 
+static void bnxt_re_async_notifier(void *handle, struct hwrm_async_event_cmpl *cmpl)
+{
+     struct bnxt_re_dev *rdev = (struct bnxt_re_dev *)handle;
+     u32 data1, data2;
+     u16 event_id;
+
+     event_id = le16_to_cpu(cmpl->event_id);
+     data1 = le32_to_cpu(cmpl->event_data1);
+     data2 = le32_to_cpu(cmpl->event_data2);
+
+     ibdev_dbg(&rdev->ibdev, "Async event_id = %d data1 = %d data2 = %d",
+               event_id, data1, data2);
+}
+
 static void bnxt_re_stop_irq(void *handle)
 {
      struct bnxt_re_dev *rdev = (struct bnxt_re_dev *)handle;
@@ -358,6 +372,7 @@ static void bnxt_re_start_irq(void *handle, struct bnxt_msix_entry *ent)
 }
 
 static struct bnxt_ulp_ops bnxt_re_ulp_ops = {
+     .ulp_async_notifier = bnxt_re_async_notifier,
      .ulp_irq_stop = bnxt_re_stop_irq,
      .ulp_irq_restart = bnxt_re_start_irq
 };
@@ -1518,6 +1533,34 @@ static int bnxt_re_setup_qos(struct bnxt_re_dev *rdev)
      return 0;
 }
 
+static void bnxt_re_net_unregister_async_event(struct bnxt_re_dev *rdev)
+{
+     int rc;
+
+     if (rdev->is_virtfn)
+             return;
+
+     memset(&rdev->event_bitmap, 0, sizeof(rdev->event_bitmap));
+     rc = bnxt_register_async_events(rdev->en_dev, &rdev->event_bitmap,
+                                     ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE);
+     if (rc)
+             ibdev_err(&rdev->ibdev, "Failed to unregister async event");
+}
+
+static void bnxt_re_net_register_async_event(struct bnxt_re_dev *rdev)
+{
+     int rc;
+
+     if (rdev->is_virtfn)
+             return;
+
+     rdev->event_bitmap |= (1 << ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE);
+     rc = bnxt_register_async_events(rdev->en_dev, &rdev->event_bitmap,
+                                     ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE);
+     if (rc)
+             ibdev_err(&rdev->ibdev, "Failed to unregister async event");
+}
+
 static void bnxt_re_query_hwrm_intf_version(struct bnxt_re_dev *rdev)
 {
      struct bnxt_en_dev *en_dev = rdev->en_dev;
@@ -1580,6 +1623,8 @@ static void bnxt_re_dev_uninit(struct bnxt_re_dev *rdev)
      u8 type;
      int rc;
 
+     bnxt_re_net_unregister_async_event(rdev);
+
      if (test_and_clear_bit(BNXT_RE_FLAG_QOS_WORK_REG, &rdev->flags))
              cancel_delayed_work_sync(&rdev->worker);
 
@@ -1776,6 +1821,8 @@ static int bnxt_re_dev_init(struct bnxt_re_dev *rdev)
      if (rdev->chip_ctx->modes.toggle_bits & BNXT_QPLIB_SRQ_TOGGLE_BIT)
              hash_init(rdev->srq_hash);
 
+     bnxt_re_net_register_async_event(rdev);
+
      return 0;
 free_sctx:
      bnxt_re_net_stats_ctx_free(rdev, rdev->qplib_ctx.stats.fw_id);
drivers/net/ethernet/broadcom/bnxt/bnxt.c +1 -0
index 04a623b3..2c82a2e 100644
@@ -2787,6 +2787,7 @@ static int bnxt_async_event_process(struct bnxt *bp,
      }
      __bnxt_queue_sp_work(bp);
 async_event_process_exit:
+     bnxt_ulp_async_events(bp, cmpl);
      return 0;
 }
 
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c +17 -0
index b9e7d3e..9a55b06 100644
@@ -339,6 +339,37 @@ void bnxt_ulp_irq_restart(struct bnxt *bp, int err)
      }
 }
 
+void bnxt_ulp_async_events(struct bnxt *bp, struct hwrm_async_event_cmpl *cmpl)
+{
+     u16 event_id = le16_to_cpu(cmpl->event_id);
+     struct bnxt_en_dev *edev = bp->edev;
+     struct bnxt_ulp_ops *ops;
+     struct bnxt_ulp *ulp;
+
+     if (!bnxt_ulp_registered(edev))
+             return;
+     ulp = edev->ulp_tbl;
+
+     rcu_read_lock();
+
+     ops = rcu_dereference(ulp->ulp_ops);
+     if (!ops || !ops->ulp_async_notifier)
+             goto exit_unlock_rcu;
+     if (!ulp->async_events_bmap || event_id > ulp->max_async_event_id)
Quoted 8 lines

drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c void bnxt_ulp_irq_restart(struct bnxt *bp, int err) · line 364

Quoted 6 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c +6 -0
+             goto exit_unlock_rcu;
+
+     /* Read max_async_event_id first before testing the bitmap. */
+     smp_rmb();
+     if (edev->flags & BNXT_EN_FLAG_ULP_STOPPED)
+             goto exit_unlock_rcu;

Isn't this racy with bnxt_ulp_stop()?

will review this and get back on this. There is a possibility though we haven't seen this in our testing. You can drop this series for now.

Quoted 27 lines
Quoted 27 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c +8 -0
+
+     if (test_bit(event_id, ulp->async_events_bmap))
+             ops->ulp_async_notifier(ulp->handle, cmpl);
+exit_unlock_rcu:
+     rcu_read_unlock();
+}
+EXPORT_SYMBOL(bnxt_ulp_async_events);
+
 int bnxt_register_async_events(struct bnxt_en_dev *edev,
                             unsigned long *events_bmap,
                             u16 max_id)
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h +1 -1
index 4eafe6e..5bba0d7 100644
@@ -28,6 +28,7 @@ struct bnxt_msix_entry {
 };
 
 struct bnxt_ulp_ops {
+     void (*ulp_async_notifier)(void *, struct hwrm_async_event_cmpl *);
      void (*ulp_irq_stop)(void *);
      void (*ulp_irq_restart)(void *, struct bnxt_msix_entry *);
 };
--

2.5.5

author maintainer
#4 lore raw

PATCH 2/4 RDMA/bnxt_re: Query firmware defaults of CC params during probe

In reply to Selvin Xavier

From: Kalesh AP <[email protected]>

Added function to query firmware default values of CC parameters during driver init. These values will be stored in driver local structures and used in subsequent patches.

---
 drivers/infiniband/hw/bnxt_re/bnxt_re.h  |   1 +
 drivers/infiniband/hw/bnxt_re/main.c     |   5 ++
 drivers/infiniband/hw/bnxt_re/qplib_sp.c | 113 +++++++++++++++++++++++++++++++
 drivers/infiniband/hw/bnxt_re/qplib_sp.h |   2 +
 4 files changed, 121 insertions(+)
drivers/infiniband/hw/bnxt_re/bnxt_re.h +1 -0
index b2ed557..7149bd0 100644
@@ -199,6 +199,7 @@ struct bnxt_re_dev {
 	DECLARE_HASHTABLE(cq_hash, MAX_CQ_HASH_BITS);
 	DECLARE_HASHTABLE(srq_hash, MAX_SRQ_HASH_BITS);
 	unsigned long			event_bitmap;
+	struct bnxt_qplib_cc_param	cc_param;
 };
 
 #define to_bnxt_re_dev(ptr, member)	\
drivers/infiniband/hw/bnxt_re/main.c +5 -0
index 0f86a34..541b8f9 100644
@@ -1803,6 +1803,11 @@ static int bnxt_re_dev_init(struct bnxt_re_dev *rdev)
 	set_bit(BNXT_RE_FLAG_RESOURCES_INITIALIZED, &rdev->flags);
 
 	if (!rdev->is_virtfn) {
+		/* Query f/w defaults of CC params */
+		rc = bnxt_qplib_query_cc_param(&rdev->qplib_res, &rdev->cc_param);
+		if (rc)
+			ibdev_warn(&rdev->ibdev, "Failed to query CC defaults\n");
+
 		rc = bnxt_re_setup_qos(rdev);
 		if (rc)
 			ibdev_info(&rdev->ibdev,
drivers/infiniband/hw/bnxt_re/qplib_sp.c +113 -0

116 lines not on this page · raw message

drivers/infiniband/hw/bnxt_re/qplib_sp.h +2 -0
index 4ce44aa..8cbbbeb 100644
@@ -352,6 +352,8 @@ int bnxt_qplib_qext_stat(struct bnxt_qplib_rcfw *rcfw, u32 fid,
 			 struct bnxt_qplib_ext_stat *estat);
 int bnxt_qplib_modify_cc(struct bnxt_qplib_res *res,
 			 struct bnxt_qplib_cc_param *cc_param);
+int bnxt_qplib_query_cc_param(struct bnxt_qplib_res *res,
+			      struct bnxt_qplib_cc_param *cc_param);
 
 #define BNXT_VAR_MAX_WQE       4352
 #define BNXT_VAR_MAX_SLOT_ALIGN 256
Signature · 1 line
2.5.5
author maintainer
#5 lore raw

PATCH 3/4 RDMA/bnxt_re: Add support to handle DCB_CONFIG_CHANGE event

In reply to Selvin Xavier

From: Kalesh AP <[email protected]>

QP1 context in HW needs to be updated when there is a change in the default DSCP values used for RoCE traffic. Handle the event from FW and modify the dscp value used by QP1.

---
 drivers/infiniband/hw/bnxt_re/bnxt_re.h  |   1 +
 drivers/infiniband/hw/bnxt_re/main.c     | 105 +++++++++++++++++++++++++++++++
 drivers/infiniband/hw/bnxt_re/qplib_fp.h |   2 +
 drivers/infiniband/hw/bnxt_re/qplib_sp.h |   1 +
 4 files changed, 109 insertions(+)
drivers/infiniband/hw/bnxt_re/bnxt_re.h +1 -0
index 7149bd0..3f7ac20 100644
@@ -200,6 +200,7 @@ struct bnxt_re_dev {
 	DECLARE_HASHTABLE(srq_hash, MAX_SRQ_HASH_BITS);
 	unsigned long			event_bitmap;
 	struct bnxt_qplib_cc_param	cc_param;
+	struct workqueue_struct		*dcb_wq;
 };
 
 #define to_bnxt_re_dev(ptr, member)	\
drivers/infiniband/hw/bnxt_re/main.c +105 -0

132 lines not on this page · raw message

drivers/infiniband/hw/bnxt_re/qplib_fp.h +2 -0
index b62df87..f27d6dc 100644
@@ -343,6 +343,8 @@ struct bnxt_qplib_qp {
 	u32				msn;
 	u32				msn_tbl_sz;
 	bool				is_host_msn_tbl;
+	/* ToS */
+	u8				tos_dscp;
 };
 
 #define BNXT_QPLIB_MAX_CQE_ENTRY_SIZE	sizeof(struct cq_base)
drivers/infiniband/hw/bnxt_re/qplib_sp.h +1 -0
index 8cbbbeb..5934bcf 100644
@@ -295,6 +295,7 @@ struct bnxt_qplib_cc_param_ext {
 
 struct bnxt_qplib_cc_param {
 	u8 alt_vlan_pcp;
+	u8 qp1_tos_dscp;
 	u16 alt_tos_dscp;
 	u8 cc_mode;
 	u8 enable;
Signature · 1 line
2.5.5
#6 lore raw

Re: [PATCH for-next 3/4] RDMA/bnxt_re: Add support to handle DCB_CONFIG_CHANGE event

Quoted 15 lines · Selvin Xavier

From: Kalesh AP <[email protected]>

QP1 context in HW needs to be updated when there is a change in the default DSCP values used for RoCE traffic. Handle the event from FW and modify the dscp value used by QP1.

---
 drivers/infiniband/hw/bnxt_re/bnxt_re.h  |   1 +
 drivers/infiniband/hw/bnxt_re/main.c     | 105 +++++++++++++++++++++++++++++++
 drivers/infiniband/hw/bnxt_re/qplib_fp.h |   2 +
 drivers/infiniband/hw/bnxt_re/qplib_sp.h |   1 +
 4 files changed, 109 insertions(+)

<...>

drivers/infiniband/hw/bnxt_re/main.c static void bnxt_re_shutdown(struct auxiliary_device *adev) · line 356

Quoted 6 lines
drivers/infiniband/hw/bnxt_re/main.c +6 -0
+static void bnxt_re_uninit_dcb_wq(struct bnxt_re_dev *rdev)
+{
+	if (!rdev->dcb_wq)
+		return;
+	flush_workqueue(rdev->dcb_wq);
+	destroy_workqueue(rdev->dcb_wq);

There is no need in flush_workqueue() as destroy_workqueue() will do it.

drivers/infiniband/hw/bnxt_re/main.c static void bnxt_re_shutdown(struct auxiliary_device *adev) · line 357

Quoted 1 line
drivers/infiniband/hw/bnxt_re/main.c +1 -0
+	rdev->dcb_wq = NULL;

Is this assignment needed?

Quoted 1 line

+}

Thanks

author maintainer
#7 lore raw

Re: [PATCH for-next 3/4] RDMA/bnxt_re: Add support to handle DCB_CONFIG_CHANGE event

Quoted 29 lines · Leon Romanovsky
Quoted 15 lines · Selvin Xavier

From: Kalesh AP <[email protected]>

QP1 context in HW needs to be updated when there is a change in the default DSCP values used for RoCE traffic. Handle the event from FW and modify the dscp value used by QP1.

---
 drivers/infiniband/hw/bnxt_re/bnxt_re.h  |   1 +
 drivers/infiniband/hw/bnxt_re/main.c     | 105 +++++++++++++++++++++++++++++++
 drivers/infiniband/hw/bnxt_re/qplib_fp.h |   2 +
 drivers/infiniband/hw/bnxt_re/qplib_sp.h |   1 +
 4 files changed, 109 insertions(+)

<...>

drivers/infiniband/hw/bnxt_re/main.c static void bnxt_re_shutdown(struct auxiliary_device *adev) · line 356

Quoted 6 lines
drivers/infiniband/hw/bnxt_re/main.c +6 -0
+static void bnxt_re_uninit_dcb_wq(struct bnxt_re_dev *rdev)
+{
+     if (!rdev->dcb_wq)
+             return;
+     flush_workqueue(rdev->dcb_wq);
+     destroy_workqueue(rdev->dcb_wq);

There is no need in flush_workqueue() as destroy_workqueue() will do it.

Quoted 3 lines
Quoted 1 line

+ rdev->dcb_wq = NULL;

Is this assignment needed?

Ack. Will remove this when we post v2.

Quoted 4 lines
Quoted 2 lines

+}

Thanks

author maintainer
#8 lore raw

PATCH 4/4 RDMA/bnxt_re: Enable ECN marking by default

In reply to Selvin Xavier

To mark the packet as ECN capable, driver need to enable the configuration during the driver load. Enable this along with enabling the congestion control feature.

Fixes f13bcef04ba0 ("RDMA/bnxt_re: Enable congestion control by default")
---
 drivers/infiniband/hw/bnxt_re/main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/infiniband/hw/bnxt_re/main.c +1 -0
index e13c0cc..4eac6b8 100644
@@ -2003,6 +2003,7 @@ static void bnxt_re_setup_cc(struct bnxt_re_dev *rdev, bool enable)
 		return;
 
 	if (enable) {
+		cc_param.tos_ecn = 1;
 		cc_param.enable  = 1;
 		cc_param.cc_mode = CMDQ_MODIFY_ROCE_CC_CC_MODE_PROBABILISTIC_CC_MODE;
 	}
Signature · 1 line
2.5.5