Struct ibverbs::ProtectionDomain [−][src]
A protection domain for a device’s context.
Implementations
impl<'ctx> ProtectionDomain<'ctx>
[src]
pub fn create_qp<'pd, 'scq, 'rcq, 'res>(
&'pd self,
send: &'scq CompletionQueue<'_>,
recv: &'rcq CompletionQueue<'_>,
qp_type: Type
) -> QueuePairBuilder<'res> where
'scq: 'res,
'rcq: 'res,
'pd: 'res,
[src]
&'pd self,
send: &'scq CompletionQueue<'_>,
recv: &'rcq CompletionQueue<'_>,
qp_type: Type
) -> QueuePairBuilder<'res> where
'scq: 'res,
'rcq: 'res,
'pd: 'res,
Creates a queue pair builder associated with this protection domain.
send
and recv
are the device Context
to associate with the send and receive queues
respectively. send
and recv
may refer to the same Context
.
qp_type
indicates the requested Transport Service Type of this QP:
IBV_QPT_RC
: Reliable ConnectionIBV_QPT_UC
: Unreliable ConnectionIBV_QPT_UD
: Unreliable Datagram
Note that both this protection domain, and both provided completion queues, must outlive
the resulting QueuePair
.
pub fn allocate<T: Sized + Copy + Default>(
&self,
n: usize
) -> Result<MemoryRegion<T>>
[src]
&self,
n: usize
) -> Result<MemoryRegion<T>>
Allocates and registers a Memory Region (MR) associated with this ProtectionDomain
.
This process allows the RDMA device to read and write data to the allocated memory. Only
registered memory can be sent from and received to by QueuePair
s. Performing this
registration takes some time, so performing memory registration isn’t recommended in the
data path, when fast response is required.
Every successful registration will result with a MR which has unique (within a specific
RDMA device) lkey
and rkey
values. These keys must be communicated to the other end’s
QueuePair
for direct memory access.
The maximum size of the block that can be registered is limited to
device_attr.max_mr_size
. There isn’t any way to know what is the total size of memory
that can be registered for a specific device.
allocate
currently sets the following permissions for each new MemoryRegion
:
IBV_ACCESS_LOCAL_WRITE
: Enables Local Write AccessIBV_ACCESS_REMOTE_WRITE
: Enables Remote Write AccessIBV_ACCESS_REMOTE_READ
: Enables Remote Read AccessIBV_ACCESS_REMOTE_ATOMIC
: Enables Remote Atomic Operation Access (if supported)
Local read access is always enabled for the MR.
Panics
Panics if the size of the memory region zero bytes, which can occur either if n
is 0, or
if mem::size_of::<T>()
is 0.
Errors
EINVAL
: Invalid access value.ENOMEM
: Not enough resources (either in operating system or in RDMA device) to complete this operation.
Trait Implementations
impl<'a> Drop for ProtectionDomain<'a>
[src]
impl<'a> Send for ProtectionDomain<'a>
[src]
impl<'a> Sync for ProtectionDomain<'a>
[src]
Auto Trait Implementations
impl<'ctx> RefUnwindSafe for ProtectionDomain<'ctx>
impl<'ctx> Unpin for ProtectionDomain<'ctx>
impl<'ctx> UnwindSafe for ProtectionDomain<'ctx>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,