Struct mlx_ethernet::send_queue::SendQueue
source · pub struct SendQueue { /* private fields */ }
Expand description
A data structure that contains the SQ ring of descriptors and is used to interact with the SQ once initialized.
Implementations§
source§impl SendQueue
impl SendQueue
sourcepub fn create(
entries_mp: MappedPages,
num_entries: usize,
doorbell_mp: MappedPages,
uar_mp: MappedPages,
sqn: Sqn,
_tisn: Tisn,
lkey: Lkey
) -> Result<SendQueue, &'static str>
pub fn create( entries_mp: MappedPages, num_entries: usize, doorbell_mp: MappedPages, uar_mp: MappedPages, sqn: Sqn, _tisn: Tisn, lkey: Lkey ) -> Result<SendQueue, &'static str>
Creates a SQ by mapping the buffer as a slice of WorkQueueEntrySend
s.
Each WQE is set to an initial state.
Arguments
entries_mp
: memory that is to be transformed into a slice of WQEs. The starting physical address should have been passed to the HCA when creating the SQ.num_entries
: number of entries in the SQdoorbell_mp
: memory that is to be transformed into a doorbell record. The starting physical address should have been passed to the HCA when creating the SQ.uar_mp
: The UAR page that is associate with this SQ.sqn
: SQ number returned by the HCAtisn
: number of the TIS context associated with this SQlkey
: the lkey used by the SQ
sourcepub fn send(&mut self, packet_address: PhysicalAddress, packet: &[u8]) -> u16
pub fn send(&mut self, packet_address: PhysicalAddress, packet: &[u8]) -> u16
Perform all the steps to send a packet: initialize the WQE, update the doorbell record and the uar doorbell register. Returns the current value of the WQE counter.
Auto Trait Implementations§
impl RefUnwindSafe for SendQueue
impl Send for SendQueue
impl Sync for SendQueue
impl Unpin for SendQueue
impl UnwindSafe for SendQueue
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
Mutably borrows from an owned value. Read more