Skip to contentSkip to conversation

IB/rdmavt,staging/rdma/hfi1: Misc bug fixes for hfi1

PATCH New Dennis Dalessandro 1 participant 6 messages Feb 9, 2016 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover IB/rdmavt,staging/rdma/hfi1: Misc bug fixes for hfi1

This series adds some more bug fixes for hfi1. It also adds a performance fix for qp timeouts that is incorporated into rdmavt.

Series applies on the previously submitted "Dual lock pre-reqs" series and can be seen in context at: https://github.com/ddalessa/kernel/tree/for-4.6

---

Easwar Hariharan (2):
staging/rdma/hfi1: Fetch platform configuration data from EFI variable staging/rdma/hfi1: Tune for unknown channel if configuration file is absent

Mike Marciniszyn (1):
staging/rdma/hfi1: actually use new RNR timer API in loopback path

Sebastian Sanchez (1):
staging/rdma/hfi1: Turning off LED without checking if stepping is Ax

Vennila Megavannan (1):
IB/rdmavt, staging/rdma/hfi1: use qps to dynamically scale timeout value

 drivers/infiniband/sw/rdmavt/qp.c    |   17 ++++
 drivers/staging/rdma/hfi1/chip.c     |    7 +-
 drivers/staging/rdma/hfi1/chip.h     |    6 +
 drivers/staging/rdma/hfi1/firmware.c |  112 ++++++++++++++++++++++---
 drivers/staging/rdma/hfi1/hfi.h      |    1 
 drivers/staging/rdma/hfi1/init.c     |    1 
 drivers/staging/rdma/hfi1/pcie.c     |    3 -
 drivers/staging/rdma/hfi1/platform.c |  151 ++++++++++++++++++++++------------
 drivers/staging/rdma/hfi1/platform.h |    9 ++
 drivers/staging/rdma/hfi1/qsfp.c     |    1 
 drivers/staging/rdma/hfi1/rc.c       |   14 ++-
 drivers/staging/rdma/hfi1/ruc.c      |    8 +-
 drivers/staging/rdma/hfi1/verbs.h    |    1 
 include/rdma/rdma_vt.h               |    4 +
 include/rdma/rdmavt_qp.h             |    2 
 15 files changed, 255 insertions(+), 82 deletions(-)
Signature · 5 lines
-Denny
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20160209222705.7444.85189.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org

#2 lore raw

PATCH 1/5 staging/rdma/hfi1: Fetch platform configuration data from EFI variable

From: Easwar Hariharan <[email protected]>

The platform configuration data has been moved into the EFI variable store where it is populated by the HFI1 option ROM. This patch pulls the configuration data from the new location, retaining a fallback to request_firmware.

---
 drivers/staging/rdma/hfi1/chip.c     |    3 +
 drivers/staging/rdma/hfi1/chip.h     |    2 +
 drivers/staging/rdma/hfi1/firmware.c |   69 +++++++++++++++++++++++++++-------
 drivers/staging/rdma/hfi1/hfi.h      |    1 
 drivers/staging/rdma/hfi1/init.c     |    1 
 drivers/staging/rdma/hfi1/platform.c |   58 +++++++++++++++++++++++++----
 drivers/staging/rdma/hfi1/platform.h |    9 ++++
 7 files changed, 121 insertions(+), 22 deletions(-)
drivers/staging/rdma/hfi1/chip.c +3 -0
index 77b07c3..4750e3c 100644
@@ -14096,6 +14096,9 @@ struct hfi1_devdata *hfi1_init_dd(struct pci_dev *pdev,
 	if (ret)
 		goto bail_cleanup;
 
+	/* Needs to be called before hfi1_firmware_init */
+	get_platform_config(dd);
+
 	/* read in firmware */
 	ret = hfi1_firmware_init(dd);
 	if (ret)
drivers/staging/rdma/hfi1/chip.h +2 -0
index 0e95f0b..3b041dc 100644
@@ -617,6 +617,8 @@ u64 create_pbc(struct hfi1_pportdata *ppd, u64, int, u32, u32);
 #define NUM_PCIE_SERDES 16	/* number of PCIe serdes on the SBus */
 extern const u8 pcie_serdes_broadcast[];
 extern const u8 pcie_pcs_addrs[2][NUM_PCIE_SERDES];
+extern uint platform_config_load;
+
 /* SBus commands */
 #define RESET_SBUS_RECEIVER 0x20
 #define WRITE_SBUS_RECEIVER 0x21
drivers/staging/rdma/hfi1/firmware.c +54 -15

135 lines not on this page · raw message

drivers/staging/rdma/hfi1/hfi.h +1 -0
index 585485b..702723b 100644
@@ -1028,6 +1028,7 @@ struct hfi1_devdata {
 	u16 irev;	/* implementation revision */
 	u16 dc8051_ver; /* 8051 firmware version */
 
+	struct platform_config platform_config;
 	struct platform_config_cache pcfg_cache;
 	/* control high-level access to qsfp */
 	struct mutex qsfp_i2c_mutex;
drivers/staging/rdma/hfi1/init.c +1 -0
index fe5e1e5..112cb6c 100644
@@ -983,6 +983,7 @@ void hfi1_free_devdata(struct hfi1_devdata *dd)
 	idr_remove(&hfi1_unit_table, dd->unit);
 	list_del(&dd->list);
 	spin_unlock_irqrestore(&hfi1_devs_lock, flags);
+	free_platform_config(dd);
 	hfi1_dbg_ibdev_exit(&dd->verbs_dev);
 	rcu_barrier(); /* wait for rcu callbacks to complete */
 	free_percpu(dd->int_counter);
drivers/staging/rdma/hfi1/platform.c +51 -7

89 lines not on this page · raw message

drivers/staging/rdma/hfi1/platform.h +9 -0
index 5b53d71..cc280cc 100644
@@ -150,6 +150,11 @@ enum platform_config_variable_settings_table_fields {
 	VARIABLE_SETTINGS_TABLE_MAX
 };
 
+struct platform_config {
+	size_t size;
+	const u8 *data;
+};
+
 struct platform_config_data {
 	u32 *table;
 	u32 *table_metadata;
@@ -293,6 +298,10 @@ enum link_tuning_encoding {
 	OPA_UNKNOWN_TUNING
 };
 
+/* platform.c */
+void get_platform_config(struct hfi1_devdata *dd);
+void free_platform_config(struct hfi1_devdata *dd);
 int set_qsfp_tx(struct hfi1_pportdata *ppd, int on);
 void tune_serdes(struct hfi1_pportdata *ppd);
+
 #endif			/*__PLATFORM_H*/

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

PATCH 2/5 staging/rdma/hfi1: Tune for unknown channel if configuration file is absent

In reply to a message not in the archive

From: Easwar Hariharan <[email protected]>

Currently, the driver fails to tune the SerDes and therefore prevents link up if the configuration file is missing or fails parsing or validation. This patch adds a fallback option so that the 8051 is asked to tune for an unknown channel and possibly get the link up if tuning succeeds. It also adds a user-friendly message to update the configuration file if it is out-of-date.

---
 drivers/staging/rdma/hfi1/chip.h     |    4 +
 drivers/staging/rdma/hfi1/firmware.c |   49 ++++++++++++++++-
 drivers/staging/rdma/hfi1/platform.c |   97 ++++++++++++++++++----------------
 drivers/staging/rdma/hfi1/qsfp.c     |    1 
 4 files changed, 99 insertions(+), 52 deletions(-)
drivers/staging/rdma/hfi1/chip.h +4 -0
index 3b041dc..b86c220 100644
@@ -390,6 +390,10 @@
 #define LINK_QUALITY_INFO            0x14
 #define REMOTE_DEVICE_ID	     0x15
 
+/* 8051 lane specific register field IDs */
+#define TX_EQ_SETTINGS		0x00
+#define CHANNEL_LOSS_SETTINGS	0x05
+
 /* Lane ID for general configuration registers */
 #define GENERAL_CONFIG 4
 
drivers/staging/rdma/hfi1/firmware.c +45 -4

85 lines not on this page · raw message

drivers/staging/rdma/hfi1/platform.c +50 -47

163 lines not on this page · raw message

drivers/staging/rdma/hfi1/qsfp.c +0 -1
index c9d1e64..42e5be4 100644
@@ -344,7 +344,6 @@ int refresh_qsfp_cache(struct hfi1_pportdata *ppd, struct qsfp_data *cp)
 	ppd->qsfp_info.cache_valid = 0;
 	spin_unlock_irqrestore(&ppd->qsfp_info.qsfp_lock, flags);
 
-	dd_dev_info(ppd->dd, "%s called\n", __func__);
 	if (!qsfp_mod_present(ppd)) {
 		ret = -ENODEV;
 		goto bail;

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw

PATCH 3/5 staging/rdma/hfi1: actually use new RNR timer API in loopback path

In reply to a message not in the archive

From: Mike Marciniszyn <[email protected]>

The patch series which added a new API for the RNR timer did not include an updated call in the loopback path. RC/UC RNR loopback would be broken without this.

---
 drivers/staging/rdma/hfi1/rc.c    |    2 +-
 drivers/staging/rdma/hfi1/ruc.c   |    8 +++-----
 drivers/staging/rdma/hfi1/verbs.h |    1 +
 3 files changed, 5 insertions(+), 6 deletions(-)
drivers/staging/rdma/hfi1/rc.c +1 -1
index e54e0b4..ba2a2cc 100644
@@ -81,7 +81,7 @@ static inline void hfi1_add_retry_timer(struct rvt_qp *qp)
  *
  * add an rnr timer on the QP
  */
-static inline void hfi1_add_rnr_timer(struct rvt_qp *qp, u32 to)
+void hfi1_add_rnr_timer(struct rvt_qp *qp, u32 to)
 {
 	struct hfi1_qp_priv *priv = qp->priv;
 
drivers/staging/rdma/hfi1/ruc.c +3 -5
index 66449ac..a7add3c 100644
@@ -371,6 +371,7 @@ static void ruc_loopback(struct rvt_qp *sqp)
 	int release;
 	int ret;
 	int copy_last = 0;
+	u32 to;
 
 	rcu_read_lock();
 
@@ -600,11 +601,8 @@ rnr_nak:
 	spin_lock_irqsave(&sqp->s_lock, flags);
 	if (!(ib_rvt_state_ops[sqp->state] & RVT_PROCESS_RECV_OK))
 		goto clr_busy;
-	sqp->s_flags |= RVT_S_WAIT_RNR;
-	sqp->s_timer.function = hfi1_rc_rnr_retry;
-	sqp->s_timer.expires = jiffies +
-		usecs_to_jiffies(ib_hfi1_rnr_table[qp->r_min_rnr_timer]);
-	add_timer(&sqp->s_timer);
+	to = ib_hfi1_rnr_table[qp->r_min_rnr_timer];
+	hfi1_add_rnr_timer(sqp, to);
 	goto clr_busy;
 
 op_err:
drivers/staging/rdma/hfi1/verbs.h +1 -0
index 26eda8a..adb63bb 100644
@@ -404,6 +404,7 @@ u8 ah_to_sc(struct ib_device *ibdev, struct ib_ah_attr *ah_attr);
 struct ib_ah *hfi1_create_qp0_ah(struct hfi1_ibport *ibp, u16 dlid);
 
 void hfi1_rc_rnr_retry(unsigned long arg);
+void hfi1_add_rnr_timer(struct rvt_qp *qp, u32 to);
 void hfi1_rc_timeout(unsigned long arg);
 void hfi1_del_timers_sync(struct rvt_qp *qp);
 void hfi1_stop_rc_timers(struct rvt_qp *qp);

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw

PATCH 4/5 staging/rdma/hfi1: Turning off LED without checking if stepping is Ax

In reply to a message not in the archive

From: Sebastian Sanchez <[email protected]>

It prevents the LED from staying on when the QSFP module is not present.

---
 drivers/staging/rdma/hfi1/chip.c |    4 ++--
 drivers/staging/rdma/hfi1/pcie.c |    3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)
drivers/staging/rdma/hfi1/chip.c +2 -2
index 4750e3c..1294617 100644
@@ -13418,8 +13418,8 @@ static void init_chip(struct hfi1_devdata *dd)
 	write_csr(dd, CCE_DC_CTRL, 0);
 
 	/* Set the LED off */
-	if (is_ax(dd))
-		setextled(dd, 0);
+	setextled(dd, 0);
+
 	/*
 	 * Clear the QSFP reset.
 	 * An FLR enforces a 0 on all out pins. The driver does not touch
drivers/staging/rdma/hfi1/pcie.c +1 -2
index 5642d85..04f2d8a 100644
@@ -1261,8 +1261,7 @@ retry:
 	write_csr(dd, CCE_DC_CTRL, 0);
 
 	/* Set the LED off */
-	if (is_ax(dd))
-		setextled(dd, 0);
+	setextled(dd, 0);
 
 	/* check for any per-lane errors */
 	pci_read_config_dword(dd->pcidev, PCIE_CFG_SPCIE2, &reg32);

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw

PATCH 5/5 IB/rdmavt, staging/rdma/hfi1: use qps to dynamically scale timeout value

In reply to a message not in the archive

From: Vennila Megavannan <[email protected]>

A busy_jiffies variable is maintained and updated when rc qps are created and deleted. busy_jiffies is a scaled value of the number of rc qps in the device. busy_jiffies is incremented every rc qp scaling interval. busy_jiffies is added to the rc timeout in add_retry_timer and mod_retry_timer. The rc qp scaling interval is selected based on extensive performance evaluation of targeted workloads.

---
 drivers/infiniband/sw/rdmavt/qp.c |   17 +++++++++++++++++
 drivers/staging/rdma/hfi1/rc.c    |   12 ++++++++++--
 include/rdma/rdma_vt.h            |    4 +++-
 include/rdma/rdmavt_qp.h          |    2 ++
 4 files changed, 32 insertions(+), 3 deletions(-)
drivers/infiniband/sw/rdmavt/qp.c +17 -0
index 439213c..7dc837c 100644
@@ -685,6 +685,19 @@ struct ib_qp *rvt_create_qp(struct ib_pd *ibpd,
 	}
 
 	rdi->n_qps_allocated++;
+	/*
+	 * Maintain a busy_jiffies variable that will be added to the timeout
+	 * period in mod_retry_timer and add_retry_timer. This busy jiffies
+	 * is scaled by the number of rc qps created for the device to reduce
+	 * the number of timeouts occurring when there is a large number of
+	 * qps. busy_jiffies is incremented every rc qp scaling interval.
+	 * The scaling interval is selected based on extensive performance
+	 * evaluation of targeted workloads.
+	 */
+	if (init_attr->qp_type == IB_QPT_RC) {
+		rdi->n_rc_qps++;
+		rdi->busy_jiffies = rdi->n_rc_qps / RC_QP_SCALING_INTERVAL;
+	}
 	spin_unlock(&rdi->n_qps_lock);
 
 	if (qp->ip) {
@@ -1223,6 +1236,10 @@ int rvt_destroy_qp(struct ib_qp *ibqp)
 
 	spin_lock(&rdi->n_qps_lock);
 	rdi->n_qps_allocated--;
+	if (qp->ibqp.qp_type == IB_QPT_RC) {
+		rdi->n_rc_qps--;
+		rdi->busy_jiffies = rdi->n_rc_qps / RC_QP_SCALING_INTERVAL;
+	}
 	spin_unlock(&rdi->n_qps_lock);
 
 	if (qp->ip)
drivers/staging/rdma/hfi1/rc.c +10 -2
index ba2a2cc..a4a44d3 100644
@@ -68,9 +68,13 @@
  */
 static inline void hfi1_add_retry_timer(struct rvt_qp *qp)
 {
+	struct ib_qp *ibqp = &qp->ibqp;
+	struct rvt_dev_info *rdi = ib_to_rvt(ibqp->device);
+
 	qp->s_flags |= RVT_S_TIMER;
 	/* 4.096 usec. * (1 << qp->timeout) */
-	qp->s_timer.expires = jiffies + qp->timeout_jiffies;
+	qp->s_timer.expires = jiffies + qp->timeout_jiffies +
+			      rdi->busy_jiffies;
 	add_timer(&qp->s_timer);
 }
 
@@ -99,9 +103,13 @@ void hfi1_add_rnr_timer(struct rvt_qp *qp, u32 to)
  */
 static inline void hfi1_mod_retry_timer(struct rvt_qp *qp)
 {
+	struct ib_qp *ibqp = &qp->ibqp;
+	struct rvt_dev_info *rdi = ib_to_rvt(ibqp->device);
+
 	qp->s_flags |= RVT_S_TIMER;
 	/* 4.096 usec. * (1 << qp->timeout) */
-	mod_timer(&qp->s_timer, jiffies + qp->timeout_jiffies);
+	mod_timer(&qp->s_timer, jiffies + qp->timeout_jiffies +
+		  rdi->busy_jiffies);
 }
 
 /**
include/rdma/rdma_vt.h +3 -1
index 4242fea..5ccf683 100644
@@ -318,7 +318,9 @@ struct rvt_dev_info {
 	/* QP */
 	struct rvt_qp_ibdev *qp_dev;
 	u32 n_qps_allocated;    /* number of QPs allocated for device */
-	spinlock_t n_qps_lock; /* keep track of number of qps */
+	u32 n_rc_qps;		/* number of RC QPs allocated for device */
+	u32 busy_jiffies;	/* timeout scaling based on RC QP count */
+	spinlock_t n_qps_lock;	/* protect qps, rc qps and busy jiffy counts */
 
 	/* memory maps */
 	struct list_head pending_mmaps;
include/rdma/rdmavt_qp.h +2 -0
index aed13e1..b3ea745 100644
@@ -225,6 +225,8 @@ struct rvt_ack_entry {
 	};
 };
 
+#define	RC_QP_SCALING_INTERVAL	5
+
 /*
  * Variables prefixed with s_ are for the requester (sender).
  * Variables prefixed with r_ are for the responder (receiver).

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html