pub struct TxQueue { /* private fields */ }
Implementations
sourceimpl TxQueue
impl TxQueue
sourcepub unsafe fn produce(&mut self, descs: &[FrameDesc]) -> usize
pub unsafe fn produce(&mut self, descs: &[FrameDesc]) -> usize
Let the kernel know that the frames described by descs
are
ready to be transmitted. Returns the number of frames
submitted to the kernel.
Note that if the length of descs
is greater than the number
of available spaces on the underlying ring buffer then no
frames at all will be submitted for transmission.
Once the frames have been submitted to this queue they should
not be used again until consumed via the CompQueue
.
Safety
This function is unsafe as it is possible to cause a data race
if used improperly. For example, by simultaneously submitting
the same frame to this TxQueue
and the FillQueue
.
Furthermore, the frames passed to this queue must belong to
the same Umem
that this TxQueue
instance is tied to.
sourcepub unsafe fn produce_one(&mut self, desc: &FrameDesc) -> usize
pub unsafe fn produce_one(&mut self, desc: &FrameDesc) -> usize
sourcepub unsafe fn produce_one_and_wakeup(
&mut self,
desc: &FrameDesc
) -> Result<usize>
pub unsafe fn produce_one_and_wakeup(
&mut self,
desc: &FrameDesc
) -> Result<usize>
sourcepub fn wakeup(&self) -> Result<()>
pub fn wakeup(&self) -> Result<()>
Wake up the kernel to continue processing produced frames.
See produce_and_wakeup
for a link to docs with further
explanation.
sourcepub fn needs_wakeup(&self) -> bool
pub fn needs_wakeup(&self) -> bool
Check if the XDP_USE_NEED_WAKEUP
flag is set on the tx
ring. If so then this means a call to wakeup
will be
required to continue processing produced frames.
See produce_and_wakeup
for link to docs with further
explanation.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for TxQueue
impl Send for TxQueue
impl !Sync for TxQueue
impl Unpin for TxQueue
impl UnwindSafe for TxQueue
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more