diff mbox

[06/37] IB/rdmavt: Add query and modify device stubs

Message ID 20151207204322.8144.60452.stgit@phlsvslse11.ph.intel.com (mailing list archive)
State Superseded
Headers show

Commit Message

Dennis Dalessandro Dec. 7, 2015, 8:43 p.m. UTC
Adds the stubs which will handle the query and modify device functions. At
this time the only intention is to support changing the node desc and the
guid via these calls.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
---
 drivers/infiniband/sw/rdmavt/vt.c |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)


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

Comments

Hefty, Sean Dec. 7, 2015, 9:26 p.m. UTC | #1
PiArc3RhdGljIGludCBydnRfcXVlcnlfZGV2aWNlKHN0cnVjdCBpYl9kZXZpY2UgKmliZGV2LA0K
PiArCQkJICAgIHN0cnVjdCBpYl9kZXZpY2VfYXR0ciAqcHJvcHMsDQo+ICsJCQkgICAgc3RydWN0
IGliX3VkYXRhICp1aHcpDQo+ICt7DQo+ICsJLyoNCj4gKwkgKiBSZXR1cm4gcnZ0X2Rldl9pbmZv
LnByb3BzIGNvbnRlbnRzDQo+ICsJICovDQo+ICsJcmV0dXJuIC1FSU5WQUw7DQoNCkVOT1NZUyBv
biBhbGwgb2YgdGhlIGZ1bmN0aW9uIHRlbXBsYXRlcy4gIFRoaXMgYW5kIHN1YnNlcXVlbnQgcGF0
Y2hlcy4NCg0K
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jason Gunthorpe Dec. 7, 2015, 9:39 p.m. UTC | #2
On Mon, Dec 07, 2015 at 09:26:11PM +0000, Hefty, Sean wrote:
> > +static int rvt_query_device(struct ib_device *ibdev,
> > +			    struct ib_device_attr *props,
> > +			    struct ib_udata *uhw)
> > +{
> > +	/*
> > +	 * Return rvt_dev_info.props contents
> > +	 */
> > +	return -EINVAL;
> 
> ENOSYS on all of the function templates.  This and subsequent patches.

We recently had a long discussion about what the correct answer here
is.

ENOSYS and EINVAL are both wrong for different reasons.. Can't recall
if something else was settled on? I think I was suggesting one of the
ENOTSUP varients?

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Leon Romanovsky Dec. 8, 2015, 7:29 a.m. UTC | #3
On Mon, Dec 07, 2015 at 02:39:04PM -0700, Jason Gunthorpe wrote:
> On Mon, Dec 07, 2015 at 09:26:11PM +0000, Hefty, Sean wrote:
> > > +static int rvt_query_device(struct ib_device *ibdev,
> > > +			    struct ib_device_attr *props,
> > > +			    struct ib_udata *uhw)
> > > +{
> > > +	/*
> > > +	 * Return rvt_dev_info.props contents
> > > +	 */
> > > +	return -EINVAL;
> > 
> > ENOSYS on all of the function templates.  This and subsequent patches.
> 
> We recently had a long discussion about what the correct answer here
> is.
> 
> ENOSYS and EINVAL are both wrong for different reasons.. Can't recall
> if something else was settled on? I think I was suggesting one of the
> ENOTSUP varients?
You suggested EOPNOTSUPP [1]

[1] http://www.spinics.net/lists/linux-rdma/msg30176.html
> 
> Jason
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> 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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/infiniband/sw/rdmavt/vt.c b/drivers/infiniband/sw/rdmavt/vt.c
index aaf10e7..b807ee8 100644
--- a/drivers/infiniband/sw/rdmavt/vt.c
+++ b/drivers/infiniband/sw/rdmavt/vt.c
@@ -70,6 +70,33 @@  static void rvt_cleanup(void)
 }
 module_exit(rvt_cleanup);
 
+static int rvt_query_device(struct ib_device *ibdev,
+			    struct ib_device_attr *props,
+			    struct ib_udata *uhw)
+{
+	/*
+	 * Return rvt_dev_info.props contents
+	 */
+	return -EINVAL;
+}
+
+static int rvt_modify_device(struct ib_device *device,
+			     int device_modify_mask,
+			     struct ib_device_modify *device_modify)
+{
+	/*
+	 * Change dev props. Planned support is for node desc change and sys
+	 * guid change only. This matches hfi1 and qib behavior. Other drivers
+	 * that support existing modifications will need to add their support.
+	 */
+
+	/*
+	 * VT-DRIVER-API: node_desc_change()
+	 * VT-DRIVER-API: sys_guid_change()
+	 */
+	return -EINVAL;
+}
+
 /*
  * Check driver override. If driver passes a value use it, otherwise we use our
  * own value.
@@ -82,6 +109,10 @@  int rvt_register_device(struct rvt_dev_info *rdi)
 	if (!rdi)
 		return -EINVAL;
 
+	/* Dev Ops */
+	CDR(rdi, query_device);
+	CDR(rdi, modify_device);
+
 	/* DMA Operations */
 	rdi->ibdev.dma_ops =
 		rdi->ibdev.dma_ops ? : &rvt_default_dma_mapping_ops;