pub struct CommandQueue { /* private fields */ }
Expand description

A buffer of fixed-size entries that is used to pass commands to the HCA. It resides in a physically contiguous 4 KiB memory chunk. (Section 8.24.1: HCA Command Queue)

Implementations§

source§

impl CommandQueue

source

pub fn create( entries: BorrowedSliceMappedPages<CommandQueueEntry, Mutable>, num_cmdq_entries: usize ) -> Result<CommandQueue, &'static str>

Create a command queue object.

Arguments
  • entries: physically contiguous memory that is mapped as a slice of command queue entries.
  • num_cmdq_entries: number of entries in the queue.
source

pub fn create_and_execute_command( &mut self, parameters: CommandBuilder, init_segment: &mut InitializationSegment ) -> Result<Command<{ CmdState::Completed }>, CommandQueueError>

Find an command queue entry that is not in use

source

pub fn wait_for_command_completion( &self, command: &Command<{ CmdState::Posted }> )

Waits for ownership bit to be cleared, and then returns the command delivery status and the command return status.

source

pub fn get_command_status( &mut self, command: Command<{ CmdState::Completed }> ) -> Result<CommandCompletionStatus, CommandQueueError>

source

pub fn get_port_type( &mut self, command: Command<{ CmdState::Completed }> ) -> Result<(HcaPortType, CommandCompletionStatus), CommandQueueError>

Get the number of pages requested by the NIC, which is the output of the CommandOpcode::QueryHcaCap command.

source

pub fn get_device_capabilities( &mut self, command: Command<{ CmdState::Completed }> ) -> Result<(HCACapabilities, CommandCompletionStatus), CommandQueueError>

Get the device capabilities, which is the output of the CommandOpcode::QueryHcaCap command.

source

pub fn get_query_issi_command_output( &mut self, command: Command<{ CmdState::Completed }> ) -> Result<(u16, u8, CommandCompletionStatus), CommandQueueError>

Get the current ISSI version and the supported ISSI versions, which is the output of the CommandOpcode::QueryIssi command.

source

pub fn get_query_pages_command_output( &mut self, command: Command<{ CmdState::Completed }> ) -> Result<(u32, CommandCompletionStatus), CommandQueueError>

Get the number of pages requested by the NIC, which is the output of the CommandOpcode::QueryPages command.

source

pub fn get_max_mtu( &mut self, command: Command<{ CmdState::Completed }> ) -> Result<(u16, CommandCompletionStatus), CommandQueueError>

Get the maximum value the MTU can be set to, which is the output of the CommandOpcode::AccessRegister command when accessing [NetworkPortRegisters::PMTU].

source

pub fn get_uar( &mut self, command: Command<{ CmdState::Completed }> ) -> Result<(u32, CommandCompletionStatus), CommandQueueError>

Get the User Access Region (UAR) number, which is the output of the CommandOpcode::AllocUar command.

source

pub fn get_protection_domain( &mut self, command: Command<{ CmdState::Completed }> ) -> Result<(Pd, CommandCompletionStatus), CommandQueueError>

Get the protection domain number, which is the output of the CommandOpcode::AllocPd command.

source

pub fn get_transport_domain( &mut self, command: Command<{ CmdState::Completed }> ) -> Result<(Td, CommandCompletionStatus), CommandQueueError>

Get the transport domain number, which is the output of the CommandOpcode::AllocTransportDomain command.

source

pub fn get_reserved_lkey( &mut self, command: Command<{ CmdState::Completed }> ) -> Result<(Lkey, CommandCompletionStatus), CommandQueueError>

Get the value of the reserved Lkey for Base Memory Management Extension, which is used when we are using physical addresses. It is taken as the output of the CommandOpcode::QuerySpecialContexts command.

source

pub fn get_vport_state( &mut self, command: Command<{ CmdState::Completed }> ) -> Result<(u16, u8, u8, CommandCompletionStatus), CommandQueueError>

Get the Vport state in the format (max_tx_speed, admin_state, state) It is taken as the output of the CommandOpcode::QueryVportState command.

source

pub fn get_vport_mac_address( &mut self, command: Command<{ CmdState::Completed }> ) -> Result<([u8; 6], CommandCompletionStatus), CommandQueueError>

Get the port mac address, which is the output of the CommandOpcode::QueryNicVportContext command.

source

pub fn get_eq_number( &mut self, command: Command<{ CmdState::Completed }> ) -> Result<(Eqn, CommandCompletionStatus), CommandQueueError>

source

pub fn get_cq_number( &mut self, command: Command<{ CmdState::Completed }> ) -> Result<(Cqn, CommandCompletionStatus), CommandQueueError>

source

pub fn get_tis_context_number( &mut self, command: Command<{ CmdState::Completed }> ) -> Result<(Tisn, CommandCompletionStatus), CommandQueueError>

source

pub fn get_send_queue_number( &mut self, command: Command<{ CmdState::Completed }> ) -> Result<(Sqn, CommandCompletionStatus), CommandQueueError>

source

pub fn get_receive_queue_number( &mut self, command: Command<{ CmdState::Completed }> ) -> Result<(Rqn, CommandCompletionStatus), CommandQueueError>

source

pub fn get_sq_state( &mut self, command: Command<{ CmdState::Completed }> ) -> Result<(SendQueueState, CommandCompletionStatus), CommandQueueError>

source

pub fn get_flow_table_id( &mut self, command: Command<{ CmdState::Completed }> ) -> Result<(FtId, CommandCompletionStatus), CommandQueueError>

source

pub fn get_flow_group_id( &mut self, command: Command<{ CmdState::Completed }> ) -> Result<(FgId, CommandCompletionStatus), CommandQueueError>

source

pub fn get_tir_context_number( &mut self, command: Command<{ CmdState::Completed }> ) -> Result<(Tirn, CommandCompletionStatus), CommandQueueError>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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.