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: falseumem_config.fill_size: 2048 framesumem_config.complete_size: 2048 framesumem_config.frame_size: 4096 bytesumem_config.headroom: 32 bytesumem_config.flags: 0socket_config.rx_size: 2048 framessocket_config.tx_size: 2048 framessocket_config.bind_flags:SocketConfig::XDP_BIND_NEED_WAKEUPframe_count: 8192queue_id: 0
Implementations§
Source§impl RouteConfig
impl RouteConfig
Sourcepub fn force_enabled(self) -> Self
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.
Sourcepub fn umem_config(self, umem_config: UmemConfig) -> Self
pub fn umem_config(self, umem_config: UmemConfig) -> Self
Overrides the default UmemConfig for the AF_XDP socket.
Sourcepub fn socket_config(self, socket_config: SocketConfig) -> Self
pub fn socket_config(self, socket_config: SocketConfig) -> Self
Overrides the default SocketConfig for the AF_XDP socket.
Sourcepub fn frame_count(self, frame_count: u32) -> Self
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.
Sourcepub fn queue_id(self, queue_id: u32) -> Self
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