Struct ibverbs::ibv_wc

source ·
#[repr(C)]
pub struct ibv_wc { pub imm_data: u32, pub qp_num: u32, pub src_qp: u32, pub wc_flags: ibv_wc_flags, pub pkey_index: u16, pub slid: u16, pub sl: u8, pub dlid_path_bits: u8, /* private fields */ }
Expand description

An ibverb work completion.

Fields§

§imm_data: u32

Immediate data OR the local RKey that was invalidated depending on wc_flags. See man ibv_poll_cq for details.

§qp_num: u32

Local QP number of completed WR.

Relevant for Receive Work Completions that are associated with an SRQ.

§src_qp: u32

Source QP number (remote QP number) of completed WR.

Relevant for Receive Work Completions of a UD QP.

§wc_flags: ibv_wc_flags

Flags of the Work Completion. It is either 0 or the bitwise OR of one or more of the following flags:

  • IBV_WC_GRH: Indicator that GRH is present for a Receive Work Completions of a UD QP. If this bit is set, the first 40 bytes of the buffered that were referred to in the Receive request will contain the GRH of the incoming message. If this bit is cleared, the content of those first 40 bytes is undefined
  • IBV_WC_WITH_IMM: Indicator that imm_data is valid. Relevant for Receive Work Completions
§pkey_index: u16

P_Key index (valid only for GSI QPs).

§slid: u16

Source LID (the base LID that this message was sent from).

Relevant for Receive Work Completions of a UD QP.

§sl: u8

Service Level (the SL LID that this message was sent with).

Relevant for Receive Work Completions of a UD QP.

§dlid_path_bits: u8

Destination LID path bits.

Relevant for Receive Work Completions of a UD QP (not applicable for multicast messages).

Implementations§

source§

impl ibv_wc

source

pub fn wr_id(&self) -> u64

Returns the 64 bit value that was associated with the corresponding Work Request.

source

pub fn len(&self) -> usize

Returns the number of bytes transferred.

Relevant if the Receive Queue for incoming Send or RDMA Write with immediate operations. This value doesn’t include the length of the immediate data, if such exists. Relevant in the Send Queue for RDMA Read and Atomic operations.

For the Receive Queue of a UD QP that is not associated with an SRQ or for an SRQ that is associated with a UD QP this value equals to the payload of the message plus the 40 bytes reserved for the GRH. The number of bytes transferred is the payload of the message plus the 40 bytes reserved for the GRH, whether or not the GRH is present

source

pub fn is_valid(&self) -> bool

Check if this work requested completed successfully.

A successful work completion (IBV_WC_SUCCESS) means that the corresponding Work Request (and all of the unsignaled Work Requests that were posted previous to it) ended, and the memory buffers that this Work Request refers to are ready to be (re)used.

source

pub fn error(&self) -> Option<(u32, u32)>

Returns the work completion status and vendor error syndrome (vendor_err) if the work request did not completed successfully.

Possible statuses include:

  • IBV_WC_LOC_LEN_ERR: Local Length Error: this happens if a Work Request that was posted in a local Send Queue contains a message that is greater than the maximum message size that is supported by the RDMA device port that should send the message or an Atomic operation which its size is different than 8 bytes was sent. This also may happen if a Work Request that was posted in a local Receive Queue isn’t big enough for holding the incoming message or if the incoming message size if greater the maximum message size supported by the RDMA device port that received the message.
  • IBV_WC_LOC_QP_OP_ERR: Local QP Operation Error: an internal QP consistency error was detected while processing this Work Request: this happens if a Work Request that was posted in a local Send Queue of a UD QP contains an Address Handle that is associated with a Protection Domain to a QP which is associated with a different Protection Domain or an opcode which isn’t supported by the transport type of the QP isn’t supported (for example: RDMA Write over a UD QP).
  • IBV_WC_LOC_EEC_OP_ERR: Local EE Context Operation Error: an internal EE Context consistency error was detected while processing this Work Request (unused, since its relevant only to RD QPs or EE Context, which aren’t supported).
  • IBV_WC_LOC_PROT_ERR: Local Protection Error: the locally posted Work Request’s buffers in the scatter/gather list does not reference a Memory Region that is valid for the requested operation.
  • IBV_WC_WR_FLUSH_ERR: Work Request Flushed Error: A Work Request was in process or outstanding when the QP transitioned into the Error State.
  • IBV_WC_MW_BIND_ERR: Memory Window Binding Error: A failure happened when tried to bind a MW to a MR.
  • IBV_WC_BAD_RESP_ERR: Bad Response Error: an unexpected transport layer opcode was returned by the responder. Relevant for RC QPs.
  • IBV_WC_LOC_ACCESS_ERR: Local Access Error: a protection error occurred on a local data buffer during the processing of a RDMA Write with Immediate operation sent from the remote node. Relevant for RC QPs.
  • IBV_WC_REM_INV_REQ_ERR: Remote Invalid Request Error: The responder detected an invalid message on the channel. Possible causes include the operation is not supported by this receive queue (qp_access_flags in remote QP wasn’t configured to support this operation), insufficient buffering to receive a new RDMA or Atomic Operation request, or the length specified in a RDMA request is greater than 2^{31} bytes. Relevant for RC QPs.
  • IBV_WC_REM_ACCESS_ERR: Remote Access Error: a protection error occurred on a remote data buffer to be read by an RDMA Read, written by an RDMA Write or accessed by an atomic operation. This error is reported only on RDMA operations or atomic operations. Relevant for RC QPs.
  • IBV_WC_REM_OP_ERR: Remote Operation Error: the operation could not be completed successfully by the responder. Possible causes include a responder QP related error that prevented the responder from completing the request or a malformed WQE on the Receive Queue. Relevant for RC QPs.
  • IBV_WC_RETRY_EXC_ERR: Transport Retry Counter Exceeded: The local transport timeout retry counter was exceeded while trying to send this message. This means that the remote side didn’t send any Ack or Nack. If this happens when sending the first message, usually this mean that the connection attributes are wrong or the remote side isn’t in a state that it can respond to messages. If this happens after sending the first message, usually it means that the remote QP isn’t available anymore. Relevant for RC QPs.
  • IBV_WC_RNR_RETRY_EXC_ERR: RNR Retry Counter Exceeded: The RNR NAK retry count was exceeded. This usually means that the remote side didn’t post any WR to its Receive Queue. Relevant for RC QPs.
  • IBV_WC_LOC_RDD_VIOL_ERR: Local RDD Violation Error: The RDD associated with the QP does not match the RDD associated with the EE Context (unused, since its relevant only to RD QPs or EE Context, which aren’t supported).
  • IBV_WC_REM_INV_RD_REQ_ERR: Remote Invalid RD Request: The responder detected an invalid incoming RD message. Causes include a Q_Key or RDD violation (unused, since its relevant only to RD QPs or EE Context, which aren’t supported)
  • IBV_WC_REM_ABORT_ERR: Remote Aborted Error: For UD or UC QPs associated with a SRQ, the responder aborted the operation.
  • IBV_WC_INV_EECN_ERR: Invalid EE Context Number: An invalid EE Context number was detected (unused, since its relevant only to RD QPs or EE Context, which aren’t supported).
  • IBV_WC_INV_EEC_STATE_ERR: Invalid EE Context State Error: Operation is not legal for the specified EE Context state (unused, since its relevant only to RD QPs or EE Context, which aren’t supported).
  • IBV_WC_FATAL_ERR: Fatal Error.
  • IBV_WC_RESP_TIMEOUT_ERR: Response Timeout Error.
  • IBV_WC_GENERAL_ERR: General Error: other error which isn’t one of the above errors.
source

pub fn opcode(&self) -> u32

Returns the operation that the corresponding Work Request performed.

This value controls the way that data was sent, the direction of the data flow and the valid attributes in the Work Completion.

source

pub fn imm_data(&self) -> Option<u32>

Returns a 32 bits number, in network order, in an SEND or RDMA WRITE opcodes that is being sent along with the payload to the remote side and placed in a Receive Work Completion and not in a remote memory buffer

Note that IMM is only returned if IBV_WC_WITH_IMM is set in wc_flags. If this is not the case, no immediate value was provided, and imm_data should be interpreted differently. See man ibv_poll_cq for details.

Trait Implementations§

source§

impl Clone for ibv_wc

source§

fn clone(&self) -> ibv_wc

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ibv_wc

source§

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

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

impl Default for ibv_wc

source§

fn default() -> ibv_wc

Returns the “default value” for a type. Read more
source§

impl Copy for ibv_wc

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.

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.