pub struct PreparedQueuePair<'res> { /* private fields */ }
Expand description

An allocated but uninitialized QueuePair.

Specifically, this QueuePair has been allocated with ibv_create_qp, but has not yet been initialized with calls to ibv_modify_qp.

To complete the construction of the QueuePair, you will need to obtain the QueuePairEndpoint of the remote end (by using PreparedQueuePair::endpoint), and then call PreparedQueuePair::handshake on both sides with the other side’s QueuePairEndpoint:

// on host 1
let pqp: PreparedQueuePair = ...;
let host1end = pqp.endpoint();
host2.send(host1end);
let host2end = host2.recv();
let qp = pqp.handshake(host2end);

// on host 2
let pqp: PreparedQueuePair = ...;
let host2end = pqp.endpoint();
host1.send(host2end);
let host1end = host1.recv();
let qp = pqp.handshake(host1end);

Implementations§

source§

impl<'res> PreparedQueuePair<'res>

source

pub fn endpoint(&self) -> QueuePairEndpoint

Get the network endpoint for this QueuePair.

This endpoint will need to be communicated to the QueuePair on the remote end.

source

pub fn handshake(self, remote: QueuePairEndpoint) -> Result<QueuePair<'res>>

Set up the QueuePair such that it is ready to exchange packets with a remote QueuePair.

Internally, this uses ibv_modify_qp to mark the QueuePair as initialized (IBV_QPS_INIT), ready to receive (IBV_QPS_RTR), and ready to send (IBV_QPS_RTS). Further discussion of the protocol can be found on RDMAmojo.

If the endpoint contains a Gid, the routing will be global. This means:

ah_attr.is_global = 1;
ah_attr.grh.hop_limit = 0xff;

The handshake also sets the following parameters, which are currently not configurable:

§Examples
port_num = PORT_NUM;
pkey_index = 0;
rq_psn = 0;
sq_psn = 0;

max_dest_rd_atomic = 1;
max_rd_atomic = 1;

ah_attr.sl = 0;
ah_attr.src_path_bits = 0;
§Errors
  • EINVAL: Invalid value provided in attr or in attr_mask.
  • ENOMEM: Not enough resources to complete this operation.

Auto Trait Implementations§

§

impl<'res> RefUnwindSafe for PreparedQueuePair<'res>

§

impl<'res> Send for PreparedQueuePair<'res>

§

impl<'res> Sync for PreparedQueuePair<'res>

§

impl<'res> Unpin for PreparedQueuePair<'res>

§

impl<'res> UnwindSafe for PreparedQueuePair<'res>

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.

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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.