pub struct FillRing { /* private fields */ }Expand description
Ring buffer for UMEM fill descriptors (chunk addresses pushed by userspace for the kernel/NIC to fill).
Implementations§
Source§impl FillRing
impl FillRing
Sourcepub fn new(capacity: u32) -> Self
pub fn new(capacity: u32) -> Self
Creates a new fill ring with capacity descriptors. capacity must be a power of two.
Sourcepub fn produce(&mut self, addr: u64) -> bool
pub fn produce(&mut self, addr: u64) -> bool
Enqueues a chunk address for the kernel/NIC to fill. Returns false if full.
Sourcepub fn produce_batch(&mut self, addrs: &[u64]) -> usize
pub fn produce_batch(&mut self, addrs: &[u64]) -> usize
Enqueues a batch of chunk addresses into the ring. Returns count enqueued.
Sourcepub fn consume_batch(&mut self, out: &mut [u64]) -> usize
pub fn consume_batch(&mut self, out: &mut [u64]) -> usize
Dequeues up to out.len() chunk addresses into out. Returns count dequeued.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FillRing
impl RefUnwindSafe for FillRing
impl Send for FillRing
impl Sync for FillRing
impl Unpin for FillRing
impl UnsafeUnpin for FillRing
impl UnwindSafe for FillRing
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