Struct mlx_ethernet::receive_queue::ReceiveQueue
source · pub struct ReceiveQueue { /* private fields */ }
Expand description
A data structure that contains the RQ ring of descriptors and is used to interact with the RQ once initialized.
Implementations§
source§impl ReceiveQueue
impl ReceiveQueue
sourcepub fn create(
entries_mp: MappedPages,
num_entries: usize,
mtu: u32,
pool: &'static Queue<ReceiveBuffer>,
rqn: Rqn,
lkey: Lkey,
cq: CompletionQueue
) -> Result<ReceiveQueue, &'static str>
pub fn create( entries_mp: MappedPages, num_entries: usize, mtu: u32, pool: &'static Queue<ReceiveBuffer>, rqn: Rqn, lkey: Lkey, cq: CompletionQueue ) -> Result<ReceiveQueue, &'static str>
Creates a RQ by mapping the buffer as a slice of WorkQueueEntryReceive
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 RQmtu
: size of the receive buffers in bytesbuffer_pool
: receive buffer poolrqn
: SQ number returned by the HCAlkey
: the lkey used by the RQ
sourcepub fn refill(&mut self) -> Result<(), &'static str>
pub fn refill(&mut self) -> Result<(), &'static str>
Refills the receive queue by updating WQEs with new packet buffers. Right now we assume that this function is only called once at the point of initialization.
TODO: this function can be shifted to nic_initialization if we remove intel specific actions from those functions
Auto Trait Implementations§
impl !RefUnwindSafe for ReceiveQueue
impl Send for ReceiveQueue
impl Sync for ReceiveQueue
impl Unpin for ReceiveQueue
impl !UnwindSafe for ReceiveQueue
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