Struct xdpsock::TxQueue [−][src]
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]
impl TxQueue<'_>
[src]pub unsafe fn produce(&mut self, descs: &[Frame<'_>]) -> 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: &[Frame<'_>]
) -> Result<usize>
[src]
&mut self,
descs: &[Frame<'_>]
) -> Result<usize>
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
Auto Trait Implementations
impl<'umem> RefUnwindSafe for TxQueue<'umem>
impl<'umem> RefUnwindSafe for TxQueue<'umem>
impl<'umem> UnwindSafe for TxQueue<'umem>
impl<'umem> UnwindSafe for TxQueue<'umem>