pub struct IbvQueuePair {
pub send_cq: usize,
pub recv_cq: usize,
pub qp: usize,
pub dv_qp: usize,
pub dv_send_cq: usize,
pub dv_recv_cq: usize,
/* private fields */
}Expand description
An RDMA Queue Pair (QP) for communication between two endpoints.
Encapsulates the send/receive queues, completion queues, and mlx5dv device-specific structures needed for RDMA communication.
§Connection Lifecycle
- Create with
new()from context and protection domain pointers - Get connection info with
get_qp_info() - Exchange connection info with remote peer
- Connect to remote endpoint with
connect() - Perform RDMA operations with
put()orget() - Poll for completions with
poll_completion()
§Notes
- The
qpfield stores a pointer tordmaxcel_qp_t(notibv_qp) rdmaxcel_qp_tcontains atomic counters and completion caches internally- This makes IbvQueuePair trivially Clone and Serialize
- Multiple clones share the same underlying rdmaxcel_qp_t via the pointer
Fields§
§send_cq: usize§recv_cq: usize§qp: usize§dv_qp: usize§dv_send_cq: usize§dv_recv_cq: usizeImplementations§
Source§impl IbvQueuePair
impl IbvQueuePair
Sourcepub fn new(
context: *mut ibv_context,
pd: *mut ibv_pd,
config: IbvConfig,
) -> Result<Self, Error>
pub fn new( context: *mut ibv_context, pd: *mut ibv_pd, config: IbvConfig, ) -> Result<Self, Error>
Creates a new IbvQueuePair.
Initializes a new Queue Pair (QP) and associated Completion Queues (CQ)
using the provided context and protection domain. The QP is created in
the RESET state and must be transitioned via connect() before use.
§Errors
Returns errors if CQ or QP creation fails.
Sourcepub fn get_qp_info(&mut self) -> Result<IbvQpInfo, Error>
pub fn get_qp_info(&mut self) -> Result<IbvQpInfo, Error>
Returns the connection info needed by a remote peer to connect to this QP.
Sourcepub fn connect(&mut self, connection_info: &IbvQpInfo) -> Result<(), Error>
pub fn connect(&mut self, connection_info: &IbvQpInfo) -> Result<(), Error>
Transitions the QP through INIT -> RTR -> RTS to establish a connection.
§Arguments
connection_info- The remote connection info to connect to
pub fn recv( &mut self, lhandle: IbvBuffer, rhandle: IbvBuffer, ) -> Result<u64, Error>
pub fn put_with_recv( &mut self, lhandle: IbvBuffer, rhandle: IbvBuffer, ) -> Result<Vec<u64>, Error>
pub fn put( &mut self, lhandle: IbvBuffer, rhandle: IbvBuffer, ) -> Result<Vec<u64>, Error>
Sourcepub fn ring_doorbell(&mut self) -> Result<(), Error>
pub fn ring_doorbell(&mut self) -> Result<(), Error>
Rings the doorbell to execute all enqueued operations.
Sourcepub fn enqueue_put(
&mut self,
lhandle: IbvBuffer,
rhandle: IbvBuffer,
) -> Result<Vec<u64>, Error>
pub fn enqueue_put( &mut self, lhandle: IbvBuffer, rhandle: IbvBuffer, ) -> Result<Vec<u64>, Error>
Enqueues a put operation without ringing the doorbell.
Sourcepub fn enqueue_put_with_recv(
&mut self,
lhandle: IbvBuffer,
rhandle: IbvBuffer,
) -> Result<Vec<u64>, Error>
pub fn enqueue_put_with_recv( &mut self, lhandle: IbvBuffer, rhandle: IbvBuffer, ) -> Result<Vec<u64>, Error>
Enqueues a put-with-receive operation without ringing the doorbell.
Sourcepub fn enqueue_get(
&mut self,
lhandle: IbvBuffer,
rhandle: IbvBuffer,
) -> Result<Vec<u64>, Error>
pub fn enqueue_get( &mut self, lhandle: IbvBuffer, rhandle: IbvBuffer, ) -> Result<Vec<u64>, Error>
Enqueues a get operation without ringing the doorbell.
pub fn get( &mut self, lhandle: IbvBuffer, rhandle: IbvBuffer, ) -> Result<Vec<u64>, Error>
Sourcepub fn poll_completion(
&mut self,
target: PollTarget,
expected_wr_ids: &[u64],
) -> Result<Vec<(u64, IbvWc)>, Error>
pub fn poll_completion( &mut self, target: PollTarget, expected_wr_ids: &[u64], ) -> Result<Vec<(u64, IbvWc)>, Error>
Trait Implementations§
Source§impl Clone for IbvQueuePair
impl Clone for IbvQueuePair
Source§fn clone(&self) -> IbvQueuePair
fn clone(&self) -> IbvQueuePair
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IbvQueuePair
impl Debug for IbvQueuePair
Source§impl<'de> Deserialize<'de> for IbvQueuePair
impl<'de> Deserialize<'de> for IbvQueuePair
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Named for IbvQueuePair
impl Named for IbvQueuePair
Source§fn typename() -> &'static str
fn typename() -> &'static str
Source§fn typehash() -> u64
fn typehash() -> u64
Source§fn typeid() -> TypeId
fn typeid() -> TypeId
Source§fn port() -> u64
fn port() -> u64
Auto Trait Implementations§
impl Freeze for IbvQueuePair
impl RefUnwindSafe for IbvQueuePair
impl Send for IbvQueuePair
impl Sync for IbvQueuePair
impl Unpin for IbvQueuePair
impl UnwindSafe for IbvQueuePair
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
Source§impl<T> Checkpointable for Twhere
T: RemoteMessage + Clone,
impl<T> Checkpointable for Twhere
T: RemoteMessage + Clone,
Source§type State = T
type State = T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].