Skip to main content

RouteConfig

Struct RouteConfig 

Source
pub struct RouteConfig { /* private fields */ }
Expand description

Optional configuration for routing packets.

Presently, AF_XDP routing is configured with a shared UMEM region, with a queue serving as a free list to coordinate available frames.

This Defaults to the following:

  • force_enabled: false
  • umem_config.fill_size: 2048 frames
  • umem_config.complete_size: 2048 frames
  • umem_config.frame_size: 4096 bytes
  • umem_config.headroom: 32 bytes
  • umem_config.flags: 0
  • socket_config.rx_size: 2048 frames
  • socket_config.tx_size: 2048 frames
  • socket_config.bind_flags: SocketConfig::XDP_BIND_NEED_WAKEUP
  • frame_count: 8192
  • queue_id: 0

Implementations§

Source§

impl RouteConfig

Source

pub fn force_enabled(self) -> Self

Force the Tap to provision route primitives, even if no rules use route. Set this if you want to dynamically add a rule with Action::Route later.

Source

pub fn umem_config(self, umem_config: UmemConfig) -> Self

Overrides the default UmemConfig for the AF_XDP socket.

Source

pub fn socket_config(self, socket_config: SocketConfig) -> Self

Overrides the default SocketConfig for the AF_XDP socket.

Source

pub fn frame_count(self, frame_count: u32) -> Self

Sets the frame_count for the AF_XDP socket. Combined with the UmemConfig settings, this will determine the total size of the Umem region.

Source

pub fn queue_id(self, queue_id: u32) -> Self

Sets the queue_id for the AF_XDP socket.

§Note

The queue_id is likely not going to contain all of the traffic you expect unless you specifially route traffic to that queue id, for example, using ethtool. https://www.kernel.org/doc/html/latest/networking/af_xdp.html#faq

Trait Implementations§

Source§

impl Default for RouteConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.