pub struct PortConfig {
pub nb_rx_queues: u16,
pub nb_tx_queues: u16,
pub nb_rx_desc: u16,
pub nb_tx_desc: u16,
pub promiscuous: bool,
pub mtu: u32,
pub rx_offload: RxOffload,
pub tx_offload: TxOffload,
}Expand description
Configuration for an Ethernet port
Fields§
§nb_rx_queues: u16Number of RX queues
nb_tx_queues: u16Number of TX queues
nb_rx_desc: u16Number of RX descriptors per queue
nb_tx_desc: u16Number of TX descriptors per queue
promiscuous: boolEnable promiscuous mode
mtu: u32MTU size (0 for default)
rx_offload: RxOffloadRX hardware offload configuration
tx_offload: TxOffloadTX hardware offload configuration
Implementations§
Source§impl PortConfig
impl PortConfig
Sourcepub fn with_queues(self, rx: u16, tx: u16) -> Self
pub fn with_queues(self, rx: u16, tx: u16) -> Self
Set the number of RX/TX queues
Sourcepub fn with_descriptors(self, rx: u16, tx: u16) -> Self
pub fn with_descriptors(self, rx: u16, tx: u16) -> Self
Set the number of RX/TX descriptors
Sourcepub fn with_promiscuous(self, enable: bool) -> Self
pub fn with_promiscuous(self, enable: bool) -> Self
Enable or disable promiscuous mode
Sourcepub fn with_rx_offload(self, offload: RxOffload) -> Self
pub fn with_rx_offload(self, offload: RxOffload) -> Self
Configure RX hardware offloads
Sourcepub fn with_tx_offload(self, offload: TxOffload) -> Self
pub fn with_tx_offload(self, offload: TxOffload) -> Self
Configure TX hardware offloads
Sourcepub fn with_checksum_offload(self) -> Self
pub fn with_checksum_offload(self) -> Self
Enable all checksum offloads (RX and TX)
Sourcepub fn with_vlan_offload(self) -> Self
pub fn with_vlan_offload(self) -> Self
Enable hardware VLAN offloads (RX strip + TX insert).
When the NIC supports it, VLAN tags are stripped on RX (TCI stored in mbuf.vlan_tci) and inserted on TX (from mbuf.vlan_tci). Falls back to software tag handling if the NIC doesn’t support it.
Trait Implementations§
Source§impl Clone for PortConfig
impl Clone for PortConfig
Source§fn clone(&self) -> PortConfig
fn clone(&self) -> PortConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PortConfig
impl Debug for PortConfig
Auto Trait Implementations§
impl Freeze for PortConfig
impl RefUnwindSafe for PortConfig
impl Send for PortConfig
impl Sync for PortConfig
impl Unpin for PortConfig
impl UnsafeUnpin for PortConfig
impl UnwindSafe for PortConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more