Skip to content

Commit c03ef42

Browse files
yuwatakeszybz
authored andcommitted
network: tc: rename several settings which take size in bytes
1 parent 25b6703 commit c03ef42

File tree

15 files changed

+142
-71
lines changed

15 files changed

+142
-71
lines changed

man/systemd.network.xml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2724,20 +2724,20 @@
27242724
</varlistentry>
27252725

27262726
<varlistentry>
2727-
<term><varname>LimitSize=</varname></term>
2727+
<term><varname>LimitBytes=</varname></term>
27282728
<listitem>
27292729
<para>Takes the number of bytes that can be queued waiting for tokens to become available.
27302730
When the size is suffixed with K, M, or G, it is parsed as Kilobytes, Megabytes, or Gigabytes,
2731-
respectively, to the base of 1000. Defaults to unset.</para>
2731+
respectively, to the base of 1024. Defaults to unset.</para>
27322732
</listitem>
27332733
</varlistentry>
27342734

27352735
<varlistentry>
2736-
<term><varname>Burst=</varname></term>
2736+
<term><varname>BurstBytes=</varname></term>
27372737
<listitem>
27382738
<para>Specifies the size of the bucket. This is the maximum amount of bytes that tokens
27392739
can be available for instantaneous transfer. When the size is suffixed with K, M, or G, it is
2740-
parsed as Kilobytes, Megabytes, or Gigabytes, respectively, to the base of 1000. Defaults to
2740+
parsed as Kilobytes, Megabytes, or Gigabytes, respectively, to the base of 1024. Defaults to
27412741
unset.</para>
27422742
</listitem>
27432743
</varlistentry>
@@ -2756,7 +2756,7 @@
27562756
<listitem>
27572757
<para>The Minimum Packet Unit (MPU) determines the minimal token usage (specified in bytes)
27582758
for a packet. When suffixed with K, M, or G, the specified size is parsed as Kilobytes,
2759-
Megabytes, or Gigabytes, respectively, to the base of 1000. Defaults to zero.</para>
2759+
Megabytes, or Gigabytes, respectively, to the base of 1024. Defaults to zero.</para>
27602760
</listitem>
27612761
</varlistentry>
27622762

@@ -2773,7 +2773,7 @@
27732773
<term><varname>MTUBytes=</varname></term>
27742774
<listitem>
27752775
<para>Specifies the size of the peakrate bucket. When suffixed with K, M, or G, the specified
2776-
size is parsed as Kilobytes, Megabytes, or Gigabytes, respectively, to the base of 1000.
2776+
size is parsed as Kilobytes, Megabytes, or Gigabytes, respectively, to the base of 1024.
27772777
Defaults to unset.</para>
27782778
</listitem>
27792779
</varlistentry>
@@ -2846,7 +2846,7 @@
28462846
<xi:include href="tc.xml" xpointer="qdisc-handle" />
28472847

28482848
<varlistentry>
2849-
<term><varname>LimitSize=</varname></term>
2849+
<term><varname>LimitBytes=</varname></term>
28502850
<listitem>
28512851
<para>Specifies the hard limit on the FIFO size in bytes. The size limit (a buffer size) to prevent it
28522852
from overflowing in case it is unable to dequeue packets as quickly as it receives them. When this limit
@@ -2915,7 +2915,7 @@
29152915
<xi:include href="tc.xml" xpointer="qdisc-handle" />
29162916

29172917
<varlistentry>
2918-
<term><varname>Overhead=</varname></term>
2918+
<term><varname>OverheadBytes=</varname></term>
29192919
<listitem>
29202920
<para>Specifies that bytes to be addeded to the size of each packet. Bytes may be negative.
29212921
Takes an integer ranges -64 to 256. Defaults to unset and kernel's default is used.</para>
@@ -3005,11 +3005,12 @@
30053005
<xi:include href="tc.xml" xpointer="tclass-classid" />
30063006

30073007
<varlistentry>
3008-
<term><varname>Quantum=</varname></term>
3008+
<term><varname>QuantumBytes=</varname></term>
30093009
<listitem>
3010-
<para>Specifies the amount of bytes a flow is allowed to dequeue before the
3011-
scheduler moves to the next class. An unsigned integer ranges 1 to 4294967294.
3012-
Defaults to the MTU of the interface.</para>
3010+
<para>Specifies the amount of bytes a flow is allowed to dequeue before the scheduler moves
3011+
to the next class. When suffixed with K, M, or G, the specified size is parsed as Kilobytes,
3012+
Megabytes, or Gigabytes, respectively, to the base of 1024. Defaults to the MTU of the
3013+
interface.</para>
30133014
</listitem>
30143015
</varlistentry>
30153016

@@ -3120,7 +3121,7 @@
31203121
</varlistentry>
31213122

31223123
<varlistentry>
3123-
<term><varname>MemoryLimit=</varname></term>
3124+
<term><varname>MemoryLimitBytes=</varname></term>
31243125
<listitem>
31253126
<para>Specifies the limit on the total number of bytes that can be queued in this FQ-CoDel instance.
31263127
When suffixed with K, M, or G, the specified size is parsed as Kilobytes, Megabytes, or Gigabytes,
@@ -3153,7 +3154,7 @@
31533154
</varlistentry>
31543155

31553156
<varlistentry>
3156-
<term><varname>Quantum=</varname></term>
3157+
<term><varname>QuantumBytes=</varname></term>
31573158
<listitem>
31583159
<para>Specifies the number of bytes used as 'deficit' in the fair queuing algorithmtimespan.
31593160
When suffixed with K, M, or G, the specified size is parsed as Kilobytes, Megabytes, or Gigabytes,
@@ -3205,7 +3206,7 @@
32053206
</varlistentry>
32063207

32073208
<varlistentry>
3208-
<term><varname>Quantum=</varname></term>
3209+
<term><varname>QuantumBytes=</varname></term>
32093210
<listitem>
32103211
<para>Specifies the credit per dequeue RR round, i.e. the amount of bytes a flow is allowed
32113212
to dequeue at once. When suffixed with K, M, or G, the specified size is parsed as Kilobytes,
@@ -3215,7 +3216,7 @@
32153216
</varlistentry>
32163217

32173218
<varlistentry>
3218-
<term><varname>InitialQuantum=</varname></term>
3219+
<term><varname>InitialQuantumBytes=</varname></term>
32193220
<listitem>
32203221
<para>Specifies the initial sending rate credit, i.e. the amount of bytes a new flow is
32213222
allowed to dequeue initially. When suffixed with K, M, or G, the specified size is parsed as
@@ -3446,10 +3447,10 @@
34463447
</varlistentry>
34473448

34483449
<varlistentry>
3449-
<term><varname>MaxPacketSize=</varname></term>
3450+
<term><varname>MaxPacketBytes=</varname></term>
34503451
<listitem>
34513452
<para>Specifies the maximum packet size in bytes for the class. When suffixed with K, M, or G, the specified
3452-
size is parsed as Kilobytes, Megabytes, or Gigabytes, respectively, to the base of 1000. When unset,
3453+
size is parsed as Kilobytes, Megabytes, or Gigabytes, respectively, to the base of 1024. When unset,
34533454
the kernel default is used.</para>
34543455
</listitem>
34553456
</varlistentry>

src/network/networkd-network-gperf.gperf

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,11 @@ QDisc.Parent, config_parse_qdisc_parent,
304304
QDisc.Handle, config_parse_qdisc_handle, _QDISC_KIND_INVALID, 0
305305
BFIFO.Parent, config_parse_qdisc_parent, QDISC_KIND_BFIFO, 0
306306
BFIFO.Handle, config_parse_qdisc_handle, QDISC_KIND_BFIFO, 0
307-
BFIFO.LimitSize, config_parse_bfifo_size, QDISC_KIND_BFIFO, 0
307+
BFIFO.LimitBytes, config_parse_bfifo_size, QDISC_KIND_BFIFO, 0
308308
CAKE.Parent, config_parse_qdisc_parent, QDISC_KIND_CAKE, 0
309309
CAKE.Handle, config_parse_qdisc_handle, QDISC_KIND_CAKE, 0
310310
CAKE.Bandwidth, config_parse_cake_bandwidth, QDISC_KIND_CAKE, 0
311-
CAKE.Overhead, config_parse_cake_overhead, QDISC_KIND_CAKE, 0
311+
CAKE.OverheadBytes, config_parse_cake_overhead, QDISC_KIND_CAKE, 0
312312
ControlledDelay.Parent, config_parse_qdisc_parent, QDISC_KIND_CODEL, 0
313313
ControlledDelay.Handle, config_parse_qdisc_handle, QDISC_KIND_CODEL, 0
314314
ControlledDelay.PacketLimit, config_parse_controlled_delay_u32, QDISC_KIND_CODEL, 0
@@ -320,7 +320,7 @@ DeficitRoundRobinScheduler.Parent, config_parse_qdisc_parent,
320320
DeficitRoundRobinScheduler.Handle, config_parse_qdisc_handle, QDISC_KIND_DRR, 0
321321
DeficitRoundRobinSchedulerClass.Parent, config_parse_tclass_parent, TCLASS_KIND_DRR, 0
322322
DeficitRoundRobinSchedulerClass.ClassId, config_parse_tclass_classid, TCLASS_KIND_DRR, 0
323-
DeficitRoundRobinSchedulerClass.Quantum, config_parse_drr_size, TCLASS_KIND_DRR, 0
323+
DeficitRoundRobinSchedulerClass.QuantumBytes, config_parse_drr_size, TCLASS_KIND_DRR, 0
324324
EnhancedTransmissionSelection.Parent, config_parse_qdisc_parent, QDISC_KIND_ETS, 0
325325
EnhancedTransmissionSelection.Handle, config_parse_qdisc_handle, QDISC_KIND_ETS, 0
326326
EnhancedTransmissionSelection.Bands, config_parse_ets_u8, QDISC_KIND_ETS, 0
@@ -340,13 +340,13 @@ QuickFairQueueing.Handle, config_parse_qdisc_handle,
340340
QuickFairQueueingClass.Parent, config_parse_tclass_parent, TCLASS_KIND_QFQ, 0
341341
QuickFairQueueingClass.ClassId, config_parse_tclass_classid, TCLASS_KIND_QFQ, 0
342342
QuickFairQueueingClass.Weight, config_parse_quick_fair_queueing_weight, TCLASS_KIND_QFQ, 0
343-
QuickFairQueueingClass.MaxPacketSize, config_parse_quick_fair_queueing_max_packet, TCLASS_KIND_QFQ, 0
343+
QuickFairQueueingClass.MaxPacketBytes, config_parse_quick_fair_queueing_max_packet, TCLASS_KIND_QFQ, 0
344344
FairQueueing.Parent, config_parse_qdisc_parent, QDISC_KIND_FQ, 0
345345
FairQueueing.Handle, config_parse_qdisc_handle, QDISC_KIND_FQ, 0
346346
FairQueueing.PacketLimit, config_parse_fair_queueing_u32, QDISC_KIND_FQ, 0
347347
FairQueueing.FlowLimit, config_parse_fair_queueing_u32, QDISC_KIND_FQ, 0
348-
FairQueueing.Quantum, config_parse_fair_queueing_size, QDISC_KIND_FQ, 0
349-
FairQueueing.InitialQuantum, config_parse_fair_queueing_size, QDISC_KIND_FQ, 0
348+
FairQueueing.QuantumBytes, config_parse_fair_queueing_size, QDISC_KIND_FQ, 0
349+
FairQueueing.InitialQuantumBytes, config_parse_fair_queueing_size, QDISC_KIND_FQ, 0
350350
FairQueueing.MaximumRate, config_parse_fair_queueing_max_rate, QDISC_KIND_FQ, 0
351351
FairQueueing.Buckets, config_parse_fair_queueing_u32, QDISC_KIND_FQ, 0
352352
FairQueueing.OrphanMask, config_parse_fair_queueing_u32, QDISC_KIND_FQ, 0
@@ -355,9 +355,9 @@ FairQueueing.CEThresholdSec, config_parse_fair_queueing_usec,
355355
FairQueueingControlledDelay.Parent, config_parse_qdisc_parent, QDISC_KIND_FQ_CODEL, 0
356356
FairQueueingControlledDelay.Handle, config_parse_qdisc_handle, QDISC_KIND_FQ_CODEL, 0
357357
FairQueueingControlledDelay.PacketLimit, config_parse_fair_queueing_controlled_delay_u32, QDISC_KIND_FQ_CODEL, 0
358-
FairQueueingControlledDelay.MemoryLimit, config_parse_fair_queueing_controlled_delay_size, QDISC_KIND_FQ_CODEL, 0
358+
FairQueueingControlledDelay.MemoryLimitBytes, config_parse_fair_queueing_controlled_delay_size, QDISC_KIND_FQ_CODEL, 0
359359
FairQueueingControlledDelay.Flows, config_parse_fair_queueing_controlled_delay_u32, QDISC_KIND_FQ_CODEL, 0
360-
FairQueueingControlledDelay.Quantum, config_parse_fair_queueing_controlled_delay_size, QDISC_KIND_FQ_CODEL, 0
360+
FairQueueingControlledDelay.QuantumBytes, config_parse_fair_queueing_controlled_delay_size, QDISC_KIND_FQ_CODEL, 0
361361
FairQueueingControlledDelay.TargetSec, config_parse_fair_queueing_controlled_delay_usec, QDISC_KIND_FQ_CODEL, 0
362362
FairQueueingControlledDelay.IntervalSec, config_parse_fair_queueing_controlled_delay_usec, QDISC_KIND_FQ_CODEL, 0
363363
FairQueueingControlledDelay.CEThresholdSec, config_parse_fair_queueing_controlled_delay_usec, QDISC_KIND_FQ_CODEL, 0
@@ -402,12 +402,12 @@ StochasticFairnessQueueing.Handle, config_parse_qdisc_handle,
402402
StochasticFairnessQueueing.PerturbPeriodSec, config_parse_stochastic_fairness_queueing_perturb_period, QDISC_KIND_SFQ, 0
403403
TokenBucketFilter.Parent, config_parse_qdisc_parent, QDISC_KIND_TBF, 0
404404
TokenBucketFilter.Handle, config_parse_qdisc_handle, QDISC_KIND_TBF, 0
405-
TokenBucketFilter.Rate, config_parse_token_bucket_filter_size, QDISC_KIND_TBF, 0
406-
TokenBucketFilter.Burst, config_parse_token_bucket_filter_size, QDISC_KIND_TBF, 0
407-
TokenBucketFilter.LimitSize, config_parse_token_bucket_filter_size, QDISC_KIND_TBF, 0
405+
TokenBucketFilter.Rate, config_parse_token_bucket_filter_rate, QDISC_KIND_TBF, 0
406+
TokenBucketFilter.BurstBytes, config_parse_token_bucket_filter_size, QDISC_KIND_TBF, 0
407+
TokenBucketFilter.LimitBytes, config_parse_token_bucket_filter_size, QDISC_KIND_TBF, 0
408408
TokenBucketFilter.MTUBytes, config_parse_token_bucket_filter_size, QDISC_KIND_TBF, 0
409409
TokenBucketFilter.MPUBytes, config_parse_token_bucket_filter_size, QDISC_KIND_TBF, 0
410-
TokenBucketFilter.PeakRate, config_parse_token_bucket_filter_size, QDISC_KIND_TBF, 0
410+
TokenBucketFilter.PeakRate, config_parse_token_bucket_filter_rate, QDISC_KIND_TBF, 0
411411
TokenBucketFilter.LatencySec, config_parse_token_bucket_filter_latency, QDISC_KIND_TBF, 0
412412
TrivialLinkEqualizer.Parent, config_parse_qdisc_parent, QDISC_KIND_TEQL, 0
413413
TrivialLinkEqualizer.Handle, config_parse_qdisc_handle, QDISC_KIND_TEQL, 0
@@ -446,3 +446,9 @@ TrafficControlQueueingDiscipline.NetworkEmulatorDelayJitterSec, config_parse_net
446446
TrafficControlQueueingDiscipline.NetworkEmulatorLossRate, config_parse_network_emulator_rate, 0, 0
447447
TrafficControlQueueingDiscipline.NetworkEmulatorDuplicateRate, config_parse_network_emulator_rate, 0, 0
448448
TrafficControlQueueingDiscipline.NetworkEmulatorPacketLimit, config_parse_network_emulator_packet_limit, 0, 0
449+
FairQueueing.Quantum, config_parse_fair_queueing_size, QDISC_KIND_FQ, 0
450+
FairQueueing.InitialQuantum, config_parse_fair_queueing_size, QDISC_KIND_FQ, 0
451+
FairQueueingControlledDelay.MemoryLimit, config_parse_fair_queueing_controlled_delay_size, QDISC_KIND_FQ_CODEL, 0
452+
FairQueueingControlledDelay.Quantum, config_parse_fair_queueing_controlled_delay_size, QDISC_KIND_FQ_CODEL, 0
453+
TokenBucketFilter.Burst, config_parse_token_bucket_filter_size, QDISC_KIND_TBF, 0
454+
TokenBucketFilter.LimitSize, config_parse_token_bucket_filter_size, QDISC_KIND_TBF, 0

src/network/tc/cake.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,14 @@ int config_parse_cake_overhead(
136136
r = safe_atoi32(rvalue, &v);
137137
if (r < 0) {
138138
log_syntax(unit, LOG_ERR, filename, line, r,
139-
"Failed to parse 'Overhead=', ignoring assignment: %s",
140-
rvalue);
139+
"Failed to parse '%s=', ignoring assignment: %s",
140+
lvalue, rvalue);
141141
return 0;
142142
}
143143
if (v < -64 || v > 256) {
144144
log_syntax(unit, LOG_ERR, filename, line, 0,
145-
"Invalid 'Overhead=', ignoring assignment: %s",
146-
rvalue);
145+
"Invalid '%s=', ignoring assignment: %s",
146+
lvalue, rvalue);
147147
return 0;
148148
}
149149

src/network/tc/drr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ int config_parse_drr_size(
7979
return 0;
8080
}
8181

82-
r = parse_size(rvalue, 1000, &u);
82+
r = parse_size(rvalue, 1024, &u);
8383
if (r < 0) {
8484
log_syntax(unit, LOG_ERR, filename, line, r,
8585
"Failed to parse '%s=', ignoring assignment: %s",

src/network/tc/fifo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ int config_parse_bfifo_size(
140140
return 0;
141141
}
142142

143-
r = parse_size(rvalue, 1000, &u);
143+
r = parse_size(rvalue, 1024, &u);
144144
if (r < 0) {
145145
log_syntax(unit, LOG_ERR, filename, line, r,
146146
"Failed to parse '%s=', ignoring assignment: %s",

src/network/tc/fq-codel.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "parse-util.h"
1010
#include "qdisc.h"
1111
#include "string-util.h"
12+
#include "strv.h"
1213

1314
static int fair_queueing_controlled_delay_init(QDisc *qdisc) {
1415
FairQueueingControlledDelay *fqcd;
@@ -301,15 +302,15 @@ int config_parse_fair_queueing_controlled_delay_size(
301302

302303
fqcd = FQ_CODEL(qdisc);
303304

304-
if (streq(lvalue, "MemoryLimit"))
305+
if (STR_IN_SET(lvalue, "MemoryLimitBytes", "MemoryLimit"))
305306
p = &fqcd->memory_limit;
306-
else if (streq(lvalue, "Quantum"))
307+
else if (STR_IN_SET(lvalue, "QuantumBytes", "Quantum"))
307308
p = &fqcd->quantum;
308309
else
309310
assert_not_reached("Invalid lvalue.");
310311

311312
if (isempty(rvalue)) {
312-
if (streq(lvalue, "MemoryLimit"))
313+
if (STR_IN_SET(lvalue, "MemoryLimitBytes", "MemoryLimit"))
313314
*p = UINT32_MAX;
314315
else
315316
*p = 0;

src/network/tc/fq.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "netlink-util.h"
1010
#include "parse-util.h"
1111
#include "string-util.h"
12-
#include "util.h"
12+
#include "strv.h"
1313

1414
static int fair_queueing_init(QDisc *qdisc) {
1515
FairQueueing *fq;
@@ -198,9 +198,9 @@ int config_parse_fair_queueing_size(
198198

199199
fq = FQ(qdisc);
200200

201-
if (streq(lvalue, "Quantum"))
201+
if (STR_IN_SET(lvalue, "QuantumBytes", "Quantum"))
202202
p = &fq->quantum;
203-
else if (streq(lvalue, "InitialQuantum"))
203+
else if (STR_IN_SET(lvalue, "InitialQuantumBytes", "InitialQuantum"))
204204
p = &fq->initial_quantum;
205205
else
206206
assert_not_reached("Invalid lvalue");

src/network/tc/qfq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ int config_parse_quick_fair_queueing_max_packet(
142142
return 0;
143143
}
144144

145-
r = parse_size(rvalue, 1000, &v);
145+
r = parse_size(rvalue, 1024, &v);
146146
if (r < 0) {
147147
log_syntax(unit, LOG_ERR, filename, line, r,
148148
"Failed to parse '%s=', ignoring assignment: %s",

0 commit comments

Comments
 (0)