Skip to contentSkip to conversation

staging/rdma/hfi1: Initial patches to add rdmavt support in HFI1

RFC PATCH Superseded Dennis Dalessandro 5 participants 25 messages Dec 14, 2015 – Jan 5, 2016 7 messages not in the archive

Subsystems (2)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

cover staging/rdma/hfi1: Initial patches to add rdmavt support in HFI1

This patch series is being submitted as a Request For Comment only. It depends on code submitted to the rdma subsystem [1].

This work is the first submission aimed to satisfy the TODO item for removing duplicated code in hfi1. At the time of submission hfi1 and qib contained alot of duplicated verbs processing code. The qib driver is having similar changes made to use rdmavt. This will result in a common code base that both drivers and future drivers such as soft-roce can use.

Note that due to the ongoing submission of hfi1 improvement patches, there will likely be a number of conflicts which will still need to be resolved.

We also are still faced with the issue of separate trees for this work as was discussed previously [2]. The result of that conversation was to keep the drivers in separate trees until the 4.5 merge window. We are hoping that after this merge window a single maintainer can take control of hfi1, qib, and rdmavt so that these patches can move forward and be applied.

For now though we would like to get feedback on these patches with more to follow.

[1] https://www.mail-archive.com/[email protected]/msg30074.html
[2] https://www.mail-archive.com/linux-rdma%40vger.kernel.org/msg29360.html

---

Dennis Dalessandro (15):
IB/hfi1: Begin to use rdmavt for verbs
IB/hfi1: Add basic rdmavt capability flags for hfi1 IB/hfi1: Consolidate dma ops for hfi1
IB/hfi1: Use rdmavt protection domain
IB/hfi1: Remove MR data structures from hfi1 IB/hfi1: Remove driver specific members from hfi1 qp type IB/hfi1: Add device specific info prints IB/hfi1: Use correct rdmavt header files after move. IB/hfi1: Use address handle in rdmavt and remove from hfi1 IB/hfi1: Implement hfi1 support for AH notification IB/hfi1: Remove hfi1 MR and hfi1 specific qp type IB/hfi1: Remove srq from hfi1
IB/hfi1: Remove ibport and use rdmavt version IB/hfi1: Remove mmap from hfi1
IB/hfi1: Use rdmavt pkey verbs function

 drivers/staging/rdma/hfi1/Kconfig       |    2 
 drivers/staging/rdma/hfi1/Makefile      |    4 
 drivers/staging/rdma/hfi1/chip.c        |   36 +-
 drivers/staging/rdma/hfi1/common.h      |    2 
 drivers/staging/rdma/hfi1/cq.c          |   20 +
 drivers/staging/rdma/hfi1/diag.c        |   13 -
 drivers/staging/rdma/hfi1/driver.c      |   31 +-
 drivers/staging/rdma/hfi1/hfi.h         |   27 +-
 drivers/staging/rdma/hfi1/init.c        |    5 
 drivers/staging/rdma/hfi1/intr.c        |    2 
 drivers/staging/rdma/hfi1/keys.c        |  356 ---------------------
 drivers/staging/rdma/hfi1/mad.c         |  163 +++++-----
 drivers/staging/rdma/hfi1/mmap.c        |  192 -----------
 drivers/staging/rdma/hfi1/mr.c          |  522 ------------------------------
 drivers/staging/rdma/hfi1/pio.c         |   10 -
 drivers/staging/rdma/hfi1/qp.c          |  214 +++++++-----
 drivers/staging/rdma/hfi1/qp.h          |   44 +--
 drivers/staging/rdma/hfi1/rc.c          |  155 +++++----
 drivers/staging/rdma/hfi1/ruc.c         |  161 +++++----
 drivers/staging/rdma/hfi1/sdma.h        |    8 
 drivers/staging/rdma/hfi1/srq.c         |   58 ++-
 drivers/staging/rdma/hfi1/sysfs.c       |   18 +
 drivers/staging/rdma/hfi1/trace.h       |   22 +
 drivers/staging/rdma/hfi1/uc.c          |   19 +
 drivers/staging/rdma/hfi1/ud.c          |   91 +++--
 drivers/staging/rdma/hfi1/verbs.c       |  526 +++++++++++--------------------
 drivers/staging/rdma/hfi1/verbs.h       |  531 ++++---------------------------
 drivers/staging/rdma/hfi1/verbs_mcast.c |   36 +-
 28 files changed, 843 insertions(+), 2425 deletions(-)
 delete mode 100644 drivers/staging/rdma/hfi1/keys.c
 delete mode 100644 drivers/staging/rdma/hfi1/mmap.c
 delete mode 100644 drivers/staging/rdma/hfi1/mr.c

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

#2 lore raw

RFC PATCH 1/15 IB/hfi1: Begin to use rdmavt for verbs

In reply to a message not in the archive

This patch begins to make use of rdmavt by registering with it and providing access to the header files. This is just the beginning of rdmavt support in hfi1.

---
 drivers/staging/rdma/hfi1/Kconfig |    2 +-
 drivers/staging/rdma/hfi1/chip.c  |    2 +-
 drivers/staging/rdma/hfi1/diag.c  |    2 +-
 drivers/staging/rdma/hfi1/hfi.h   |    1 +
 drivers/staging/rdma/hfi1/init.c  |    5 +++--
 drivers/staging/rdma/hfi1/intr.c  |    2 +-
 drivers/staging/rdma/hfi1/mad.c   |    5 +++--
 drivers/staging/rdma/hfi1/qp.c    |    4 ++--
 drivers/staging/rdma/hfi1/sysfs.c |   18 +++++++++---------
 drivers/staging/rdma/hfi1/verbs.c |   15 ++++++++++-----
 drivers/staging/rdma/hfi1/verbs.h |    8 ++++++--
 11 files changed, 38 insertions(+), 26 deletions(-)
drivers/staging/rdma/hfi1/Kconfig +1 -1
index fd25078..55048fe 100644
@@ -1,6 +1,6 @@
 config INFINIBAND_HFI1
 	tristate "Intel OPA Gen1 support"
-	depends on X86_64
+	depends on X86_64 && INFINIBAND_RDMAVT
 	default m
 	---help---
 	This is a low-level driver for Intel OPA Gen1 adapter.
drivers/staging/rdma/hfi1/chip.c +1 -1
index dc69159..f799b86 100644
@@ -6631,7 +6631,7 @@ int set_link_state(struct hfi1_pportdata *ppd, u32 state)
 			sdma_all_running(dd);
 
 			/* Signal the IB layer that the port has went active */
-			event.device = &dd->verbs_dev.ibdev;
+			event.device = &dd->verbs_dev.rdi.ibdev;
 			event.element.port_num = ppd->port;
 			event.event = IB_EVENT_PORT_ACTIVE;
 		}
drivers/staging/rdma/hfi1/diag.c +1 -1
index 0aaad74..0cf324d 100644
@@ -856,7 +856,7 @@ static ssize_t hfi1_snoop_write(struct file *fp, const char __user *data,
 			vl = sc4;
 		} else {
 			sl = (byte_two >> 4) & 0xf;
-			ibp = to_iport(&dd->verbs_dev.ibdev, 1);
+			ibp = to_iport(&dd->verbs_dev.rdi.ibdev, 1);
 			sc5 = ibp->sl_to_sc[sl];
 			vl = sc_to_vlt(dd, sc5);
 			if (vl != sc4) {
drivers/staging/rdma/hfi1/hfi.h +1 -0
index 54ed6b3..c4991be 100644
@@ -65,6 +65,7 @@
 #include <linux/cdev.h>
 #include <linux/delay.h>
 #include <linux/kthread.h>
+#include <rdma/rdma_vt.h>
 
 #include "chip_registers.h"
 #include "common.h"
drivers/staging/rdma/hfi1/init.c +3 -2
index 1c8286f..1f64e4e 100644
@@ -56,6 +56,7 @@
 #include <linux/module.h>
 #include <linux/printk.h>
 #include <linux/hrtimer.h>
+#include <rdma/rdma_vt.h>
 
 #include "hfi.h"
 #include "device.h"
@@ -985,7 +986,7 @@ void hfi1_free_devdata(struct hfi1_devdata *dd)
 	rcu_barrier(); /* wait for rcu callbacks to complete */
 	free_percpu(dd->int_counter);
 	free_percpu(dd->rcv_limit);
-	ib_dealloc_device(&dd->verbs_dev.ibdev);
+	ib_dealloc_device(&dd->verbs_dev.rdi.ibdev);
 }
 
 /*
@@ -1081,7 +1082,7 @@ struct hfi1_devdata *hfi1_alloc_devdata(struct pci_dev *pdev, size_t extra)
 bail:
 	if (!list_empty(&dd->list))
 		list_del_init(&dd->list);
-	ib_dealloc_device(&dd->verbs_dev.ibdev);
+	ib_dealloc_device(&dd->verbs_dev.rdi.ibdev);
 	return ERR_PTR(ret);
 }
 
drivers/staging/rdma/hfi1/intr.c +1 -1
index 426582b..1283f2d 100644
@@ -98,7 +98,7 @@ static void signal_ib_event(struct hfi1_pportdata *ppd, enum ib_event_type ev)
 	 */
 	if (!(dd->flags & HFI1_INITTED))
 		return;
-	event.device = &dd->verbs_dev.ibdev;
+	event.device = &dd->verbs_dev.rdi.ibdev;
 	event.element.port_num = ppd->port;
 	event.event = ev;
 	ib_dispatch_event(&event);
drivers/staging/rdma/hfi1/mad.c +3 -2
index a122565..1c34396 100644
@@ -1387,7 +1387,7 @@ static int set_pkeys(struct hfi1_devdata *dd, u8 port, u16 *pkeys)
 		(void)hfi1_set_ib_cfg(ppd, HFI1_IB_CFG_PKEYS, 0);
 
 		event.event = IB_EVENT_PKEY_CHANGE;
-		event.device = &dd->verbs_dev.ibdev;
+		event.device = &dd->verbs_dev.rdi.ibdev;
 		event.element.port_num = port;
 		ib_dispatch_event(&event);
 	}
@@ -4209,7 +4209,8 @@ int hfi1_create_agents(struct hfi1_ibdev *dev)
 
 	for (p = 0; p < dd->num_pports; p++) {
 		ibp = &dd->pport[p].ibport_data;
-		agent = ib_register_mad_agent(&dev->ibdev, p + 1, IB_QPT_SMI,
+		agent = ib_register_mad_agent(&dev->rdi.ibdev, p + 1,
+					      IB_QPT_SMI,
 					      NULL, 0, send_handler,
 					      NULL, NULL, 0);
 		if (IS_ERR(agent)) {
drivers/staging/rdma/hfi1/qp.c +2 -2
index ce03681..bb447b5 100644
@@ -1570,7 +1570,7 @@ struct qp_iter *qp_iter_init(struct hfi1_ibdev *dev)
 		return NULL;
 
 	iter->dev = dev;
-	iter->specials = dev->ibdev.phys_port_cnt * 2;
+	iter->specials = dev->rdi.ibdev.phys_port_cnt * 2;
 	if (qp_iter_next(iter)) {
 		kfree(iter);
 		return NULL;
@@ -1610,7 +1610,7 @@ int qp_iter_next(struct qp_iter *iter)
 				struct hfi1_ibport *ibp;
 				int pidx;
 
-				pidx = n % dev->ibdev.phys_port_cnt;
+				pidx = n % dev->rdi.ibdev.phys_port_cnt;
 				ppd = &dd_from_dev(dev)->pport[pidx];
 				ibp = &ppd->ibport_data;
 
drivers/staging/rdma/hfi1/sysfs.c +9 -9
index 1dd6727..d05b9f3 100644
@@ -446,7 +446,7 @@ static ssize_t show_rev(struct device *device, struct device_attribute *attr,
 			char *buf)
 {
 	struct hfi1_ibdev *dev =
-		container_of(device, struct hfi1_ibdev, ibdev.dev);
+		container_of(device, struct hfi1_ibdev, rdi.ibdev.dev);
 
 	return sprintf(buf, "%x\n", dd_from_dev(dev)->minrev);
 }
@@ -455,7 +455,7 @@ static ssize_t show_hfi(struct device *device, struct device_attribute *attr,
 			char *buf)
 {
 	struct hfi1_ibdev *dev =
-		container_of(device, struct hfi1_ibdev, ibdev.dev);
+		container_of(device, struct hfi1_ibdev, rdi.ibdev.dev);
 	struct hfi1_devdata *dd = dd_from_dev(dev);
 	int ret;
 
@@ -470,7 +470,7 @@ static ssize_t show_boardversion(struct device *device,
 				 struct device_attribute *attr, char *buf)
 {
 	struct hfi1_ibdev *dev =
-		container_of(device, struct hfi1_ibdev, ibdev.dev);
+		container_of(device, struct hfi1_ibdev, rdi.ibdev.dev);
 	struct hfi1_devdata *dd = dd_from_dev(dev);
 
 	/* The string printed here is already newline-terminated. */
@@ -482,7 +482,7 @@ static ssize_t show_nctxts(struct device *device,
 			   struct device_attribute *attr, char *buf)
 {
 	struct hfi1_ibdev *dev =
-		container_of(device, struct hfi1_ibdev, ibdev.dev);
+		container_of(device, struct hfi1_ibdev, rdi.ibdev.dev);
 	struct hfi1_devdata *dd = dd_from_dev(dev);
 
 	/*
@@ -500,7 +500,7 @@ static ssize_t show_nfreectxts(struct device *device,
 			   struct device_attribute *attr, char *buf)
 {
 	struct hfi1_ibdev *dev =
-		container_of(device, struct hfi1_ibdev, ibdev.dev);
+		container_of(device, struct hfi1_ibdev, rdi.ibdev.dev);
 	struct hfi1_devdata *dd = dd_from_dev(dev);
 
 	/* Return the number of free user ports (contexts) available. */
@@ -511,7 +511,7 @@ static ssize_t show_serial(struct device *device,
 			   struct device_attribute *attr, char *buf)
 {
 	struct hfi1_ibdev *dev =
-		container_of(device, struct hfi1_ibdev, ibdev.dev);
+		container_of(device, struct hfi1_ibdev, rdi.ibdev.dev);
 	struct hfi1_devdata *dd = dd_from_dev(dev);
 
 	return scnprintf(buf, PAGE_SIZE, "%s", dd->serial);
@@ -523,7 +523,7 @@ static ssize_t store_chip_reset(struct device *device,
 				size_t count)
 {
 	struct hfi1_ibdev *dev =
-		container_of(device, struct hfi1_ibdev, ibdev.dev);
+		container_of(device, struct hfi1_ibdev, rdi.ibdev.dev);
 	struct hfi1_devdata *dd = dd_from_dev(dev);
 	int ret;
 
@@ -552,7 +552,7 @@ static ssize_t show_tempsense(struct device *device,
 			      struct device_attribute *attr, char *buf)
 {
 	struct hfi1_ibdev *dev =
-		container_of(device, struct hfi1_ibdev, ibdev.dev);
+		container_of(device, struct hfi1_ibdev, rdi.ibdev.dev);
 	struct hfi1_devdata *dd = dd_from_dev(dev);
 	struct hfi1_temp temp;
 	int ret;
@@ -700,7 +700,7 @@ bail:
  */
 int hfi1_verbs_register_sysfs(struct hfi1_devdata *dd)
 {
-	struct ib_device *dev = &dd->verbs_dev.ibdev;
+	struct ib_device *dev = &dd->verbs_dev.rdi.ibdev;
 	int i, ret;
 
 	for (i = 0; i < ARRAY_SIZE(hfi1_attributes); ++i) {
drivers/staging/rdma/hfi1/verbs.c +10 -5
index ef0feaa..4292d52 100644
@@ -1903,7 +1903,7 @@ static void verbs_txreq_kmem_cache_ctor(void *obj)
 int hfi1_register_ib_device(struct hfi1_devdata *dd)
 {
 	struct hfi1_ibdev *dev = &dd->verbs_dev;
-	struct ib_device *ibdev = &dev->ibdev;
+	struct ib_device *ibdev = &dev->rdi.ibdev;
 	struct hfi1_pportdata *ppd = dd->pport;
 	unsigned i, lk_tab_size;
 	int ret;
@@ -2070,7 +2070,13 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
 	strncpy(ibdev->node_desc, init_utsname()->nodename,
 		sizeof(ibdev->node_desc));
 
-	ret = ib_register_device(ibdev, hfi1_create_port_files);
+	/*
+	 * Fill in rvt info object.
+	 */
+	dd->verbs_dev.rdi.driver_f.port_callback = hfi1_create_port_files;
+	dd->verbs_dev.rdi.dparms.props.max_pd = hfi1_max_pds;
+
+	ret = rvt_register_device(&dd->verbs_dev.rdi);
 	if (ret)
 		goto err_reg;
 
@@ -2087,7 +2093,7 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
 err_class:
 	hfi1_free_agents(dev);
 err_agents:
-	ib_unregister_device(ibdev);
+	rvt_unregister_device(&dd->verbs_dev.rdi);
 err_reg:
 err_verbs_txreq:
 	kmem_cache_destroy(dev->verbs_txreq_cache);
@@ -2103,13 +2109,12 @@ bail:
 void hfi1_unregister_ib_device(struct hfi1_devdata *dd)
 {
 	struct hfi1_ibdev *dev = &dd->verbs_dev;
-	struct ib_device *ibdev = &dev->ibdev;
 
 	hfi1_verbs_unregister_sysfs(dd);
 
 	hfi1_free_agents(dev);
 
-	ib_unregister_device(ibdev);
+	rvt_unregister_device(&dd->verbs_dev.rdi);
 
 	if (!list_empty(&dev->txwait))
 		dd_dev_err(dd, "txwait list not empty!\n");
drivers/staging/rdma/hfi1/verbs.h +6 -2
index 7e27531..a290ed3 100644
@@ -62,6 +62,7 @@
 #include <rdma/ib_pack.h>
 #include <rdma/ib_user_verbs.h>
 #include <rdma/ib_mad.h>
+#include <rdma/rdma_vt.h>
 
 struct hfi1_ctxtdata;
 struct hfi1_pportdata;
@@ -749,7 +750,7 @@ struct hfi1_ibport {
 
 struct hfi1_qp_ibdev;
 struct hfi1_ibdev {
-	struct ib_device ibdev;
+	struct rvt_dev_info rdi; /* Must be first */
 	struct list_head pending_mmaps;
 	spinlock_t mmap_offset_lock; /* protect mmap_offset */
 	u32 mmap_offset;
@@ -843,7 +844,10 @@ static inline struct hfi1_qp *to_iqp(struct ib_qp *ibqp)
 
 static inline struct hfi1_ibdev *to_idev(struct ib_device *ibdev)
 {
-	return container_of(ibdev, struct hfi1_ibdev, ibdev);
+	struct rvt_dev_info *rdi;
+
+	rdi = container_of(ibdev, struct rvt_dev_info, ibdev);
+	return container_of(rdi, struct hfi1_ibdev, rdi);
 }
 
 /*

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

RFC PATCH 2/15 IB/hfi1: Add basic rdmavt capability flags for hfi1

In reply to a message not in the archive

Most functionality is still being done in the driver, set flags so that rdmavt will let hfi1 continue to handle mr, qp, and cq init.

---
 drivers/staging/rdma/hfi1/verbs.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/staging/rdma/hfi1/verbs.c +3 -0
index 4292d52..c457e82 100644
@@ -2075,6 +2075,9 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
 	 */
 	dd->verbs_dev.rdi.driver_f.port_callback = hfi1_create_port_files;
 	dd->verbs_dev.rdi.dparms.props.max_pd = hfi1_max_pds;
+	dd->verbs_dev.rdi.flags = (RVT_FLAG_MR_INIT_DRIVER |
+				   RVT_FLAG_QP_INIT_DRIVER |
+				   RVT_FLAG_CQ_INIT_DRIVER);
 
 	ret = rvt_register_device(&dd->verbs_dev.rdi);
 	if (ret)

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

RFC PATCH 3/15 IB/hfi1: Consolidate dma ops for hfi1

In reply to a message not in the archive

Remove the dma.c file from hfi1 in favor of using that which is present in rdmavt.

---
 drivers/staging/rdma/hfi1/Makefile |    2 +-
 drivers/staging/rdma/hfi1/verbs.c  |    2 +-
 drivers/staging/rdma/hfi1/verbs.h  |    2 --
 3 files changed, 2 insertions(+), 4 deletions(-)
drivers/staging/rdma/hfi1/Makefile +1 -1
index 2e5daa6..2126b8b 100644
@@ -7,7 +7,7 @@
 #
 obj-$(CONFIG_INFINIBAND_HFI1) += hfi1.o
 
-hfi1-y := chip.o cq.o device.o diag.o dma.o driver.o eprom.o file_ops.o firmware.o \
+hfi1-y := chip.o cq.o device.o diag.o driver.o eprom.o file_ops.o firmware.o \
 	init.o intr.o keys.o mad.o mmap.o mr.o pcie.o pio.o pio_copy.o \
 	qp.o qsfp.o rc.o ruc.o sdma.o srq.o sysfs.o trace.o twsi.o \
 	uc.o ud.o user_pages.o user_sdma.o verbs_mcast.o verbs.o
drivers/staging/rdma/hfi1/verbs.c +1 -1
index c457e82..22e2742 100644
@@ -2064,7 +2064,7 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
 	ibdev->detach_mcast = hfi1_multicast_detach;
 	ibdev->process_mad = hfi1_process_mad;
 	ibdev->mmap = hfi1_mmap;
-	ibdev->dma_ops = &hfi1_dma_mapping_ops;
+	ibdev->dma_ops = NULL;
 	ibdev->get_port_immutable = port_immutable;
 
 	strncpy(ibdev->node_desc, init_utsname()->nodename,
drivers/staging/rdma/hfi1/verbs.h +0 -2
index a290ed3..4f23e00 100644
@@ -1155,6 +1155,4 @@ extern unsigned int hfi1_max_srq_wrs;
 
 extern const u32 ib_hfi1_rnr_table[];
 
-extern struct ib_dma_mapping_ops hfi1_dma_mapping_ops;
-
 #endif                          /* HFI1_VERBS_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

#5 lore raw

RFC PATCH 4/15 IB/hfi1: Use rdmavt protection domain

In reply to a message not in the archive

Remove protection domain from hfi1 and use rdmavt's version.

---
 drivers/staging/rdma/hfi1/keys.c  |    4 +-
 drivers/staging/rdma/hfi1/mr.c    |    2 +
 drivers/staging/rdma/hfi1/ruc.c   |    4 +-
 drivers/staging/rdma/hfi1/verbs.c |   67 +++----------------------------------
 drivers/staging/rdma/hfi1/verbs.h |   15 +-------
 5 files changed, 12 insertions(+), 80 deletions(-)
drivers/staging/rdma/hfi1/keys.c +2 -2
index cb4e608..57a266f 100644
@@ -176,7 +176,7 @@ out:
  * Check the IB SGE for validity and initialize our internal version
  * of it.
  */
-int hfi1_lkey_ok(struct hfi1_lkey_table *rkt, struct hfi1_pd *pd,
+int hfi1_lkey_ok(struct hfi1_lkey_table *rkt, struct rvt_pd *pd,
 		 struct hfi1_sge *isge, struct ib_sge *sge, int acc)
 {
 	struct hfi1_mregion *mr;
@@ -285,7 +285,7 @@ int hfi1_rkey_ok(struct hfi1_qp *qp, struct hfi1_sge *sge,
 	 */
 	rcu_read_lock();
 	if (rkey == 0) {
-		struct hfi1_pd *pd = to_ipd(qp->ibqp.pd);
+		struct rvt_pd *pd = ibpd_to_rvtpd(qp->ibqp.pd);
 		struct hfi1_ibdev *dev = to_idev(pd->ibpd.device);
 
 		if (pd->user)
drivers/staging/rdma/hfi1/mr.c +1 -1
index 568f185..02589b2 100644
@@ -116,7 +116,7 @@ struct ib_mr *hfi1_get_dma_mr(struct ib_pd *pd, int acc)
 	struct ib_mr *ret;
 	int rval;
 
-	if (to_ipd(pd)->user) {
+	if (ibpd_to_rvtpd(pd)->user) {
 		ret = ERR_PTR(-EPERM);
 		goto bail;
 	}
drivers/staging/rdma/hfi1/ruc.c +2 -2
index 317bf6f..eb7aea9 100644
@@ -102,11 +102,11 @@ static int init_sge(struct hfi1_qp *qp, struct hfi1_rwqe *wqe)
 	int i, j, ret;
 	struct ib_wc wc;
 	struct hfi1_lkey_table *rkt;
-	struct hfi1_pd *pd;
+	struct rvt_pd *pd;
 	struct hfi1_sge_state *ss;
 
 	rkt = &to_idev(qp->ibqp.device)->lk_table;
-	pd = to_ipd(qp->ibqp.srq ? qp->ibqp.srq->pd : qp->ibqp.pd);
+	pd = ibpd_to_rvtpd(qp->ibqp.srq ? qp->ibqp.srq->pd : qp->ibqp.pd);
 	ss = &qp->r_sge;
 	ss->sg_list = qp->r_sg_list;
 	qp->r_len = 0;
drivers/staging/rdma/hfi1/verbs.c +6 -61

103 lines not on this page · raw message

drivers/staging/rdma/hfi1/verbs.h +1 -14
index 4f23e00..9043e5d 100644
@@ -234,12 +234,6 @@ struct hfi1_mcast {
 	int n_attached;
 };
 
-/* Protection domain */
-struct hfi1_pd {
-	struct ib_pd ibpd;
-	int user;               /* non-zero if created from user space */
-};
-
 /* Address Handle */
 struct hfi1_ah {
 	struct ib_ah ibah;
@@ -776,8 +770,6 @@ struct hfi1_ibdev {
 	u64 n_kmem_wait;
 	u64 n_send_schedule;
 
-	u32 n_pds_allocated;    /* number of PDs allocated for device */
-	spinlock_t n_pds_lock;
 	u32 n_ahs_allocated;    /* number of AHs allocated for device */
 	spinlock_t n_ahs_lock;
 	u32 n_cqs_allocated;    /* number of CQs allocated for device */
@@ -817,11 +809,6 @@ static inline struct hfi1_mr *to_imr(struct ib_mr *ibmr)
 	return container_of(ibmr, struct hfi1_mr, ibmr);
 }
 
-static inline struct hfi1_pd *to_ipd(struct ib_pd *ibpd)
-{
-	return container_of(ibpd, struct hfi1_pd, ibpd);
-}
-
 static inline struct hfi1_ah *to_iah(struct ib_ah *ibah)
 {
 	return container_of(ibah, struct hfi1_ah, ibah);
@@ -983,7 +970,7 @@ int hfi1_alloc_lkey(struct hfi1_mregion *mr, int dma_region);
 
 void hfi1_free_lkey(struct hfi1_mregion *mr);
 
-int hfi1_lkey_ok(struct hfi1_lkey_table *rkt, struct hfi1_pd *pd,
+int hfi1_lkey_ok(struct hfi1_lkey_table *rkt, struct rvt_pd *pd,
 		 struct hfi1_sge *isge, struct ib_sge *sge, int acc);
 
 int hfi1_rkey_ok(struct hfi1_qp *qp, struct hfi1_sge *sge,

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

RFC PATCH 5/15 IB/hfi1: Remove MR data structures from hfi1

In reply to a message not in the archive

Remove MR data structures from hfi1 and use the version in rdmavt

---
 drivers/staging/rdma/hfi1/keys.c  |   30 +++++++++---------
 drivers/staging/rdma/hfi1/mr.c    |   22 ++++++-------
 drivers/staging/rdma/hfi1/ruc.c   |    4 +-
 drivers/staging/rdma/hfi1/sdma.h  |    2 +
 drivers/staging/rdma/hfi1/ud.c    |    2 +
 drivers/staging/rdma/hfi1/verbs.c |   16 +++++----
 drivers/staging/rdma/hfi1/verbs.h |   63 ++++++-------------------------------
 7 files changed, 48 insertions(+), 91 deletions(-)
drivers/staging/rdma/hfi1/keys.c +15 -15
index 57a266f..ffaaa6f 100644
@@ -63,21 +63,21 @@
  *
  */
 
-int hfi1_alloc_lkey(struct hfi1_mregion *mr, int dma_region)
+int hfi1_alloc_lkey(struct rvt_mregion *mr, int dma_region)
 {
 	unsigned long flags;
 	u32 r;
 	u32 n;
 	int ret = 0;
 	struct hfi1_ibdev *dev = to_idev(mr->pd->device);
-	struct hfi1_lkey_table *rkt = &dev->lk_table;
+	struct rvt_lkey_table *rkt = &dev->lk_table;
 
 	hfi1_get_mr(mr);
 	spin_lock_irqsave(&rkt->lock, flags);
 
 	/* special case for dma_mr lkey == 0 */
 	if (dma_region) {
-		struct hfi1_mregion *tmr;
+		struct rvt_mregion *tmr;
 
 		tmr = rcu_access_pointer(dev->dma_mr);
 		if (!tmr) {
@@ -133,13 +133,13 @@ bail:
  * hfi1_free_lkey - free an lkey
  * @mr: mr to free from tables
  */
-void hfi1_free_lkey(struct hfi1_mregion *mr)
+void hfi1_free_lkey(struct rvt_mregion *mr)
 {
 	unsigned long flags;
 	u32 lkey = mr->lkey;
 	u32 r;
 	struct hfi1_ibdev *dev = to_idev(mr->pd->device);
-	struct hfi1_lkey_table *rkt = &dev->lk_table;
+	struct rvt_lkey_table *rkt = &dev->lk_table;
 	int freed = 0;
 
 	spin_lock_irqsave(&rkt->lock, flags);
@@ -176,10 +176,10 @@ out:
  * Check the IB SGE for validity and initialize our internal version
  * of it.
  */
-int hfi1_lkey_ok(struct hfi1_lkey_table *rkt, struct rvt_pd *pd,
+int hfi1_lkey_ok(struct rvt_lkey_table *rkt, struct rvt_pd *pd,
 		 struct hfi1_sge *isge, struct ib_sge *sge, int acc)
 {
-	struct hfi1_mregion *mr;
+	struct rvt_mregion *mr;
 	unsigned n, m;
 	size_t off;
 
@@ -231,15 +231,15 @@ int hfi1_lkey_ok(struct hfi1_lkey_table *rkt, struct rvt_pd *pd,
 
 		entries_spanned_by_off = off >> mr->page_shift;
 		off -= (entries_spanned_by_off << mr->page_shift);
-		m = entries_spanned_by_off / HFI1_SEGSZ;
-		n = entries_spanned_by_off % HFI1_SEGSZ;
+		m = entries_spanned_by_off / RVT_SEGSZ;
+		n = entries_spanned_by_off % RVT_SEGSZ;
 	} else {
 		m = 0;
 		n = 0;
 		while (off >= mr->map[m]->segs[n].length) {
 			off -= mr->map[m]->segs[n].length;
 			n++;
-			if (n >= HFI1_SEGSZ) {
+			if (n >= RVT_SEGSZ) {
 				m++;
 				n = 0;
 			}
@@ -274,8 +274,8 @@ bail:
 int hfi1_rkey_ok(struct hfi1_qp *qp, struct hfi1_sge *sge,
 		 u32 len, u64 vaddr, u32 rkey, int acc)
 {
-	struct hfi1_lkey_table *rkt = &to_idev(qp->ibqp.device)->lk_table;
-	struct hfi1_mregion *mr;
+	struct rvt_lkey_table *rkt = &to_idev(qp->ibqp.device)->lk_table;
+	struct rvt_mregion *mr;
 	unsigned n, m;
 	size_t off;
 
@@ -328,15 +328,15 @@ int hfi1_rkey_ok(struct hfi1_qp *qp, struct hfi1_sge *sge,
 
 		entries_spanned_by_off = off >> mr->page_shift;
 		off -= (entries_spanned_by_off << mr->page_shift);
-		m = entries_spanned_by_off / HFI1_SEGSZ;
-		n = entries_spanned_by_off % HFI1_SEGSZ;
+		m = entries_spanned_by_off / RVT_SEGSZ;
+		n = entries_spanned_by_off % RVT_SEGSZ;
 	} else {
 		m = 0;
 		n = 0;
 		while (off >= mr->map[m]->segs[n].length) {
 			off -= mr->map[m]->segs[n].length;
 			n++;
-			if (n >= HFI1_SEGSZ) {
+			if (n >= RVT_SEGSZ) {
 				m++;
 				n = 0;
 			}
drivers/staging/rdma/hfi1/mr.c +11 -11
index 02589b2..27f8081 100644
@@ -56,7 +56,7 @@
 /* Fast memory region */
 struct hfi1_fmr {
 	struct ib_fmr ibfmr;
-	struct hfi1_mregion mr;        /* must be last */
+	struct rvt_mregion mr;        /* must be last */
 };
 
 static inline struct hfi1_fmr *to_ifmr(struct ib_fmr *ibfmr)
@@ -64,13 +64,13 @@ static inline struct hfi1_fmr *to_ifmr(struct ib_fmr *ibfmr)
 	return container_of(ibfmr, struct hfi1_fmr, ibfmr);
 }
 
-static int init_mregion(struct hfi1_mregion *mr, struct ib_pd *pd,
+static int init_mregion(struct rvt_mregion *mr, struct ib_pd *pd,
 			int count)
 {
 	int m, i = 0;
 	int rval = 0;
 
-	m = (count + HFI1_SEGSZ - 1) / HFI1_SEGSZ;
+	m = (count + RVT_SEGSZ - 1) / RVT_SEGSZ;
 	for (; i < m; i++) {
 		mr->map[i] = kzalloc(sizeof(*mr->map[0]), GFP_KERNEL);
 		if (!mr->map[i])
@@ -91,7 +91,7 @@ bail:
 	goto out;
 }
 
-static void deinit_mregion(struct hfi1_mregion *mr)
+static void deinit_mregion(struct rvt_mregion *mr)
 {
 	int i = mr->mapsz;
 
@@ -159,7 +159,7 @@ static struct hfi1_mr *alloc_mr(int count, struct ib_pd *pd)
 	int m;
 
 	/* Allocate struct plus pointers to first level page tables. */
-	m = (count + HFI1_SEGSZ - 1) / HFI1_SEGSZ;
+	m = (count + RVT_SEGSZ - 1) / RVT_SEGSZ;
 	mr = kzalloc(sizeof(*mr) + m * sizeof(mr->mr.map[0]), GFP_KERNEL);
 	if (!mr)
 		goto bail;
@@ -221,7 +221,7 @@ struct ib_mr *hfi1_reg_phys_mr(struct ib_pd *pd,
 		mr->mr.map[m]->segs[n].length = buffer_list[i].size;
 		mr->mr.length += buffer_list[i].size;
 		n++;
-		if (n == HFI1_SEGSZ) {
+		if (n == RVT_SEGSZ) {
 			m++;
 			n = 0;
 		}
@@ -294,7 +294,7 @@ struct ib_mr *hfi1_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
 		mr->mr.map[m]->segs[n].vaddr = vaddr;
 		mr->mr.map[m]->segs[n].length = umem->page_size;
 		n++;
-		if (n == HFI1_SEGSZ) {
+		if (n == RVT_SEGSZ) {
 			m++;
 			n = 0;
 		}
@@ -382,7 +382,7 @@ struct ib_fmr *hfi1_alloc_fmr(struct ib_pd *pd, int mr_access_flags,
 	int rval = -ENOMEM;
 
 	/* Allocate struct plus pointers to first level page tables. */
-	m = (fmr_attr->max_pages + HFI1_SEGSZ - 1) / HFI1_SEGSZ;
+	m = (fmr_attr->max_pages + RVT_SEGSZ - 1) / RVT_SEGSZ;
 	fmr = kzalloc(sizeof(*fmr) + m * sizeof(fmr->mr.map[0]), GFP_KERNEL);
 	if (!fmr)
 		goto bail;
@@ -434,7 +434,7 @@ int hfi1_map_phys_fmr(struct ib_fmr *ibfmr, u64 *page_list,
 		      int list_len, u64 iova)
 {
 	struct hfi1_fmr *fmr = to_ifmr(ibfmr);
-	struct hfi1_lkey_table *rkt;
+	struct rvt_lkey_table *rkt;
 	unsigned long flags;
 	int m, n, i;
 	u32 ps;
@@ -459,7 +459,7 @@ int hfi1_map_phys_fmr(struct ib_fmr *ibfmr, u64 *page_list,
 	for (i = 0; i < list_len; i++) {
 		fmr->mr.map[m]->segs[n].vaddr = (void *) page_list[i];
 		fmr->mr.map[m]->segs[n].length = ps;
-		if (++n == HFI1_SEGSZ) {
+		if (++n == RVT_SEGSZ) {
 			m++;
 			n = 0;
 		}
@@ -480,7 +480,7 @@ bail:
 int hfi1_unmap_fmr(struct list_head *fmr_list)
 {
 	struct hfi1_fmr *fmr;
-	struct hfi1_lkey_table *rkt;
+	struct rvt_lkey_table *rkt;
 	unsigned long flags;
 
 	list_for_each_entry(fmr, fmr_list, ibfmr.list) {
drivers/staging/rdma/hfi1/ruc.c +2 -2
index eb7aea9..1c9c054 100644
@@ -101,7 +101,7 @@ static int init_sge(struct hfi1_qp *qp, struct hfi1_rwqe *wqe)
 {
 	int i, j, ret;
 	struct ib_wc wc;
-	struct hfi1_lkey_table *rkt;
+	struct rvt_lkey_table *rkt;
 	struct rvt_pd *pd;
 	struct hfi1_sge_state *ss;
 
@@ -532,7 +532,7 @@ again:
 			if (--sqp->s_sge.num_sge)
 				*sge = *sqp->s_sge.sg_list++;
 		} else if (sge->length == 0 && sge->mr->lkey) {
-			if (++sge->n >= HFI1_SEGSZ) {
+			if (++sge->n >= RVT_SEGSZ) {
 				if (++sge->m >= sge->mr->mapsz)
 					break;
 				sge->n = 0;
drivers/staging/rdma/hfi1/sdma.h +1 -1
index 85701ee..664b251 100644
@@ -381,7 +381,7 @@ struct verbs_txreq {
 	struct sdma_txreq       txreq;
 	struct hfi1_qp           *qp;
 	struct hfi1_swqe         *wqe;
-	struct hfi1_mregion	*mr;
+	struct rvt_mregion	*mr;
 	struct hfi1_sge_state    *ss;
 	struct sdma_engine     *sde;
 	u16                     hdr_dwords;
drivers/staging/rdma/hfi1/ud.c +1 -1
index 54ff1f5..969335a 100644
@@ -211,7 +211,7 @@ static void ud_loopback(struct hfi1_qp *sqp, struct hfi1_swqe *swqe)
 			if (--ssge.num_sge)
 				*sge = *ssge.sg_list++;
 		} else if (sge->length == 0 && sge->mr->lkey) {
-			if (++sge->n >= HFI1_SEGSZ) {
+			if (++sge->n >= RVT_SEGSZ) {
 				if (++sge->m >= sge->mr->mapsz)
 					break;
 				sge->n = 0;
drivers/staging/rdma/hfi1/verbs.c +8 -8
index 1390755..9abf691 100644
@@ -300,7 +300,7 @@ void hfi1_copy_sge(
 			if (--ss->num_sge)
 				*sge = *ss->sg_list++;
 		} else if (sge->length == 0 && sge->mr->lkey) {
-			if (++sge->n >= HFI1_SEGSZ) {
+			if (++sge->n >= RVT_SEGSZ) {
 				if (++sge->m >= sge->mr->mapsz)
 					break;
 				sge->n = 0;
@@ -341,7 +341,7 @@ void hfi1_skip_sge(struct hfi1_sge_state *ss, u32 length, int release)
 			if (--ss->num_sge)
 				*sge = *ss->sg_list++;
 		} else if (sge->length == 0 && sge->mr->lkey) {
-			if (++sge->n >= HFI1_SEGSZ) {
+			if (++sge->n >= RVT_SEGSZ) {
 				if (++sge->m >= sge->mr->mapsz)
 					break;
 				sge->n = 0;
@@ -367,7 +367,7 @@ static int post_one_send(struct hfi1_qp *qp, struct ib_send_wr *wr)
 	int i;
 	int j;
 	int acc;
-	struct hfi1_lkey_table *rkt;
+	struct rvt_lkey_table *rkt;
 	struct rvt_pd *pd;
 	struct hfi1_devdata *dd = dd_from_ibdev(qp->ibqp.device);
 	struct hfi1_pportdata *ppd;
@@ -725,7 +725,7 @@ void update_sge(struct hfi1_sge_state *ss, u32 length)
 		if (--ss->num_sge)
 			*sge = *ss->sg_list++;
 	} else if (sge->length == 0 && sge->mr->lkey) {
-		if (++sge->n >= HFI1_SEGSZ) {
+		if (++sge->n >= RVT_SEGSZ) {
 			if (++sge->m >= sge->mr->mapsz)
 				return;
 			sge->n = 0;
@@ -1883,13 +1883,13 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
 	spin_lock_init(&dev->lk_table.lock);
 	dev->lk_table.max = 1 << hfi1_lkey_table_size;
 	/* ensure generation is at least 4 bits (keys.c) */
-	if (hfi1_lkey_table_size > MAX_LKEY_TABLE_BITS) {
+	if (hfi1_lkey_table_size > RVT_MAX_LKEY_TABLE_BITS) {
 		dd_dev_warn(dd, "lkey bits %u too large, reduced to %u\n",
-			      hfi1_lkey_table_size, MAX_LKEY_TABLE_BITS);
-		hfi1_lkey_table_size = MAX_LKEY_TABLE_BITS;
+			      hfi1_lkey_table_size, RVT_MAX_LKEY_TABLE_BITS);
+		hfi1_lkey_table_size = RVT_MAX_LKEY_TABLE_BITS;
 	}
 	lk_tab_size = dev->lk_table.max * sizeof(*dev->lk_table.table);
-	dev->lk_table.table = (struct hfi1_mregion __rcu **)
+	dev->lk_table.table = (struct rvt_mregion __rcu **)
 		vmalloc(lk_tab_size);
 	if (dev->lk_table.table == NULL) {
 		ret = -ENOMEM;
drivers/staging/rdma/hfi1/verbs.h +10 -53

119 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

#29 lore raw

RFC PATCH 6/15 IB/hfi1: Remove driver specific members from hfi1 qp type

In reply to Dennis Dalessandro

In preparation for moving the queue pair data structure to rdmavt the members of the driver specific queue pairs which are not common need to be pushed off to a private driver structure. This structure will be available in the queue pair once moved to rdmavt as a void pointer. This patch while not adding a lot of value in and of itself is a prerequisite to move the queue pair out of the drivers and into rdmavt.

The driver specific, private queue pair data structure should condense as more of the send side code moves to rdmavt.

---
 drivers/staging/rdma/hfi1/diag.c  |    3 +
 drivers/staging/rdma/hfi1/pio.c   |    6 ++-
 drivers/staging/rdma/hfi1/qp.c    |   76 ++++++++++++++++++++++++-------------
 drivers/staging/rdma/hfi1/qp.h    |    9 +++-
 drivers/staging/rdma/hfi1/rc.c    |    7 ++-
 drivers/staging/rdma/hfi1/ruc.c   |   46 ++++++++++++----------
 drivers/staging/rdma/hfi1/uc.c    |    7 ++-
 drivers/staging/rdma/hfi1/ud.c    |   37 +++++++++---------
 drivers/staging/rdma/hfi1/verbs.c |   54 ++++++++++++++++----------
 drivers/staging/rdma/hfi1/verbs.h |   26 ++++++++++---
 10 files changed, 166 insertions(+), 105 deletions(-)
drivers/staging/rdma/hfi1/diag.c +2 -1
index 0cf324d..e172f2a 100644
@@ -1634,7 +1634,8 @@ int snoop_send_dma_handler(struct hfi1_qp *qp, struct hfi1_pkt_state *ps,
 int snoop_send_pio_handler(struct hfi1_qp *qp, struct hfi1_pkt_state *ps,
 			   u64 pbc)
 {
-	struct ahg_ib_header *ahdr = qp->s_hdr;
+	struct hfi1_qp_priv *priv = qp->priv;
+	struct ahg_ib_header *ahdr = priv->s_hdr;
 	u32 hdrwords = qp->s_hdrwords;
 	struct hfi1_sge_state *ss = qp->s_cur_sge;
 	u32 len = qp->s_cur_size;
drivers/staging/rdma/hfi1/pio.c +4 -2
index eab58c1..b5bce5e 100644
@@ -1498,6 +1498,7 @@ static void sc_piobufavail(struct send_context *sc)
 	struct list_head *list;
 	struct hfi1_qp *qps[PIO_WAIT_BATCH_SIZE];
 	struct hfi1_qp *qp;
+	struct hfi1_qp_priv *priv;
 	unsigned long flags;
 	unsigned i, n = 0;
 
@@ -1517,8 +1518,9 @@ static void sc_piobufavail(struct send_context *sc)
 		if (n == ARRAY_SIZE(qps))
 			goto full;
 		wait = list_first_entry(list, struct iowait, list);
-		qp = container_of(wait, struct hfi1_qp, s_iowait);
-		list_del_init(&qp->s_iowait.list);
+		qp = iowait_to_qp(wait);
+		priv = qp->priv;
+		list_del_init(&priv->s_iowait.list);
 		/* refcount held until actual wake up */
 		qps[n++] = qp;
 	}
drivers/staging/rdma/hfi1/qp.c +49 -27

237 lines not on this page · raw message

drivers/staging/rdma/hfi1/qp.h +6 -3
index 94fd748..1d34c22 100644
@@ -123,9 +123,11 @@ static inline struct hfi1_qp *hfi1_lookup_qpn(struct hfi1_ibport *ibp,
  */
 static inline void clear_ahg(struct hfi1_qp *qp)
 {
-	qp->s_hdr->ahgcount = 0;
+	struct hfi1_qp_priv *priv = qp->priv;
+
+	priv->s_hdr->ahgcount = 0;
 	qp->s_flags &= ~(HFI1_S_AHG_VALID | HFI1_S_AHG_CLEAR);
-	if (qp->s_sde && qp->s_ahgidx >= 0)
+	if (qp->s_sde)
 		sdma_ahg_free(qp->s_sde, qp->s_ahgidx);
 	qp->s_ahgidx = -1;
 }
@@ -257,12 +259,13 @@ void qp_comm_est(struct hfi1_qp *qp);
  */
 static inline void _hfi1_schedule_send(struct hfi1_qp *qp)
 {
+	struct hfi1_qp_priv *priv = qp->priv;
 	struct hfi1_ibport *ibp =
 		to_iport(qp->ibqp.device, qp->port_num);
 	struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);
 	struct hfi1_devdata *dd = dd_from_ibdev(qp->ibqp.device);
 
-	iowait_schedule(&qp->s_iowait, ppd->hfi1_wq,
+	iowait_schedule(&priv->s_iowait, ppd->hfi1_wq,
 			qp->s_sde ?
 			qp->s_sde->cpu :
 			cpumask_first(cpumask_of_node(dd->assigned_node_id)));
drivers/staging/rdma/hfi1/rc.c +4 -3
index 6f4a155..d830a8f 100644
@@ -259,6 +259,7 @@ bail:
  */
 int hfi1_make_rc_req(struct hfi1_qp *qp)
 {
+	struct hfi1_qp_priv *priv = qp->priv;
 	struct hfi1_ibdev *dev = to_idev(qp->ibqp.device);
 	struct hfi1_other_headers *ohdr;
 	struct hfi1_sge_state *ss;
@@ -275,9 +276,9 @@ int hfi1_make_rc_req(struct hfi1_qp *qp)
 	int middle = 0;
 	int delta;
 
-	ohdr = &qp->s_hdr->ibh.u.oth;
+	ohdr = &priv->s_hdr->ibh.u.oth;
 	if (qp->remote_ah_attr.ah_flags & IB_AH_GRH)
-		ohdr = &qp->s_hdr->ibh.u.l.oth;
+		ohdr = &priv->s_hdr->ibh.u.l.oth;
 
 	/*
 	 * The lock is needed to synchronize between the sending tasklet,
@@ -297,7 +298,7 @@ int hfi1_make_rc_req(struct hfi1_qp *qp)
 		if (qp->s_last == qp->s_head)
 			goto bail;
 		/* If DMAs are in progress, we can't flush immediately. */
-		if (atomic_read(&qp->s_iowait.sdma_busy)) {
+		if (atomic_read(&priv->s_iowait.sdma_busy)) {
 			qp->s_flags |= HFI1_S_WAIT_DMA;
 			goto bail;
 		}
drivers/staging/rdma/hfi1/ruc.c +24 -22

104 lines not on this page · raw message

drivers/staging/rdma/hfi1/uc.c +4 -3
index 4f2a788..1908a28 100644
@@ -63,6 +63,7 @@
  */
 int hfi1_make_uc_req(struct hfi1_qp *qp)
 {
+	struct hfi1_qp_priv *priv = qp->priv;
 	struct hfi1_other_headers *ohdr;
 	struct hfi1_swqe *wqe;
 	unsigned long flags;
@@ -82,7 +83,7 @@ int hfi1_make_uc_req(struct hfi1_qp *qp)
 		if (qp->s_last == qp->s_head)
 			goto bail;
 		/* If DMAs are in progress, we can't flush immediately. */
-		if (atomic_read(&qp->s_iowait.sdma_busy)) {
+		if (atomic_read(&priv->s_iowait.sdma_busy)) {
 			qp->s_flags |= HFI1_S_WAIT_DMA;
 			goto bail;
 		}
@@ -92,9 +93,9 @@ int hfi1_make_uc_req(struct hfi1_qp *qp)
 		goto done;
 	}
 
-	ohdr = &qp->s_hdr->ibh.u.oth;
+	ohdr = &priv->s_hdr->ibh.u.oth;
 	if (qp->remote_ah_attr.ah_flags & IB_AH_GRH)
-		ohdr = &qp->s_hdr->ibh.u.l.oth;
+		ohdr = &priv->s_hdr->ibh.u.l.oth;
 
 	/* Get the next send request. */
 	wqe = get_swqe_ptr(qp, qp->s_cur);
drivers/staging/rdma/hfi1/ud.c +19 -18
index 969335a..ba8a557 100644
@@ -265,6 +265,7 @@ drop:
  */
 int hfi1_make_ud_req(struct hfi1_qp *qp)
 {
+	struct hfi1_qp_priv *priv = qp->priv;
 	struct hfi1_other_headers *ohdr;
 	struct ib_ah_attr *ah_attr;
 	struct hfi1_pportdata *ppd;
@@ -289,7 +290,7 @@ int hfi1_make_ud_req(struct hfi1_qp *qp)
 		if (qp->s_last == qp->s_head)
 			goto bail;
 		/* If DMAs are in progress, we can't flush immediately. */
-		if (atomic_read(&qp->s_iowait.sdma_busy)) {
+		if (atomic_read(&priv->s_iowait.sdma_busy)) {
 			qp->s_flags |= HFI1_S_WAIT_DMA;
 			goto bail;
 		}
@@ -323,7 +324,7 @@ int hfi1_make_ud_req(struct hfi1_qp *qp)
 			 * Instead of waiting, we could queue a
 			 * zero length descriptor so we get a callback.
 			 */
-			if (atomic_read(&qp->s_iowait.sdma_busy)) {
+			if (atomic_read(&priv->s_iowait.sdma_busy)) {
 				qp->s_flags |= HFI1_S_WAIT_DMA;
 				goto bail;
 			}
@@ -354,11 +355,11 @@ int hfi1_make_ud_req(struct hfi1_qp *qp)
 
 	if (ah_attr->ah_flags & IB_AH_GRH) {
 		/* Header size in 32-bit words. */
-		qp->s_hdrwords += hfi1_make_grh(ibp, &qp->s_hdr->ibh.u.l.grh,
+		qp->s_hdrwords += hfi1_make_grh(ibp, &priv->s_hdr->ibh.u.l.grh,
 					       &ah_attr->grh,
 					       qp->s_hdrwords, nwords);
 		lrh0 = HFI1_LRH_GRH;
-		ohdr = &qp->s_hdr->ibh.u.l.oth;
+		ohdr = &priv->s_hdr->ibh.u.l.oth;
 		/*
 		 * Don't worry about sending to locally attached multicast
 		 * QPs.  It is unspecified by the spec. what happens.
@@ -366,7 +367,7 @@ int hfi1_make_ud_req(struct hfi1_qp *qp)
 	} else {
 		/* Header size in 32-bit words. */
 		lrh0 = HFI1_LRH_BTH;
-		ohdr = &qp->s_hdr->ibh.u.oth;
+		ohdr = &priv->s_hdr->ibh.u.oth;
 	}
 	if (wqe->wr.opcode == IB_WR_SEND_WITH_IMM) {
 		qp->s_hdrwords++;
@@ -378,25 +379,25 @@ int hfi1_make_ud_req(struct hfi1_qp *qp)
 	lrh0 |= (ah_attr->sl & 0xf) << 4;
 	if (qp->ibqp.qp_type == IB_QPT_SMI) {
 		lrh0 |= 0xF000; /* Set VL (see ch. 13.5.3.1) */
-		qp->s_sc = 0xf;
+		priv->s_sc = 0xf;
 	} else {
 		lrh0 |= (sc5 & 0xf) << 12;
-		qp->s_sc = sc5;
+		priv->s_sc = sc5;
 	}
-	qp->s_sde = qp_to_sdma_engine(qp, qp->s_sc);
-	qp->s_hdr->ibh.lrh[0] = cpu_to_be16(lrh0);
-	qp->s_hdr->ibh.lrh[1] = cpu_to_be16(ah_attr->dlid);  /* DEST LID */
-	qp->s_hdr->ibh.lrh[2] =
+	qp->s_sde = qp_to_sdma_engine(qp, priv->s_sc);
+	priv->s_hdr->ibh.lrh[0] = cpu_to_be16(lrh0);
+	priv->s_hdr->ibh.lrh[1] = cpu_to_be16(ah_attr->dlid);  /* DEST LID */
+	priv->s_hdr->ibh.lrh[2] =
 		cpu_to_be16(qp->s_hdrwords + nwords + SIZE_OF_CRC);
 	if (ah_attr->dlid == be16_to_cpu(IB_LID_PERMISSIVE))
-		qp->s_hdr->ibh.lrh[3] = IB_LID_PERMISSIVE;
+		priv->s_hdr->ibh.lrh[3] = IB_LID_PERMISSIVE;
 	else {
 		lid = ppd->lid;
 		if (lid) {
 			lid |= ah_attr->src_path_bits & ((1 << ppd->lmc) - 1);
-			qp->s_hdr->ibh.lrh[3] = cpu_to_be16(lid);
+			priv->s_hdr->ibh.lrh[3] = cpu_to_be16(lid);
 		} else
-			qp->s_hdr->ibh.lrh[3] = IB_LID_PERMISSIVE;
+			priv->s_hdr->ibh.lrh[3] = IB_LID_PERMISSIVE;
 	}
 	if (wqe->wr.send_flags & IB_SEND_SOLICITED)
 		bth0 |= IB_BTH_SOLICITED;
@@ -416,10 +417,10 @@ int hfi1_make_ud_req(struct hfi1_qp *qp)
 					 qp->qkey : wqe->ud_wr.remote_qkey);
 	ohdr->u.ud.deth[1] = cpu_to_be32(qp->ibqp.qp_num);
 	/* disarm any ahg */
-	qp->s_hdr->ahgcount = 0;
-	qp->s_hdr->ahgidx = 0;
-	qp->s_hdr->tx_flags = 0;
-	qp->s_hdr->sde = NULL;
+	priv->s_hdr->ahgcount = 0;
+	priv->s_hdr->ahgidx = 0;
+	priv->s_hdr->tx_flags = 0;
+	priv->s_hdr->sde = NULL;
 
 done:
 	ret = 1;
drivers/staging/rdma/hfi1/verbs.c +33 -21

188 lines not on this page · raw message

drivers/staging/rdma/hfi1/verbs.h +21 -5
index d80111f..e35c918 100644
@@ -387,6 +387,18 @@ struct hfi1_ack_entry {
 };
 
 /*
+ * hfi1 specific data structures that will be hidden from rvt after the queue
+ * pair is made common
+ */
+struct hfi1_qp;
+struct hfi1_qp_priv {
+	struct ahg_ib_header *s_hdr; /* next packet header to send */
+	u8 s_sc;		     /* SC[0..4] for next packet */
+	struct iowait s_iowait;
+	struct hfi1_qp *owner;
+};
+
+/*
  * Variables prefixed with s_ are for the requester (sender).
  * Variables prefixed with r_ are for the responder (receiver).
  * Variables prefixed with ack_ are for responder replies.
@@ -396,15 +408,13 @@ struct hfi1_ack_entry {
  */
 struct hfi1_qp {
 	struct ib_qp ibqp;
+	void *priv;
 	/* read mostly fields above and below */
 	struct ib_ah_attr remote_ah_attr;
 	struct ib_ah_attr alt_ah_attr;
 	struct hfi1_qp __rcu *next;           /* link list for QPN hash table */
 	struct hfi1_swqe *s_wq;  /* send work queue */
 	struct hfi1_mmap_info *ip;
-	struct ahg_ib_header *s_hdr;     /* next packet header to send */
-	/* sc for UC/RC QPs - based on ah for UD */
-	u8 s_sc;
 	unsigned long timeout_jiffies;  /* computed from timeout */
 
 	enum ib_mtu path_mtu;
@@ -501,8 +511,6 @@ struct hfi1_qp {
 	struct hfi1_sge_state s_ack_rdma_sge;
 	struct timer_list s_timer;
 
-	struct iowait s_iowait;
-
 	struct hfi1_sge r_sg_list[0] /* verified SGEs */
 		____cacheline_aligned_in_smp;
 };
@@ -794,6 +802,14 @@ static inline struct hfi1_ibdev *to_idev(struct ib_device *ibdev)
 	return container_of(rdi, struct hfi1_ibdev, rdi);
 }
 
+static inline struct hfi1_qp *iowait_to_qp(struct  iowait *s_iowait)
+{
+	struct hfi1_qp_priv *priv;
+
+	priv = container_of(s_iowait, struct hfi1_qp_priv, s_iowait);
+	return priv->owner;
+}
+
 /*
  * Send if not busy or waiting for I/O and either
  * a RC response is pending or we can process send work requests.
#30 lore raw

RFC PATCH 7/15 IB/hfi1: Add device specific info prints

In reply to Dennis Dalessandro

Implement get_card_name and get_pci_dev helper functions for rdmavt for hfi1.

---
 drivers/staging/rdma/hfi1/driver.c |   16 ++++++++++++++++
 drivers/staging/rdma/hfi1/hfi.h    |    2 ++
 drivers/staging/rdma/hfi1/verbs.c  |    2 ++
 3 files changed, 20 insertions(+), 0 deletions(-)
drivers/staging/rdma/hfi1/driver.c +16 -0
index 4c52e78..4f0103b 100644
@@ -162,6 +162,22 @@ const char *get_unit_name(int unit)
 	return iname;
 }
 
+const char *get_card_name(struct rvt_dev_info *rdi)
+{
+	struct hfi1_ibdev *ibdev = container_of(rdi, struct hfi1_ibdev, rdi);
+	struct hfi1_devdata *dd = container_of(ibdev,
+					       struct hfi1_devdata, verbs_dev);
+	return get_unit_name(dd->unit);
+}
+
+struct pci_dev *get_pci_dev(struct rvt_dev_info *rdi)
+{
+	struct hfi1_ibdev *ibdev = container_of(rdi, struct hfi1_ibdev, rdi);
+	struct hfi1_devdata *dd = container_of(ibdev,
+					       struct hfi1_devdata, verbs_dev);
+	return dd->pcidev;
+}
+
 /*
  * Return count of units with at least one port ACTIVE.
  */
drivers/staging/rdma/hfi1/hfi.h +2 -0
index c4991be..5925deb 100644
@@ -1604,6 +1604,8 @@ int get_platform_config_field(struct hfi1_devdata *dd,
 dma_addr_t hfi1_map_page(struct pci_dev *, struct page *, unsigned long,
 			 size_t, int);
 const char *get_unit_name(int unit);
+const char *get_card_name(struct rvt_dev_info *rdi);
+struct pci_dev *get_pci_dev(struct rvt_dev_info *rdi);
 
 /*
  * Flush write combining store buffers (if present) and perform a write
drivers/staging/rdma/hfi1/verbs.c +2 -0
index b810142..1477d00 100644
@@ -2031,6 +2031,8 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
 	 * Fill in rvt info object.
 	 */
 	dd->verbs_dev.rdi.driver_f.port_callback = hfi1_create_port_files;
+	dd->verbs_dev.rdi.driver_f.get_card_name = get_card_name;
+	dd->verbs_dev.rdi.driver_f.get_pci_dev = get_pci_dev;
 	dd->verbs_dev.rdi.dparms.props.max_pd = hfi1_max_pds;
 	dd->verbs_dev.rdi.flags = (RVT_FLAG_MR_INIT_DRIVER |
 				   RVT_FLAG_QP_INIT_DRIVER |
#7 lore raw

RFC PATCH 8/15 IB/hfi1: Use correct rdmavt header files after move.

In reply to a message not in the archive

Rdmavt split the header files to be based on ibta object. This patch makes changes in hfi1 to account for the move.

The actual removal of HFI1 code continues in the following patch.

---
 drivers/staging/rdma/hfi1/driver.c |    3 ++-
 drivers/staging/rdma/hfi1/mad.c    |    4 ++--
 drivers/staging/rdma/hfi1/qp.c     |    5 +++--
 drivers/staging/rdma/hfi1/ud.c     |   14 +++++++-------
 drivers/staging/rdma/hfi1/verbs.c  |    4 ++--
 5 files changed, 16 insertions(+), 14 deletions(-)
drivers/staging/rdma/hfi1/driver.c +2 -1
index 4f0103b..fb52d07 100644
@@ -56,6 +56,7 @@
 #include <linux/vmalloc.h>
 #include <linux/module.h>
 #include <linux/prefetch.h>
+#include <rdma/ib_verbs.h>
 
 #include "hfi.h"
 #include "trace.h"
@@ -316,7 +317,7 @@ static void rcv_hdrerr(struct hfi1_ctxtdata *rcd, struct hfi1_pportdata *ppd,
 
 		/* Get the destination QP number. */
 		qp_num = be32_to_cpu(ohdr->bth[1]) & HFI1_QPN_MASK;
-		if (lid < HFI1_MULTICAST_LID_BASE) {
+		if (lid < be16_to_cpu(IB_MULTICAST_LID_BASE)) {
 			struct hfi1_qp *qp;
 			unsigned long flags;
 
drivers/staging/rdma/hfi1/mad.c +2 -2
index 1c34396..0a3f291 100644
@@ -1096,7 +1096,7 @@ static int __subn_set_opa_portinfo(struct opa_smp *smp, u32 am, u8 *data,
 
 	/* Must be a valid unicast LID address. */
 	if ((lid == 0 && ls_old > IB_PORT_INIT) ||
-	     lid >= HFI1_MULTICAST_LID_BASE) {
+	     lid >= be16_to_cpu(IB_MULTICAST_LID_BASE)) {
 		smp->status |= IB_SMP_INVALID_FIELD;
 		pr_warn("SubnSet(OPA_PortInfo) lid invalid 0x%x\n",
 			lid);
@@ -1129,7 +1129,7 @@ static int __subn_set_opa_portinfo(struct opa_smp *smp, u32 am, u8 *data,
 
 	/* Must be a valid unicast LID address. */
 	if ((smlid == 0 && ls_old > IB_PORT_INIT) ||
-	     smlid >= HFI1_MULTICAST_LID_BASE) {
+	     smlid >= be16_to_cpu(IB_MULTICAST_LID_BASE)) {
 		smp->status |= IB_SMP_INVALID_FIELD;
 		pr_warn("SubnSet(OPA_PortInfo) smlid invalid 0x%x\n", smlid);
 	} else if (smlid != ibp->sm_lid || msl != ibp->sm_sl) {
drivers/staging/rdma/hfi1/qp.c +3 -2
index d49b1e9..7c356e4 100644
@@ -640,7 +640,7 @@ int hfi1_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
 	if (attr_mask & IB_QP_AV) {
 		u8 sc;
 
-		if (attr->ah_attr.dlid >= HFI1_MULTICAST_LID_BASE)
+		if (attr->ah_attr.dlid >= be16_to_cpu(IB_MULTICAST_LID_BASE))
 			goto inval;
 		if (hfi1_check_ah(qp->ibqp.device, &attr->ah_attr))
 			goto inval;
@@ -653,7 +653,8 @@ int hfi1_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
 	if (attr_mask & IB_QP_ALT_PATH) {
 		u8 sc;
 
-		if (attr->alt_ah_attr.dlid >= HFI1_MULTICAST_LID_BASE)
+		if (attr->alt_ah_attr.dlid >=
+		    be16_to_cpu(IB_MULTICAST_LID_BASE))
 			goto inval;
 		if (hfi1_check_ah(qp->ibqp.device, &attr->alt_ah_attr))
 			goto inval;
drivers/staging/rdma/hfi1/ud.c +7 -7
index ba8a557..aad4e49 100644
@@ -243,7 +243,7 @@ static void ud_loopback(struct hfi1_qp *sqp, struct hfi1_swqe *swqe)
 	wc.slid = ppd->lid | (ah_attr->src_path_bits & ((1 << ppd->lmc) - 1));
 	/* Check for loopback when the port lid is not set */
 	if (wc.slid == 0 && sqp->ibqp.qp_type == IB_QPT_GSI)
-		wc.slid = HFI1_PERMISSIVE_LID;
+		wc.slid = be16_to_cpu(IB_LID_PERMISSIVE);
 	wc.sl = ah_attr->sl;
 	wc.dlid_path_bits = ah_attr->dlid & ((1 << ppd->lmc) - 1);
 	wc.port_num = qp->port_num;
@@ -311,11 +311,11 @@ int hfi1_make_ud_req(struct hfi1_qp *qp)
 	ibp = to_iport(qp->ibqp.device, qp->port_num);
 	ppd = ppd_from_ibp(ibp);
 	ah_attr = &to_iah(wqe->ud_wr.ah)->attr;
-	if (ah_attr->dlid < HFI1_MULTICAST_LID_BASE ||
-	    ah_attr->dlid == HFI1_PERMISSIVE_LID) {
+	if (ah_attr->dlid < be16_to_cpu(IB_MULTICAST_LID_BASE) ||
+	    ah_attr->dlid == be16_to_cpu(IB_LID_PERMISSIVE)) {
 		lid = ah_attr->dlid & ~((1 << ppd->lmc) - 1);
 		if (unlikely(!loopback && (lid == ppd->lid ||
-		    (lid == HFI1_PERMISSIVE_LID &&
+		    (lid == be16_to_cpu(IB_LID_PERMISSIVE) &&
 		     qp->ibqp.qp_type == IB_QPT_GSI)))) {
 			/*
 			 * If DMAs are in progress, we can't generate
@@ -667,8 +667,8 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)
 	qkey = be32_to_cpu(ohdr->u.ud.deth[0]);
 	src_qp = be32_to_cpu(ohdr->u.ud.deth[1]) & HFI1_QPN_MASK;
 	dlid = be16_to_cpu(hdr->lrh[1]);
-	is_mcast = (dlid > HFI1_MULTICAST_LID_BASE) &&
-			(dlid != HFI1_PERMISSIVE_LID);
+	is_mcast = (dlid > be16_to_cpu(IB_MULTICAST_LID_BASE)) &&
+			(dlid != be16_to_cpu(IB_LID_PERMISSIVE));
 	bth1 = be32_to_cpu(ohdr->bth[1]);
 	if (unlikely(bth1 & HFI1_BECN_SMASK)) {
 		/*
@@ -873,7 +873,7 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)
 	/*
 	 * Save the LMC lower bits if the destination LID is a unicast LID.
 	 */
-	wc.dlid_path_bits = dlid >= HFI1_MULTICAST_LID_BASE ? 0 :
+	wc.dlid_path_bits = dlid >= be16_to_cpu(IB_MULTICAST_LID_BASE) ? 0 :
 		dlid & ((1 << ppd_from_ibp(ibp)->lmc) - 1);
 	wc.port_num = qp->port_num;
 	/* Signal completion event if the solicited bit is set. */
drivers/staging/rdma/hfi1/verbs.c +2 -2
index 1477d00..644950e 100644
@@ -646,8 +646,8 @@ void hfi1_ib_rcv(struct hfi1_packet *packet)
 	/* Get the destination QP number. */
 	qp_num = be32_to_cpu(packet->ohdr->bth[1]) & HFI1_QPN_MASK;
 	lid = be16_to_cpu(hdr->lrh[1]);
-	if (unlikely((lid >= HFI1_MULTICAST_LID_BASE) &&
-	    (lid != HFI1_PERMISSIVE_LID))) {
+	if (unlikely((lid >= be16_to_cpu(IB_MULTICAST_LID_BASE)) &&
+		     (lid != be16_to_cpu(IB_LID_PERMISSIVE)))) {
 		struct hfi1_mcast *mcast;
 		struct hfi1_mcast_qp *p;
 

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

RFC PATCH 9/15 IB/hfi1: Use address handle in rdmavt and remove from hfi1

In reply to a message not in the archive

Original patch from Kamal Heib <kamalh-VPRAkNaXOzVWk0Htik3J/[email protected]>, split apart from original and modified to accomodate recent changes
in rdmavt.

Remove AH from hfi1 and use rdmavt version.

---
 drivers/staging/rdma/hfi1/common.h |    2 -
 drivers/staging/rdma/hfi1/mad.c    |    2 -
 drivers/staging/rdma/hfi1/qp.c     |    6 +-
 drivers/staging/rdma/hfi1/ruc.c    |    2 -
 drivers/staging/rdma/hfi1/ud.c     |    4 +
 drivers/staging/rdma/hfi1/verbs.c  |  131 ++----------------------------------
 drivers/staging/rdma/hfi1/verbs.h  |   20 +----
 7 files changed, 18 insertions(+), 149 deletions(-)
drivers/staging/rdma/hfi1/common.h +0 -2
index 5dd9272..b0c415a 100644
@@ -341,7 +341,6 @@ struct hfi1_message_header {
 #define FULL_MGMT_P_KEY      0xFFFF
 
 #define DEFAULT_P_KEY LIM_MGMT_P_KEY
-#define HFI1_PERMISSIVE_LID 0xFFFF
 #define HFI1_AETH_CREDIT_SHIFT 24
 #define HFI1_AETH_CREDIT_MASK 0x1F
 #define HFI1_AETH_CREDIT_INVAL 0x1F
@@ -353,7 +352,6 @@ struct hfi1_message_header {
 #define HFI1_BECN_SHIFT 30
 #define HFI1_BECN_MASK 1
 #define HFI1_BECN_SMASK (1 << HFI1_BECN_SHIFT)
-#define HFI1_MULTICAST_LID_BASE 0xC000
 
 static inline __u64 rhf_to_cpu(const __le32 *rbuf)
 {
drivers/staging/rdma/hfi1/mad.c +1 -1
index 0a3f291..8e9d1e7 100644
@@ -137,7 +137,7 @@ static void send_trap(struct hfi1_ibport *ibp, void *data, unsigned len)
 				ret = PTR_ERR(ah);
 			else {
 				send_buf->ah = ah;
-				ibp->sm_ah = to_iah(ah);
+				ibp->sm_ah = ibah_to_rvtah(ah);
 				ret = 0;
 			}
 		} else
drivers/staging/rdma/hfi1/qp.c +3 -3
index 7c356e4..bbe6b4d 100644
@@ -424,7 +424,7 @@ static void clear_mr_refs(struct hfi1_qp *qp, int clr_sends)
 			if (qp->ibqp.qp_type == IB_QPT_UD ||
 			    qp->ibqp.qp_type == IB_QPT_SMI ||
 			    qp->ibqp.qp_type == IB_QPT_GSI)
-				atomic_dec(&to_iah(wqe->ud_wr.ah)->refcount);
+				atomic_dec(&ibah_to_rvtah(wqe->ud_wr.ah)->refcount);
 			if (++qp->s_last >= qp->s_size)
 				qp->s_last = 0;
 		}
@@ -642,7 +642,7 @@ int hfi1_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
 
 		if (attr->ah_attr.dlid >= be16_to_cpu(IB_MULTICAST_LID_BASE))
 			goto inval;
-		if (hfi1_check_ah(qp->ibqp.device, &attr->ah_attr))
+		if (rvt_check_ah(qp->ibqp.device, &attr->ah_attr))
 			goto inval;
 		sc = ah_to_sc(ibqp->device, &attr->ah_attr);
 		if (!qp_to_sdma_engine(qp, sc) &&
@@ -656,7 +656,7 @@ int hfi1_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
 		if (attr->alt_ah_attr.dlid >=
 		    be16_to_cpu(IB_MULTICAST_LID_BASE))
 			goto inval;
-		if (hfi1_check_ah(qp->ibqp.device, &attr->alt_ah_attr))
+		if (rvt_check_ah(qp->ibqp.device, &attr->alt_ah_attr))
 			goto inval;
 		if (attr->alt_pkey_index >= hfi1_get_npkeys(dd))
 			goto inval;
drivers/staging/rdma/hfi1/ruc.c +1 -1
index 736b44d..4108c6a 100644
@@ -891,7 +891,7 @@ void hfi1_send_complete(struct hfi1_qp *qp, struct hfi1_swqe *wqe,
 	if (qp->ibqp.qp_type == IB_QPT_UD ||
 	    qp->ibqp.qp_type == IB_QPT_SMI ||
 	    qp->ibqp.qp_type == IB_QPT_GSI)
-		atomic_dec(&to_iah(wqe->ud_wr.ah)->refcount);
+		atomic_dec(&ibah_to_rvtah(wqe->ud_wr.ah)->refcount);
 
 	/* See ch. 11.2.4.1 and 10.7.3.1 */
 	if (!(qp->s_flags & HFI1_S_SIGNAL_REQ_WR) ||
drivers/staging/rdma/hfi1/ud.c +2 -2
index aad4e49..24b6077 100644
@@ -98,7 +98,7 @@ static void ud_loopback(struct hfi1_qp *sqp, struct hfi1_swqe *swqe)
 		goto drop;
 	}
 
-	ah_attr = &to_iah(swqe->ud_wr.ah)->attr;
+	ah_attr = &ibah_to_rvtah(swqe->ud_wr.ah)->attr;
 	ppd = ppd_from_ibp(ibp);
 
 	if (qp->ibqp.qp_num > 1) {
@@ -310,7 +310,7 @@ int hfi1_make_ud_req(struct hfi1_qp *qp)
 	/* Construct the header. */
 	ibp = to_iport(qp->ibqp.device, qp->port_num);
 	ppd = ppd_from_ibp(ibp);
-	ah_attr = &to_iah(wqe->ud_wr.ah)->attr;
+	ah_attr = &ibah_to_rvtah(wqe->ud_wr.ah)->attr;
 	if (ah_attr->dlid < be16_to_cpu(IB_MULTICAST_LID_BASE) ||
 	    ah_attr->dlid == be16_to_cpu(IB_LID_PERMISSIVE)) {
 		lid = ah_attr->dlid & ~((1 << ppd->lmc) - 1);
drivers/staging/rdma/hfi1/verbs.c +9 -122

180 lines not on this page · raw message

drivers/staging/rdma/hfi1/verbs.h +2 -18
index e35c918..3f3815c 100644
@@ -234,13 +234,6 @@ struct hfi1_mcast {
 	int n_attached;
 };
 
-/* Address Handle */
-struct hfi1_ah {
-	struct ib_ah ibah;
-	struct ib_ah_attr attr;
-	atomic_t refcount;
-};
-
 /*
  * This structure is used by hfi1_mmap() to validate an offset
  * when an mmap() request is made.  The vm_area_struct then uses
@@ -652,8 +645,8 @@ static inline void inc_opstats(
 struct hfi1_ibport {
 	struct hfi1_qp __rcu *qp[2];
 	struct ib_mad_agent *send_agent;	/* agent for SMI (traps) */
-	struct hfi1_ah *sm_ah;
-	struct hfi1_ah *smi_ah;
+	struct rvt_ah *sm_ah;
+	struct rvt_ah *smi_ah;
 	struct rb_root mcast_tree;
 	spinlock_t lock;		/* protect changes in this struct */
 
@@ -735,8 +728,6 @@ struct hfi1_ibdev {
 	u64 n_kmem_wait;
 	u64 n_send_schedule;
 
-	u32 n_ahs_allocated;    /* number of AHs allocated for device */
-	spinlock_t n_ahs_lock;
 	u32 n_cqs_allocated;    /* number of CQs allocated for device */
 	spinlock_t n_cqs_lock;
 	u32 n_qps_allocated;    /* number of QPs allocated for device */
@@ -774,11 +765,6 @@ static inline struct hfi1_mr *to_imr(struct ib_mr *ibmr)
 	return container_of(ibmr, struct hfi1_mr, ibmr);
 }
 
-static inline struct hfi1_ah *to_iah(struct ib_ah *ibah)
-{
-	return container_of(ibah, struct hfi1_ah, ibah);
-}
-
 static inline struct hfi1_cq *to_icq(struct ib_cq *ibcq)
 {
 	return container_of(ibcq, struct hfi1_cq, ibcq);
@@ -925,8 +911,6 @@ void hfi1_rc_hdrerr(
 
 u8 ah_to_sc(struct ib_device *ibdev, struct ib_ah_attr *ah_attr);
 
-int hfi1_check_ah(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);

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

RFC PATCH 10/15 IB/hfi1: Implement hfi1 support for AH notification

In reply to a message not in the archive

For OPA devices additional work is required to create an AH. This patch adds support to set the VL correctly.

---
 drivers/staging/rdma/hfi1/verbs.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
drivers/staging/rdma/hfi1/verbs.c +24 -0
index e007c52..6d69491 100644
@@ -1629,6 +1629,29 @@ static int hfi1_check_ah(struct ib_device *ibdev, struct ib_ah_attr *ah_attr)
 	return 0;
 }
 
+static void hfi1_notify_new_ah(struct ib_device *ibdev,
+			       struct ib_ah_attr *ah_attr,
+			       struct rvt_ah *ah)
+{
+	struct hfi1_ibport *ibp;
+	struct hfi1_pportdata *ppd;
+	struct hfi1_devdata *dd;
+	u8 sc5;
+
+	/*
+	 * Do not trust reading anything from rvt_ah at this point as it is not
+	 * done being setup. We can however modify things which we need to set.
+	 */
+
+	ibp = to_iport(ibdev, ah_attr->port_num);
+	ppd = ppd_from_ibp(ibp);
+	sc5 = ibp->sl_to_sc[ah->attr.sl];
+	dd = dd_from_ppd(ppd);
+	ah->vl = sc_to_vlt(dd, sc5);
+	if (ah->vl < num_vls || ah->vl == 15)
+		ah->log_pmtu = ilog2(dd->vld[ah->vl].mtu);
+}
+
 struct ib_ah *hfi1_create_qp0_ah(struct hfi1_ibport *ibp, u16 dlid)
 {
 	struct ib_ah_attr attr;
@@ -1919,6 +1942,7 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
 	dd->verbs_dev.rdi.driver_f.get_card_name = get_card_name;
 	dd->verbs_dev.rdi.driver_f.get_pci_dev = get_pci_dev;
 	dd->verbs_dev.rdi.driver_f.check_ah = hfi1_check_ah;
+	dd->verbs_dev.rdi.driver_f.notify_new_ah = hfi1_notify_new_ah;
 	dd->verbs_dev.rdi.dparms.props.max_ah = hfi1_max_ahs;
 	dd->verbs_dev.rdi.dparms.props.max_pd = hfi1_max_pds;
 	dd->verbs_dev.rdi.flags = (RVT_FLAG_MR_INIT_DRIVER |

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

RFC PATCH 11/15 IB/hfi1: Remove hfi1 MR and hfi1 specific qp type

In reply to a message not in the archive

This patch does the actual removal of the queue pair from the hfi1 driver along with a number of dependent data structures. These were moved to rvt.

It also removes the MR functions to use those in rdmavt.

These two pieces can not reasonably be split apart becuase they depend on each other.

---
 drivers/staging/rdma/hfi1/Makefile      |    2 
 drivers/staging/rdma/hfi1/cq.c          |    2 
 drivers/staging/rdma/hfi1/diag.c        |    8 
 drivers/staging/rdma/hfi1/driver.c      |   10 -
 drivers/staging/rdma/hfi1/hfi.h         |   16 -
 drivers/staging/rdma/hfi1/keys.c        |  356 ---------------------
 drivers/staging/rdma/hfi1/mmap.c        |   24 +
 drivers/staging/rdma/hfi1/mr.c          |  522 -------------------------------
 drivers/staging/rdma/hfi1/pio.c         |    4 
 drivers/staging/rdma/hfi1/qp.c          |   88 +++--
 drivers/staging/rdma/hfi1/qp.h          |   41 +-
 drivers/staging/rdma/hfi1/rc.c          |  116 +++----
 drivers/staging/rdma/hfi1/ruc.c         |   89 +++--
 drivers/staging/rdma/hfi1/sdma.h        |    6 
 drivers/staging/rdma/hfi1/srq.c         |   28 +-
 drivers/staging/rdma/hfi1/trace.h       |   22 +
 drivers/staging/rdma/hfi1/uc.c          |   10 -
 drivers/staging/rdma/hfi1/ud.c          |   18 +
 drivers/staging/rdma/hfi1/verbs.c       |  143 +++-----
 drivers/staging/rdma/hfi1/verbs.h       |  372 +++-------------------
 drivers/staging/rdma/hfi1/verbs_mcast.c |    8 
 21 files changed, 349 insertions(+), 1536 deletions(-)
 delete mode 100644 drivers/staging/rdma/hfi1/keys.c
 delete mode 100644 drivers/staging/rdma/hfi1/mr.c
drivers/staging/rdma/hfi1/Makefile +1 -1
index 2126b8b..3ba64fe 100644
@@ -8,7 +8,7 @@
 obj-$(CONFIG_INFINIBAND_HFI1) += hfi1.o
 
 hfi1-y := chip.o cq.o device.o diag.o driver.o eprom.o file_ops.o firmware.o \
-	init.o intr.o keys.o mad.o mmap.o mr.o pcie.o pio.o pio_copy.o \
+	init.o intr.o mad.o mmap.o pcie.o pio.o pio_copy.o \
 	qp.o qsfp.o rc.o ruc.o sdma.o srq.o sysfs.o trace.o twsi.o \
 	uc.o ud.o user_pages.o user_sdma.o verbs_mcast.o verbs.o
 hfi1-$(CONFIG_DEBUG_FS) += debugfs.o
drivers/staging/rdma/hfi1/cq.c +1 -1
index 4f046ff..ffd0e7a 100644
@@ -479,7 +479,7 @@ int hfi1_resize_cq(struct ib_cq *ibcq, int cqe, struct ib_udata *udata)
 
 	if (cq->ip) {
 		struct hfi1_ibdev *dev = to_idev(ibcq->device);
-		struct hfi1_mmap_info *ip = cq->ip;
+		struct rvt_mmap_info *ip = cq->ip;
 
 		hfi1_update_mmap_info(dev, ip, sz, wc);
 
drivers/staging/rdma/hfi1/diag.c +4 -4
index e172f2a..49822c1 100644
@@ -1618,7 +1618,7 @@ int snoop_recv_handler(struct hfi1_packet *packet)
 /*
  * Handle snooping and capturing packets when sdma is being used.
  */
-int snoop_send_dma_handler(struct hfi1_qp *qp, struct hfi1_pkt_state *ps,
+int snoop_send_dma_handler(struct rvt_qp *qp, struct hfi1_pkt_state *ps,
 			   u64 pbc)
 {
 	pr_alert("Snooping/Capture of Send DMA Packets Is Not Supported!\n");
@@ -1631,13 +1631,13 @@ int snoop_send_dma_handler(struct hfi1_qp *qp, struct hfi1_pkt_state *ps,
  * bypass packets. The only way to send a bypass packet currently is to use the
  * diagpkt interface. When that interface is enable snoop/capture is not.
  */
-int snoop_send_pio_handler(struct hfi1_qp *qp, struct hfi1_pkt_state *ps,
+int snoop_send_pio_handler(struct rvt_qp *qp, struct hfi1_pkt_state *ps,
 			   u64 pbc)
 {
 	struct hfi1_qp_priv *priv = qp->priv;
 	struct ahg_ib_header *ahdr = priv->s_hdr;
 	u32 hdrwords = qp->s_hdrwords;
-	struct hfi1_sge_state *ss = qp->s_cur_sge;
+	struct rvt_sge_state *ss = qp->s_cur_sge;
 	u32 len = qp->s_cur_size;
 	u32 dwords = (len + 3) >> 2;
 	u32 plen = hdrwords + dwords + 2; /* includes pbc */
@@ -1645,7 +1645,7 @@ int snoop_send_pio_handler(struct hfi1_qp *qp, struct hfi1_pkt_state *ps,
 	struct snoop_packet *s_packet = NULL;
 	u32 *hdr = (u32 *)&ahdr->ibh;
 	u32 length = 0;
-	struct hfi1_sge_state temp_ss;
+	struct rvt_sge_state temp_ss;
 	void *data = NULL;
 	void *data_start = NULL;
 	int ret;
drivers/staging/rdma/hfi1/driver.c +5 -5
index fb52d07..182e05f 100644
@@ -318,7 +318,7 @@ static void rcv_hdrerr(struct hfi1_ctxtdata *rcd, struct hfi1_pportdata *ppd,
 		/* Get the destination QP number. */
 		qp_num = be32_to_cpu(ohdr->bth[1]) & HFI1_QPN_MASK;
 		if (lid < be16_to_cpu(IB_MULTICAST_LID_BASE)) {
-			struct hfi1_qp *qp;
+			struct rvt_qp *qp;
 			unsigned long flags;
 
 			rcu_read_lock();
@@ -387,7 +387,7 @@ static void rcv_hdrerr(struct hfi1_ctxtdata *rcd, struct hfi1_pportdata *ppd,
 			 * Only in pre-B0 h/w is the CNP_OPCODE handled
 			 * via this code path (errata 291394).
 			 */
-			struct hfi1_qp *qp = NULL;
+			struct rvt_qp *qp = NULL;
 			u32 lqpn, rqpn;
 			u16 rlid;
 			u8 svc_type, sl, sc5;
@@ -456,7 +456,7 @@ static void prescan_rxq(struct hfi1_packet *packet) {}
 #else /* !CONFIG_PRESCAN_RXQ */
 static int prescan_receive_queue;
 
-static void process_ecn(struct hfi1_qp *qp, struct hfi1_ib_header *hdr,
+static void process_ecn(struct rvt_qp *qp, struct hfi1_ib_header *hdr,
 			struct hfi1_other_headers *ohdr,
 			u64 rhf, u32 bth1, struct ib_grh *grh)
 {
@@ -595,7 +595,7 @@ static void prescan_rxq(struct hfi1_packet *packet)
 		struct hfi1_ibport *ibp = &rcd->ppd->ibport_data;
 		__le32 *rhf_addr = (__le32 *) rcd->rcvhdrq + mdata.ps_head +
 					 dd->rhf_offset;
-		struct hfi1_qp *qp;
+		struct rvt_qp *qp;
 		struct hfi1_ib_header *hdr;
 		struct hfi1_other_headers *ohdr;
 		struct ib_grh *grh = NULL;
@@ -770,7 +770,7 @@ static inline void process_rcv_qp_work(struct hfi1_packet *packet)
 {
 
 	struct hfi1_ctxtdata *rcd;
-	struct hfi1_qp *qp, *nqp;
+	struct rvt_qp *qp, *nqp;
 
 	rcd = packet->rcd;
 	rcd->head = packet->rhqoff;
drivers/staging/rdma/hfi1/hfi.h +8 -8
index 5925deb..414d920 100644
@@ -322,7 +322,7 @@ struct hfi1_packet {
 	void *hdr;
 	struct hfi1_ctxtdata *rcd;
 	__le32 *rhf_addr;
-	struct hfi1_qp *qp;
+	struct rvt_qp *qp;
 	struct hfi1_other_headers *ohdr;
 	u64 rhf;
 	u32 maxcnt;
@@ -362,7 +362,7 @@ struct hfi1_snoop_data {
 #define HFI1_PORT_SNOOP_MODE     1U
 #define HFI1_PORT_CAPTURE_MODE   2U
 
-struct hfi1_sge_state;
+struct rvt_sge_state;
 
 /*
  * Get/Set IB link-level config parameters for f_get/set_ib_cfg()
@@ -1055,9 +1055,9 @@ struct hfi1_devdata {
 	 * Handlers for outgoing data so that snoop/capture does not
 	 * have to have its hooks in the send path
 	 */
-	int (*process_pio_send)(struct hfi1_qp *qp, struct hfi1_pkt_state *ps,
+	int (*process_pio_send)(struct rvt_qp *qp, struct hfi1_pkt_state *ps,
 				u64 pbc);
-	int (*process_dma_send)(struct hfi1_qp *qp, struct hfi1_pkt_state *ps,
+	int (*process_dma_send)(struct rvt_qp *qp, struct hfi1_pkt_state *ps,
 				u64 pbc);
 	void (*pio_inline_send)(struct hfi1_devdata *dd, struct pio_buf *pbuf,
 				u64 pbc, const void *from, size_t count);
@@ -1218,7 +1218,7 @@ static inline u32 egress_cycles(u32 len, u32 rate)
 void set_link_ipg(struct hfi1_pportdata *ppd);
 void process_becn(struct hfi1_pportdata *ppd, u8 sl,  u16 rlid, u32 lqpn,
 		  u32 rqpn, u8 svc_type);
-void return_cnp(struct hfi1_ibport *ibp, struct hfi1_qp *qp, u32 remote_qpn,
+void return_cnp(struct hfi1_ibport *ibp, struct rvt_qp *qp, u32 remote_qpn,
 		u32 pkey, u32 slid, u32 dlid, u8 sc5,
 		const struct ib_grh *old_grh);
 
@@ -1410,9 +1410,9 @@ void reset_link_credits(struct hfi1_devdata *dd);
 void assign_remote_cm_au_table(struct hfi1_devdata *dd, u8 vcu);
 
 int snoop_recv_handler(struct hfi1_packet *packet);
-int snoop_send_dma_handler(struct hfi1_qp *qp, struct hfi1_pkt_state *ps,
+int snoop_send_dma_handler(struct rvt_qp *qp, struct hfi1_pkt_state *ps,
 			   u64 pbc);
-int snoop_send_pio_handler(struct hfi1_qp *qp, struct hfi1_pkt_state *ps,
+int snoop_send_pio_handler(struct rvt_qp *qp, struct hfi1_pkt_state *ps,
 			   u64 pbc);
 void snoop_inline_pio_send(struct hfi1_devdata *dd, struct pio_buf *pbuf,
 			   u64 pbc, const void *from, size_t count);
@@ -1626,7 +1626,7 @@ int process_receive_invalid(struct hfi1_packet *packet);
 
 extern rhf_rcv_function_ptr snoop_rhf_rcv_functions[8];
 
-void update_sge(struct hfi1_sge_state *ss, u32 length);
+void update_sge(struct rvt_sge_state *ss, u32 length);
 
 /* global module parameter variables */
 extern unsigned int hfi1_max_mtu;
drivers/staging/rdma/hfi1/keys.c deleted +0 -356

356 lines not on this page · raw message

drivers/staging/rdma/hfi1/mmap.c +12 -12
index 5173b1c..4ce6be6 100644
@@ -59,12 +59,12 @@
 
 /**
  * hfi1_release_mmap_info - free mmap info structure
- * @ref: a pointer to the kref within struct hfi1_mmap_info
+ * @ref: a pointer to the kref within struct rvt_mmap_info
  */
 void hfi1_release_mmap_info(struct kref *ref)
 {
-	struct hfi1_mmap_info *ip =
-		container_of(ref, struct hfi1_mmap_info, ref);
+	struct rvt_mmap_info *ip =
+		container_of(ref, struct rvt_mmap_info, ref);
 	struct hfi1_ibdev *dev = to_idev(ip->context->device);
 
 	spin_lock_irq(&dev->pending_lock);
@@ -81,14 +81,14 @@ void hfi1_release_mmap_info(struct kref *ref)
  */
 static void hfi1_vma_open(struct vm_area_struct *vma)
 {
-	struct hfi1_mmap_info *ip = vma->vm_private_data;
+	struct rvt_mmap_info *ip = vma->vm_private_data;
 
 	kref_get(&ip->ref);
 }
 
 static void hfi1_vma_close(struct vm_area_struct *vma)
 {
-	struct hfi1_mmap_info *ip = vma->vm_private_data;
+	struct rvt_mmap_info *ip = vma->vm_private_data;
 
 	kref_put(&ip->ref, hfi1_release_mmap_info);
 }
@@ -109,7 +109,7 @@ int hfi1_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
 	struct hfi1_ibdev *dev = to_idev(context->device);
 	unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
 	unsigned long size = vma->vm_end - vma->vm_start;
-	struct hfi1_mmap_info *ip, *pp;
+	struct rvt_mmap_info *ip, *pp;
 	int ret = -EINVAL;
 
 	/*
@@ -146,11 +146,11 @@ done:
 /*
  * Allocate information for hfi1_mmap
  */
-struct hfi1_mmap_info *hfi1_create_mmap_info(struct hfi1_ibdev *dev,
-					     u32 size,
-					     struct ib_ucontext *context,
-					     void *obj) {
-	struct hfi1_mmap_info *ip;
+struct rvt_mmap_info *hfi1_create_mmap_info(struct hfi1_ibdev *dev,
+					    u32 size,
+					    struct ib_ucontext *context,
+					    void *obj) {
+	struct rvt_mmap_info *ip;
 
 	ip = kmalloc(sizeof(*ip), GFP_KERNEL);
 	if (!ip)
@@ -175,7 +175,7 @@ bail:
 	return ip;
 }
 
-void hfi1_update_mmap_info(struct hfi1_ibdev *dev, struct hfi1_mmap_info *ip,
+void hfi1_update_mmap_info(struct hfi1_ibdev *dev, struct rvt_mmap_info *ip,
 			   u32 size, void *obj)
 {
 	size = PAGE_ALIGN(size);
drivers/staging/rdma/hfi1/mr.c deleted +0 -522

522 lines not on this page · raw message

drivers/staging/rdma/hfi1/pio.c +2 -2
index b5bce5e..1852c4b 100644
@@ -1496,8 +1496,8 @@ static void sc_piobufavail(struct send_context *sc)
 	struct hfi1_devdata *dd = sc->dd;
 	struct hfi1_ibdev *dev = &dd->verbs_dev;
 	struct list_head *list;
-	struct hfi1_qp *qps[PIO_WAIT_BATCH_SIZE];
-	struct hfi1_qp *qp;
+	struct rvt_qp *qps[PIO_WAIT_BATCH_SIZE];
+	struct rvt_qp *qp;
 	struct hfi1_qp_priv *priv;
 	unsigned long flags;
 	unsigned i, n = 0;
drivers/staging/rdma/hfi1/qp.c +44 -44

308 lines not on this page · raw message

drivers/staging/rdma/hfi1/qp.h +13 -28

107 lines not on this page · raw message

drivers/staging/rdma/hfi1/rc.c +58 -58

370 lines not on this page · raw message

drivers/staging/rdma/hfi1/ruc.c +51 -38

205 lines not on this page · raw message

drivers/staging/rdma/hfi1/sdma.h +3 -3
index 664b251..e7ebd16 100644
@@ -379,10 +379,10 @@ struct sdma_txreq {
 struct verbs_txreq {
 	struct hfi1_pio_header	phdr;
 	struct sdma_txreq       txreq;
-	struct hfi1_qp           *qp;
-	struct hfi1_swqe         *wqe;
+	struct rvt_qp           *qp;
+	struct rvt_swqe         *wqe;
 	struct rvt_mregion	*mr;
-	struct hfi1_sge_state    *ss;
+	struct rvt_sge_state    *ss;
 	struct sdma_engine     *sde;
 	u16                     hdr_dwords;
 	u16                     hdr_inx;
drivers/staging/rdma/hfi1/srq.c +14 -14
index 67786d4..932bd96 100644
@@ -66,12 +66,12 @@ int hfi1_post_srq_receive(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
 			  struct ib_recv_wr **bad_wr)
 {
 	struct hfi1_srq *srq = to_isrq(ibsrq);
-	struct hfi1_rwq *wq;
+	struct rvt_rwq *wq;
 	unsigned long flags;
 	int ret;
 
 	for (; wr; wr = wr->next) {
-		struct hfi1_rwqe *wqe;
+		struct rvt_rwqe *wqe;
 		u32 next;
 		int i;
 
@@ -149,8 +149,8 @@ struct ib_srq *hfi1_create_srq(struct ib_pd *ibpd,
 	srq->rq.size = srq_init_attr->attr.max_wr + 1;
 	srq->rq.max_sge = srq_init_attr->attr.max_sge;
 	sz = sizeof(struct ib_sge) * srq->rq.max_sge +
-		sizeof(struct hfi1_rwqe);
-	srq->rq.wq = vmalloc_user(sizeof(struct hfi1_rwq) + srq->rq.size * sz);
+		sizeof(struct rvt_rwqe);
+	srq->rq.wq = vmalloc_user(sizeof(struct rvt_rwq) + srq->rq.size * sz);
 	if (!srq->rq.wq) {
 		ret = ERR_PTR(-ENOMEM);
 		goto bail_srq;
@@ -162,7 +162,7 @@ struct ib_srq *hfi1_create_srq(struct ib_pd *ibpd,
 	 */
 	if (udata && udata->outlen >= sizeof(__u64)) {
 		int err;
-		u32 s = sizeof(struct hfi1_rwq) + srq->rq.size * sz;
+		u32 s = sizeof(struct rvt_rwq) + srq->rq.size * sz;
 
 		srq->ip =
 		    hfi1_create_mmap_info(dev, s, ibpd->uobject->context,
@@ -230,12 +230,12 @@ int hfi1_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
 		    struct ib_udata *udata)
 {
 	struct hfi1_srq *srq = to_isrq(ibsrq);
-	struct hfi1_rwq *wq;
+	struct rvt_rwq *wq;
 	int ret = 0;
 
 	if (attr_mask & IB_SRQ_MAX_WR) {
-		struct hfi1_rwq *owq;
-		struct hfi1_rwqe *p;
+		struct rvt_rwq *owq;
+		struct rvt_rwqe *p;
 		u32 sz, size, n, head, tail;
 
 		/* Check that the requested sizes are below the limits. */
@@ -246,10 +246,10 @@ int hfi1_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
 			goto bail;
 		}
 
-		sz = sizeof(struct hfi1_rwqe) +
+		sz = sizeof(struct rvt_rwqe) +
 			srq->rq.max_sge * sizeof(struct ib_sge);
 		size = attr->max_wr + 1;
-		wq = vmalloc_user(sizeof(struct hfi1_rwq) + size * sz);
+		wq = vmalloc_user(sizeof(struct rvt_rwq) + size * sz);
 		if (!wq) {
 			ret = -ENOMEM;
 			goto bail;
@@ -296,7 +296,7 @@ int hfi1_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
 		n = 0;
 		p = wq->wq;
 		while (tail != head) {
-			struct hfi1_rwqe *wqe;
+			struct rvt_rwqe *wqe;
 			int i;
 
 			wqe = get_rwqe_ptr(&srq->rq, tail);
@@ -305,7 +305,7 @@ int hfi1_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
 			for (i = 0; i < wqe->num_sge; i++)
 				p->sg_list[i] = wqe->sg_list[i];
 			n++;
-			p = (struct hfi1_rwqe *)((char *)p + sz);
+			p = (struct rvt_rwqe *)((char *)p + sz);
 			if (++tail >= srq->rq.size)
 				tail = 0;
 		}
@@ -320,9 +320,9 @@ int hfi1_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
 		vfree(owq);
 
 		if (srq->ip) {
-			struct hfi1_mmap_info *ip = srq->ip;
+			struct rvt_mmap_info *ip = srq->ip;
 			struct hfi1_ibdev *dev = to_idev(srq->ibsrq.device);
-			u32 s = sizeof(struct hfi1_rwq) + size * sz;
+			u32 s = sizeof(struct rvt_rwq) + size * sz;
 
 			hfi1_update_mmap_info(dev, ip, s, wq);
 
drivers/staging/rdma/hfi1/trace.h +11 -11
index 5743029..570ad4c 100644
@@ -294,7 +294,7 @@ TRACE_EVENT(hfi1_wantpiointr,
 );
 
 DECLARE_EVENT_CLASS(hfi1_qpsleepwakeup_template,
-	TP_PROTO(struct hfi1_qp *qp, u32 flags),
+	TP_PROTO(struct rvt_qp *qp, u32 flags),
 	TP_ARGS(qp, flags),
 	TP_STRUCT__entry(
 		DD_DEV_ENTRY(dd_from_ibdev(qp->ibqp.device))
@@ -318,17 +318,17 @@ DECLARE_EVENT_CLASS(hfi1_qpsleepwakeup_template,
 );
 
 DEFINE_EVENT(hfi1_qpsleepwakeup_template, hfi1_qpwakeup,
-	     TP_PROTO(struct hfi1_qp *qp, u32 flags),
+	     TP_PROTO(struct rvt_qp *qp, u32 flags),
 	     TP_ARGS(qp, flags));
 
 DEFINE_EVENT(hfi1_qpsleepwakeup_template, hfi1_qpsleep,
-	     TP_PROTO(struct hfi1_qp *qp, u32 flags),
+	     TP_PROTO(struct rvt_qp *qp, u32 flags),
 	     TP_ARGS(qp, flags));
 
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM hfi1_qphash
 DECLARE_EVENT_CLASS(hfi1_qphash_template,
-	TP_PROTO(struct hfi1_qp *qp, u32 bucket),
+	TP_PROTO(struct rvt_qp *qp, u32 bucket),
 	TP_ARGS(qp, bucket),
 	TP_STRUCT__entry(
 		DD_DEV_ENTRY(dd_from_ibdev(qp->ibqp.device))
@@ -349,11 +349,11 @@ DECLARE_EVENT_CLASS(hfi1_qphash_template,
 );
 
 DEFINE_EVENT(hfi1_qphash_template, hfi1_qpinsert,
-	TP_PROTO(struct hfi1_qp *qp, u32 bucket),
+	TP_PROTO(struct rvt_qp *qp, u32 bucket),
 	TP_ARGS(qp, bucket));
 
 DEFINE_EVENT(hfi1_qphash_template, hfi1_qpremove,
-	TP_PROTO(struct hfi1_qp *qp, u32 bucket),
+	TP_PROTO(struct rvt_qp *qp, u32 bucket),
 	TP_ARGS(qp, bucket));
 
 #undef TRACE_SYSTEM
@@ -1253,7 +1253,7 @@ TRACE_EVENT(hfi1_sdma_state,
 #define TRACE_SYSTEM hfi1_rc
 
 DECLARE_EVENT_CLASS(hfi1_rc_template,
-	TP_PROTO(struct hfi1_qp *qp, u32 psn),
+	TP_PROTO(struct rvt_qp *qp, u32 psn),
 	TP_ARGS(qp, psn),
 	TP_STRUCT__entry(
 		DD_DEV_ENTRY(dd_from_ibdev(qp->ibqp.device))
@@ -1292,22 +1292,22 @@ DECLARE_EVENT_CLASS(hfi1_rc_template,
 );
 
 DEFINE_EVENT(hfi1_rc_template, hfi1_rc_sendcomplete,
-	     TP_PROTO(struct hfi1_qp *qp, u32 psn),
+	     TP_PROTO(struct rvt_qp *qp, u32 psn),
 	     TP_ARGS(qp, psn)
 );
 
 DEFINE_EVENT(hfi1_rc_template, hfi1_rc_ack,
-	     TP_PROTO(struct hfi1_qp *qp, u32 psn),
+	     TP_PROTO(struct rvt_qp *qp, u32 psn),
 	     TP_ARGS(qp, psn)
 );
 
 DEFINE_EVENT(hfi1_rc_template, hfi1_rc_timeout,
-	     TP_PROTO(struct hfi1_qp *qp, u32 psn),
+	     TP_PROTO(struct rvt_qp *qp, u32 psn),
 	     TP_ARGS(qp, psn)
 );
 
 DEFINE_EVENT(hfi1_rc_template, hfi1_rc_rcv_error,
-	     TP_PROTO(struct hfi1_qp *qp, u32 psn),
+	     TP_PROTO(struct rvt_qp *qp, u32 psn),
 	     TP_ARGS(qp, psn)
 );
 
drivers/staging/rdma/hfi1/uc.c +5 -5
index 1908a28..6686331 100644
@@ -61,11 +61,11 @@
  *
  * Return 1 if constructed; otherwise, return 0.
  */
-int hfi1_make_uc_req(struct hfi1_qp *qp)
+int hfi1_make_uc_req(struct rvt_qp *qp)
 {
 	struct hfi1_qp_priv *priv = qp->priv;
 	struct hfi1_other_headers *ohdr;
-	struct hfi1_swqe *wqe;
+	struct rvt_swqe *wqe;
 	unsigned long flags;
 	u32 hwords = 5;
 	u32 bth0 = 0;
@@ -267,7 +267,7 @@ void hfi1_uc_rcv(struct hfi1_packet *packet)
 	u32 rcv_flags = packet->rcv_flags;
 	void *data = packet->ebuf;
 	u32 tlen = packet->tlen;
-	struct hfi1_qp *qp = packet->qp;
+	struct rvt_qp *qp = packet->qp;
 	struct hfi1_other_headers *ohdr = packet->ohdr;
 	u32 bth0, opcode;
 	u32 hdrsize = packet->hlen;
@@ -492,8 +492,8 @@ rdma_first:
 			int ok;
 
 			/* Check rkey */
-			ok = hfi1_rkey_ok(qp, &qp->r_sge.sge, qp->r_len,
-					  vaddr, rkey, IB_ACCESS_REMOTE_WRITE);
+			ok = rvt_rkey_ok(qp, &qp->r_sge.sge, qp->r_len,
+					 vaddr, rkey, IB_ACCESS_REMOTE_WRITE);
 			if (unlikely(!ok))
 				goto drop;
 			qp->r_sge.num_sge = 1;
drivers/staging/rdma/hfi1/ud.c +9 -9
index 24b6077..b14641c 100644
@@ -65,15 +65,15 @@
  * Note that the receive interrupt handler may be calling hfi1_ud_rcv()
  * while this is being called.
  */
-static void ud_loopback(struct hfi1_qp *sqp, struct hfi1_swqe *swqe)
+static void ud_loopback(struct rvt_qp *sqp, struct rvt_swqe *swqe)
 {
 	struct hfi1_ibport *ibp = to_iport(sqp->ibqp.device, sqp->port_num);
 	struct hfi1_pportdata *ppd;
-	struct hfi1_qp *qp;
+	struct rvt_qp *qp;
 	struct ib_ah_attr *ah_attr;
 	unsigned long flags;
-	struct hfi1_sge_state ssge;
-	struct hfi1_sge *sge;
+	struct rvt_sge_state ssge;
+	struct rvt_sge *sge;
 	struct ib_wc wc;
 	u32 length;
 	enum ib_qp_type sqptype, dqptype;
@@ -263,14 +263,14 @@ drop:
  *
  * Return 1 if constructed; otherwise, return 0.
  */
-int hfi1_make_ud_req(struct hfi1_qp *qp)
+int hfi1_make_ud_req(struct rvt_qp *qp)
 {
 	struct hfi1_qp_priv *priv = qp->priv;
 	struct hfi1_other_headers *ohdr;
 	struct ib_ah_attr *ah_attr;
 	struct hfi1_pportdata *ppd;
 	struct hfi1_ibport *ibp;
-	struct hfi1_swqe *wqe;
+	struct rvt_swqe *wqe;
 	unsigned long flags;
 	u32 nwords;
 	u32 extra_bytes;
@@ -478,7 +478,7 @@ int hfi1_lookup_pkey_idx(struct hfi1_ibport *ibp, u16 pkey)
 	return -1;
 }
 
-void return_cnp(struct hfi1_ibport *ibp, struct hfi1_qp *qp, u32 remote_qpn,
+void return_cnp(struct hfi1_ibport *ibp, struct rvt_qp *qp, u32 remote_qpn,
 		u32 pkey, u32 slid, u32 dlid, u8 sc5,
 		const struct ib_grh *old_grh)
 {
@@ -552,7 +552,7 @@ void return_cnp(struct hfi1_ibport *ibp, struct hfi1_qp *qp, u32 remote_qpn,
  * opa_smp_check() returns 0 if all checks succeed, 1 otherwise.
  */
 static int opa_smp_check(struct hfi1_ibport *ibp, u16 pkey, u8 sc5,
-			 struct hfi1_qp *qp, u16 slid, struct opa_smp *smp)
+			 struct rvt_qp *qp, u16 slid, struct opa_smp *smp)
 {
 	struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);
 
@@ -656,7 +656,7 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)
 	u32 rcv_flags = packet->rcv_flags;
 	void *data = packet->ebuf;
 	u32 tlen = packet->tlen;
-	struct hfi1_qp *qp = packet->qp;
+	struct rvt_qp *qp = packet->qp;
 	bool has_grh = rcv_flags & HFI1_HAS_GRH;
 	bool sc4_bit = has_sc4_bit(packet);
 	u8 sc;
drivers/staging/rdma/hfi1/verbs.c +58 -85

402 lines not on this page · raw message

drivers/staging/rdma/hfi1/verbs.h +46 -326

252 lines not on this page · raw message

drivers/staging/rdma/hfi1/verbs_mcast.c +4 -4
index afc6b4c..49954b9 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the 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

Part of the diff is not shown here. View the raw message.

#11 lore raw

RFC PATCH 12/15 IB/hfi1: Remove srq from hfi1

In reply to a message not in the archive

SRQ data structure has been moved to rdmavt. Make use of it.

---
 drivers/staging/rdma/hfi1/qp.c    |    2 +-
 drivers/staging/rdma/hfi1/ruc.c   |    4 ++--
 drivers/staging/rdma/hfi1/srq.c   |   10 +++++-----
 drivers/staging/rdma/hfi1/verbs.h |   13 -------------
 4 files changed, 8 insertions(+), 21 deletions(-)
drivers/staging/rdma/hfi1/qp.c +1 -1
index b82855f..045ee74 100644
@@ -1092,7 +1092,7 @@ struct ib_qp *hfi1_create_qp(struct ib_pd *ibpd,
 		sz = sizeof(*qp);
 		sg_list_sz = 0;
 		if (init_attr->srq) {
-			struct hfi1_srq *srq = to_isrq(init_attr->srq);
+			struct rvt_srq *srq = ibsrq_to_rvtsrq(init_attr->srq);
 
 			if (srq->rq.max_sge > 1)
 				sg_list_sz = sizeof(*qp->r_sg_list) *
drivers/staging/rdma/hfi1/ruc.c +2 -2
index 558dadb..9841e89 100644
@@ -159,14 +159,14 @@ int hfi1_get_rwqe(struct rvt_qp *qp, int wr_id_only)
 	unsigned long flags;
 	struct rvt_rq *rq;
 	struct rvt_rwq *wq;
-	struct hfi1_srq *srq;
+	struct rvt_srq *srq;
 	struct rvt_rwqe *wqe;
 	void (*handler)(struct ib_event *, void *);
 	u32 tail;
 	int ret;
 
 	if (qp->ibqp.srq) {
-		srq = to_isrq(qp->ibqp.srq);
+		srq = ibsrq_to_rvtsrq(qp->ibqp.srq);
 		handler = srq->ibsrq.event_handler;
 		rq = &srq->rq;
 	} else {
drivers/staging/rdma/hfi1/srq.c +5 -5
index 932bd96..78f190a 100644
@@ -65,7 +65,7 @@
 int hfi1_post_srq_receive(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
 			  struct ib_recv_wr **bad_wr)
 {
-	struct hfi1_srq *srq = to_isrq(ibsrq);
+	struct rvt_srq *srq = ibsrq_to_rvtsrq(ibsrq);
 	struct rvt_rwq *wq;
 	unsigned long flags;
 	int ret;
@@ -120,7 +120,7 @@ struct ib_srq *hfi1_create_srq(struct ib_pd *ibpd,
 			       struct ib_udata *udata)
 {
 	struct hfi1_ibdev *dev = to_idev(ibpd->device);
-	struct hfi1_srq *srq;
+	struct rvt_srq *srq;
 	u32 sz;
 	struct ib_srq *ret;
 
@@ -229,7 +229,7 @@ int hfi1_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
 		    enum ib_srq_attr_mask attr_mask,
 		    struct ib_udata *udata)
 {
-	struct hfi1_srq *srq = to_isrq(ibsrq);
+	struct rvt_srq *srq = ibsrq_to_rvtsrq(ibsrq);
 	struct rvt_rwq *wq;
 	int ret = 0;
 
@@ -367,7 +367,7 @@ bail:
 
 int hfi1_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr)
 {
-	struct hfi1_srq *srq = to_isrq(ibsrq);
+	struct rvt_srq *srq = ibsrq_to_rvtsrq(ibsrq);
 
 	attr->max_wr = srq->rq.size - 1;
 	attr->max_sge = srq->rq.max_sge;
@@ -381,7 +381,7 @@ int hfi1_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr)
  */
 int hfi1_destroy_srq(struct ib_srq *ibsrq)
 {
-	struct hfi1_srq *srq = to_isrq(ibsrq);
+	struct rvt_srq *srq = ibsrq_to_rvtsrq(ibsrq);
 	struct hfi1_ibdev *dev = to_idev(ibsrq->device);
 
 	spin_lock(&dev->n_srqs_lock);
drivers/staging/rdma/hfi1/verbs.h +0 -13
index fec5e7b..f4ec83c 100644
@@ -263,14 +263,6 @@ struct hfi1_cq {
 	struct rvt_mmap_info *ip;
 };
 
-struct hfi1_srq {
-	struct ib_srq ibsrq;
-	struct rvt_rq rq;
-	struct rvt_mmap_info *ip;
-	/* send signal when number of RWQEs < limit */
-	u32 limit;
-};
-
 /*
  * hfi1 specific data structures that will be hidden from rvt after the queue
  * pair is made common
@@ -537,11 +529,6 @@ static inline struct hfi1_cq *to_icq(struct ib_cq *ibcq)
 	return container_of(ibcq, struct hfi1_cq, ibcq);
 }
 
-static inline struct hfi1_srq *to_isrq(struct ib_srq *ibsrq)
-{
-	return container_of(ibsrq, struct hfi1_srq, ibsrq);
-}
-
 static inline struct rvt_qp *to_iqp(struct ib_qp *ibqp)
 {
 	return container_of(ibqp, struct rvt_qp, ibqp);

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

#12 lore raw

RFC PATCH 13/15 IB/hfi1: Remove ibport and use rdmavt version

In reply to a message not in the archive

Remove most of the ibport members from hfi1 and use the rdmavt version. Also register the port with rdmavt.

---
 drivers/staging/rdma/hfi1/chip.c        |   34 +++----
 drivers/staging/rdma/hfi1/driver.c      |    2 
 drivers/staging/rdma/hfi1/hfi.h         |    8 +-
 drivers/staging/rdma/hfi1/mad.c         |  152 ++++++++++++++++---------------
 drivers/staging/rdma/hfi1/qp.c          |   23 ++---
 drivers/staging/rdma/hfi1/qp.h          |    2 
 drivers/staging/rdma/hfi1/rc.c          |   32 +++----
 drivers/staging/rdma/hfi1/ruc.c         |   14 ++-
 drivers/staging/rdma/hfi1/uc.c          |    2 
 drivers/staging/rdma/hfi1/ud.c          |   16 ++-
 drivers/staging/rdma/hfi1/verbs.c       |   61 +++++++-----
 drivers/staging/rdma/hfi1/verbs.h       |   51 +---------
 drivers/staging/rdma/hfi1/verbs_mcast.c |   28 +++---
 13 files changed, 198 insertions(+), 227 deletions(-)
drivers/staging/rdma/hfi1/chip.c +17 -17
index f799b86..6d916d0 100644
@@ -1543,8 +1543,8 @@ static u64 access_sw_cpu_##cntr(const struct cntr_entry *entry,		      \
 			      void *context, int vl, int mode, u64 data)      \
 {									      \
 	struct hfi1_pportdata *ppd = (struct hfi1_pportdata *)context;	      \
-	return read_write_cpu(ppd->dd, &ppd->ibport_data.z_ ##cntr,	      \
-			      ppd->ibport_data.cntr, vl,		      \
+	return read_write_cpu(ppd->dd, &ppd->ibport_data.rvp.z_ ##cntr,	      \
+			      ppd->ibport_data.rvp.cntr, vl,		      \
 			      mode, data);				      \
 }
 
@@ -1561,7 +1561,7 @@ static u64 access_ibp_##cntr(const struct cntr_entry *entry,		      \
 	if (vl != CNTR_INVALID_VL)					      \
 		return 0;						      \
 									      \
-	return read_write_sw(ppd->dd, &ppd->ibport_data.n_ ##cntr,	      \
+	return read_write_sw(ppd->dd, &ppd->ibport_data.rvp.n_ ##cntr,	      \
 			     mode, data);				      \
 }
 
@@ -5947,14 +5947,14 @@ static inline int init_cpu_counters(struct hfi1_devdata *dd)
 
 	ppd = (struct hfi1_pportdata *)(dd + 1);
 	for (i = 0; i < dd->num_pports; i++, ppd++) {
-		ppd->ibport_data.rc_acks = NULL;
-		ppd->ibport_data.rc_qacks = NULL;
-		ppd->ibport_data.rc_acks = alloc_percpu(u64);
-		ppd->ibport_data.rc_qacks = alloc_percpu(u64);
-		ppd->ibport_data.rc_delayed_comp = alloc_percpu(u64);
-		if ((ppd->ibport_data.rc_acks == NULL) ||
-		    (ppd->ibport_data.rc_delayed_comp == NULL) ||
-		    (ppd->ibport_data.rc_qacks == NULL))
+		ppd->ibport_data.rvp.rc_acks = NULL;
+		ppd->ibport_data.rvp.rc_qacks = NULL;
+		ppd->ibport_data.rvp.rc_acks = alloc_percpu(u64);
+		ppd->ibport_data.rvp.rc_qacks = alloc_percpu(u64);
+		ppd->ibport_data.rvp.rc_delayed_comp = alloc_percpu(u64);
+		if (!ppd->ibport_data.rvp.rc_acks ||
+		    !ppd->ibport_data.rvp.rc_delayed_comp ||
+		    !ppd->ibport_data.rvp.rc_qacks)
 			return -ENOMEM;
 	}
 
@@ -8010,14 +8010,14 @@ static void free_cntrs(struct hfi1_devdata *dd)
 	for (i = 0; i < dd->num_pports; i++, ppd++) {
 		kfree(ppd->cntrs);
 		kfree(ppd->scntrs);
-		free_percpu(ppd->ibport_data.rc_acks);
-		free_percpu(ppd->ibport_data.rc_qacks);
-		free_percpu(ppd->ibport_data.rc_delayed_comp);
+		free_percpu(ppd->ibport_data.rvp.rc_acks);
+		free_percpu(ppd->ibport_data.rvp.rc_qacks);
+		free_percpu(ppd->ibport_data.rvp.rc_delayed_comp);
 		ppd->cntrs = NULL;
 		ppd->scntrs = NULL;
-		ppd->ibport_data.rc_acks = NULL;
-		ppd->ibport_data.rc_qacks = NULL;
-		ppd->ibport_data.rc_delayed_comp = NULL;
+		ppd->ibport_data.rvp.rc_acks = NULL;
+		ppd->ibport_data.rvp.rc_qacks = NULL;
+		ppd->ibport_data.rvp.rc_delayed_comp = NULL;
 	}
 	kfree(dd->portcntrnames);
 	dd->portcntrnames = NULL;
drivers/staging/rdma/hfi1/driver.c +1 -1
index 182e05f..3b17913 100644
@@ -337,7 +337,7 @@ static void rcv_hdrerr(struct hfi1_ctxtdata *rcd, struct hfi1_pportdata *ppd,
 			/* Check for valid receive state. */
 			if (!(ib_hfi1_state_ops[qp->state] &
 			      HFI1_PROCESS_RECV_OK)) {
-				ibp->n_pkt_drops++;
+				ibp->rvp.n_pkt_drops++;
 			}
 
 			switch (qp->ibqp.qp_type) {
drivers/staging/rdma/hfi1/hfi.h +4 -4
index 414d920..a893789 100644
@@ -1795,10 +1795,10 @@ static inline void hfi1_reset_cpu_counters(struct hfi1_devdata *dd)
 
 	ppd = (struct hfi1_pportdata *)(dd + 1);
 	for (i = 0; i < dd->num_pports; i++, ppd++) {
-		ppd->ibport_data.z_rc_acks =
-			get_all_cpu_total(ppd->ibport_data.rc_acks);
-		ppd->ibport_data.z_rc_qacks =
-			get_all_cpu_total(ppd->ibport_data.rc_qacks);
+		ppd->ibport_data.rvp.z_rc_acks =
+			get_all_cpu_total(ppd->ibport_data.rvp.rc_acks);
+		ppd->ibport_data.rvp.z_rc_qacks =
+			get_all_cpu_total(ppd->ibport_data.rvp.rc_qacks);
 	}
 }
 
drivers/staging/rdma/hfi1/mad.c +78 -74

323 lines not on this page · raw message

drivers/staging/rdma/hfi1/qp.c +12 -11
index 045ee74..18e7276 100644
@@ -238,7 +238,7 @@ static void insert_qp(struct hfi1_ibdev *dev, struct rvt_qp *qp)
 	spin_lock_irqsave(&dev->qp_dev->qpt_lock, flags);
 
 	if (qp->ibqp.qp_num <= 1) {
-		rcu_assign_pointer(ibp->qp[qp->ibqp.qp_num], qp);
+		rcu_assign_pointer(ibp->rvp.qp[qp->ibqp.qp_num], qp);
 	} else {
 		u32 n = qpn_hash(dev->qp_dev, qp->ibqp.qp_num);
 
@@ -263,12 +263,13 @@ static void remove_qp(struct hfi1_ibdev *dev, struct rvt_qp *qp)
 
 	spin_lock_irqsave(&dev->qp_dev->qpt_lock, flags);
 
-	if (rcu_dereference_protected(ibp->qp[0],
+	if (rcu_dereference_protected(ibp->rvp.qp[0],
+				      lockdep_is_held(
+				      &dev->qp_dev->qpt_lock)) == qp) {
+		RCU_INIT_POINTER(ibp->rvp.qp[0], NULL);
+	} else if (rcu_dereference_protected(ibp->rvp.qp[1],
 			lockdep_is_held(&dev->qp_dev->qpt_lock)) == qp) {
-		RCU_INIT_POINTER(ibp->qp[0], NULL);
-	} else if (rcu_dereference_protected(ibp->qp[1],
-			lockdep_is_held(&dev->qp_dev->qpt_lock)) == qp) {
-		RCU_INIT_POINTER(ibp->qp[1], NULL);
+		RCU_INIT_POINTER(ibp->rvp.qp[1], NULL);
 	} else {
 		struct rvt_qp *q;
 		struct rvt_qp __rcu **qpp;
@@ -317,9 +318,9 @@ static unsigned free_all_qps(struct hfi1_devdata *dd)
 		if (!hfi1_mcast_tree_empty(ibp))
 			qp_inuse++;
 		rcu_read_lock();
-		if (rcu_dereference(ibp->qp[0]))
+		if (rcu_dereference(ibp->rvp.qp[0]))
 			qp_inuse++;
-		if (rcu_dereference(ibp->qp[1]))
+		if (rcu_dereference(ibp->rvp.qp[1]))
 			qp_inuse++;
 		rcu_read_unlock();
 	}
@@ -1467,7 +1468,7 @@ static int iowait_sleep(
 			struct hfi1_ibport *ibp =
 				to_iport(qp->ibqp.device, qp->port_num);
 
-			ibp->n_dmawait++;
+			ibp->rvp.n_dmawait++;
 			qp->s_flags |= HFI1_S_WAIT_DMA_DESC;
 			list_add_tail(&priv->s_iowait.list, &sde->dmawait);
 			trace_hfi1_qpsleep(qp, HFI1_S_WAIT_DMA_DESC);
@@ -1636,9 +1637,9 @@ int qp_iter_next(struct qp_iter *iter)
 				ibp = &ppd->ibport_data;
 
 				if (!(n & 1))
-					qp = rcu_dereference(ibp->qp[0]);
+					qp = rcu_dereference(ibp->rvp.qp[0]);
 				else
-					qp = rcu_dereference(ibp->qp[1]);
+					qp = rcu_dereference(ibp->rvp.qp[1]);
 			} else {
 				qp = rcu_dereference(
 					dev->qp_dev->qp_table[
drivers/staging/rdma/hfi1/qp.h +1 -1
index fff61f9..f735825 100644
@@ -104,7 +104,7 @@ static inline struct rvt_qp *hfi1_lookup_qpn(struct hfi1_ibport *ibp,
 	struct rvt_qp *qp = NULL;
 
 	if (unlikely(qpn <= 1)) {
-		qp = rcu_dereference(ibp->qp[qpn]);
+		qp = rcu_dereference(ibp->rvp.qp[qpn]);
 	} else {
 		struct hfi1_ibdev *dev = &ppd_from_ibp(ibp)->dd->verbs_dev;
 		u32 n = qpn_hash(dev->qp_dev, qpn);
drivers/staging/rdma/hfi1/rc.c +16 -16
index 752643d..833f00f 100644
@@ -772,7 +772,7 @@ void hfi1_send_rc_ack(struct hfi1_ctxtdata *rcd, struct rvt_qp *qp,
 	return;
 
 queue_ack:
-	this_cpu_inc(*ibp->rc_qacks);
+	this_cpu_inc(*ibp->rvp.rc_qacks);
 	spin_lock_irqsave(&qp->s_lock, flags);
 	qp->s_flags |= HFI1_S_ACK_PENDING | HFI1_S_RESP_PENDING;
 	qp->s_nak_state = qp->r_nak_state;
@@ -900,9 +900,9 @@ static void restart_rc(struct rvt_qp *qp, u32 psn, int wait)
 
 	ibp = to_iport(qp->ibqp.device, qp->port_num);
 	if (wqe->wr.opcode == IB_WR_RDMA_READ)
-		ibp->n_rc_resends++;
+		ibp->rvp.n_rc_resends++;
 	else
-		ibp->n_rc_resends += delta_psn(qp->s_psn, psn);
+		ibp->rvp.n_rc_resends += delta_psn(qp->s_psn, psn);
 
 	qp->s_flags &= ~(HFI1_S_WAIT_FENCE | HFI1_S_WAIT_RDMAR |
 			 HFI1_S_WAIT_SSN_CREDIT | HFI1_S_WAIT_PSN |
@@ -925,7 +925,7 @@ static void rc_timeout(unsigned long arg)
 	spin_lock(&qp->s_lock);
 	if (qp->s_flags & HFI1_S_TIMER) {
 		ibp = to_iport(qp->ibqp.device, qp->port_num);
-		ibp->n_rc_timeouts++;
+		ibp->rvp.n_rc_timeouts++;
 		qp->s_flags &= ~HFI1_S_TIMER;
 		del_timer(&qp->s_timer);
 		trace_hfi1_rc_timeout(qp, qp->s_last_psn + 1);
@@ -1104,7 +1104,7 @@ static struct rvt_swqe *do_rc_completion(struct rvt_qp *qp,
 	} else {
 		struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);
 
-		this_cpu_inc(*ibp->rc_delayed_comp);
+		this_cpu_inc(*ibp->rvp.rc_delayed_comp);
 		/*
 		 * If send progress not running attempt to progress
 		 * SDMA queue.
@@ -1263,7 +1263,7 @@ static int do_rc_ack(struct rvt_qp *qp, u32 aeth, u32 psn, int opcode,
 
 	switch (aeth >> 29) {
 	case 0:         /* ACK */
-		this_cpu_inc(*ibp->rc_acks);
+		this_cpu_inc(*ibp->rvp.rc_acks);
 		if (qp->s_acked != qp->s_tail) {
 			/*
 			 * We are expecting more ACKs so
@@ -1292,7 +1292,7 @@ static int do_rc_ack(struct rvt_qp *qp, u32 aeth, u32 psn, int opcode,
 		goto bail;
 
 	case 1:         /* RNR NAK */
-		ibp->n_rnr_naks++;
+		ibp->rvp.n_rnr_naks++;
 		if (qp->s_acked == qp->s_tail)
 			goto bail;
 		if (qp->s_flags & HFI1_S_WAIT_RNR)
@@ -1307,7 +1307,7 @@ static int do_rc_ack(struct rvt_qp *qp, u32 aeth, u32 psn, int opcode,
 		/* The last valid PSN is the previous PSN. */
 		update_last_psn(qp, psn - 1);
 
-		ibp->n_rc_resends += delta_psn(qp->s_psn, psn);
+		ibp->rvp.n_rc_resends += delta_psn(qp->s_psn, psn);
 
 		reset_psn(qp, psn);
 
@@ -1328,7 +1328,7 @@ static int do_rc_ack(struct rvt_qp *qp, u32 aeth, u32 psn, int opcode,
 		switch ((aeth >> HFI1_AETH_CREDIT_SHIFT) &
 			HFI1_AETH_CREDIT_MASK) {
 		case 0: /* PSN sequence error */
-			ibp->n_seq_naks++;
+			ibp->rvp.n_seq_naks++;
 			/*
 			 * Back up to the responder's expected PSN.
 			 * Note that we might get a NAK in the middle of an
@@ -1341,17 +1341,17 @@ static int do_rc_ack(struct rvt_qp *qp, u32 aeth, u32 psn, int opcode,
 
 		case 1: /* Invalid Request */
 			status = IB_WC_REM_INV_REQ_ERR;
-			ibp->n_other_naks++;
+			ibp->rvp.n_other_naks++;
 			goto class_b;
 
 		case 2: /* Remote Access Error */
 			status = IB_WC_REM_ACCESS_ERR;
-			ibp->n_other_naks++;
+			ibp->rvp.n_other_naks++;
 			goto class_b;
 
 		case 3: /* Remote Operation Error */
 			status = IB_WC_REM_OP_ERR;
-			ibp->n_other_naks++;
+			ibp->rvp.n_other_naks++;
 class_b:
 			if (qp->s_last == qp->s_acked) {
 				hfi1_send_complete(qp, wqe, status);
@@ -1402,7 +1402,7 @@ static void rdma_seq_err(struct rvt_qp *qp, struct hfi1_ibport *ibp, u32 psn,
 		wqe = do_rc_completion(qp, wqe, ibp);
 	}
 
-	ibp->n_rdma_seq++;
+	ibp->rvp.n_rdma_seq++;
 	qp->r_flags |= HFI1_R_RDMAR_SEQ;
 	restart_rc(qp, qp->s_last_psn + 1, 0);
 	if (list_empty(&qp->rspwait)) {
@@ -1663,7 +1663,7 @@ static noinline int rc_rcv_error(struct hfi1_other_headers *ohdr, void *data,
 		 * Don't queue the NAK if we already sent one.
 		 */
 		if (!qp->r_nak_state) {
-			ibp->n_rc_seqnak++;
+			ibp->rvp.n_rc_seqnak++;
 			qp->r_nak_state = IB_NAK_PSN_ERROR;
 			/* Use the expected PSN. */
 			qp->r_ack_psn = qp->r_psn;
@@ -1695,7 +1695,7 @@ static noinline int rc_rcv_error(struct hfi1_other_headers *ohdr, void *data,
 	 */
 	e = NULL;
 	old_req = 1;
-	ibp->n_rc_dupreq++;
+	ibp->rvp.n_rc_dupreq++;
 
 	spin_lock_irqsave(&qp->s_lock, flags);
 
@@ -2429,7 +2429,7 @@ void hfi1_rc_hdrerr(
 	if (opcode < IB_OPCODE_RC_RDMA_READ_RESPONSE_FIRST) {
 		diff = delta_psn(psn, qp->r_psn);
 		if (!qp->r_nak_state && diff >= 0) {
-			ibp->n_rc_seqnak++;
+			ibp->rvp.n_rc_seqnak++;
 			qp->r_nak_state = IB_NAK_PSN_ERROR;
 			/* Use the expected PSN. */
 			qp->r_ack_psn = qp->r_psn;
drivers/staging/rdma/hfi1/ruc.c +8 -6
index 9841e89..adc28b6 100644
@@ -279,7 +279,8 @@ int hfi1_ruc_check_hdr(struct hfi1_ibport *ibp, struct hfi1_ib_header *hdr,
 			if (!(qp->alt_ah_attr.ah_flags & IB_AH_GRH))
 				goto err;
 			guid = get_sguid(ibp, qp->alt_ah_attr.grh.sgid_index);
-			if (!gid_ok(&hdr->u.l.grh.dgid, ibp->gid_prefix, guid))
+			if (!gid_ok(&hdr->u.l.grh.dgid, ibp->rvp.gid_prefix,
+				    guid))
 				goto err;
 			if (!gid_ok(&hdr->u.l.grh.sgid,
 			    qp->alt_ah_attr.grh.dgid.global.subnet_prefix,
@@ -311,7 +312,8 @@ int hfi1_ruc_check_hdr(struct hfi1_ibport *ibp, struct hfi1_ib_header *hdr,
 				goto err;
 			guid = get_sguid(ibp,
 					 qp->remote_ah_attr.grh.sgid_index);
-			if (!gid_ok(&hdr->u.l.grh.dgid, ibp->gid_prefix, guid))
+			if (!gid_ok(&hdr->u.l.grh.dgid, ibp->rvp.gid_prefix,
+				    guid))
 				goto err;
 			if (!gid_ok(&hdr->u.l.grh.sgid,
 			    qp->remote_ah_attr.grh.dgid.global.subnet_prefix,
@@ -411,7 +413,7 @@ again:
 
 	if (!qp || !(ib_hfi1_state_ops[qp->state] & HFI1_PROCESS_RECV_OK) ||
 	    qp->ibqp.qp_type != sqp->ibqp.qp_type) {
-		ibp->n_pkt_drops++;
+		ibp->rvp.n_pkt_drops++;
 		/*
 		 * For RC, the requester would timeout and retry so
 		 * shortcut the timeouts and just signal too many retries.
@@ -567,7 +569,7 @@ again:
 
 send_comp:
 	spin_lock_irqsave(&sqp->s_lock, flags);
-	ibp->n_loop_pkts++;
+	ibp->rvp.n_loop_pkts++;
 flush_send:
 	sqp->s_rnr_retry = sqp->s_rnr_retry_cnt;
 	hfi1_send_complete(sqp, wqe, send_status);
@@ -577,7 +579,7 @@ rnr_nak:
 	/* Handle RNR NAK */
 	if (qp->ibqp.qp_type == IB_QPT_UC)
 		goto send_comp;
-	ibp->n_rnr_naks++;
+	ibp->rvp.n_rnr_naks++;
 	/*
 	 * Note: we don't need the s_lock held since the BUSY flag
 	 * makes this single threaded.
@@ -663,7 +665,7 @@ u32 hfi1_make_grh(struct hfi1_ibport *ibp, struct ib_grh *hdr,
 	hdr->next_hdr = IB_GRH_NEXT_HDR;
 	hdr->hop_limit = grh->hop_limit;
 	/* The SGID is 32-bit aligned. */
-	hdr->sgid.global.subnet_prefix = ibp->gid_prefix;
+	hdr->sgid.global.subnet_prefix = ibp->rvp.gid_prefix;
 	hdr->sgid.global.interface_id =
 		grh->sgid_index && grh->sgid_index < ARRAY_SIZE(ibp->guids) ?
 		ibp->guids[grh->sgid_index - 1] :
drivers/staging/rdma/hfi1/uc.c +1 -1
index 6686331..cac3724 100644
@@ -579,7 +579,7 @@ rewind:
 	set_bit(HFI1_R_REWIND_SGE, &qp->r_aflags);
 	qp->r_sge.num_sge = 0;
 drop:
-	ibp->n_pkt_drops++;
+	ibp->rvp.n_pkt_drops++;
 	return;
 
 op_err:
drivers/staging/rdma/hfi1/ud.c +8 -8
index b14641c..f1d43b3 100644
@@ -82,7 +82,7 @@ static void ud_loopback(struct rvt_qp *sqp, struct rvt_swqe *swqe)
 
 	qp = hfi1_lookup_qpn(ibp, swqe->ud_wr.remote_qpn);
 	if (!qp) {
-		ibp->n_pkt_drops++;
+		ibp->rvp.n_pkt_drops++;
 		rcu_read_unlock();
 		return;
 	}
@@ -94,7 +94,7 @@ static void ud_loopback(struct rvt_qp *sqp, struct rvt_swqe *swqe)
 
 	if (dqptype != sqptype ||
 	    !(ib_hfi1_state_ops[qp->state] & HFI1_PROCESS_RECV_OK)) {
-		ibp->n_pkt_drops++;
+		ibp->rvp.n_pkt_drops++;
 		goto drop;
 	}
 
@@ -174,14 +174,14 @@ static void ud_loopback(struct rvt_qp *sqp, struct rvt_swqe *swqe)
 		}
 		if (!ret) {
 			if (qp->ibqp.qp_num == 0)
-				ibp->n_vl15_dropped++;
+				ibp->rvp.n_vl15_dropped++;
 			goto bail_unlock;
 		}
 	}
 	/* Silently drop packets which are too big. */
 	if (unlikely(wc.byte_len > qp->r_len)) {
 		qp->r_flags |= HFI1_R_REUSE_SGE;
-		ibp->n_pkt_drops++;
+		ibp->rvp.n_pkt_drops++;
 		goto bail_unlock;
 	}
 
@@ -250,7 +250,7 @@ static void ud_loopback(struct rvt_qp *sqp, struct rvt_swqe *swqe)
 	/* Signal completion event if the solicited bit is set. */
 	hfi1_cq_enter(to_icq(qp->ibqp.recv_cq), &wc,
 		      swqe->wr.send_flags & IB_SEND_SOLICITED);
-	ibp->n_loop_pkts++;
+	ibp->rvp.n_loop_pkts++;
 bail_unlock:
 	spin_unlock_irqrestore(&qp->r_lock, flags);
 drop:
@@ -609,7 +609,7 @@ static int opa_smp_check(struct hfi1_ibport *ibp, u16 pkey, u8 sc5,
 	case IB_MGMT_METHOD_TRAP:
 	case IB_MGMT_METHOD_GET_RESP:
 	case IB_MGMT_METHOD_REPORT_RESP:
-		if (ibp->port_cap_flags & IB_PORT_SM)
+		if (ibp->rvp.port_cap_flags & IB_PORT_SM)
 			return 0;
 		if (pkey == FULL_MGMT_P_KEY) {
 			smp->status |= IB_SMP_UNSUP_METHOD;
@@ -823,7 +823,7 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)
 		}
 		if (!ret) {
 			if (qp->ibqp.qp_num == 0)
-				ibp->n_vl15_dropped++;
+				ibp->rvp.n_vl15_dropped++;
 			return;
 		}
 	}
@@ -883,5 +883,5 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)
 	return;
 
 drop:
-	ibp->n_pkt_drops++;
+	ibp->rvp.n_pkt_drops++;
 }
drivers/staging/rdma/hfi1/verbs.c +35 -26

136 lines not on this page · raw message

drivers/staging/rdma/hfi1/verbs.h +3 -48

65 lines not on this page · raw message

drivers/staging/rdma/hfi1/verbs_mcast.c +14 -14
index 49954b9..aa3f560 100644
@@ -131,8 +131,8 @@ struct hfi1_mcast *hfi1_mcast_find(struct hfi1_ibport *ibp, union ib_gid *mgid)
 	unsigned long flags;
 	struct hfi1_mcast *mcast;
 
-	spin_lock_irqsave(&ibp->lock, flags);
-	n = ibp->mcast_tree.rb_node;
+	spin_lock_irqsave(&ibp->rvp.lock, flags);
+	n = ibp->rvp.mcast_tree.rb_node;
 	while (n) {
 		int ret;
 
@@ -146,11 +146,11 @@ struct hfi1_mcast *hfi1_mcast_find(struct hfi1_ibport *ibp, union ib_gid *mgid)
 			n = n->rb_right;
 		else {
 			atomic_inc(&mcast->refcount);
-			spin_unlock_irqrestore(&ibp->lock, flags);
+			spin_unlock_irqrestore(&ibp->rvp.lock, flags);
 			goto bail;
 		}
 	}
-	spin_unlock_irqrestore(&ibp->lock, flags);
+	spin_unlock_irqrestore(&ibp->rvp.lock, flags);
 
 	mcast = NULL;
 
@@ -170,11 +170,11 @@ bail:
 static int mcast_add(struct hfi1_ibdev *dev, struct hfi1_ibport *ibp,
 		     struct hfi1_mcast *mcast, struct hfi1_mcast_qp *mqp)
 {
-	struct rb_node **n = &ibp->mcast_tree.rb_node;
+	struct rb_node **n = &ibp->rvp.mcast_tree.rb_node;
 	struct rb_node *pn = NULL;
 	int ret;
 
-	spin_lock_irq(&ibp->lock);
+	spin_lock_irq(&ibp->rvp.lock);
 
 	while (*n) {
 		struct hfi1_mcast *tmcast;
@@ -229,12 +229,12 @@ static int mcast_add(struct hfi1_ibdev *dev, struct hfi1_ibport *ibp,
 
 	atomic_inc(&mcast->refcount);
 	rb_link_node(&mcast->rb_node, pn, n);
-	rb_insert_color(&mcast->rb_node, &ibp->mcast_tree);
+	rb_insert_color(&mcast->rb_node, &ibp->rvp.mcast_tree);
 
 	ret = 0;
 
 bail:
-	spin_unlock_irq(&ibp->lock);
+	spin_unlock_irq(&ibp->rvp.lock);
 
 	return ret;
 }
@@ -313,13 +313,13 @@ int hfi1_multicast_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
 		goto bail;
 	}
 
-	spin_lock_irq(&ibp->lock);
+	spin_lock_irq(&ibp->rvp.lock);
 
 	/* Find the GID in the mcast table. */
-	n = ibp->mcast_tree.rb_node;
+	n = ibp->rvp.mcast_tree.rb_node;
 	while (1) {
 		if (n == NULL) {
-			spin_unlock_irq(&ibp->lock);
+			spin_unlock_irq(&ibp->rvp.lock);
 			ret = -EINVAL;
 			goto bail;
 		}
@@ -348,13 +348,13 @@ int hfi1_multicast_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
 
 		/* If this was the last attached QP, remove the GID too. */
 		if (list_empty(&mcast->qp_list)) {
-			rb_erase(&mcast->rb_node, &ibp->mcast_tree);
+			rb_erase(&mcast->rb_node, &ibp->rvp.mcast_tree);
 			last = 1;
 		}
 		break;
 	}
 
-	spin_unlock_irq(&ibp->lock);
+	spin_unlock_irq(&ibp->rvp.lock);
 
 	if (p) {
 		/*
@@ -381,5 +381,5 @@ bail:
 
 int hfi1_mcast_tree_empty(struct hfi1_ibport *ibp)
 {
-	return ibp->mcast_tree.rb_node == NULL;
+	return !ibp->rvp.mcast_tree.rb_node;
 }

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

RFC PATCH 14/15 IB/hfi1: Remove mmap from hfi1

In reply to a message not in the archive

Mmap data structure has already been moved to rdmavt and hfi1 supports it. Now that the mmap functionality has also been moved to rdmavt its time for hfi1 to use that as well.

---
 drivers/staging/rdma/hfi1/Makefile |    2 
 drivers/staging/rdma/hfi1/cq.c     |   18 ++-
 drivers/staging/rdma/hfi1/mmap.c   |  192 ------------------------------------
 drivers/staging/rdma/hfi1/qp.c     |   12 +-
 drivers/staging/rdma/hfi1/srq.c    |   20 ++--
 drivers/staging/rdma/hfi1/verbs.c  |    6 -
 drivers/staging/rdma/hfi1/verbs.h  |   17 ---
 7 files changed, 27 insertions(+), 240 deletions(-)
 delete mode 100644 drivers/staging/rdma/hfi1/mmap.c
drivers/staging/rdma/hfi1/Makefile +1 -1
index 3ba64fe..ff663b3 100644
@@ -8,7 +8,7 @@
 obj-$(CONFIG_INFINIBAND_HFI1) += hfi1.o
 
 hfi1-y := chip.o cq.o device.o diag.o driver.o eprom.o file_ops.o firmware.o \
-	init.o intr.o mad.o mmap.o pcie.o pio.o pio_copy.o \
+	init.o intr.o mad.o pcie.o pio.o pio_copy.o \
 	qp.o qsfp.o rc.o ruc.o sdma.o srq.o sysfs.o trace.o twsi.o \
 	uc.o ud.o user_pages.o user_sdma.o verbs_mcast.o verbs.o
 hfi1-$(CONFIG_DEBUG_FS) += debugfs.o
drivers/staging/rdma/hfi1/cq.c +9 -9
index ffd0e7a..25d1a2a 100644
@@ -277,7 +277,7 @@ struct ib_cq *hfi1_create_cq(
 	if (udata && udata->outlen >= sizeof(__u64)) {
 		int err;
 
-		cq->ip = hfi1_create_mmap_info(dev, sz, context, wc);
+		cq->ip = rvt_create_mmap_info(&dev->rdi, sz, context, wc);
 		if (!cq->ip) {
 			ret = ERR_PTR(-ENOMEM);
 			goto bail_wc;
@@ -303,9 +303,9 @@ struct ib_cq *hfi1_create_cq(
 	spin_unlock(&dev->n_cqs_lock);
 
 	if (cq->ip) {
-		spin_lock_irq(&dev->pending_lock);
-		list_add(&cq->ip->pending_mmaps, &dev->pending_mmaps);
-		spin_unlock_irq(&dev->pending_lock);
+		spin_lock_irq(&dev->rdi.pending_lock);
+		list_add(&cq->ip->pending_mmaps, &dev->rdi.pending_mmaps);
+		spin_unlock_irq(&dev->rdi.pending_lock);
 	}
 
 	/*
@@ -355,7 +355,7 @@ int hfi1_destroy_cq(struct ib_cq *ibcq)
 	dev->n_cqs_allocated--;
 	spin_unlock(&dev->n_cqs_lock);
 	if (cq->ip)
-		kref_put(&cq->ip->ref, hfi1_release_mmap_info);
+		kref_put(&cq->ip->ref, rvt_release_mmap_info);
 	else
 		vfree(cq->queue);
 	kfree(cq);
@@ -481,7 +481,7 @@ int hfi1_resize_cq(struct ib_cq *ibcq, int cqe, struct ib_udata *udata)
 		struct hfi1_ibdev *dev = to_idev(ibcq->device);
 		struct rvt_mmap_info *ip = cq->ip;
 
-		hfi1_update_mmap_info(dev, ip, sz, wc);
+		rvt_update_mmap_info(&dev->rdi, ip, sz, wc);
 
 		/*
 		 * Return the offset to mmap.
@@ -494,10 +494,10 @@ int hfi1_resize_cq(struct ib_cq *ibcq, int cqe, struct ib_udata *udata)
 				goto bail;
 		}
 
-		spin_lock_irq(&dev->pending_lock);
+		spin_lock_irq(&dev->rdi.pending_lock);
 		if (list_empty(&ip->pending_mmaps))
-			list_add(&ip->pending_mmaps, &dev->pending_mmaps);
-		spin_unlock_irq(&dev->pending_lock);
+			list_add(&ip->pending_mmaps, &dev->rdi.pending_mmaps);
+		spin_unlock_irq(&dev->rdi.pending_lock);
 	}
 
 	ret = 0;
drivers/staging/rdma/hfi1/mmap.c deleted +0 -192

192 lines not on this page · raw message

drivers/staging/rdma/hfi1/qp.c +6 -6
index 18e7276..b09aaa3 100644
@@ -1195,7 +1195,7 @@ struct ib_qp *hfi1_create_qp(struct ib_pd *ibpd,
 		} else {
 			u32 s = sizeof(struct rvt_rwq) + qp->r_rq.size * sz;
 
-			qp->ip = hfi1_create_mmap_info(dev, s,
+			qp->ip = rvt_create_mmap_info(&dev->rdi, s,
 						      ibpd->uobject->context,
 						      qp->r_rq.wq);
 			if (!qp->ip) {
@@ -1223,9 +1223,9 @@ struct ib_qp *hfi1_create_qp(struct ib_pd *ibpd,
 	spin_unlock(&dev->n_qps_lock);
 
 	if (qp->ip) {
-		spin_lock_irq(&dev->pending_lock);
-		list_add(&qp->ip->pending_mmaps, &dev->pending_mmaps);
-		spin_unlock_irq(&dev->pending_lock);
+		spin_lock_irq(&dev->rdi.pending_lock);
+		list_add(&qp->ip->pending_mmaps, &dev->rdi.pending_mmaps);
+		spin_unlock_irq(&dev->rdi.pending_lock);
 	}
 
 	ret = &qp->ibqp;
@@ -1256,7 +1256,7 @@ struct ib_qp *hfi1_create_qp(struct ib_pd *ibpd,
 
 bail_ip:
 	if (qp->ip)
-		kref_put(&qp->ip->ref, hfi1_release_mmap_info);
+		kref_put(&qp->ip->ref, rvt_release_mmap_info);
 	else
 		vfree(qp->r_rq.wq);
 	free_qpn(&dev->qp_dev->qpn_table, qp->ibqp.qp_num);
@@ -1316,7 +1316,7 @@ int hfi1_destroy_qp(struct ib_qp *ibqp)
 	spin_unlock(&dev->n_qps_lock);
 
 	if (qp->ip)
-		kref_put(&qp->ip->ref, hfi1_release_mmap_info);
+		kref_put(&qp->ip->ref, rvt_release_mmap_info);
 	else
 		vfree(qp->r_rq.wq);
 	vfree(qp->s_wq);
drivers/staging/rdma/hfi1/srq.c +10 -10
index 78f190a..c53b378 100644
@@ -165,8 +165,8 @@ struct ib_srq *hfi1_create_srq(struct ib_pd *ibpd,
 		u32 s = sizeof(struct rvt_rwq) + srq->rq.size * sz;
 
 		srq->ip =
-		    hfi1_create_mmap_info(dev, s, ibpd->uobject->context,
-					  srq->rq.wq);
+		    rvt_create_mmap_info(&dev->rdi, s, ibpd->uobject->context,
+					 srq->rq.wq);
 		if (!srq->ip) {
 			ret = ERR_PTR(-ENOMEM);
 			goto bail_wq;
@@ -200,9 +200,9 @@ struct ib_srq *hfi1_create_srq(struct ib_pd *ibpd,
 	spin_unlock(&dev->n_srqs_lock);
 
 	if (srq->ip) {
-		spin_lock_irq(&dev->pending_lock);
-		list_add(&srq->ip->pending_mmaps, &dev->pending_mmaps);
-		spin_unlock_irq(&dev->pending_lock);
+		spin_lock_irq(&dev->rdi.pending_lock);
+		list_add(&srq->ip->pending_mmaps, &dev->rdi.pending_mmaps);
+		spin_unlock_irq(&dev->rdi.pending_lock);
 	}
 
 	ret = &srq->ibsrq;
@@ -324,7 +324,7 @@ int hfi1_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
 			struct hfi1_ibdev *dev = to_idev(srq->ibsrq.device);
 			u32 s = sizeof(struct rvt_rwq) + size * sz;
 
-			hfi1_update_mmap_info(dev, ip, s, wq);
+			rvt_update_mmap_info(&dev->rdi, ip, s, wq);
 
 			/*
 			 * Return the offset to mmap.
@@ -341,11 +341,11 @@ int hfi1_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
 			 * Put user mapping info onto the pending list
 			 * unless it already is on the list.
 			 */
-			spin_lock_irq(&dev->pending_lock);
+			spin_lock_irq(&dev->rdi.pending_lock);
 			if (list_empty(&ip->pending_mmaps))
 				list_add(&ip->pending_mmaps,
-					 &dev->pending_mmaps);
-			spin_unlock_irq(&dev->pending_lock);
+					 &dev->rdi.pending_mmaps);
+			spin_unlock_irq(&dev->rdi.pending_lock);
 		}
 	} else if (attr_mask & IB_SRQ_LIMIT) {
 		spin_lock_irq(&srq->rq.lock);
@@ -388,7 +388,7 @@ int hfi1_destroy_srq(struct ib_srq *ibsrq)
 	dev->n_srqs_allocated--;
 	spin_unlock(&dev->n_srqs_lock);
 	if (srq->ip)
-		kref_put(&srq->ip->ref, hfi1_release_mmap_info);
+		kref_put(&srq->ip->ref, rvt_release_mmap_info);
 	else
 		vfree(srq->rq.wq);
 	kfree(srq);
drivers/staging/rdma/hfi1/verbs.c +1 -5
index 895d07a..d208717 100644
@@ -1795,11 +1795,7 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
 	dev->mem_timer.function = mem_timer;
 	dev->mem_timer.data = (unsigned long) dev;
 
-	INIT_LIST_HEAD(&dev->pending_mmaps);
-	spin_lock_init(&dev->pending_lock);
 	seqlock_init(&dev->iowait_lock);
-	dev->mmap_offset = PAGE_SIZE;
-	spin_lock_init(&dev->mmap_offset_lock);
 	INIT_LIST_HEAD(&dev->txwait);
 	INIT_LIST_HEAD(&dev->memwait);
 
@@ -1906,7 +1902,7 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
 	ibdev->attach_mcast = hfi1_multicast_attach;
 	ibdev->detach_mcast = hfi1_multicast_detach;
 	ibdev->process_mad = hfi1_process_mad;
-	ibdev->mmap = hfi1_mmap;
+	ibdev->mmap = NULL;
 	ibdev->dma_ops = NULL;
 	ibdev->get_port_immutable = port_immutable;
 
drivers/staging/rdma/hfi1/verbs.h +0 -17
index bc21f1a..cbbdfbd 100644
@@ -424,9 +424,6 @@ struct hfi1_ibport {
 struct hfi1_qp_ibdev;
 struct hfi1_ibdev {
 	struct rvt_dev_info rdi; /* Must be first */
-	struct list_head pending_mmaps;
-	spinlock_t mmap_offset_lock; /* protect mmap_offset */
-	u32 mmap_offset;
 
 	struct hfi1_qp_ibdev *qp_dev;
 
@@ -439,9 +436,6 @@ struct hfi1_ibdev {
 	struct kmem_cache *verbs_txreq_cache;
 	struct timer_list mem_timer;
 
-	/* other waiters */
-	spinlock_t pending_lock;
-
 	u64 n_piowait;
 	u64 n_txwait;
 	u64 n_kmem_wait;
@@ -678,17 +672,6 @@ static inline void hfi1_put_ss(struct rvt_sge_state *ss)
 	}
 }
 
-void hfi1_release_mmap_info(struct kref *ref);
-
-struct rvt_mmap_info *hfi1_create_mmap_info(struct hfi1_ibdev *dev, u32 size,
-					    struct ib_ucontext *context,
-					    void *obj);
-
-void hfi1_update_mmap_info(struct hfi1_ibdev *dev, struct rvt_mmap_info *ip,
-			   u32 size, void *obj);
-
-int hfi1_mmap(struct ib_ucontext *context, struct vm_area_struct *vma);
-
 int hfi1_get_rwqe(struct rvt_qp *qp, int wr_id_only);
 
 int hfi1_ruc_check_hdr(struct hfi1_ibport *ibp, struct hfi1_ib_header *hdr,

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

#31 lore raw

RFC PATCH 15/15 IB/hfi1: Use rdmavt pkey verbs function

In reply to Dennis Dalessandro

No need to keep providing the query pkey function. This is now being done in rdmavt. Remove support from hfi1. The allocation and maintenance of the list still resides in the driver.

---
 drivers/staging/rdma/hfi1/verbs.c |   20 +-------------------
 1 files changed, 1 insertions(+), 19 deletions(-)
drivers/staging/rdma/hfi1/verbs.c +1 -19
index d208717..e1f249a 100644
@@ -1678,24 +1678,6 @@ unsigned hfi1_get_npkeys(struct hfi1_devdata *dd)
 	return ARRAY_SIZE(dd->pport[0].pkeys);
 }
 
-static int query_pkey(struct ib_device *ibdev, u8 port, u16 index,
-		      u16 *pkey)
-{
-	struct hfi1_devdata *dd = dd_from_ibdev(ibdev);
-	int ret;
-
-	if (index >= hfi1_get_npkeys(dd)) {
-		ret = -EINVAL;
-		goto bail;
-	}
-
-	*pkey = hfi1_get_pkey(to_iport(ibdev, port), index);
-	ret = 0;
-
-bail:
-	return ret;
-}
-
 /**
  * alloc_ucontext - allocate a ucontest
  * @ibdev: the infiniband device
@@ -1863,7 +1845,7 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
 	ibdev->modify_device = modify_device;
 	ibdev->query_port = query_port;
 	ibdev->modify_port = modify_port;
-	ibdev->query_pkey = query_pkey;
+	ibdev->query_pkey = NULL;
 	ibdev->query_gid = query_gid;
 	ibdev->alloc_ucontext = alloc_ucontext;
 	ibdev->dealloc_ucontext = dealloc_ucontext;
#14 lore raw
In reply to a message not in the archive

Greg, Doug,

As mentioned below, these patches depend on the new rdmavt library submitted to Doug on linux-rdma.

We continue to identify (and rework) patches by our other developers which can be submitted without conflicts with this series. Furthermore, We have, as much as possible, placed fixes directly into rdmavt such that those changes can be dropped from hfi1. But at this point, we need to know if and where these are going to land so that we can start reworking as appropriate.

Therefore, I would like to discuss plans to get hfi1 under the same maintainer to work through this transitional period.

Basically, At what point should we stop submitting patches to Greg and start submitting to Doug?

Should we consider the merge window itself as the swap over point and submit changes to Doug at that point? If so, should we continue to submit what we can to Greg until then (and continue rebase'ing the series below on that work)? Or given Gregs backlog, should we stop submitting to Greg sometime prior to the merge window?

That brings up my final question, at the point of swap over I assume anything not accepted by Greg should be considered rejected and we need to resubmit to Doug?

Thanks in advance for any guidance,
Ira

Quoted 77 lines · Dennis

This patch series is being submitted as a Request For Comment only. It depends on code submitted to the rdma subsystem [1].

This work is the first submission aimed to satisfy the TODO item for removing duplicated code in hfi1. At the time of submission hfi1 and qib contained alot of duplicated verbs processing code. The qib driver is having similar changes made to use rdmavt. This will result in a common code base that both drivers and future drivers such as soft-roce can use.

Note that due to the ongoing submission of hfi1 improvement patches, there will likely be a number of conflicts which will still need to be resolved.

We also are still faced with the issue of separate trees for this work as was discussed previously [2]. The result of that conversation was to keep the drivers in separate trees until the 4.5 merge window. We are hoping that after this merge window a single maintainer can take control of hfi1, qib, and rdmavt so that these patches can move forward and be applied.

For now though we would like to get feedback on these patches with more to follow.

[1] https://www.mail-archive.com/[email protected]/msg30074.html
[2] https://www.mail-archive.com/linux-rdma%40vger.kernel.org/msg29360.html

---

Dennis Dalessandro (15):
IB/hfi1: Begin to use rdmavt for verbs
IB/hfi1: Add basic rdmavt capability flags for hfi1 IB/hfi1: Consolidate dma ops for hfi1
IB/hfi1: Use rdmavt protection domain
IB/hfi1: Remove MR data structures from hfi1 IB/hfi1: Remove driver specific members from hfi1 qp type IB/hfi1: Add device specific info prints IB/hfi1: Use correct rdmavt header files after move. IB/hfi1: Use address handle in rdmavt and remove from hfi1 IB/hfi1: Implement hfi1 support for AH notification IB/hfi1: Remove hfi1 MR and hfi1 specific qp type IB/hfi1: Remove srq from hfi1
IB/hfi1: Remove ibport and use rdmavt version IB/hfi1: Remove mmap from hfi1
IB/hfi1: Use rdmavt pkey verbs function

 drivers/staging/rdma/hfi1/Kconfig       |    2 
 drivers/staging/rdma/hfi1/Makefile      |    4 
 drivers/staging/rdma/hfi1/chip.c        |   36 +-
 drivers/staging/rdma/hfi1/common.h      |    2 
 drivers/staging/rdma/hfi1/cq.c          |   20 +
 drivers/staging/rdma/hfi1/diag.c        |   13 -
 drivers/staging/rdma/hfi1/driver.c      |   31 +-
 drivers/staging/rdma/hfi1/hfi.h         |   27 +-
 drivers/staging/rdma/hfi1/init.c        |    5 
 drivers/staging/rdma/hfi1/intr.c        |    2 
 drivers/staging/rdma/hfi1/keys.c        |  356 ---------------------
 drivers/staging/rdma/hfi1/mad.c         |  163 +++++-----
 drivers/staging/rdma/hfi1/mmap.c        |  192 -----------
 drivers/staging/rdma/hfi1/mr.c          |  522 ------------------------------
 drivers/staging/rdma/hfi1/pio.c         |   10 -
 drivers/staging/rdma/hfi1/qp.c          |  214 +++++++-----
 drivers/staging/rdma/hfi1/qp.h          |   44 +--
 drivers/staging/rdma/hfi1/rc.c          |  155 +++++----
 drivers/staging/rdma/hfi1/ruc.c         |  161 +++++----
 drivers/staging/rdma/hfi1/sdma.h        |    8 
 drivers/staging/rdma/hfi1/srq.c         |   58 ++-
 drivers/staging/rdma/hfi1/sysfs.c       |   18 +
 drivers/staging/rdma/hfi1/trace.h       |   22 +
 drivers/staging/rdma/hfi1/uc.c          |   19 +
 drivers/staging/rdma/hfi1/ud.c          |   91 +++--
 drivers/staging/rdma/hfi1/verbs.c       |  526 +++++++++++--------------------
 drivers/staging/rdma/hfi1/verbs.h       |  531 ++++---------------------------
 drivers/staging/rdma/hfi1/verbs_mcast.c |   36 +-
 28 files changed, 843 insertions(+), 2425 deletions(-)
 delete mode 100644 drivers/staging/rdma/hfi1/keys.c
 delete mode 100644 drivers/staging/rdma/hfi1/mmap.c
 delete mode 100644 drivers/staging/rdma/hfi1/mr.c
Quoted 6 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

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

#16 lore raw
In reply to a message not in the archive
Quoted 23 lines · ira.weiny

Greg, Doug,

As mentioned below, these patches depend on the new rdmavt library submitted to Doug on linux-rdma.

We continue to identify (and rework) patches by our other developers which can be submitted without conflicts with this series. Furthermore, We have, as much as possible, placed fixes directly into rdmavt such that those changes can be dropped from hfi1. But at this point, we need to know if and where these are going to land so that we can start reworking as appropriate.

Therefore, I would like to discuss plans to get hfi1 under the same maintainer to work through this transitional period.

Basically, At what point should we stop submitting patches to Greg and start submitting to Doug?

Should we consider the merge window itself as the swap over point and submit changes to Doug at that point? If so, should we continue to submit what we can to Greg until then (and continue rebase'ing the series below on that work)? Or given Gregs backlog, should we stop submitting to Greg sometime prior to the merge window?

Quoted 3 lines

That brings up my final question, at the point of swap over I assume anything not accepted by Greg should be considered rejected and we need to resubmit to Doug?

If Doug accepts the library changes, let me know that public git commit and I can pull it into the staging-next branch and you can continue to send me staging patches that way.

That's the easiest thing to do usually.

thanks,

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

#18 lore raw
In reply to a message not in the archive
Quoted 24 lines · On Mon, Dec 21, 2015 at 02:02:35PM -0800…
Quoted 23 lines · ira.weiny

Greg, Doug,

As mentioned below, these patches depend on the new rdmavt library submitted to Doug on linux-rdma.

We continue to identify (and rework) patches by our other developers which can be submitted without conflicts with this series. Furthermore, We have, as much as possible, placed fixes directly into rdmavt such that those changes can be dropped from hfi1. But at this point, we need to know if and where these are going to land so that we can start reworking as appropriate.

Therefore, I would like to discuss plans to get hfi1 under the same maintainer to work through this transitional period.

Basically, At what point should we stop submitting patches to Greg and start submitting to Doug?

Should we consider the merge window itself as the swap over point and submit changes to Doug at that point? If so, should we continue to submit what we can to Greg until then (and continue rebase'ing the series below on that work)? Or given Gregs backlog, should we stop submitting to Greg sometime prior to the merge window?

Quoted 7 lines
Quoted 3 lines

That brings up my final question, at the point of swap over I assume anything not accepted by Greg should be considered rejected and we need to resubmit to Doug?

If Doug accepts the library changes, let me know that public git commit and I can pull it into the staging-next branch and you can continue to send me staging patches that way.

Won't this cause a conflict during the merge window?

How do we handle changes which affect both qib and hfi1?

Ira

Quoted 10 lines

That's the easiest thing to do usually.

thanks,

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

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

#20 lore raw
In reply to a message not in the archive
Quoted 29 lines · ira.weiny
Quoted 28 lines · On Mon, Dec 21, 2015 at 02:02:35PM -0800…
Quoted 26 lines · ira.weiny

Greg, Doug,

As mentioned below, these patches depend on the new rdmavt library submitted to Doug on linux-rdma.

We continue to identify (and rework) patches by our other developers which can be submitted without conflicts with this series. Furthermore, We have, as much as possible, placed fixes directly into rdmavt such that those changes can be dropped from hfi1. But at this point, we need to know if and where these are going to land so that we can start reworking as appropriate.

Therefore, I would like to discuss plans to get hfi1 under the same maintainer to work through this transitional period.

Basically, At what point should we stop submitting patches to Greg and start submitting to Doug?

Should we consider the merge window itself as the swap over point and submit changes to Doug at that point? If so, should we continue to submit what we can to Greg until then (and continue rebase'ing the series below on that work)? Or given Gregs backlog, should we stop submitting to Greg sometime prior to the merge window?

That brings up my final question, at the point of swap over I assume anything not accepted by Greg should be considered rejected and we need to resubmit to Doug?

Quoted 5 lines
Quoted 3 lines

If Doug accepts the library changes, let me know that public git commit and I can pull it into the staging-next branch and you can continue to send me staging patches that way.

Won't this cause a conflict during the merge window?

No, git is good :)

Quoted 1 line

How do we handle changes which affect both qib and hfi1?

I don't know, now this gets messy...

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

#22 lore raw
In reply to a message not in the archive
Quoted 34 lines · On Mon, Dec 21, 2015 at 05:01:48PM -0800…
Quoted 33 lines · ira.weiny
Quoted 31 lines · On Mon, Dec 21, 2015 at 02:02:35PM -0800…
Quoted 23 lines · ira.weiny

Greg, Doug,

As mentioned below, these patches depend on the new rdmavt library submitted to Doug on linux-rdma.

We continue to identify (and rework) patches by our other developers which can be submitted without conflicts with this series. Furthermore, We have, as much as possible, placed fixes directly into rdmavt such that those changes can be dropped from hfi1. But at this point, we need to know if and where these are going to land so that we can start reworking as appropriate.

Therefore, I would like to discuss plans to get hfi1 under the same maintainer to work through this transitional period.

Basically, At what point should we stop submitting patches to Greg and start submitting to Doug?

Should we consider the merge window itself as the swap over point and submit changes to Doug at that point? If so, should we continue to submit what we can to Greg until then (and continue rebase'ing the series below on that work)? Or given Gregs backlog, should we stop submitting to Greg sometime prior to the merge window?

Quoted 3 lines

That brings up my final question, at the point of swap over I assume anything not accepted by Greg should be considered rejected and we need to resubmit to Doug?

If Doug accepts the library changes, let me know that public git commit and I can pull it into the staging-next branch and you can continue to send me staging patches that way.

Quoted 8 lines
Quoted 1 line

Won't this cause a conflict during the merge window?

No, git is good :)

Quoted 1 line

How do we handle changes which affect both qib and hfi1?

I don't know, now this gets messy...

Agreed and this is what we are worried about.

Can we do what Dan and Doug have proposed in the past and have Doug take over the staging/rdma sub-tree?

http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2015-November/081922.html

I think the upcoming merge window is a reasonable time for him to do that.

Ira

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

#24 lore raw
In reply to a message not in the archive
Quoted 44 lines · ira.weiny
Quoted 34 lines · On Mon, Dec 21, 2015 at 05:01:48PM -0800…
Quoted 33 lines · ira.weiny
Quoted 31 lines · On Mon, Dec 21, 2015 at 02:02:35PM -0800…
Quoted 23 lines · ira.weiny

Greg, Doug,

As mentioned below, these patches depend on the new rdmavt library submitted to Doug on linux-rdma.

We continue to identify (and rework) patches by our other developers which can be submitted without conflicts with this series. Furthermore, We have, as much as possible, placed fixes directly into rdmavt such that those changes can be dropped from hfi1. But at this point, we need to know if and where these are going to land so that we can start reworking as appropriate.

Therefore, I would like to discuss plans to get hfi1 under the same maintainer to work through this transitional period.

Basically, At what point should we stop submitting patches to Greg and start submitting to Doug?

Should we consider the merge window itself as the swap over point and submit changes to Doug at that point? If so, should we continue to submit what we can to Greg until then (and continue rebase'ing the series below on that work)? Or given Gregs backlog, should we stop submitting to Greg sometime prior to the merge window?

Quoted 3 lines

That brings up my final question, at the point of swap over I assume anything not accepted by Greg should be considered rejected and we need to resubmit to Doug?

If Doug accepts the library changes, let me know that public git commit and I can pull it into the staging-next branch and you can continue to send me staging patches that way.

Quoted 8 lines
Quoted 1 line

Won't this cause a conflict during the merge window?

No, git is good :)

Quoted 1 line

How do we handle changes which affect both qib and hfi1?

I don't know, now this gets messy...

Quoted 8 lines

Agreed and this is what we are worried about.

Can we do what Dan and Doug have proposed in the past and have Doug take over the staging/rdma sub-tree?

http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2015-November/081922.html

I think the upcoming merge window is a reasonable time for him to do that.

Ok, but keeping on top of all of the generic staging patches that come in is a tough thing to do, that's up to Doug, if he is ready for it...

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

#26 lore raw
In reply to a message not in the archive
Quoted 50 lines · On 12/22/2015 09:27 PM, [email protected]…
Quoted 49 lines · ira.weiny
Quoted 34 lines · On Mon, Dec 21, 2015 at 05:01:48PM -0800…
Quoted 33 lines · ira.weiny
Quoted 31 lines · On Mon, Dec 21, 2015 at 02:02:35PM -0800…
Quoted 23 lines · ira.weiny

Greg, Doug,

As mentioned below, these patches depend on the new rdmavt library submitted to Doug on linux-rdma.

We continue to identify (and rework) patches by our other developers which can be submitted without conflicts with this series. Furthermore, We have, as much as possible, placed fixes directly into rdmavt such that those changes can be dropped from hfi1. But at this point, we need to know if and where these are going to land so that we can start reworking as appropriate.

Therefore, I would like to discuss plans to get hfi1 under the same maintainer to work through this transitional period.

Basically, At what point should we stop submitting patches to Greg and start submitting to Doug?

Should we consider the merge window itself as the swap over point and submit changes to Doug at that point? If so, should we continue to submit what we can to Greg until then (and continue rebase'ing the series below on that work)? Or given Gregs backlog, should we stop submitting to Greg sometime prior to the merge window?

Quoted 3 lines

That brings up my final question, at the point of swap over I assume anything not accepted by Greg should be considered rejected and we need to resubmit to Doug?

If Doug accepts the library changes, let me know that public git commit and I can pull it into the staging-next branch and you can continue to send me staging patches that way.

Quoted 8 lines
Quoted 1 line

Won't this cause a conflict during the merge window?

No, git is good :)

Quoted 1 line

How do we handle changes which affect both qib and hfi1?

I don't know, now this gets messy...

Agreed and this is what we are worried about.

Can we do what Dan and Doug have proposed in the past and have Doug take over the staging/rdma sub-tree?

Quoted 6 lines
Quoted 3 lines

http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2015-November/081922.html

I think the upcoming merge window is a reasonable time for him to do that.

Ok, but keeping on top of all of the generic staging patches that come in is a tough thing to do, that's up to Doug, if he is ready for it...

I'm not worried about that. Patchworks makes the workflow reasonable.

Signature · 2 lines
Doug Ledford <[email protected]>
              GPG KeyID: 0E572FDD
#27 lore raw
In reply to a message not in the archive
Quoted 2 lines · On Tue, Dec 22, 2015 at 06:27:57PM -0800…
Quoted 1 line · ira.weiny

On Mon, Dec 21, 2015 at 05:01:48PM -0800, [email protected] wrote:

[snip]

Quoted 13 lines
Quoted 13 lines
Quoted 7 lines

No, git is good :)

Quoted 1 line

How do we handle changes which affect both qib and hfi1?

I don't know, now this gets messy...

Agreed and this is what we are worried about.

Can we do what Dan and Doug have proposed in the past and have Doug take over the staging/rdma sub-tree?

Quoted 7 lines
Quoted 3 lines

http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2015-November/081922.html

I think the upcoming merge window is a reasonable time for him to do that.

Ok, but keeping on top of all of the generic staging patches that come in is a tough thing to do, that's up to Doug, if he is ready for it...

To help this process, once the change over happens, we will help to monitor driverdev-devel for anything submitted to staging/rdma. If something is submitted which was not to Doug and linux-rdma we can handle alerting the submitter to make sure it gets submitted to Doug as per the current MAINTAINERS file.

Hope this helps,
Ira

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

#28 lore raw
In reply to a message not in the archive
Quoted 19 lines
Quoted 19 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

If Doug accepts the library changes, let me know that public git commit and I can pull it into the staging-next branch and you can continue to send me staging patches that way.

Quoted 8 lines
Quoted 1 line

Won't this cause a conflict during the merge window?

No, git is good :)

Quoted 1 line

How do we handle changes which affect both qib and hfi1?

I don't know, now this gets messy...

Agreed and this is what we are worried about.

Can we do what Dan and Doug have proposed in the past and have Doug take over the staging/rdma sub-tree?

Quoted 7 lines
Quoted 3 lines

http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2015-November/081922.html

I think the upcoming merge window is a reasonable time for him to do that.

Ok, but keeping on top of all of the generic staging patches that come in is a tough thing to do, that's up to Doug, if he is ready for it...

Greg,

Forgive me for not knowing how multiple maintainers deal with hand offs like this. I'm hoping you, and/or Doug, can answer some questions for me.

Am I correct in assuming the merge window will be open on Monday? If so, when will Linus pull the staging tree? Then at what point will Doug get the hfi1 changes which have already been accepted?

Are you going to be able to review the outstanding patches for staging/rdma/hfi1 before the merge window? Or should we consider them dropped and resubmit to Doug to apply after he has merged the latest hfi1 code from Linus?

Doug,

At what point should we start submitting additional patches to you which we have queued up but are not yet submitted to Greg?

So far we have been cross posting to linux-rdma for feedback and I see that the patches have been dropped from patchworks. I assume you dropped them from patchworks because you knew that Greg was handling them?

Thanks,
Ira

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