Skip to content

Commit

Permalink
nixos/networkd: add FairQueueing options
Browse files Browse the repository at this point in the history
  • Loading branch information
apfelkuchen6 committed Mar 16, 2023
1 parent dbc14e5 commit cf470eb
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions nixos/modules/system/boot/networkd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1333,6 +1333,26 @@ let
(assertInt "Flows")
(assertValueOneOf "ECN" boolValues)
];

sectionFairQueueing = checkUnitConfig "FairQueueing" [
(assertOnlyFields [
"Parent"
"Handle"
"PacketLimit"
"FlowLimit"
"QuantumBytes"
"InitualQuantumBytes"
"MaximumRate"
"Buckets"
"OrphanMask"
"Pacing"
"CEThresholdSec"
])
(assertInt "PacketLimit")
(assertInt "FlowLimit")
(assertInt "OrphanMask")
(assertValueOneOf "Pacing" boolValues)
];
};
};

Expand Down Expand Up @@ -2199,6 +2219,17 @@ let
'';
};

fairQueueingConfig = mkOption {
default = {};
example = { Parent = "root"; FlowLimit = 5; };
type = types.addCheck (types.attrsOf unitOption) check.network.sectionFairQueueing;
description = lib.mdDoc ''
Each attribute in this set specifies an option in the
`[FairQueueing]` section of the unit. See
{manpage}`systemd.network(5)` for details.
'';
};

name = mkOption {
type = types.nullOr types.str;
default = null;
Expand Down Expand Up @@ -2702,6 +2733,10 @@ let
[FairQueueingControlledDelay]
${attrsToSection def.fairQueueingControlledDelayConfig}
''
+ optionalString (def.fairQueueingConfig != { }) ''
[FairQueueing]
${attrsToSection def.fairQueueingConfig}
''
+ def.extraConfig;
};

Expand Down

0 comments on commit cf470eb

Please sign in to comment.