aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/sw/rdmavt/mmap.c
diff options
context:
space:
mode:
authorDennis Dalessandro <dennis.dalessandro@intel.com>2016-02-14 12:10:29 -0800
committerDoug Ledford <dledford@redhat.com>2016-03-10 20:38:08 -0500
commit90793f7179478df19ac4b2244cfd9764b28e4b38 (patch)
treecdbad7af7b4899bade80236891d381e8fd310c47 /drivers/infiniband/sw/rdmavt/mmap.c
parentstaging/rdma/hfi1: Put QPs into error state after SL->SC table changes (diff)
downloadlinux-dev-90793f7179478df19ac4b2244cfd9764b28e4b38.tar.xz
linux-dev-90793f7179478df19ac4b2244cfd9764b28e4b38.zip
IB/rdmavt: Clean up comments and add more documentation
Add, remove, and otherwise clean up existing comments that are leftover from the initial code postings of rdmavt. Many of the comments were added to provide an idea on the direction we were thinking of going. Now that the design is solidified make a pass over and clean everything up. Also add details where lacking. Ensure all non static functions have nano comments. Reviewed-by: Jubin John <jubin.john@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/mmap.c')
-rw-r--r--drivers/infiniband/sw/rdmavt/mmap.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/drivers/infiniband/sw/rdmavt/mmap.c b/drivers/infiniband/sw/rdmavt/mmap.c
index 49180c4eb76e..273974fb7d1f 100644
--- a/drivers/infiniband/sw/rdmavt/mmap.c
+++ b/drivers/infiniband/sw/rdmavt/mmap.c
@@ -51,6 +51,10 @@
#include <asm/pgtable.h>
#include "mmap.h"
+/**
+ * rvt_mmap_init - init link list and lock for mem map
+ * @rdi: rvt dev struct
+ */
void rvt_mmap_init(struct rvt_dev_info *rdi)
{
INIT_LIST_HEAD(&rdi->pending_mmaps);
@@ -78,10 +82,6 @@ void rvt_release_mmap_info(struct kref *ref)
}
EXPORT_SYMBOL(rvt_release_mmap_info);
-/*
- * open and close keep track of how many times the CQ is mapped,
- * to avoid releasing it.
- */
static void rvt_vma_open(struct vm_area_struct *vma)
{
struct rvt_mmap_info *ip = vma->vm_private_data;
@@ -105,7 +105,8 @@ static const struct vm_operations_struct rvt_vm_ops = {
* rvt_mmap - create a new mmap region
* @context: the IB user context of the process making the mmap() call
* @vma: the VMA to be initialized
- * Return zero if the mmap is OK. Otherwise, return an errno.
+ *
+ * Return: zero if the mmap is OK. Otherwise, return an errno.
*/
int rvt_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
{
@@ -147,8 +148,14 @@ done:
}
EXPORT_SYMBOL(rvt_mmap);
-/*
- * Allocate information for hfi1_mmap
+/**
+ * rvt_create_mmap_info - allocate information for hfi1_mmap
+ * @rdi: rvt dev struct
+ * @size: size in bytes to map
+ * @context: user context
+ * @obj: opaque pointer to a cq, wq etc
+ *
+ * Return: rvt_mmap struct on success
*/
struct rvt_mmap_info *rvt_create_mmap_info(struct rvt_dev_info *rdi,
u32 size,
@@ -180,6 +187,13 @@ struct rvt_mmap_info *rvt_create_mmap_info(struct rvt_dev_info *rdi,
}
EXPORT_SYMBOL(rvt_create_mmap_info);
+/**
+ * rvt_update_mmap_info - update a mem map
+ * @rdi: rvt dev struct
+ * @ip: mmap info pointer
+ * @size: size to grow by
+ * @obj: opaque pointer to cq, wq, etc.
+ */
void rvt_update_mmap_info(struct rvt_dev_info *rdi, struct rvt_mmap_info *ip,
u32 size, void *obj)
{