diff mbox series

[v1,rdma-core,02/12] man: Add description to ibv_import_pd function

Message ID 20190821142639.5807-3-yuval.shaia@oracle.com (mailing list archive)
State Changes Requested
Headers show
Series Shared PD and MR | expand

Commit Message

Yuval Shaia Aug. 21, 2019, 2:26 p.m. UTC
New ibv_import_pd is introduce to allow process to import a PD craeted
by another process.
Add description of the API to ibv_alloc_pd man page.

Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Shamir Rabinovitch <shamir.rabinovitch@oracle.com>
Signed-off-by: Shamir Rabinovitch <srabinov7@gmail.com>
---
 libibverbs/man/ibv_alloc_pd.3 | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libibverbs/man/ibv_alloc_pd.3 b/libibverbs/man/ibv_alloc_pd.3
index cc475f4a..aed72ff4 100644
--- a/libibverbs/man/ibv_alloc_pd.3
+++ b/libibverbs/man/ibv_alloc_pd.3
@@ -3,13 +3,16 @@ 
 .\"
 .TH IBV_ALLOC_PD 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual"
 .SH "NAME"
-ibv_alloc_pd, ibv_dealloc_pd \- allocate or deallocate a protection domain (PDs)
+ibv_alloc_pd, ibv_import_pd, ibv_dealloc_pd \- allocate, import or deallocate a protection domain (PDs)
 .SH "SYNOPSIS"
 .nf
 .B #include <infiniband/verbs.h>
 .sp
 .BI "struct ibv_pd *ibv_alloc_pd(struct ibv_context " "*context" );
 .sp
+.BI "struct ibv_pd *ibv_import_pd(struct ibv_context " "*context" ",
+.BI "                             uint32_t" " fd" ", uint32_t" " handle" );
+.sp
 .BI "int ibv_dealloc_pd(struct ibv_pd " "*pd" );
 .fi
 .SH "DESCRIPTION"
@@ -17,6 +20,14 @@  ibv_alloc_pd, ibv_dealloc_pd \- allocate or deallocate a protection domain (PDs)
 allocates a PD for the RDMA device context 
 .I context\fR.
 .PP
+.B ibv_import_pd()
+imports PD identified by
+.I handle\fR
+from context identified by file descriptor
+.I fd\fR
+to context
+.I context\fR.
+.PP
 .B ibv_dealloc_pd()
 deallocates the PD
 .I pd\fR.
@@ -24,9 +35,18 @@  deallocates the PD
 .B ibv_alloc_pd()
 returns a pointer to the allocated PD, or NULL if the request fails.
 .PP
+.B ibv_import_pd()
+returns a pointer to the imported PD, or NULL if the request fails.
+.PP
 .B ibv_dealloc_pd()
 returns 0 on success, or the value of errno on failure (which indicates the failure reason).
 .SH "NOTES"
+.B ibv_import_pd()
+once PD is imported the process which created it stays on hold until all
+reference to it are deallocated (PD can be imported more than once). The
+results of importing a PD from the same process that creates it are
+unexpected.
+.PP
 .B ibv_dealloc_pd()
 may fail if any other resource is still associated with the PD being
 freed.