Skip to contentSkip to conversation

IB/rdmavt: clean ups, mad agents and query_qp

PATCH Superseded Dennis Dalessandro 1 participant 7 messages Jan 19, 2016 1 message not in the archive

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover IB/rdmavt: clean ups, mad agents and query_qp

Add some minor clean ups as well as the mad agents and query queue pair to rdmavt.

This patch set should apply on a merged tree of Doug's kernel.org for 4.5 branch and the current head of Linus' tree.

---

Dennis Dalessandro (3):
IB/rdmavt: Add device structure allocation
IB/rdmavt: Add mad agents to rdmavt
IB/rdmavt: Fix copyright date

Harish Chegondi (1):
IB/rdmavt: Add support for rvt_query_qp

Ira Weiny (2):
IB/rdmavt: Remove unused variable from Queue Pair IB/rdmavt: add modify queue pair driver helpers

 drivers/infiniband/sw/rdmavt/ah.c    |    2 -
 drivers/infiniband/sw/rdmavt/ah.h    |    2 -
 drivers/infiniband/sw/rdmavt/cq.c    |    2 -
 drivers/infiniband/sw/rdmavt/cq.h    |    2 -
 drivers/infiniband/sw/rdmavt/dma.c   |    2 -
 drivers/infiniband/sw/rdmavt/dma.h   |    2 -
 drivers/infiniband/sw/rdmavt/mad.c   |   74 ++++++++++++++++++++++++++++++++++
 drivers/infiniband/sw/rdmavt/mad.h   |    5 +-
 drivers/infiniband/sw/rdmavt/mcast.c |    2 -
 drivers/infiniband/sw/rdmavt/mcast.h |    2 -
 drivers/infiniband/sw/rdmavt/mmap.c  |    2 -
 drivers/infiniband/sw/rdmavt/mmap.h  |    2 -
 drivers/infiniband/sw/rdmavt/mr.c    |    2 -
 drivers/infiniband/sw/rdmavt/mr.h    |    2 -
 drivers/infiniband/sw/rdmavt/pd.c    |    2 -
 drivers/infiniband/sw/rdmavt/pd.h    |    2 -
 drivers/infiniband/sw/rdmavt/qp.c    |   56 +++++++++++++++++++++++++-
 drivers/infiniband/sw/rdmavt/qp.h    |    2 -
 drivers/infiniband/sw/rdmavt/srq.c   |    2 -
 drivers/infiniband/sw/rdmavt/srq.h   |    2 -
 drivers/infiniband/sw/rdmavt/trace.c |    2 -
 drivers/infiniband/sw/rdmavt/trace.h |    2 -
 drivers/infiniband/sw/rdmavt/vt.c    |   36 +++++++++++------
 drivers/infiniband/sw/rdmavt/vt.h    |    3 +
 include/rdma/rdma_vt.h               |   16 ++++++-
 include/rdma/rdmavt_mr.h             |    2 -
 include/rdma/rdmavt_qp.h             |    3 -
 27 files changed, 190 insertions(+), 43 deletions(-)
Signature · 5 lines
-Denny
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

#2 lore raw

PATCH 1/6 IB/rdmavt: Remove unused variable from Queue Pair

From: Ira Weiny <[email protected]>

s_sde should be in the low level driver QP private data.

Remove the definition from rvt_qp.

---
 include/rdma/rdmavt_qp.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
include/rdma/rdmavt_qp.h +0 -1
index a97b95b..f0e2426 100644
@@ -304,7 +304,6 @@ struct rvt_qp {
 	struct rvt_swqe *s_wqe;
 	struct rvt_sge_state s_sge;     /* current send request data */
 	struct rvt_mregion *s_rdma_mr;
-	struct sdma_engine *s_sde; /* current sde */
 	u32 s_cur_size;         /* size of send packet in bytes */
 	u32 s_len;              /* total length of s_sge */
 	u32 s_rdma_read_len;    /* total length of s_rdma_read_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

#3 lore raw

PATCH 2/6 IB/rdmavt: add modify queue pair driver helpers

In reply to a message not in the archive

From: Ira Weiny <[email protected]>

Low level drivers need to be able to check incoming attributes as well as be able to adjust their private data on queue pair modification. Add 2 driver callbacks, check_modify_qp and modify_qp, to facilitate this.

---
 drivers/infiniband/sw/rdmavt/qp.c |    7 +++++++
 include/rdma/rdma_vt.h            |    7 +++++++
 2 files changed, 14 insertions(+), 0 deletions(-)
drivers/infiniband/sw/rdmavt/qp.c +7 -0
index 6b76cf2..e340c1a 100644
@@ -940,6 +940,10 @@ int rvt_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
 				attr_mask, link))
 		goto inval;
 
+	if (rdi->driver_f.check_modify_qp &&
+	    rdi->driver_f.check_modify_qp(qp, attr, attr_mask, udata))
+		goto inval;
+
 	if (attr_mask & IB_QP_AV) {
 		if (attr->ah_attr.dlid >= be16_to_cpu(IB_MULTICAST_LID_BASE))
 			goto inval;
@@ -1136,6 +1140,9 @@ int rvt_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
 	if (attr_mask & IB_QP_MAX_QP_RD_ATOMIC)
 		qp->s_max_rd_atomic = attr->max_rd_atomic;
 
+	if (rdi->driver_f.modify_qp)
+		rdi->driver_f.modify_qp(qp, attr, attr_mask, udata);
+
 	spin_unlock(&qp->s_lock);
 	spin_unlock_irq(&qp->r_lock);
 
include/rdma/rdma_vt.h +7 -0
index 1ad902d..2940337 100644
@@ -255,6 +255,13 @@ struct rvt_driver_provided {
 			      struct rvt_ah *);
 	int (*alloc_qpn)(struct rvt_dev_info *rdi, struct rvt_qpn_table *qpt,
 			 enum ib_qp_type type, u8 port);
+	/**
+	 * Return 0 if modification is valid, -errno otherwise
+	 */
+	int (*check_modify_qp)(struct rvt_qp *qp, struct ib_qp_attr *attr,
+			       int attr_mask, struct ib_udata *udata);
+	void (*modify_qp)(struct rvt_qp *qp, struct ib_qp_attr *attr,
+			  int attr_mask, struct ib_udata *udata);
 };
 
 struct rvt_dev_info {

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

#4 lore raw

PATCH 3/6 IB/rdmavt: Add device structure allocation

In reply to a message not in the archive

This patch adds rdmavt device structure allocation in rdamvt. The ib_device alloc is now done in rdmavt instead of the driver. Drivers need to tell rdmavt the number of ports when calling.

A side of effect of this patch is fixing a bug with port initialization where the device structure port array was allocated over top of an existing one.

---
 drivers/infiniband/sw/rdmavt/vt.c |   30 ++++++++++++++++++------------
 include/rdma/rdma_vt.h            |    1 +
 2 files changed, 19 insertions(+), 12 deletions(-)
drivers/infiniband/sw/rdmavt/vt.c +18 -12
index cf7cac6..450caa7 100644
@@ -67,6 +67,24 @@ static void rvt_cleanup(void)
 }
 module_exit(rvt_cleanup);
 
+struct rvt_dev_info *rvt_alloc_device(size_t size, int nports)
+{
+	struct rvt_dev_info *rdi = ERR_PTR(-ENOMEM);
+
+	rdi = (struct rvt_dev_info *)ib_alloc_device(size);
+	if (!rdi)
+		return rdi;
+
+	rdi->ports = kcalloc(nports,
+			     sizeof(struct rvt_ibport **),
+			     GFP_KERNEL);
+	if (!rdi->ports)
+		ib_dealloc_device(&rdi->ibdev);
+
+	return rdi;
+}
+EXPORT_SYMBOL(rvt_alloc_device);
+
 static int rvt_query_device(struct ib_device *ibdev,
 			    struct ib_device_attr *props,
 			    struct ib_udata *uhw)
@@ -434,18 +452,6 @@ EXPORT_SYMBOL(rvt_unregister_device);
 int rvt_init_port(struct rvt_dev_info *rdi, struct rvt_ibport *port,
 		  int portnum, u16 *pkey_table)
 {
-	if (!rdi->dparms.nports) {
-		rvt_pr_err(rdi, "Driver says it has no ports.\n");
-		return -EINVAL;
-	}
-
-	rdi->ports = kcalloc(rdi->dparms.nports,
-			     sizeof(struct rvt_ibport **),
-			     GFP_KERNEL);
-	if (!rdi->ports) {
-		rvt_pr_err(rdi, "Could not allocate port mem.\n");
-		return -ENOMEM;
-	}
 
 	rdi->ports[portnum] = port;
 	rdi->ports[portnum]->pkey_table = pkey_table;
include/rdma/rdma_vt.h +1 -0
index 2940337..b7931bd 100644
@@ -393,6 +393,7 @@ static inline struct rvt_qp *rvt_lookup_qpn(struct rvt_dev_info *rdi,
 	return qp;
 }
 
+struct rvt_dev_info *rvt_alloc_device(size_t size, int nports);
 int rvt_register_device(struct rvt_dev_info *rvd);
 void rvt_unregister_device(struct rvt_dev_info *rvd);
 int rvt_check_ah(struct ib_device *ibdev, struct ib_ah_attr *ah_attr);

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

#5 lore raw

PATCH 4/6 IB/rdmavt: Add mad agents to rdmavt

In reply to a message not in the archive

This patch adds mad agent create and free to rdmavt.

---
 drivers/infiniband/sw/rdmavt/mad.c |   72 ++++++++++++++++++++++++++++++++++++
 drivers/infiniband/sw/rdmavt/mad.h |    3 +-
 drivers/infiniband/sw/rdmavt/vt.c  |    4 ++
 drivers/infiniband/sw/rdmavt/vt.h  |    1 +
 include/rdma/rdma_vt.h             |    6 +++
 5 files changed, 84 insertions(+), 2 deletions(-)
drivers/infiniband/sw/rdmavt/mad.c +72 -0
index eef7029..e01f3fb 100644
@@ -45,6 +45,7 @@
  *
  */
 
+#include <rdma/ib_mad.h>
 #include "mad.h"
 
 /**
@@ -83,3 +84,74 @@ int rvt_process_mad(struct ib_device *ibdev, int mad_flags, u8 port,
 	 */
 	return IB_MAD_RESULT_FAILURE;
 }
+
+static void rvt_send_mad_handler(struct ib_mad_agent *agent,
+				 struct ib_mad_send_wc *mad_send_wc)
+{
+	ib_free_send_mad(mad_send_wc->send_buf);
+}
+
+int rvt_create_mad_agents(struct rvt_dev_info *rdi)
+{
+	struct ib_mad_agent *agent;
+	struct rvt_ibport *rvp;
+	int p;
+	int ret;
+
+	for (p = 0; p < rdi->dparms.nports; p++) {
+		rvp = rdi->ports[p];
+		agent = ib_register_mad_agent(&rdi->ibdev, p + 1,
+					      IB_QPT_SMI,
+					      NULL, 0, rvt_send_mad_handler,
+					      NULL, NULL, 0);
+		if (IS_ERR(agent)) {
+			ret = PTR_ERR(agent);
+			goto err;
+		}
+
+		rvp->send_agent = agent;
+
+		if (rdi->driver_f.notify_create_mad_agent)
+			rdi->driver_f.notify_create_mad_agent(rdi, p);
+	}
+
+	return 0;
+
+err:
+	for (p = 0; p < rdi->dparms.nports; p++) {
+		rvp = rdi->ports[p];
+		if (rvp->send_agent) {
+			agent = rvp->send_agent;
+			rvp->send_agent = NULL;
+			ib_unregister_mad_agent(agent);
+			if (rdi->driver_f.notify_free_mad_agent)
+				rdi->driver_f.notify_free_mad_agent(rdi, p);
+		}
+	}
+
+	return ret;
+}
+
+void rvt_free_mad_agents(struct rvt_dev_info *rdi)
+{
+	struct ib_mad_agent *agent;
+	struct rvt_ibport *rvp;
+	int p;
+
+	for (p = 0; p < rdi->dparms.nports; p++) {
+		rvp = rdi->ports[p];
+		if (rvp->send_agent) {
+			agent = rvp->send_agent;
+			rvp->send_agent = NULL;
+			ib_unregister_mad_agent(agent);
+		}
+		if (rvp->sm_ah) {
+			ib_destroy_ah(&rvp->sm_ah->ibah);
+			rvp->sm_ah = NULL;
+		}
+
+		if (rdi->driver_f.notify_free_mad_agent)
+			rdi->driver_f.notify_free_mad_agent(rdi, p);
+	}
+}
+
drivers/infiniband/sw/rdmavt/mad.h +2 -1
index ee740e9..5d8a6a9 100644
@@ -55,5 +55,6 @@ int rvt_process_mad(struct ib_device *ibdev, int mad_flags, u8 port,
 		    const struct ib_mad_hdr *in, size_t in_mad_size,
 		    struct ib_mad_hdr *out, size_t *out_mad_size,
 		    u16 *out_mad_pkey_index);
-
+int rvt_create_mad_agents(struct rvt_dev_info *rdi);
+void rvt_free_mad_agents(struct rvt_dev_info *rdi);
 #endif          /* DEF_RVTMAD_H */
drivers/infiniband/sw/rdmavt/vt.c +4 -0
index 450caa7..7496d43 100644
@@ -416,6 +416,8 @@ int rvt_register_device(struct rvt_dev_info *rdi)
 		goto bail_cq;
 	}
 
+	rvt_create_mad_agents(rdi);
+
 	rvt_pr_info(rdi, "Registration with rdmavt done.\n");
 	return ret;
 
@@ -438,6 +440,8 @@ void rvt_unregister_device(struct rvt_dev_info *rdi)
 	if (!rdi)
 		return;
 
+	rvt_free_mad_agents(rdi);
+
 	ib_unregister_device(&rdi->ibdev);
 	rvt_cq_exit(rdi);
 	rvt_mr_exit(rdi);
drivers/infiniband/sw/rdmavt/vt.h +1 -0
index 54ee05a..d9f78cc 100644
@@ -59,6 +59,7 @@
 #include "mcast.h"
 #include "mmap.h"
 #include "cq.h"
+#include "mad.h"
 
 #define rvt_pr_info(rdi, fmt, ...) \
 	__rvt_pr_info(rdi->driver_f.get_pci_dev(rdi), \
include/rdma/rdma_vt.h +5 -1
index b7931bd..eb1c17a 100644
@@ -136,7 +136,8 @@ struct rvt_ibport {
 	 */
 	u16 *pkey_table;
 
-	/* TODO: Move sm_ah and smi_ah into here as well*/
+	struct rvt_ah *sm_ah;
+	struct rvt_ah *smi_ah;
 };
 
 #define RVT_CQN_MAX 16 /* maximum length of cq name */
@@ -262,6 +263,9 @@ struct rvt_driver_provided {
 			       int attr_mask, struct ib_udata *udata);
 	void (*modify_qp)(struct rvt_qp *qp, struct ib_qp_attr *attr,
 			  int attr_mask, struct ib_udata *udata);
+
+	void (*notify_create_mad_agent)(struct rvt_dev_info *rdi, int port_idx);
+	void (*notify_free_mad_agent)(struct rvt_dev_info *rdi, int port_idx);
 };
 
 struct rvt_dev_info {

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

#6 lore raw

PATCH 5/6 IB/rdmavt: Fix copyright date

In reply to a message not in the archive

Update all files added by rdmavt which do not yet have 2016 as the copyright year.

---
 drivers/infiniband/sw/rdmavt/ah.c    |    2 +-
 drivers/infiniband/sw/rdmavt/ah.h    |    2 +-
 drivers/infiniband/sw/rdmavt/cq.c    |    2 +-
 drivers/infiniband/sw/rdmavt/cq.h    |    2 +-
 drivers/infiniband/sw/rdmavt/dma.c   |    2 +-
 drivers/infiniband/sw/rdmavt/dma.h   |    2 +-
 drivers/infiniband/sw/rdmavt/mad.c   |    2 +-
 drivers/infiniband/sw/rdmavt/mad.h   |    2 +-
 drivers/infiniband/sw/rdmavt/mcast.c |    2 +-
 drivers/infiniband/sw/rdmavt/mcast.h |    2 +-
 drivers/infiniband/sw/rdmavt/mmap.c  |    2 +-
 drivers/infiniband/sw/rdmavt/mmap.h  |    2 +-
 drivers/infiniband/sw/rdmavt/mr.c    |    2 +-
 drivers/infiniband/sw/rdmavt/mr.h    |    2 +-
 drivers/infiniband/sw/rdmavt/pd.c    |    2 +-
 drivers/infiniband/sw/rdmavt/pd.h    |    2 +-
 drivers/infiniband/sw/rdmavt/qp.c    |    2 +-
 drivers/infiniband/sw/rdmavt/qp.h    |    2 +-
 drivers/infiniband/sw/rdmavt/srq.c   |    2 +-
 drivers/infiniband/sw/rdmavt/srq.h   |    2 +-
 drivers/infiniband/sw/rdmavt/trace.c |    2 +-
 drivers/infiniband/sw/rdmavt/trace.h |    2 +-
 drivers/infiniband/sw/rdmavt/vt.c    |    2 +-
 drivers/infiniband/sw/rdmavt/vt.h    |    2 +-
 include/rdma/rdma_vt.h               |    2 +-
 include/rdma/rdmavt_mr.h             |    2 +-
 include/rdma/rdmavt_qp.h             |    2 +-
 27 files changed, 27 insertions(+), 27 deletions(-)
drivers/infiniband/sw/rdmavt/ah.c +1 -1
index c194d9d..9372c43 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 2015 Intel Corporation.
+ * Copyright(c) 2016 Intel Corporation.
  *
  * This file is provided under a dual BSD/GPLv2 license.  When using or
  * redistributing this file, you may do so under either license.
drivers/infiniband/sw/rdmavt/ah.h +1 -1
index 8cd7ea7..e9c36be 100644
@@ -2,7 +2,7 @@
 #define DEF_RVTAH_H
 
 /*
- * Copyright(c) 2015 Intel Corporation.
+ * Copyright(c) 2016 Intel Corporation.
  *
  * This file is provided under a dual BSD/GPLv2 license.  When using or
  * redistributing this file, you may do so under either license.
drivers/infiniband/sw/rdmavt/cq.c +1 -1
index 7308a27..055aa71 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 2015 Intel Corporation.
+ * Copyright(c) 2016 Intel Corporation.
  *
  * This file is provided under a dual BSD/GPLv2 license.  When using or
  * redistributing this file, you may do so under either license.
drivers/infiniband/sw/rdmavt/cq.h +1 -1
index 3813d90..6182c29 100644
@@ -2,7 +2,7 @@
 #define DEF_RVTCQ_H
 
 /*
- * Copyright(c) 2015 Intel Corporation.
+ * Copyright(c) 2016 Intel Corporation.
  *
  * This file is provided under a dual BSD/GPLv2 license.  When using or
  * redistributing this file, you may do so under either license.
drivers/infiniband/sw/rdmavt/dma.c +1 -1
index c070141..33076a5 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 2015 Intel Corporation.
+ * Copyright(c) 2016 Intel Corporation.
  *
  * This file is provided under a dual BSD/GPLv2 license.  When using or
  * redistributing this file, you may do so under either license.
drivers/infiniband/sw/rdmavt/dma.h +1 -1
index a80cc35..979f07e 100644
@@ -2,7 +2,7 @@
 #define DEF_RDMAVTDMA_H
 
 /*
- * Copyright(c) 2015 Intel Corporation.
+ * Copyright(c) 2016 Intel Corporation.
  *
  * This file is provided under a dual BSD/GPLv2 license.  When using or
  * redistributing this file, you may do so under either license.
drivers/infiniband/sw/rdmavt/mad.c +1 -1
index e01f3fb..5c720d3 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 2015 Intel Corporation.
+ * Copyright(c) 2016 Intel Corporation.
  *
  * This file is provided under a dual BSD/GPLv2 license.  When using or
  * redistributing this file, you may do so under either license.
drivers/infiniband/sw/rdmavt/mad.h +1 -1
index 5d8a6a9..c89faf4 100644
@@ -2,7 +2,7 @@
 #define DEF_RVTMAD_H
 
 /*
- * Copyright(c) 2015 Intel Corporation.
+ * Copyright(c) 2016 Intel Corporation.
  *
  * This file is provided under a dual BSD/GPLv2 license.  When using or
  * redistributing this file, you may do so under either license.
drivers/infiniband/sw/rdmavt/mcast.c +1 -1
index 528c1ca..e06a875 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 2015 Intel Corporation.
+ * Copyright(c) 2016 Intel Corporation.
  *
  * This file is provided under a dual BSD/GPLv2 license.  When using or
  * redistributing this file, you may do so under either license.
drivers/infiniband/sw/rdmavt/mcast.h +1 -1
index cd15a98..29f5792 100644
@@ -2,7 +2,7 @@
 #define DEF_RVTMCAST_H
 
 /*
- * Copyright(c) 2015 Intel Corporation.
+ * Copyright(c) 2016 Intel Corporation.
  *
  * This file is provided under a dual BSD/GPLv2 license.  When using or
  * redistributing this file, you may do so under either license.
drivers/infiniband/sw/rdmavt/mmap.c +1 -1
index fc30ff7..d6330d7 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 2015 Intel Corporation.
+ * Copyright(c) 2016 Intel Corporation.
  *
  * This file is provided under a dual BSD/GPLv2 license.  When using or
  * redistributing this file, you may do so under either license.
drivers/infiniband/sw/rdmavt/mmap.h +1 -1
index 3513e25..e806747 100644
@@ -2,7 +2,7 @@
 #define DEF_RDMAVTMMAP_H
 
 /*
- * Copyright(c) 2015 Intel Corporation.
+ * Copyright(c) 2016 Intel Corporation.
  *
  * This file is provided under a dual BSD/GPLv2 license.  When using or
  * redistributing this file, you may do so under either license.
drivers/infiniband/sw/rdmavt/mr.c +1 -1
index f1dcaf4..ee36be3 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 2015 Intel Corporation.
+ * Copyright(c) 2016 Intel Corporation.
  *
  * This file is provided under a dual BSD/GPLv2 license.  When using or
  * redistributing this file, you may do so under either license.
drivers/infiniband/sw/rdmavt/mr.h +1 -1
index c5339aa..6938051 100644
@@ -2,7 +2,7 @@
 #define DEF_RVTMR_H
 
 /*
- * Copyright(c) 2015 Intel Corporation.
+ * Copyright(c) 2016 Intel Corporation.
  *
  * This file is provided under a dual BSD/GPLv2 license.  When using or
  * redistributing this file, you may do so under either license.
drivers/infiniband/sw/rdmavt/pd.c +1 -1
index f8dba88..62fee44 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 2015 Intel Corporation.
+ * Copyright(c) 2016 Intel Corporation.
  *
  * This file is provided under a dual BSD/GPLv2 license.  When using or
  * redistributing this file, you may do so under either license.
drivers/infiniband/sw/rdmavt/pd.h +1 -1
index 56d75e6..1892ca4 100644
@@ -2,7 +2,7 @@
 #define DEF_RDMAVTPD_H
 
 /*
- * Copyright(c) 2015 Intel Corporation.
+ * Copyright(c) 2016 Intel Corporation.
  *
  * This file is provided under a dual BSD/GPLv2 license.  When using or
  * redistributing this file, you may do so under either license.
drivers/infiniband/sw/rdmavt/qp.c +1 -1
index e340c1a..17f1dd7 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 2015 Intel Corporation.
+ * Copyright(c) 2016 Intel Corporation.
  *
  * This file is provided under a dual BSD/GPLv2 license.  When using or
  * redistributing this file, you may do so under either license.
drivers/infiniband/sw/rdmavt/qp.h +1 -1
index f438809..8409f80 100644
@@ -2,7 +2,7 @@
 #define DEF_RVTQP_H
 
 /*
- * Copyright(c) 2015 Intel Corporation.
+ * Copyright(c) 2016 Intel Corporation.
  *
  * This file is provided under a dual BSD/GPLv2 license.  When using or
  * redistributing this file, you may do so under either license.
drivers/infiniband/sw/rdmavt/srq.c +1 -1
index bbb623a..c9eb8b3 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 2015 Intel Corporation.
+ * Copyright(c) 2016 Intel Corporation.
  *
  * This file is provided under a dual BSD/GPLv2 license.  When using or
  * redistributing this file, you may do so under either license.
drivers/infiniband/sw/rdmavt/srq.h +1 -1
index 0c3c5a7..9f07880 100644
@@ -2,7 +2,7 @@
 #define DEF_RVTSRQ_H
 
 /*
- * Copyright(c) 2015 Intel Corporation.
+ * Copyright(c) 2016 Intel Corporation.
  *
  * This file is provided under a dual BSD/GPLv2 license.  When using or
  * redistributing this file, you may do so under either license.
drivers/infiniband/sw/rdmavt/trace.c +1 -1
index 19afe39..d593285 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 2015 Intel Corporation.
+ * Copyright(c) 2016 Intel Corporation.
  *
  * This file is provided under a dual BSD/GPLv2 license.  When using or
  * redistributing this file, you may do so under either license.
drivers/infiniband/sw/rdmavt/trace.h +1 -1
index b269291..d5b1281 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 2015 Intel Corporation.
+ * Copyright(c) 2016 Intel Corporation.
  *
  * This file is provided under a dual BSD/GPLv2 license.  When using or
  * redistributing this file, you may do so under either license.
drivers/infiniband/sw/rdmavt/vt.c +1 -1
index 7496d43..571463e 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 2015 Intel Corporation.
+ * Copyright(c) 2016 Intel Corporation.
  *
  * This file is provided under a dual BSD/GPLv2 license.  When using or
  * redistributing this file, you may do so under either license.
drivers/infiniband/sw/rdmavt/vt.h +1 -1
index d9f78cc..a5c36d3 100644
@@ -2,7 +2,7 @@
 #define DEF_RDMAVT_H
 
 /*
- * Copyright(c) 2015 Intel Corporation.
+ * Copyright(c) 2016 Intel Corporation.
  *
  * This file is provided under a dual BSD/GPLv2 license.  When using or
  * redistributing this file, you may do so under either license.
include/rdma/rdma_vt.h +1 -1
index eb1c17a..b74282a 100644
@@ -2,7 +2,7 @@
 #define DEF_RDMA_VT_H
 
 /*
- * Copyright(c) 2015 Intel Corporation.
+ * Copyright(c) 2016 Intel Corporation.
  *
  * This file is provided under a dual BSD/GPLv2 license.  When using or
  * redistributing this file, you may do so under either license.
include/rdma/rdmavt_mr.h +1 -1
index 4aa8171..5edffdc 100644
@@ -2,7 +2,7 @@
 #define DEF_RDMAVT_INCMR_H
 
 /*
- * Copyright(c) 2015 Intel Corporation.
+ * Copyright(c) 2016 Intel Corporation.
  *
  * This file is provided under a dual BSD/GPLv2 license.  When using or
  * redistributing this file, you may do so under either license.
include/rdma/rdmavt_qp.h +1 -1
index f0e2426..91f20fd 100644
@@ -2,7 +2,7 @@
 #define DEF_RDMAVT_INCQP_H
 
 /*
- * Copyright(c) 2015 Intel Corporation.
+ * Copyright(c) 2016 Intel Corporation.
  *
  * This file is provided under a dual BSD/GPLv2 license.  When using or
  * redistributing this file, you may do so under either license.

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

#7 lore raw

PATCH 6/6 IB/rdmavt: Add support for rvt_query_qp

In reply to a message not in the archive

From: Harish Chegondi <[email protected]>

Drivers using rdmavt can rely on rvt_query_qp instead of defining their own query_qp functions.

---
 drivers/infiniband/sw/rdmavt/qp.c |   47 ++++++++++++++++++++++++++++++++++++-
 1 files changed, 46 insertions(+), 1 deletions(-)
drivers/infiniband/sw/rdmavt/qp.c +46 -1
index 17f1dd7..bc4e2eb 100644
@@ -1209,7 +1209,52 @@ int rvt_destroy_qp(struct ib_qp *ibqp)
 int rvt_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
 		 int attr_mask, struct ib_qp_init_attr *init_attr)
 {
-	return -EOPNOTSUPP;
+	struct rvt_qp *qp = ibqp_to_rvtqp(ibqp);
+	struct rvt_dev_info *rdi = ib_to_rvt(ibqp->device);
+
+	attr->qp_state = qp->state;
+	attr->cur_qp_state = attr->qp_state;
+	attr->path_mtu = qp->path_mtu;
+	attr->path_mig_state = qp->s_mig_state;
+	attr->qkey = qp->qkey;
+	attr->rq_psn = qp->r_psn & rdi->dparms.psn_mask;
+	attr->sq_psn = qp->s_next_psn & rdi->dparms.psn_mask;
+	attr->dest_qp_num = qp->remote_qpn;
+	attr->qp_access_flags = qp->qp_access_flags;
+	attr->cap.max_send_wr = qp->s_size - 1;
+	attr->cap.max_recv_wr = qp->ibqp.srq ? 0 : qp->r_rq.size - 1;
+	attr->cap.max_send_sge = qp->s_max_sge;
+	attr->cap.max_recv_sge = qp->r_rq.max_sge;
+	attr->cap.max_inline_data = 0;
+	attr->ah_attr = qp->remote_ah_attr;
+	attr->alt_ah_attr = qp->alt_ah_attr;
+	attr->pkey_index = qp->s_pkey_index;
+	attr->alt_pkey_index = qp->s_alt_pkey_index;
+	attr->en_sqd_async_notify = 0;
+	attr->sq_draining = qp->s_draining;
+	attr->max_rd_atomic = qp->s_max_rd_atomic;
+	attr->max_dest_rd_atomic = qp->r_max_rd_atomic;
+	attr->min_rnr_timer = qp->r_min_rnr_timer;
+	attr->port_num = qp->port_num;
+	attr->timeout = qp->timeout;
+	attr->retry_cnt = qp->s_retry_cnt;
+	attr->rnr_retry = qp->s_rnr_retry_cnt;
+	attr->alt_port_num = qp->alt_ah_attr.port_num;
+	attr->alt_timeout = qp->alt_timeout;
+
+	init_attr->event_handler = qp->ibqp.event_handler;
+	init_attr->qp_context = qp->ibqp.qp_context;
+	init_attr->send_cq = qp->ibqp.send_cq;
+	init_attr->recv_cq = qp->ibqp.recv_cq;
+	init_attr->srq = qp->ibqp.srq;
+	init_attr->cap = attr->cap;
+	if (qp->s_flags & RVT_S_SIGNAL_REQ_WR)
+		init_attr->sq_sig_type = IB_SIGNAL_REQ_WR;
+	else
+		init_attr->sq_sig_type = IB_SIGNAL_ALL_WR;
+	init_attr->qp_type = qp->ibqp.qp_type;
+	init_attr->port_num = qp->port_num;
+	return 0;
 }
 
 /**

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