Struct RdmaDomain

Source
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

Source

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
Source

pub fn register_buffer( &mut self, addr: usize, size: usize, ) -> Result<RdmaMemoryRegionView, Error>

Source

pub fn deregister_buffer(&mut self, buffer: RdmaBuffer) -> Result<(), Error>

Trait Implementations§

Source§

impl Debug for RdmaDomain

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for RdmaDomain

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for RdmaDomain

Source§

impl Sync for RdmaDomain

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<A, M> Handler<IndexedErasedUnbound<M>> for A
where A: Handler<M>, M: Castable,

Source§

fn handle<'life0, 'life1, 'async_trait>( &'life0 mut self, cx: &'life1 Context<'_, A>, msg: IndexedErasedUnbound<M>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, A: 'async_trait,

Handle the next M-typed message.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<M> Message for M
where M: Debug + Send + Sync + 'static,