pub struct RdmaDomain {
pub context: *mut ibv_context,
pub pd: *mut ibv_pd,
/* private fields */
}
Expand description
Represents a domain for RDMA operations, encapsulating the necessary resources for establishing and managing RDMA connections.
An RdmaDomain
manages the context, protection domain (PD), and memory region (MR)
required for RDMA operations. It provides the foundation for creating queue pairs
and establishing connections between RDMA devices.
§Fields
context
: A pointer to the RDMA device context, representing the connection to the RDMA device.pd
: A pointer to the protection domain, which provides isolation between different connections.mr_map
: A map of memory region IDs to pointers, representing registered memory regions.counter
: A counter for generating unique memory region IDs.
Fields§
§context: *mut ibv_context
§pd: *mut ibv_pd
Implementations§
Source§impl RdmaDomain
impl RdmaDomain
Sourcepub fn new(device: RdmaDevice) -> Result<Self, Error>
pub fn new(device: RdmaDevice) -> Result<Self, Error>
Creates a new RdmaDomain.
This function initializes the RDMA device context, creates a protection domain, and registers a memory region with appropriate access permissions.
SAFETY: Our memory region (MR) registration uses implicit ODP for RDMA access, which maps large virtual address ranges without explicit pinning. This is convenient, but it broadens the memory footprint exposed to the NIC and introduces a security liability.
We currently assume a trusted, single-environment and are not enforcing finer-grained memory isolation at this layer. We plan to investigate mitigations - such as memory windows or tighter registration boundaries in future follow-ups.
§Arguments
config
- Configuration settings for the RDMA operations
§Errors
This function may return errors if:
- No RDMA devices are found
- The specified device cannot be found
- Device context creation fails
- Protection domain allocation fails
- Memory region registration fails
pub fn register_buffer( &mut self, addr: usize, size: usize, ) -> Result<RdmaMemoryRegionView, Error>
pub fn deregister_buffer(&mut self, buffer: RdmaBuffer) -> Result<(), Error>
Trait Implementations§
Source§impl Debug for RdmaDomain
impl Debug for RdmaDomain
Source§impl Drop for RdmaDomain
impl Drop for RdmaDomain
impl Send for RdmaDomain
impl Sync for RdmaDomain
Auto Trait Implementations§
impl Freeze for RdmaDomain
impl RefUnwindSafe for RdmaDomain
impl Unpin for RdmaDomain
impl UnwindSafe for RdmaDomain
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<A, M> Handler<IndexedErasedUnbound<M>> for A
impl<A, M> Handler<IndexedErasedUnbound<M>> for A
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more