Skip to main content

IbvQueuePair

Trait IbvQueuePair 

Source
pub trait IbvQueuePair:
    Debug
    + Send
    + Sync
    + 'static
    + Sized {
    // Required methods
    unsafe fn new<I: IbvDomainImpl<QueuePair = Self>>(
        domain: &IbvDomain<I>,
        config: IbvConfig,
    ) -> Result<Self, Error>;
    fn connect(&mut self, info: &IbvQpInfo) -> Result<(), Error>;
    fn get_qp_info(&mut self) -> Result<IbvQpInfo, Error>;
    fn state(&mut self) -> Result<u32, Error>;
    fn put(
        &mut self,
        remote_dst: IbvBuffer,
        local_src: IbvBuffer,
    ) -> Result<Vec<u64>, Error>;
    fn get(
        &mut self,
        local_dst: IbvBuffer,
        remote_src: IbvBuffer,
    ) -> Result<Vec<u64>, Error>;
    fn poll_completion(
        &mut self,
        target: PollTarget,
    ) -> Result<Option<Result<IbvWc, WorkRequestError>>, PollCompletionError>;
}
Expand description

A NIC-backend queue pair: the unit of RDMA communication between two endpoints, and the operations a [QueuePairActor] performs on it. Each [IbvDomainImpl] names its concrete queue-pair type via IbvDomainImpl::QueuePair and builds it through Self::new.

Required Methods§

Source

unsafe fn new<I: IbvDomainImpl<QueuePair = Self>>( domain: &IbvDomain<I>, config: IbvConfig, ) -> Result<Self, Error>

Creates a queue pair against domain in the RESET state; Self::connect transitions it to RTS before use.

§Safety

domain’s PD (domain.as_ptr()) must be null or a valid protection domain. Callers must ensure the PD outlives the QP; the easiest way to do this is for implementers to store a clone of domain.pd() (an Arc<IbvPd>) inside the QP.

Source

fn connect(&mut self, info: &IbvQpInfo) -> Result<(), Error>

Transitions the QP through INIT -> RTR -> RTS, connected to info.

Source

fn get_qp_info(&mut self) -> Result<IbvQpInfo, Error>

Returns the local endpoint other peers need in order to connect to this QP.

Source

fn state(&mut self) -> Result<u32, Error>

Returns the current ibv_qp_state of the QP.

Source

fn put( &mut self, remote_dst: IbvBuffer, local_src: IbvBuffer, ) -> Result<Vec<u64>, Error>

Post an RDMA WRITE of local_src into remote_dst. The request may be chunked into multiple WRs. This method returns the list of WR ids that were posted.

Source

fn get( &mut self, local_dst: IbvBuffer, remote_src: IbvBuffer, ) -> Result<Vec<u64>, Error>

Post an RDMA READ of remote_src into local_dst. The request may be chunked into multiple WRs. This method returns the list of WR ids that were posted.

Source

fn poll_completion( &mut self, target: PollTarget, ) -> Result<Option<Result<IbvWc, WorkRequestError>>, PollCompletionError>

Poll target’s completion queue for a single work completion.

§Returns
  • Ok(None) — the CQ is currently empty.
  • Ok(Some(Ok(wc))) — a completion landed with success status.
  • Ok(Some(Err(_))) — a completion landed with a non-success status; the WorkRequestError names the failed request.
  • Err(_)ibv_poll_cq itself failed; the QP should be treated as poisoned.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§