Struct xdpsock::umem::UmemConfig[][src]

pub struct UmemConfig { /* fields omitted */ }

Config for a Umem instance.

fill_queue_size and comp_queue_size must be powers of two and frame size must not be less than 2048. If you have set use_huge_pages as true but are getting errors, check that the HugePages_Total setting is non-zero when you run cat /proc/meminfo.

It’s worth noting that the specified frame_size is not necessarily the buffer size that will be available to write data into. Some of this will be eaten up by XDP_PACKET_HEADROOM and any non-zero frame_headroom, so make sure to check that frame_size is large enough to hold the data you with to transmit (e.g. an ETH frame) plus XDP_PACKET_HEADROOM + frame_headroom bytes.

Implementations

impl UmemConfig[src]

pub fn new(
    frame_count: u32,
    frame_size: u32,
    fill_queue_size: u32,
    comp_queue_size: u32,
    frame_headroom: u32,
    use_huge_pages: bool
) -> Result<Self, UmemConfigError>
[src]

pub fn frame_count(&self) -> u32[src]

pub fn frame_size(&self) -> u32[src]

pub fn fill_queue_size(&self) -> u32[src]

pub fn comp_queue_size(&self) -> u32[src]

pub fn frame_headroom(&self) -> u32[src]

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

pub fn umem_len(&self) -> usize[src]

Trait Implementations

impl Clone for UmemConfig[src]

impl Debug for UmemConfig[src]

impl Default for UmemConfig[src]

fn default() -> Self[src]

Default configuration based on constants set in the libbpf library.

impl PartialEq<UmemConfig> for UmemConfig[src]

impl StructuralPartialEq for UmemConfig[src]

Auto Trait Implementations

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.