New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
networking.bonds: add support for arbitrary driverOptions #22388
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -550,11 +550,28 @@ in | |
description = "The interfaces to bond together"; | ||
}; | ||
|
||
driverOptions = mkOption { | ||
type = types.attrsOf types.str; | ||
default = {}; | ||
example = literalExample { | ||
interfaces = [ "eth0" "wlan0" ]; | ||
miimon = 100; | ||
mode = "active-backup"; | ||
}; | ||
description = '' | ||
Options for the bonding driver. | ||
Documentation can be found in | ||
<link xlink:href="https://www.kernel.org/doc/Documentation/networking/bonding.txt" /> | ||
''; | ||
|
||
}; | ||
|
||
lacp_rate = mkOption { | ||
default = null; | ||
example = "fast"; | ||
type = types.nullOr types.str; | ||
description = '' | ||
DEPRECATED, use `driverOptions`. | ||
Option specifying the rate in which we'll ask our link partner | ||
to transmit LACPDU packets in 802.3ad mode. | ||
''; | ||
|
@@ -565,6 +582,7 @@ in | |
example = 100; | ||
type = types.nullOr types.int; | ||
description = '' | ||
DEPRECATED, use `driverOptions`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of writing "DEPRECATED" in the description, I'd either pass down miimon/lacp_rate/mode/... to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, it’s not really renamed, it’s been deprecated and is still being merged right now (with a warning), but will be removed in 17.09 or something. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not true, at least not using the scripted networking. This breaks bonding for me. Where do you merge the deprecated settings? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So we have a LACP bond that is configured with the deprecated options but after this change came up with balance-rr instead. Which broke its networking. 😞 This should either trigger an error or merging should work. As this breaks peoples' setups I'm inclined to revert this for now. 👍 on the change, though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, after trying to reproduce this: This problem only applies to networkd. Investigating. |
||
Miimon is the number of millisecond in between each round of polling | ||
by the device driver for failed links. By default polling is not | ||
enabled and the driver is trusted to properly detect and handle | ||
|
@@ -577,6 +595,7 @@ in | |
example = "active-backup"; | ||
type = types.nullOr types.str; | ||
description = '' | ||
DEPRECATED, use `driverOptions`. | ||
The mode which the bond will be running. The default mode for | ||
the bonding driver is balance-rr, optimizing for throughput. | ||
More information about valid modes can be found at | ||
|
@@ -589,6 +608,7 @@ in | |
example = "layer2+3"; | ||
type = types.nullOr types.str; | ||
description = '' | ||
DEPRECATED, use `driverOptions`. | ||
Selects the transmit hash policy to use for slave selection in | ||
balance-xor, 802.3ad, and tlb modes. | ||
''; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird indentation... I'd join this into something like:
ip link add name "${n}" type bond ${let ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation is done by the function that creates the lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant the indentation on the Nix side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it’s like that because otherwise the first line will be indented by two spaces more (since it starts with two spaces already).