[][src]Struct xsk_rs::TxQueue

pub struct TxQueue<'umem> { /* fields omitted */ }

The transmitting side of an AF_XDP socket.

More details can be found in the docs.

Implementations

impl TxQueue<'_>[src]

pub unsafe fn produce(&mut self, descs: &[FrameDesc<'_>]) -> usize[src]

Let the kernel know that the contents of frames in descs are ready to be transmitted.

This function is marked unsafe as it is possible to cause a data race by simultaneously submitting the same frame descriptor to the tx ring and the fill ring, for example. Once any frames have been submitted they should not be used again until consumed via the CompQueue.

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.

This function returns the number of frames submitted to the kernel for transmission. Due to the constraint mentioned in the above paragraph, this should always be the length of descs or 0.

pub unsafe fn produce_and_wakeup(
    &mut self,
    descs: &[FrameDesc<'_>]
) -> Result<usize>
[src]

Same as produce but wake up the kernel to continue processing produced frames (if required).

This function is marked unsafe for the same reasons that produce is unsafe.

For more details see the docs.

pub fn wakeup(&self) -> Result<()>[src]

Wake up the kernel to continue processing produced frames.

See produce_and_wakeup for link to docs with further explanation.

pub fn needs_wakeup(&self) -> bool[src]

Check if the libbpf 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.

pub fn fd(&mut self) -> &mut Fd[src]

Return the AF_XDP socket's file descriptor.

Required for poll_read or poll_write.

Trait Implementations

impl Send for TxQueue<'_>[src]

Auto Trait Implementations

impl<'umem> RefUnwindSafe for TxQueue<'umem>[src]

impl<'umem> !Sync for TxQueue<'umem>[src]

impl<'umem> Unpin for TxQueue<'umem>[src]

impl<'umem> UnwindSafe for TxQueue<'umem>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.