Skip to contentSkip to conversation

IB/hfi1: patches for next 08/13/2017

PATCH In review Dennis Dalessandro 3 participants 12 messages Aug 13, 2017 – Aug 22, 2017 2 messages not in the archive

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

cover IB/hfi1: patches for next 08/13/2017

Hi Doug,

Here is the next set of patches for our drivers for 4.14. One of these patches gets rid of a config option that is no longer needed. There are some cleanups as usual and minor bug fixes. Nothing that I would say needs to go into an RC. These can all just land in your for-next tree and apply on top of that branch with the addition of the pending patches still on the list. Everything applied cleanly.

There is one patch to an OPA header file that addresses a question that Leon had on the list about OPA physical port states.

Patches can can also be found in my GitHub repo at:
https://github.com/ddalessa/kernel/tree/for-4.14

---

Dennis Dalessandro (1):
IB/hfi1: Document phys port state bits not used in IB

Grzegorz Morys (1):
IB/hfi1: Remove HFI1_VERBS_31BIT_PSN option

Jakub Byczkowski (3):
IB/hfi1: Add flag for platform config scratch register read IB/hfi1: Load fallback platform configuration per HFI device IB/hfi1: Remove pstate from hfi1_pportdata

Kaike Wan (1):
IB/hfi1: Add kernel receive context info to debugfs

Kamenee Arumugame (1):
IB/hfi1: Stricter bounds checking of MAD trap index

Sebastian Sanchez (1):
IB/hfi1: Check xchg returned value for queuing link down entry

 drivers/infiniband/hw/hfi1/Kconfig      |    7 ---
 drivers/infiniband/hw/hfi1/chip.c       |   72 +++++++++++++++++++------------
 drivers/infiniband/hw/hfi1/chip.h       |    4 --
 drivers/infiniband/hw/hfi1/debugfs.c    |   47 ++++++++++++++++++++
 drivers/infiniband/hw/hfi1/driver.c     |   59 +++++++++++++++++++++++++
 drivers/infiniband/hw/hfi1/firmware.c   |   57 +++----------------------
 drivers/infiniband/hw/hfi1/hfi.h        |   28 ++----------
 drivers/infiniband/hw/hfi1/mad.c        |   15 ++++++
 drivers/infiniband/hw/hfi1/opa_compat.h |   21 ++++++++-
 drivers/infiniband/hw/hfi1/platform.c   |   43 +++++++++++++------
 drivers/infiniband/hw/hfi1/verbs.h      |    5 --
 include/rdma/rdma_vt.h                  |    2 -
 12 files changed, 224 insertions(+), 136 deletions(-)

--
-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): 20170813150659.23208.66243.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org

#2 lore raw

PATCH 1/8 IB/hfi1: Check xchg returned value for queuing link down entry

From: Sebastian Sanchez <[email protected]>

Check xchg returned value for queuing link down entry to guarantee proper atomic value reads.

Fixes 626c077c025f ("IB/hfi1: Prevent link down request double queuing")
---
 drivers/infiniband/hw/hfi1/chip.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)
drivers/infiniband/hw/hfi1/chip.c +12 -6
index 24fda52..a6c6534 100644
@@ -7810,16 +7810,22 @@ static void handle_8051_interrupt(struct hfi1_devdata *dd, u32 unused, u64 reg)
 	if (queue_link_down) {
 		/*
 		 * if the link is already going down or disabled, do not
-		 * queue another
+		 * queue another. If there's a link down entry already
+		 * queued, don't queue another one.
 		 */
 		if ((ppd->host_link_state &
 		    (HLS_GOING_OFFLINE | HLS_LINK_COOLDOWN)) ||
-		    ppd->link_enabled == 0 || ppd->is_link_down_queued) {
-			dd_dev_info(dd, "%s: not queuing link down\n",
-				    __func__);
+		    ppd->link_enabled == 0) {
+			dd_dev_info(dd, "%s: not queuing link down. host_link_state %x, link_enabled %x\n",
+				    __func__, ppd->host_link_state,
+				    ppd->link_enabled);
 		} else {
-			xchg(&ppd->is_link_down_queued, 1);
-			queue_work(ppd->link_wq, &ppd->link_down_work);
+			if (xchg(&ppd->is_link_down_queued, 1) == 1)
+				dd_dev_info(dd,
+					    "%s: link down request already queued\n",
+					    __func__);
+			else
+				queue_work(ppd->link_wq, &ppd->link_down_work);
 		}
 	}
 }

--
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/8 IB/hfi1: Document phys port state bits not used in IB

In reply to a message not in the archive

A couple bits are used by OPA for link physical state that are not present as part of InfiniBand. Add a short blurb what those states mean and removed an unused state.

---
 drivers/infiniband/hw/hfi1/opa_compat.h |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)
drivers/infiniband/hw/hfi1/opa_compat.h +19 -2
index 6ef3c1c..774215b 100644
@@ -84,7 +84,8 @@ static inline u8 port_states_to_phys_state(struct opa_port_states *ps)
 /*
  * OPA port physical states
  * IB Volume 1, Table 146 PortInfo/IB Volume 2 Section 5.4.2(1) PortPhysState
- * values.
+ * values are the same in OmniPath Architecture. OPA leverages some of the same
+ * concepts as InfiniBand, but has a few other states as well.
  *
  * When writing, only values 0-3 are valid, other values are ignored.
  * When reading, 0 is reserved.
@@ -92,6 +93,8 @@ static inline u8 port_states_to_phys_state(struct opa_port_states *ps)
  * Returned by the ibphys_portstate() routine.
  */
 enum opa_port_phys_state {
+	/* Values 0-7 have the same meaning in OPA as in InfiniBand. */
+
 	IB_PORTPHYSSTATE_NOP = 0,
 	/* 1 is reserved */
 	IB_PORTPHYSSTATE_POLLING = 2,
@@ -101,9 +104,23 @@ enum opa_port_phys_state {
 	IB_PORTPHYSSTATE_LINK_ERROR_RECOVERY = 6,
 	IB_PORTPHYSSTATE_PHY_TEST = 7,
 	/* 8 is reserved */
+
+	/*
+	 * Offline: Port is quiet (transmitters disabled) due to lack of
+	 * physical media, unsupported media, or transition between link up
+	 * and next link up attempt
+	 */
 	OPA_PORTPHYSSTATE_OFFLINE = 9,
-	OPA_PORTPHYSSTATE_GANGED = 10,
+
+	/* 10 is reserved */
+
+	/*
+	 * Phy_Test: Specific test patterns are transmitted, and receiver BER
+	 * can be monitored. This facilitates signal integrity testing for the
+	 * physical layer of the port.
+	 */
 	OPA_PORTPHYSSTATE_TEST = 11,
+
 	OPA_PORTPHYSSTATE_MAX = 11,
 	/* values 12-15 are reserved/ignored */
 };

--
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): 20170813150827.23208.83131.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org

Reviewed-by
#5 lore raw

Re: [PATCH for-next 2/8] IB/hfi1: Document phys port state bits not used in IB

Quoted 4 lines · Dennis Dalessandro

A couple bits are used by OPA for link physical state that are not present as part of InfiniBand. Add a short blurb what those states mean and removed an unused state.

Quoted 8 lines
---
 drivers/infiniband/hw/hfi1/opa_compat.h |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

Thanks,

#6 lore raw

PATCH 3/8 IB/hfi1: Add flag for platform config scratch register read

In reply to a message not in the archive

From: Jakub Byczkowski <[email protected]>

Add flag in pport data structure to determine when platform config was read from scratch registers. Change conditions in parse_platform_config and get_platform_config_field to use the new flag.

---
 drivers/infiniband/hw/hfi1/firmware.c |    6 ++++--
 drivers/infiniband/hw/hfi1/hfi.h      |    3 +++
 drivers/infiniband/hw/hfi1/platform.c |    2 ++
 3 files changed, 9 insertions(+), 2 deletions(-)
drivers/infiniband/hw/hfi1/firmware.c +4 -2
index 885714b..fb095e6 100644
@@ -1789,6 +1789,7 @@ static int check_meta_version(struct hfi1_devdata *dd, u32 *system_table)
 int parse_platform_config(struct hfi1_devdata *dd)
 {
 	struct platform_config_cache *pcfgcache = &dd->pcfg_cache;
+	struct hfi1_pportdata *ppd = dd->pport;
 	u32 *ptr = NULL;
 	u32 header1 = 0, header2 = 0, magic_num = 0, crc = 0, file_length = 0;
 	u32 record_idx = 0, table_type = 0, table_length_dwords = 0;
@@ -1800,7 +1801,7 @@ int parse_platform_config(struct hfi1_devdata *dd)
 	 * scratch register bitmap, thus there is no platform config to parse.
 	 * Skip parsing in these situations.
 	 */
-	if (is_integrated(dd) && !platform_config_load)
+	if (ppd->config_from_scratch)
 		return 0;
 
 	if (!dd->platform_config.data) {
@@ -2089,13 +2090,14 @@ int get_platform_config_field(struct hfi1_devdata *dd,
 	int ret = 0, wlen = 0, seek = 0;
 	u32 field_len_bits = 0, field_start_bits = 0, *src_ptr = NULL;
 	struct platform_config_cache *pcfgcache = &dd->pcfg_cache;
+	struct hfi1_pportdata *ppd = dd->pport;
 
 	if (data)
 		memset(data, 0, len);
 	else
 		return -EINVAL;
 
-	if (is_integrated(dd) && !platform_config_load) {
+	if (ppd->config_from_scratch) {
 		/*
 		 * Use saved configuration from ppd for integrated platforms
 		 */
drivers/infiniband/hw/hfi1/hfi.h +3 -0
index dff3d3f..181feca 100644
@@ -677,6 +677,9 @@ struct hfi1_pportdata {
 	u8  default_atten;
 	u8  max_power_class;
 
+	/* did we read platform config from scratch registers? */
+	bool config_from_scratch;
+
 	/* GUIDs for this interface, in host order, guids[0] is a port guid */
 	u64 guids[HFI1_GUIDS_PER_PORT];
 
drivers/infiniband/hw/hfi1/platform.c +2 -0
index 5c38a24..ab221b0 100644
@@ -138,6 +138,8 @@ static void save_platform_config_fields(struct hfi1_devdata *dd)
 
 	ppd->max_power_class = (temp_scratch & QSFP_MAX_POWER_SMASK) >>
 				QSFP_MAX_POWER_SHIFT;
+
+	ppd->config_from_scratch = true;
 }
 
 void get_platform_config(struct hfi1_devdata *dd)

--
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

#7 lore raw

PATCH 4/8 IB/hfi1: Load fallback platform configuration per HFI device

In reply to a message not in the archive

From: Jakub Byczkowski <[email protected]>

Currently fallback configuration is loaded once per driver instance. With multiple HFI devices in the same system the current code may not load the platform config data for the device. Change fallback platform config data loading to be per device.

---
 drivers/infiniband/hw/hfi1/chip.h     |    1 -
 drivers/infiniband/hw/hfi1/firmware.c |   51 ++-------------------------------
 drivers/infiniband/hw/hfi1/platform.c |   41 ++++++++++++++++++---------
 3 files changed, 31 insertions(+), 62 deletions(-)
drivers/infiniband/hw/hfi1/chip.h +0 -1
index f708302..fc21097 100644
@@ -648,7 +648,6 @@ u64 create_pbc(struct hfi1_pportdata *ppd, u64 flags, int srate_mbs, u32 vl,
 #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
drivers/infiniband/hw/hfi1/firmware.c +3 -48

108 lines not on this page · raw message

drivers/infiniband/hw/hfi1/platform.c +28 -13

67 lines not on this page · raw message

--
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

#8 lore raw

PATCH 5/8 IB/hfi1: Stricter bounds checking of MAD trap index

In reply to a message not in the archive

From: Kamenee Arumugame <[email protected]>

The macro size is valid. This change makes it less ambiguous. Bounds check trap type for better security.

---
 drivers/infiniband/hw/hfi1/mad.c |   13 ++++++++++++-
 include/rdma/rdma_vt.h           |    2 +-
 2 files changed, 13 insertions(+), 2 deletions(-)
drivers/infiniband/hw/hfi1/mad.c +12 -1
index 1be1d74..ba6f58e 100644
@@ -151,13 +151,24 @@ static void cleanup_traps(struct hfi1_ibport *ibp, struct trap_node *trap)
 	unsigned long flags;
 	unsigned long timeout;
 	int found = 0;
+	unsigned int queue_id;
+	static int trap_count;
+
+	queue_id = trap->data.generic_type & 0x0F;
+	if (queue_id >= RVT_MAX_TRAP_LISTS) {
+		trap_count++;
+		pr_err_ratelimited("hfi1: Invalid trap 0x%0x dropped. Total dropped: %d\n",
+				  trap->data.generic_type, trap_count);
+		kfree(trap);
+		return NULL;
+	}
 
 	/*
 	 * Since the retry (handle timeout) does not remove a trap request
 	 * from the list, all we have to do is compare the node.
 	 */
 	spin_lock_irqsave(&ibp->rvp.lock, flags);
-	trap_list = &ibp->rvp.trap_lists[trap->data.generic_type & 0x0F];
+	trap_list = &ibp->rvp.trap_lists[queue_id];
 
 	list_for_each_entry(node, &trap_list->list, list) {
 		if (node == trap) {
include/rdma/rdma_vt.h +1 -1
index 1d94f3c..1ba84a7 100644
@@ -64,7 +64,7 @@
 #define RVT_MAX_PKEY_VALUES 16
 
 #define RVT_MAX_TRAP_LEN 100 /* Limit pending trap list */
-#define RVT_MAX_TRAP_LISTS ((IB_NOTICE_TYPE_INFO & 0x0F) + 1)
+#define RVT_MAX_TRAP_LISTS 5 /*((IB_NOTICE_TYPE_INFO & 0x0F) + 1)*/
 #define RVT_TRAP_TIMEOUT 4096 /* 4.096 usec */
 
 struct trap_list {

--
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

#9 lore raw

PATCH 6/8 IB/hfi1: Remove pstate from hfi1_pportdata

In reply to a message not in the archive

From: Jakub Byczkowski <[email protected]>

Do not track physical state separately from host_link_state. Deduce physical state from host_link_state when required. Change cache_physical_state to log_physical_state to make sure host_link_state reflects hardwares physical state properly.

---
 drivers/infiniband/hw/hfi1/chip.c |   54 +++++++++++++++++++++----------------
 drivers/infiniband/hw/hfi1/chip.h |    3 +-
 drivers/infiniband/hw/hfi1/hfi.h  |   24 ----------------
 drivers/infiniband/hw/hfi1/mad.c  |    2 +
 4 files changed, 33 insertions(+), 50 deletions(-)
drivers/infiniband/hw/hfi1/chip.c +31 -23
index a6c6534..45f6874 100644
@@ -1068,6 +1068,8 @@ static int do_8051_command(struct hfi1_devdata *dd, u32 type, u64 in_data,
 static void update_statusp(struct hfi1_pportdata *ppd, u32 state);
 static int wait_logical_linkstate(struct hfi1_pportdata *ppd, u32 state,
 				  int msecs);
+static void log_state_transition(struct hfi1_pportdata *ppd, u32 state);
+static void log_physical_state(struct hfi1_pportdata *ppd, u32 state);
 static int wait_physical_linkstate(struct hfi1_pportdata *ppd, u32 state,
 				   int msecs);
 static void read_planned_down_reason_code(struct hfi1_devdata *dd, u8 *pdrrc);
@@ -10450,11 +10452,11 @@ static int goto_offline(struct hfi1_pportdata *ppd, u8 rem_reason)
 }
 
 /*
- * driver_physical_state - convert the driver's notion of a port's
+ * driver_pstate - convert the driver's notion of a port's
  * state (an HLS_*) into a physical state (a {IB,OPA}_PORTPHYSSTATE_*).
  * Return -1 (converted to a u32) to indicate error.
  */
-u32 driver_physical_state(struct hfi1_pportdata *ppd)
+u32 driver_pstate(struct hfi1_pportdata *ppd)
 {
 	switch (ppd->host_link_state) {
 	case HLS_UP_INIT:
@@ -10720,7 +10722,7 @@ int set_link_state(struct hfi1_pportdata *ppd, u32 state)
 		if (ret)
 			goto_offline(ppd, 0);
 		else
-			cache_physical_state(ppd);
+			log_physical_state(ppd, PLS_POLLING);
 		break;
 	case HLS_DN_DISABLE:
 		/* link is disabled */
@@ -10769,7 +10771,7 @@ int set_link_state(struct hfi1_pportdata *ppd, u32 state)
 		if (ppd->host_link_state != HLS_DN_POLL)
 			goto unexpected;
 		ppd->host_link_state = HLS_VERIFY_CAP;
-		cache_physical_state(ppd);
+		log_physical_state(ppd, PLS_CONFIGPHY_VERIFYCAP);
 		break;
 	case HLS_GOING_UP:
 		if (ppd->host_link_state != HLS_VERIFY_CAP)
@@ -12743,25 +12745,30 @@ static int wait_logical_linkstate(struct hfi1_pportdata *ppd, u32 state,
 	return 0;
 }
 
+static void log_state_transition(struct hfi1_pportdata *ppd, u32 state)
+{
+	u32 ib_pstate = chip_to_opa_pstate(ppd->dd, state);
+
+	dd_dev_info(ppd->dd,
+		    "physical state changed to %s (0x%x), phy 0x%x\n",
+		    opa_pstate_name(ib_pstate), ib_pstate, state);
+}
+
 /*
- * Read the physical hardware link state and set the driver's cached value
- * of it.
+ * Read the physical hardware link state and check if it matches host
+ * drivers anticipated state.
  */
-void cache_physical_state(struct hfi1_pportdata *ppd)
+static void log_physical_state(struct hfi1_pportdata *ppd, u32 state)
 {
-	u32 read_pstate;
-	u32 ib_pstate;
+	u32 read_state = read_physical_state(ppd->dd);
 
-	read_pstate = read_physical_state(ppd->dd);
-	ib_pstate = chip_to_opa_pstate(ppd->dd, read_pstate);
-	/* check if OPA pstate changed */
-	if (chip_to_opa_pstate(ppd->dd, ppd->pstate) != ib_pstate) {
-		dd_dev_info(ppd->dd,
-			    "%s: physical state changed to %s (0x%x), phy 0x%x\n",
-			    __func__, opa_pstate_name(ib_pstate), ib_pstate,
-			    read_pstate);
+	if (read_state == state) {
+		log_state_transition(ppd, state);
+	} else {
+		dd_dev_err(ppd->dd,
+			   "anticipated phy link state 0x%x, read 0x%x\n",
+			   state, read_state);
 	}
-	ppd->pstate = read_pstate;
 }
 
 /*
@@ -12776,22 +12783,24 @@ void cache_physical_state(struct hfi1_pportdata *ppd)
 static int wait_physical_linkstate(struct hfi1_pportdata *ppd, u32 state,
 				   int msecs)
 {
+	u32 read_state;
 	unsigned long timeout;
 
 	timeout = jiffies + msecs_to_jiffies(msecs);
 	while (1) {
-		cache_physical_state(ppd);
-		if (ppd->pstate == state)
+		read_state = read_physical_state(ppd->dd);
+		if (read_state == state)
 			break;
 		if (time_after(jiffies, timeout)) {
 			dd_dev_err(ppd->dd,
-				   "timeout waiting for phy link state 0x%x, current state is 0x%x\n",
-				   state, ppd->pstate);
+				   "timeout waiting for phy link state 0x%x\n",
+				   state);
 			return -ETIMEDOUT;
 		}
 		usleep_range(1950, 2050); /* sleep 2ms-ish */
 	}
 
+	log_state_transition(ppd, state);
 	return 0;
 }
 
@@ -14896,7 +14905,6 @@ struct hfi1_devdata *hfi1_init_dd(struct pci_dev *pdev,
 		/* start in offline */
 		ppd->host_link_state = HLS_DN_OFFLINE;
 		init_vl_arb_caches(ppd);
-		ppd->pstate = PLS_OFFLINE;
 	}
 
 	dd->link_default = HLS_DN_POLL;
drivers/infiniband/hw/hfi1/chip.h +1 -2
index fc21097..b8345a6 100644
@@ -747,10 +747,9 @@ void update_usrhead(struct hfi1_ctxtdata *rcd, u32 hd, u32 updegr, u32 egrhd,
 int is_bx(struct hfi1_devdata *dd);
 u32 read_physical_state(struct hfi1_devdata *dd);
 u32 chip_to_opa_pstate(struct hfi1_devdata *dd, u32 chip_pstate);
-void cache_physical_state(struct hfi1_pportdata *ppd);
 const char *opa_lstate_name(u32 lstate);
 const char *opa_pstate_name(u32 pstate);
-u32 driver_physical_state(struct hfi1_pportdata *ppd);
+u32 driver_pstate(struct hfi1_pportdata *ppd);
 u32 driver_lstate(struct hfi1_pportdata *ppd);
 
 int acquire_lcb_access(struct hfi1_devdata *dd, int sleep_ok);
drivers/infiniband/hw/hfi1/hfi.h +0 -24
index 181feca..b15749e 100644
@@ -758,7 +758,6 @@ struct hfi1_pportdata {
 	u8 link_enabled;	/* link enabled? */
 	u8 linkinit_reason;
 	u8 local_tx_rate;	/* rate given to 8051 firmware */
-	u8 pstate;		/* info only */
 	u8 qsfp_retry_count;
 
 	/* placeholders for IB MAD packet settings */
@@ -1428,29 +1427,6 @@ void hfi1_make_ud_req_16B(struct rvt_qp *qp,
 
 int hfi1_reset_device(int);
 
-/* return the driver's idea of the physical OPA port state */
-static inline u32 driver_pstate(struct hfi1_pportdata *ppd)
-{
-	/*
-	 * When DC is shut down and state is changed, its CSRs are not
-	 * impacted, therefore host_link_state should be used to get
-	 * current physical state.
-	 */
-	if (ppd->dd->dc_shutdown)
-		return driver_physical_state(ppd);
-	/*
-	 * The driver does some processing from the time the physical
-	 * link state is at LINKUP to the time the SM can be notified
-	 * as such. Return IB_PORTPHYSSTATE_TRAINING until the software
-	 * state is ready.
-	 */
-	if (ppd->pstate == PLS_LINKUP &&
-	    !(ppd->host_link_state & HLS_UP))
-		return IB_PORTPHYSSTATE_TRAINING;
-	else
-		return chip_to_opa_pstate(ppd->dd, ppd->pstate);
-}
-
 void receive_interrupt_work(struct work_struct *work);
 
 /* extract service channel from header and rhf */
drivers/infiniband/hw/hfi1/mad.c +1 -1
index ba6f58e..9336e78 100644
@@ -1181,7 +1181,7 @@ static int physical_transition_allowed(int old, int new)
 static int port_states_transition_allowed(struct hfi1_pportdata *ppd,
 					  u32 logical_new, u32 physical_new)
 {
-	u32 physical_old = driver_physical_state(ppd);
+	u32 physical_old = driver_pstate(ppd);
 	u32 logical_old = driver_lstate(ppd);
 	int ret, logical_allowed, physical_allowed;
 

--
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

#10 lore raw

PATCH 7/8 IB/hfi1: Remove HFI1_VERBS_31BIT_PSN option

In reply to a message not in the archive

From: Grzegorz Morys <[email protected]>

Remove HFI1_VERBS_31BIT_PSN Kconfig option leaving only 31-bit PSNs available. The option was implemented in the early days of the driver and is no longer needed.

---
 drivers/infiniband/hw/hfi1/Kconfig |    7 -------
 drivers/infiniband/hw/hfi1/verbs.h |    5 -----
 2 files changed, 0 insertions(+), 12 deletions(-)
drivers/infiniband/hw/hfi1/Kconfig +0 -7
index f6ea088..7b146b6 100644
@@ -13,13 +13,6 @@ config HFI1_DEBUG_SDMA_ORDER
 	---help---
 	This is a debug flag to test for out of order
 	sdma completions for unit testing
-config HFI1_VERBS_31BIT_PSN
-	bool "HFI1 enable 31 bit PSN"
-	depends on INFINIBAND_HFI1
-	default y
-	---help---
-	Setting this enables 31 BIT PSN
-	For verbs RC/UC
 config SDMA_VERBOSITY
 	bool "Config SDMA Verbosity"
 	depends on INFINIBAND_HFI1
drivers/infiniband/hw/hfi1/verbs.h +0 -5
index 56ead87..87d1285 100644
@@ -280,13 +280,8 @@ int hfi1_process_mad(struct ib_device *ibdev, int mad_flags, u8 port,
  * necessarily be at least one bit less than
  * the container holding the PSN.
  */
-#ifndef CONFIG_HFI1_VERBS_31BIT_PSN
-#define PSN_MASK 0xFFFFFF
-#define PSN_SHIFT 8
-#else
 #define PSN_MASK 0x7FFFFFFF
 #define PSN_SHIFT 1
-#endif
 #define PSN_MODIFY_MASK 0xFFFFFF
 
 /*

--
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

#11 lore raw

PATCH 8/8 IB/hfi1: Add kernel receive context info to debugfs

In reply to a message not in the archive

From: Kaike Wan <[email protected]>

---
 drivers/infiniband/hw/hfi1/debugfs.c |   47 +++++++++++++++++++++++++++
 drivers/infiniband/hw/hfi1/driver.c  |   59 ++++++++++++++++++++++++++++++++++
 drivers/infiniband/hw/hfi1/hfi.h     |    1 +
 3 files changed, 107 insertions(+), 0 deletions(-)
drivers/infiniband/hw/hfi1/debugfs.c +47 -0
index 550119c..c6a472f 100644
@@ -368,6 +368,52 @@ static int _sdes_seq_show(struct seq_file *s, void *v)
 DEBUGFS_SEQ_FILE_OPEN(sdes)
 DEBUGFS_FILE_OPS(sdes);
 
+static void *_rcds_seq_start(struct seq_file *s, loff_t *pos)
+{
+	struct hfi1_ibdev *ibd;
+	struct hfi1_devdata *dd;
+
+	ibd = (struct hfi1_ibdev *)s->private;
+	dd = dd_from_dev(ibd);
+	if (!dd->rcd || *pos >= dd->n_krcv_queues)
+		return NULL;
+	return pos;
+}
+
+static void *_rcds_seq_next(struct seq_file *s, void *v, loff_t *pos)
+{
+	struct hfi1_ibdev *ibd = (struct hfi1_ibdev *)s->private;
+	struct hfi1_devdata *dd = dd_from_dev(ibd);
+
+	++*pos;
+	if (!dd->rcd || *pos >= dd->n_krcv_queues)
+		return NULL;
+	return pos;
+}
+
+static void _rcds_seq_stop(struct seq_file *s, void *v)
+{
+}
+
+static int _rcds_seq_show(struct seq_file *s, void *v)
+{
+	struct hfi1_ibdev *ibd = (struct hfi1_ibdev *)s->private;
+	struct hfi1_devdata *dd = dd_from_dev(ibd);
+	struct hfi1_ctxtdata *rcd;
+	loff_t *spos = v;
+	loff_t i = *spos;
+
+	rcd = hfi1_rcd_get_by_index(dd, i);
+	if (rcd)
+		seqfile_dump_rcd(s, rcd);
+	hfi1_rcd_put(rcd);
+	return 0;
+}
+
+DEBUGFS_SEQ_FILE_OPS(rcds);
+DEBUGFS_SEQ_FILE_OPEN(rcds)
+DEBUGFS_FILE_OPS(rcds);
+
 /* read the per-device counters */
 static ssize_t dev_counters_read(struct file *file, char __user *buf,
 				 size_t count, loff_t *ppos)
@@ -1321,6 +1367,7 @@ void hfi1_dbg_ibdev_init(struct hfi1_ibdev *ibd)
 	DEBUGFS_SEQ_FILE_CREATE(ctx_stats, ibd->hfi1_ibdev_dbg, ibd);
 	DEBUGFS_SEQ_FILE_CREATE(qp_stats, ibd->hfi1_ibdev_dbg, ibd);
 	DEBUGFS_SEQ_FILE_CREATE(sdes, ibd->hfi1_ibdev_dbg, ibd);
+	DEBUGFS_SEQ_FILE_CREATE(rcds, ibd->hfi1_ibdev_dbg, ibd);
 	DEBUGFS_SEQ_FILE_CREATE(sdma_cpu_list, ibd->hfi1_ibdev_dbg, ibd);
 	/* dev counter files */
 	for (i = 0; i < ARRAY_SIZE(cntr_ops); i++)
drivers/infiniband/hw/hfi1/driver.c +59 -0

62 lines not on this page · raw message

drivers/infiniband/hw/hfi1/hfi.h +1 -0
index b15749e..eadb735 100644
@@ -1987,6 +1987,7 @@ static inline void flush_wc(void)
 int kdeth_process_expected(struct hfi1_packet *packet);
 int kdeth_process_eager(struct hfi1_packet *packet);
 int process_receive_invalid(struct hfi1_packet *packet);
+void seqfile_dump_rcd(struct seq_file *s, struct hfi1_ctxtdata *rcd);
 
 /* global module parameter variables */
 extern unsigned int hfi1_max_mtu;

--
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

#13 lore raw
In reply to a message not in the archive
Quoted 14 lines · Dennis Dalessandro

Hi Doug,

Here is the next set of patches for our drivers for 4.14. One of these patches
gets rid of a config option that is no longer needed. There are some cleanups
as usual and minor bug fixes. Nothing that I would say needs to go into an RC.
These can all just land in your for-next tree and apply on top of that branch
with the addition of the pending patches still on the list. Everything applied
cleanly.

Quoted 6 lines

There is one patch to an OPA header file that addresses a question that Leon
had on the list about OPA physical port states.

Patches can can also be found in my GitHub repo at:
https://github.com/ddalessa/kernel/tree/for-4.14

Thanks Denny, series applied.

Signature · 8 lines
Doug Ledford <[email protected]>
    GPG KeyID: B826A3330E572FDD
    Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

--
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