Struct nmstate::BondOptions

source ·
#[non_exhaustive]
pub struct BondOptions {
Show 27 fields pub ad_actor_sys_prio: Option<u16>, pub ad_actor_system: Option<String>, pub ad_select: Option<BondAdSelect>, pub ad_user_port_key: Option<u16>, pub all_slaves_active: Option<BondAllPortsActive>, pub arp_all_targets: Option<BondArpAllTargets>, pub arp_interval: Option<u32>, pub arp_ip_target: Option<String>, pub arp_validate: Option<BondArpValidate>, pub downdelay: Option<u32>, pub fail_over_mac: Option<BondFailOverMac>, pub lacp_rate: Option<BondLacpRate>, pub lp_interval: Option<u32>, pub miimon: Option<u32>, pub min_links: Option<u32>, pub num_grat_arp: Option<u8>, pub num_unsol_na: Option<u8>, pub packets_per_slave: Option<u32>, pub primary: Option<String>, pub primary_reselect: Option<BondPrimaryReselect>, pub resend_igmp: Option<u32>, pub tlb_dynamic_lb: Option<bool>, pub updelay: Option<u32>, pub use_carrier: Option<bool>, pub xmit_hash_policy: Option<BondXmitHashPolicy>, pub balance_slb: Option<bool>, pub arp_missed_max: Option<u8>,
}

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§ad_actor_sys_prio: Option<u16>

In an AD system, this specifies the system priority. The allowed range is 1 - 65535.

§ad_actor_system: Option<String>

In an AD system, this specifies the mac-address for the actor in protocol packet exchanges (LACPDUs). The value cannot be NULL or multicast. It is preferred to have the local-admin bit set for this mac but driver does not enforce it. If the value is not given then system defaults to using the controller’s mac address as actors’ system address.

§ad_select: Option<BondAdSelect>

Specifies the 802.3ad aggregation selection logic to use. The possible values and their effects are:

§ad_user_port_key: Option<u16>

In an AD system, the port-key has three parts as shown below -

Bits   Use
00     Duplex
01-05  Speed
06-15  User-defined

This defines the upper 10 bits of the port key. The values can be from 0

    1. If not given, the system defaults to 0.

This parameter has effect only in 802.3ad mode.

§all_slaves_active: Option<BondAllPortsActive>

Specifies that duplicate frames (received on inactive ports) should be dropped (0) or delivered (1).

Normally, bonding will drop duplicate frames (received on inactive ports), which is desirable for most users. But there are some times it is nice to allow duplicate frames to be delivered.

§arp_all_targets: Option<BondArpAllTargets>

Specifies the quantity of arp_ip_targets that must be reachable in order for the ARP monitor to consider a port as being up. This option affects only active-backup mode for ports with arp_validation enabled.

§arp_interval: Option<u32>

Specifies the ARP link monitoring frequency in milliseconds.

The ARP monitor works by periodically checking the port devices to determine whether they have sent or received traffic recently (the precise criteria depends upon the bonding mode, and the state of the port). Regular traffic is generated via ARP probes issued for the addresses specified by the arp_ip_target option.

This behavior can be modified by the arp_validate option, below.

If ARP monitoring is used in an etherchannel compatible mode (modes 0 and 2), the switch should be configured in a mode that evenly distributes packets across all links. If the switch is configured to distribute the packets in an XOR fashion, all replies from the ARP targets will be received on the same link which could cause the other team members to fail. ARP monitoring should not be used in conjunction with miimon. A value of 0 disables ARP monitoring. The default value is 0.

§arp_ip_target: Option<String>

Specifies the IP addresses to use as ARP monitoring peers when arp_interval is > 0. These are the targets of the ARP request sent to determine the health of the link to the targets. Specify these values in ddd.ddd.ddd.ddd format. Multiple IP addresses must be separated by a comma. At least one IP address must be given for ARP monitoring to function. The maximum number of targets that can be specified is 16. The default value is no IP addresses.

§arp_validate: Option<BondArpValidate>

Specifies whether or not ARP probes and replies should be validated in any mode that supports arp monitoring, or whether non-ARP traffic should be filtered (disregarded) for link monitoring purposes.

§downdelay: Option<u32>

Specifies the time, in milliseconds, to wait before disabling a port after a link failure has been detected. This option is only valid for the miimon link monitor. The downdelay value should be a multiple of the miimon value; if not, it will be rounded down to the nearest multiple. The default value is 0.

§fail_over_mac: Option<BondFailOverMac>

Specifies whether active-backup mode should set all ports to the same MAC address at enportment (the traditional behavior), or, when enabled, perform special handling of the bond’s MAC address in accordance with the selected policy.

§lacp_rate: Option<BondLacpRate>

Option specifying the rate in which we’ll ask our link partner to transmit LACPDU packets in 802.3ad mode.

§lp_interval: Option<u32>

Specifies the number of seconds between instances where the bonding driver sends learning packets to each slaves peer switch.

The valid range is 1 - 0x7fffffff; the default value is 1. This Option has effect only in balance-tlb and balance-alb modes.

§miimon: Option<u32>

Specifies the MII link monitoring frequency in milliseconds. This determines how often the link state of each port is inspected for link failures. A value of zero disables MII link monitoring. A value of 100 is a good starting point. The use_carrier option, below, affects how the link state is determined. See the High Availability section for additional information. The default value is 0.

§min_links: Option<u32>

Specifies the minimum number of links that must be active before asserting carrier. It is similar to the Cisco EtherChannel min-links feature. This allows setting the minimum number of member ports that must be up (link-up state) before marking the bond device as up (carrier on). This is useful for situations where higher level services such as clustering want to ensure a minimum number of low bandwidth links are active before switchover. This option only affect 802.3ad mode.

The default value is 0. This will cause carrier to be asserted (for 802.3ad mode) whenever there is an active aggregator, regardless of the number of available links in that aggregator. Note that, because an aggregator cannot be active without at least one available link, setting this option to 0 or to 1 has the exact same effect.

§num_grat_arp: Option<u8>

Specify the number of peer notifications (gratuitous ARPs and unsolicited IPv6 Neighbor Advertisements) to be issued after a failover event. As soon as the link is up on the new port (possibly immediately) a peer notification is sent on the bonding device and each VLAN sub-device. This is repeated at the rate specified by peer_notif_delay if the number is greater than 1.

The valid range is 0 - 255; the default value is 1. These options affect only the active-backup mode. These options were added for bonding versions 3.3.0 and 3.4.0 respectively.

From Linux 3.0 and bonding version 3.7.1, these notifications are generated by the ipv4 and ipv6 code and the numbers of repetitions cannot be set independently.

§num_unsol_na: Option<u8>

Identical to [BondOptions.num_grat_arp]

§packets_per_slave: Option<u32>

Specify the number of packets to transmit through a port before moving to the next one. When set to 0 then a port is chosen at random.

The valid range is 0 - 65535; the default value is 1. This option has effect only in balance-rr mode.

§primary: Option<String>

A string (eth0, eth2, etc) specifying which slave is the primary device. The specified device will always be the active slave while it is available. Only when the primary is off-line will alternate devices be used. This is useful when one slave is preferred over another, e.g., when one slave has higher throughput than another.

The primary option is only valid for active-backup(1), balance-tlb (5) and balance-alb (6) mode.

§primary_reselect: Option<BondPrimaryReselect>

Specifies the reselection policy for the primary port. This affects how the primary port is chosen to become the active port when failure of the active port or recovery of the primary port occurs. This option is designed to prevent flip-flopping between the primary port and other ports.

§resend_igmp: Option<u32>

Specifies the number of IGMP membership reports to be issued after a failover event. One membership report is issued immediately after the failover, subsequent packets are sent in each 200ms interval.

The valid range is 0 - 255; the default value is 1. A value of 0 prevents the IGMP membership report from being issued in response to the failover event.

This option is useful for bonding modes balance-rr (0), active-backup (1), balance-tlb (5) and balance-alb (6), in which a failover can switch the IGMP traffic from one port to another. Therefore a fresh IGMP report must be issued to cause the switch to forward the incoming IGMP traffic over the newly selected port.

§tlb_dynamic_lb: Option<bool>

Specifies if dynamic shuffling of flows is enabled in tlb mode. The value has no effect on any other modes.

The default behavior of tlb mode is to shuffle active flows across ports based on the load in that interval. This gives nice lb characteristics but can cause packet reordering. If re-ordering is a concern use this variable to disable flow shuffling and rely on load balancing provided solely by the hash distribution. xmit-hash-policy can be used to select the appropriate hashing for the setup.

The sysfs entry can be used to change the setting per bond device and the initial value is derived from the module parameter. The sysfs entry is allowed to be changed only if the bond device is down.

The default value is “1” that enables flow shuffling while value “0” disables it. This option was added in bonding driver 3.7.1

§updelay: Option<u32>

Specifies the time, in milliseconds, to wait before enabling a port after a link recovery has been detected. This option is only valid for the miimon link monitor. The updelay value should be a multiple of the miimon value; if not, it will be rounded down to the nearest multiple. The default value is 0.

§use_carrier: Option<bool>

Specifies whether or not miimon should use MII or ETHTOOL ioctls vs. netif_carrier_ok() to determine the link status. The MII or ETHTOOL ioctls are less efficient and utilize a deprecated calling sequence within the kernel. The netif_carrier_ok() relies on the device driver to maintain its state with netif_carrier_on/off; at this writing, most, but not all, device drivers support this facility.

If bonding insists that the link is up when it should not be, it may be that your network device driver does not support netif_carrier_on/off. The default state for netif_carrier is “carrier on,” so if a driver does not support netif_carrier, it will appear as if the link is always up. In this case, setting use_carrier to 0 will cause bonding to revert to the MII / ETHTOOL ioctl method to determine the link state.

A value of 1 enables the use of netif_carrier_ok(), a value of 0 will use the deprecated MII / ETHTOOL ioctls. The default value is 1.

§xmit_hash_policy: Option<BondXmitHashPolicy>

Selects the transmit hash policy to use for slave selection in balance-xor, 802.3ad, and tlb modes.

§balance_slb: Option<bool>§arp_missed_max: Option<u8>

Implementations§

source§

impl BondOptions

source

pub fn new() -> Self

Trait Implementations§

source§

impl Clone for BondOptions

source§

fn clone(&self) -> BondOptions

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for BondOptions

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for BondOptions

source§

fn default() -> BondOptions

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

impl<'de> Deserialize<'de> for BondOptions

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq for BondOptions

source§

fn eq(&self, other: &BondOptions) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for BondOptions

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for BondOptions

source§

impl StructuralPartialEq for BondOptions

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> NoneValue for T
where T: Default,

§

type NoneType = T

source§

fn null_value() -> T

The none-equivalent value.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,