Struct xdpsock::umem::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]
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]
&mut self,
descs: &mut [Frame<'_>],
socket_fd: &mut Fd,
poll_timeout: i32
) -> Result<usize>
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
Auto Trait Implementations
impl<'umem> RefUnwindSafe for FillQueue<'umem>
impl<'umem> RefUnwindSafe for FillQueue<'umem>
impl<'umem> UnwindSafe for FillQueue<'umem>
impl<'umem> UnwindSafe for FillQueue<'umem>