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§
Sourceunsafe fn new<I: IbvDomainImpl<QueuePair = Self>>(
domain: &IbvDomain<I>,
config: IbvConfig,
) -> Result<Self, Error>
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.
Sourcefn connect(&mut self, info: &IbvQpInfo) -> Result<(), Error>
fn connect(&mut self, info: &IbvQpInfo) -> Result<(), Error>
Transitions the QP through INIT -> RTR -> RTS, connected to info.
Sourcefn get_qp_info(&mut self) -> Result<IbvQpInfo, Error>
fn get_qp_info(&mut self) -> Result<IbvQpInfo, Error>
Returns the local endpoint other peers need in order to connect to this QP.
Sourcefn put(
&mut self,
remote_dst: IbvBuffer,
local_src: IbvBuffer,
) -> Result<Vec<u64>, Error>
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.
Sourcefn get(
&mut self,
local_dst: IbvBuffer,
remote_src: IbvBuffer,
) -> Result<Vec<u64>, Error>
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.
Sourcefn poll_completion(
&mut self,
target: PollTarget,
) -> Result<Option<Result<IbvWc, WorkRequestError>>, PollCompletionError>
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; theWorkRequestErrornames the failed request.Err(_)—ibv_poll_cqitself 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.