summaryrefslogtreecommitdiff
path: root/include/rdma
diff options
context:
space:
mode:
authorDennis Dalessandro <dennis.dalessandro@intel.com>2016-01-06 09:51:48 -0800
committerDoug Ledford <dledford@redhat.com>2016-03-10 20:37:05 -0500
commit8afd32eb58b6885fc3e268c69b1b1b627aa2afaf (patch)
tree6a7ad4e7c6efe75d90a726936dce5425ecfce6ac /include/rdma
parentc1b332bc16a6e9d42b4ab0b5282e3937f776bf71 (diff)
IB/rdmavt: Add protection domain to rdmavt.
Add datastructure for and allocation/deallocation of protection domains for RDMAVT. Reviewed-by: Ira Weiny <ira.weiny@intel.com> Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/rdma_vt.h34
1 files changed, 30 insertions, 4 deletions
diff --git a/include/rdma/rdma_vt.h b/include/rdma/rdma_vt.h
index 0438bf229306..6bf5fd40081d 100644
--- a/include/rdma/rdma_vt.h
+++ b/include/rdma/rdma_vt.h
@@ -54,16 +54,42 @@
*/
#include "ib_verbs.h"
+
+/*
+ * Things that are driver specific, module parameters in hfi1 and qib
+ */
+struct rvt_driver_params {
+ int max_pds;
+};
+
+/* Protection domain */
+struct rvt_pd {
+ struct ib_pd ibpd;
+ int user; /* non-zero if created from user space */
+};
+
struct rvt_dev_info {
struct ib_device ibdev;
+
+ /* Driver specific */
+ struct rvt_driver_params dparms;
int (*port_callback)(struct ib_device *, u8, struct kobject *);
- /*
- * TODO:
- * need to reflect module parameters that may vary by dev
- */
+ /* Internal use */
+ int n_pds_allocated;
+ spinlock_t n_pds_lock; /* Protect pd allocated count */
};
+static inline struct rvt_pd *ibpd_to_rvtpd(struct ib_pd *ibpd)
+{
+ return container_of(ibpd, struct rvt_pd, ibpd);
+}
+
+static inline struct rvt_dev_info *ib_to_rvt(struct ib_device *ibdev)
+{
+ return container_of(ibdev, struct rvt_dev_info, ibdev);
+}
+
int rvt_register_device(struct rvt_dev_info *rvd);
void rvt_unregister_device(struct rvt_dev_info *rvd);