summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDennis Dalessandro <dennis.dalessandro@intel.com>2016-01-06 18:54:16 +0100
committerDoug Ledford <dledford@redhat.com>2016-03-11 02:37:06 +0100
commit30588643f95e1bb1239e2568de7a653722832a5e (patch)
tree88dc1813110e3b287ed38d220b16b1ea71b7d3ec
parentIB/rdmavt: Add query and modify port stubs (diff)
downloadlinux-30588643f95e1bb1239e2568de7a653722832a5e.tar.xz
linux-30588643f95e1bb1239e2568de7a653722832a5e.zip
IB/rdmavt: Add pkey query stub
The pkey table will reside in the rvt structure but it will be modified only when the driver requests then rvt will simply read the value to return in the query. 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> Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--drivers/infiniband/sw/rdmavt/vt.c21
-rw-r--r--include/rdma/rdma_vt.h3
2 files changed, 23 insertions, 1 deletions
diff --git a/drivers/infiniband/sw/rdmavt/vt.c b/drivers/infiniband/sw/rdmavt/vt.c
index 5ac241c7966f..fc5372d75280 100644
--- a/drivers/infiniband/sw/rdmavt/vt.c
+++ b/drivers/infiniband/sw/rdmavt/vt.c
@@ -137,6 +137,26 @@ static int rvt_modify_port(struct ib_device *ibdev, u8 port,
return -EOPNOTSUPP;
}
+/**
+ * rvt_query_pkey - Return a pkey from the table at a given index
+ * @ibdev: Verbs IB dev
+ * @port: Port number
+ * @intex: Index into pkey table
+ *
+ * Returns 0 on failure pkey otherwise
+ */
+static int rvt_query_pkey(struct ib_device *ibdev, u8 port, u16 index,
+ u16 *pkey)
+{
+ /*
+ * Driver will be responsible for keeping rvt_dev_info.pkey_table up to
+ * date. This function will just return that value. There is no need to
+ * lock, if a stale value is read and sent to the user so be it there is
+ * no way to protect against that anyway.
+ */
+ return 0;
+}
+
/*
* Check driver override. If driver passes a value use it, otherwise we use our
* own value.
@@ -154,6 +174,7 @@ int rvt_register_device(struct rvt_dev_info *rdi)
CHECK_DRIVER_OVERRIDE(rdi, modify_device);
CHECK_DRIVER_OVERRIDE(rdi, query_port);
CHECK_DRIVER_OVERRIDE(rdi, modify_port);
+ CHECK_DRIVER_OVERRIDE(rdi, query_pkey);
/* DMA Operations */
rdi->ibdev.dma_ops =
diff --git a/include/rdma/rdma_vt.h b/include/rdma/rdma_vt.h
index 2990e03bdd9e..bf072a436a34 100644
--- a/include/rdma/rdma_vt.h
+++ b/include/rdma/rdma_vt.h
@@ -114,12 +114,13 @@ struct rvt_dev_info {
* The driver will also be responsible for filling in certain members of
* dparms.props
*/
-
struct ib_device ibdev;
/* Driver specific properties */
struct rvt_driver_params dparms;
+ /* PKey Table goes here */
+
/*
* The work to create port files in /sys/class Infiniband is different
* depending on the driver. This should not be extracted away and