summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/sw/rdmavt/vt.c
diff options
context:
space:
mode:
authorDennis Dalessandro2016-01-06 18:51:48 +0100
committerDoug Ledford2016-03-11 02:37:05 +0100
commit8afd32eb58b6885fc3e268c69b1b1b627aa2afaf (patch)
tree6a7ad4e7c6efe75d90a726936dce5425ecfce6ac /drivers/infiniband/sw/rdmavt/vt.c
parentIB/rdmavt: Consolidate dma ops in rdmavt. (diff)
downloadkernel-qcow2-linux-8afd32eb58b6885fc3e268c69b1b1b627aa2afaf.tar.gz
kernel-qcow2-linux-8afd32eb58b6885fc3e268c69b1b1b627aa2afaf.tar.xz
kernel-qcow2-linux-8afd32eb58b6885fc3e268c69b1b1b627aa2afaf.zip
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 'drivers/infiniband/sw/rdmavt/vt.c')
-rw-r--r--drivers/infiniband/sw/rdmavt/vt.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/infiniband/sw/rdmavt/vt.c b/drivers/infiniband/sw/rdmavt/vt.c
index d82fddad585d..b65cde435f19 100644
--- a/drivers/infiniband/sw/rdmavt/vt.c
+++ b/drivers/infiniband/sw/rdmavt/vt.c
@@ -76,9 +76,21 @@ int rvt_register_device(struct rvt_dev_info *rdi)
* come up with a better mechanism that simplifies the code at some
* point.
*/
+
+ /* DMA Operations */
rdi->ibdev.dma_ops =
rdi->ibdev.dma_ops ? : &rvt_default_dma_mapping_ops;
+ /* Protection Domain */
+ rdi->ibdev.alloc_pd =
+ rdi->ibdev.alloc_pd ? : rvt_alloc_pd;
+ rdi->ibdev.dealloc_pd =
+ rdi->ibdev.dealloc_pd ? : rvt_dealloc_pd;
+
+ spin_lock_init(&rdi->n_pds_lock);
+ rdi->n_pds_allocated = 0;
+
+ /* We are now good to announce we exist */
return ib_register_device(&rdi->ibdev, rdi->port_callback);
}
EXPORT_SYMBOL(rvt_register_device);