Struct xdpsock::FillQueue[][src]

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

Used to transfer ownership of UMEM frames from user-space to kernel-space.

These frames will be used to receive packets, and will eventually be returned via the RxQueue.

For more information see the docs

Implementations

impl FillQueue<'_>[src]

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

Let the kernel know that the frames in descs may be used to receive data.

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

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 handed over to the kernel.

This returns the number of frames submitted to the kernel. 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: &mut [Frame<'_>],
    socket_fd: &mut Fd,
    poll_timeout: i32
) -> Result<usize>
[src]

Same as produce but wake up the kernel (if required) to let it know there are frames available that may be used to receive data.

For more details see the docs.

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

pub fn wakeup(&self, fd: &mut Fd, poll_timeout: i32) -> Result<()>[src]

Wake up the kernel to let it know it can continue using the fill ring to process received data.

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 fill ring. If so then this means a call to wakeup will be required to continue processing received data with the fill ring.

See produce_and_wakeup for link to docs with further explanation.

Trait Implementations

impl<'umem> Debug for FillQueue<'umem>[src]

impl Send for FillQueue<'_>[src]

Auto Trait Implementations

impl<'umem> RefUnwindSafe for FillQueue<'umem>

impl<'umem> !Sync for FillQueue<'umem>

impl<'umem> Unpin for FillQueue<'umem>

impl<'umem> UnwindSafe for FillQueue<'umem>

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.