mii-monitor-interval unit is undocumented, and may be wrong
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Netplan |
Fix Released
|
High
|
Mathieu Trudel-Lapierre | ||
nplan (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned | ||
Artful |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
Users of bond and bridges devices requiring tuning of the default device parameters.
[Test case]
== Configure MII monitor interval ==
1) Configure a bond device
2) Add parameters:
bonds:
mybond0:
parameters:
mii-
3) Verify that the applied MII monitor interval is of 1ms, as opposed to 1 second (1000ms), by verifying the contents of /sys/class/
== Validate default behavior ==
1) Configure a bond device without parameters.
2) Verify that no special MII monitor interval is applied, the default value should be 0:
$ cat /sys/class/
0
[Regression potential]
MII monitor behavior is changing with this SRU. Default behavior for an unqualified value (ie. a number alone), which was also the only way to specify parameters, was to interpret the values as *seconds*. This leads to relatively slow checking of the device link status (for MII monitor), much slower than generally expected. The same applies to other time-based values such as up delay, down delay, arp interval. The interpretation for these values changes to reading them as *milliseconds* when unqualified, and a new way of qualifying the values (adding a modifier) was added. This was, people who do require "slow" checking of the MII link status will be migrated to "fast" checking right now, moving from an interval of 1 second to 1 millisecond (more checking means less false-negatives for packet passing through an interface, should reduce packet loss, at the cost of potentially flapping the interfaces (bringing down a path often if MII status is bad or slow to be returned)). Users who require the old behavior may add "s" at the end of the value to make it read as "1 second" again, or modify the value to be "1000", which will be 1000ms (1 second). We estimate the impact of this change to users to be minimal, actually requiring a 1 second interval for MII monitoring / up/down delay, and ARP interval is very uncommon and counter-intuitive as all other systems work on a millisecond basis.
---
The manpage for netplan doesn't indicate what the unit for mii-monitor-
From my testing, it appears to be impossible to set a value for mii-monitor-
Related branches
- Mathieu Trudel-Lapierre (community): Needs Information
-
Diff: 233 lines (+46/-49)3 files modifieddoc/netplan.md (+28/-31)
src/networkd.c (+9/-9)
tests/generate.py (+9/-9)
tags: | added: id-5acf94da4fdc30917ec9c571 |
Changed in netplan: | |
status: | Triaged → In Progress |
Changed in nplan (Ubuntu): | |
status: | New → Fix Released |
Changed in netplan: | |
status: | In Progress → Fix Released |
description: | updated |
The systemd documentation is somewhat confusing here as well.
MIIMonitorSec=
Specifies the frequency that Media Independent Interface link monitoring will occur. A value of zero disables MII link monitoring. This value is rounded down to the nearest millisecond. The default value is 0.
Netplan currently just passes this value to networkd via the configuration file.
At it turns out, systemd-networkd will allow the values to have suffixes, like 'ms':
So to achieve the 100ms interval you need to put in '100ms' in the value.
root@ubuntu:~# cat /etc/systemd/ network/ test-bond2- miimon. netdev
[NetDev]
Name=bond2
Kind=bond
[Bond] net/bond2/ bonding/ miimon
Mode=active-backup
MIIMonitorSec=100ms
root@ubuntu:~# cat /sys/class/
100
This means netplan will need an update to address this. If we attempt to read a netplan yaml using the suffix, then it fails to parse.
# netplan generate 50-cloud- init.yaml line 19 column 34: invalid unsigned int value 100ms
Error in network definition //etc/netplan/
An easy path is to update the documentation to accept the value in milliseconds (like NetworkManager) and then when rendering networkd.netdev files, to append the 'ms' suffix.