@@ -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.