mirror of
https://github.com/systemd/systemd.git
synced 2025-02-02 13:47:27 +03:00
network: tc: rename several settings which take size in bytes
This commit is contained in:
parent
25b67032a8
commit
c03ef420fa
@ -2724,20 +2724,20 @@
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>LimitSize=</varname></term>
|
||||
<term><varname>LimitBytes=</varname></term>
|
||||
<listitem>
|
||||
<para>Takes the number of bytes that can be queued waiting for tokens to become available.
|
||||
When the size is suffixed with K, M, or G, it is parsed as Kilobytes, Megabytes, or Gigabytes,
|
||||
respectively, to the base of 1000. Defaults to unset.</para>
|
||||
respectively, to the base of 1024. Defaults to unset.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>Burst=</varname></term>
|
||||
<term><varname>BurstBytes=</varname></term>
|
||||
<listitem>
|
||||
<para>Specifies the size of the bucket. This is the maximum amount of bytes that tokens
|
||||
can be available for instantaneous transfer. When the size is suffixed with K, M, or G, it is
|
||||
parsed as Kilobytes, Megabytes, or Gigabytes, respectively, to the base of 1000. Defaults to
|
||||
parsed as Kilobytes, Megabytes, or Gigabytes, respectively, to the base of 1024. Defaults to
|
||||
unset.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@ -2756,7 +2756,7 @@
|
||||
<listitem>
|
||||
<para>The Minimum Packet Unit (MPU) determines the minimal token usage (specified in bytes)
|
||||
for a packet. When suffixed with K, M, or G, the specified size is parsed as Kilobytes,
|
||||
Megabytes, or Gigabytes, respectively, to the base of 1000. Defaults to zero.</para>
|
||||
Megabytes, or Gigabytes, respectively, to the base of 1024. Defaults to zero.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@ -2773,7 +2773,7 @@
|
||||
<term><varname>MTUBytes=</varname></term>
|
||||
<listitem>
|
||||
<para>Specifies the size of the peakrate bucket. When suffixed with K, M, or G, the specified
|
||||
size is parsed as Kilobytes, Megabytes, or Gigabytes, respectively, to the base of 1000.
|
||||
size is parsed as Kilobytes, Megabytes, or Gigabytes, respectively, to the base of 1024.
|
||||
Defaults to unset.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@ -2846,7 +2846,7 @@
|
||||
<xi:include href="tc.xml" xpointer="qdisc-handle" />
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>LimitSize=</varname></term>
|
||||
<term><varname>LimitBytes=</varname></term>
|
||||
<listitem>
|
||||
<para>Specifies the hard limit on the FIFO size in bytes. The size limit (a buffer size) to prevent it
|
||||
from overflowing in case it is unable to dequeue packets as quickly as it receives them. When this limit
|
||||
@ -2915,7 +2915,7 @@
|
||||
<xi:include href="tc.xml" xpointer="qdisc-handle" />
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>Overhead=</varname></term>
|
||||
<term><varname>OverheadBytes=</varname></term>
|
||||
<listitem>
|
||||
<para>Specifies that bytes to be addeded to the size of each packet. Bytes may be negative.
|
||||
Takes an integer ranges -64 to 256. Defaults to unset and kernel's default is used.</para>
|
||||
@ -3005,11 +3005,12 @@
|
||||
<xi:include href="tc.xml" xpointer="tclass-classid" />
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>Quantum=</varname></term>
|
||||
<term><varname>QuantumBytes=</varname></term>
|
||||
<listitem>
|
||||
<para>Specifies the amount of bytes a flow is allowed to dequeue before the
|
||||
scheduler moves to the next class. An unsigned integer ranges 1 to 4294967294.
|
||||
Defaults to the MTU of the interface.</para>
|
||||
<para>Specifies the amount of bytes a flow is allowed to dequeue before the scheduler moves
|
||||
to the next class. When suffixed with K, M, or G, the specified size is parsed as Kilobytes,
|
||||
Megabytes, or Gigabytes, respectively, to the base of 1024. Defaults to the MTU of the
|
||||
interface.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@ -3120,7 +3121,7 @@
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>MemoryLimit=</varname></term>
|
||||
<term><varname>MemoryLimitBytes=</varname></term>
|
||||
<listitem>
|
||||
<para>Specifies the limit on the total number of bytes that can be queued in this FQ-CoDel instance.
|
||||
When suffixed with K, M, or G, the specified size is parsed as Kilobytes, Megabytes, or Gigabytes,
|
||||
@ -3153,7 +3154,7 @@
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>Quantum=</varname></term>
|
||||
<term><varname>QuantumBytes=</varname></term>
|
||||
<listitem>
|
||||
<para>Specifies the number of bytes used as 'deficit' in the fair queuing algorithmtimespan.
|
||||
When suffixed with K, M, or G, the specified size is parsed as Kilobytes, Megabytes, or Gigabytes,
|
||||
@ -3205,7 +3206,7 @@
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>Quantum=</varname></term>
|
||||
<term><varname>QuantumBytes=</varname></term>
|
||||
<listitem>
|
||||
<para>Specifies the credit per dequeue RR round, i.e. the amount of bytes a flow is allowed
|
||||
to dequeue at once. When suffixed with K, M, or G, the specified size is parsed as Kilobytes,
|
||||
@ -3215,7 +3216,7 @@
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>InitialQuantum=</varname></term>
|
||||
<term><varname>InitialQuantumBytes=</varname></term>
|
||||
<listitem>
|
||||
<para>Specifies the initial sending rate credit, i.e. the amount of bytes a new flow is
|
||||
allowed to dequeue initially. When suffixed with K, M, or G, the specified size is parsed as
|
||||
@ -3446,10 +3447,10 @@
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>MaxPacketSize=</varname></term>
|
||||
<term><varname>MaxPacketBytes=</varname></term>
|
||||
<listitem>
|
||||
<para>Specifies the maximum packet size in bytes for the class. When suffixed with K, M, or G, the specified
|
||||
size is parsed as Kilobytes, Megabytes, or Gigabytes, respectively, to the base of 1000. When unset,
|
||||
size is parsed as Kilobytes, Megabytes, or Gigabytes, respectively, to the base of 1024. When unset,
|
||||
the kernel default is used.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -304,11 +304,11 @@ QDisc.Parent, config_parse_qdisc_parent,
|
||||
QDisc.Handle, config_parse_qdisc_handle, _QDISC_KIND_INVALID, 0
|
||||
BFIFO.Parent, config_parse_qdisc_parent, QDISC_KIND_BFIFO, 0
|
||||
BFIFO.Handle, config_parse_qdisc_handle, QDISC_KIND_BFIFO, 0
|
||||
BFIFO.LimitSize, config_parse_bfifo_size, QDISC_KIND_BFIFO, 0
|
||||
BFIFO.LimitBytes, config_parse_bfifo_size, QDISC_KIND_BFIFO, 0
|
||||
CAKE.Parent, config_parse_qdisc_parent, QDISC_KIND_CAKE, 0
|
||||
CAKE.Handle, config_parse_qdisc_handle, QDISC_KIND_CAKE, 0
|
||||
CAKE.Bandwidth, config_parse_cake_bandwidth, QDISC_KIND_CAKE, 0
|
||||
CAKE.Overhead, config_parse_cake_overhead, QDISC_KIND_CAKE, 0
|
||||
CAKE.OverheadBytes, config_parse_cake_overhead, QDISC_KIND_CAKE, 0
|
||||
ControlledDelay.Parent, config_parse_qdisc_parent, QDISC_KIND_CODEL, 0
|
||||
ControlledDelay.Handle, config_parse_qdisc_handle, QDISC_KIND_CODEL, 0
|
||||
ControlledDelay.PacketLimit, config_parse_controlled_delay_u32, QDISC_KIND_CODEL, 0
|
||||
@ -320,7 +320,7 @@ DeficitRoundRobinScheduler.Parent, config_parse_qdisc_parent,
|
||||
DeficitRoundRobinScheduler.Handle, config_parse_qdisc_handle, QDISC_KIND_DRR, 0
|
||||
DeficitRoundRobinSchedulerClass.Parent, config_parse_tclass_parent, TCLASS_KIND_DRR, 0
|
||||
DeficitRoundRobinSchedulerClass.ClassId, config_parse_tclass_classid, TCLASS_KIND_DRR, 0
|
||||
DeficitRoundRobinSchedulerClass.Quantum, config_parse_drr_size, TCLASS_KIND_DRR, 0
|
||||
DeficitRoundRobinSchedulerClass.QuantumBytes, config_parse_drr_size, TCLASS_KIND_DRR, 0
|
||||
EnhancedTransmissionSelection.Parent, config_parse_qdisc_parent, QDISC_KIND_ETS, 0
|
||||
EnhancedTransmissionSelection.Handle, config_parse_qdisc_handle, QDISC_KIND_ETS, 0
|
||||
EnhancedTransmissionSelection.Bands, config_parse_ets_u8, QDISC_KIND_ETS, 0
|
||||
@ -340,13 +340,13 @@ QuickFairQueueing.Handle, config_parse_qdisc_handle,
|
||||
QuickFairQueueingClass.Parent, config_parse_tclass_parent, TCLASS_KIND_QFQ, 0
|
||||
QuickFairQueueingClass.ClassId, config_parse_tclass_classid, TCLASS_KIND_QFQ, 0
|
||||
QuickFairQueueingClass.Weight, config_parse_quick_fair_queueing_weight, TCLASS_KIND_QFQ, 0
|
||||
QuickFairQueueingClass.MaxPacketSize, config_parse_quick_fair_queueing_max_packet, TCLASS_KIND_QFQ, 0
|
||||
QuickFairQueueingClass.MaxPacketBytes, config_parse_quick_fair_queueing_max_packet, TCLASS_KIND_QFQ, 0
|
||||
FairQueueing.Parent, config_parse_qdisc_parent, QDISC_KIND_FQ, 0
|
||||
FairQueueing.Handle, config_parse_qdisc_handle, QDISC_KIND_FQ, 0
|
||||
FairQueueing.PacketLimit, config_parse_fair_queueing_u32, QDISC_KIND_FQ, 0
|
||||
FairQueueing.FlowLimit, config_parse_fair_queueing_u32, QDISC_KIND_FQ, 0
|
||||
FairQueueing.Quantum, config_parse_fair_queueing_size, QDISC_KIND_FQ, 0
|
||||
FairQueueing.InitialQuantum, config_parse_fair_queueing_size, QDISC_KIND_FQ, 0
|
||||
FairQueueing.QuantumBytes, config_parse_fair_queueing_size, QDISC_KIND_FQ, 0
|
||||
FairQueueing.InitialQuantumBytes, config_parse_fair_queueing_size, QDISC_KIND_FQ, 0
|
||||
FairQueueing.MaximumRate, config_parse_fair_queueing_max_rate, QDISC_KIND_FQ, 0
|
||||
FairQueueing.Buckets, config_parse_fair_queueing_u32, QDISC_KIND_FQ, 0
|
||||
FairQueueing.OrphanMask, config_parse_fair_queueing_u32, QDISC_KIND_FQ, 0
|
||||
@ -355,9 +355,9 @@ FairQueueing.CEThresholdSec, config_parse_fair_queueing_usec,
|
||||
FairQueueingControlledDelay.Parent, config_parse_qdisc_parent, QDISC_KIND_FQ_CODEL, 0
|
||||
FairQueueingControlledDelay.Handle, config_parse_qdisc_handle, QDISC_KIND_FQ_CODEL, 0
|
||||
FairQueueingControlledDelay.PacketLimit, config_parse_fair_queueing_controlled_delay_u32, QDISC_KIND_FQ_CODEL, 0
|
||||
FairQueueingControlledDelay.MemoryLimit, config_parse_fair_queueing_controlled_delay_size, QDISC_KIND_FQ_CODEL, 0
|
||||
FairQueueingControlledDelay.MemoryLimitBytes, config_parse_fair_queueing_controlled_delay_size, QDISC_KIND_FQ_CODEL, 0
|
||||
FairQueueingControlledDelay.Flows, config_parse_fair_queueing_controlled_delay_u32, QDISC_KIND_FQ_CODEL, 0
|
||||
FairQueueingControlledDelay.Quantum, config_parse_fair_queueing_controlled_delay_size, QDISC_KIND_FQ_CODEL, 0
|
||||
FairQueueingControlledDelay.QuantumBytes, config_parse_fair_queueing_controlled_delay_size, QDISC_KIND_FQ_CODEL, 0
|
||||
FairQueueingControlledDelay.TargetSec, config_parse_fair_queueing_controlled_delay_usec, QDISC_KIND_FQ_CODEL, 0
|
||||
FairQueueingControlledDelay.IntervalSec, config_parse_fair_queueing_controlled_delay_usec, QDISC_KIND_FQ_CODEL, 0
|
||||
FairQueueingControlledDelay.CEThresholdSec, config_parse_fair_queueing_controlled_delay_usec, QDISC_KIND_FQ_CODEL, 0
|
||||
@ -402,12 +402,12 @@ StochasticFairnessQueueing.Handle, config_parse_qdisc_handle,
|
||||
StochasticFairnessQueueing.PerturbPeriodSec, config_parse_stochastic_fairness_queueing_perturb_period, QDISC_KIND_SFQ, 0
|
||||
TokenBucketFilter.Parent, config_parse_qdisc_parent, QDISC_KIND_TBF, 0
|
||||
TokenBucketFilter.Handle, config_parse_qdisc_handle, QDISC_KIND_TBF, 0
|
||||
TokenBucketFilter.Rate, config_parse_token_bucket_filter_size, QDISC_KIND_TBF, 0
|
||||
TokenBucketFilter.Burst, config_parse_token_bucket_filter_size, QDISC_KIND_TBF, 0
|
||||
TokenBucketFilter.LimitSize, config_parse_token_bucket_filter_size, QDISC_KIND_TBF, 0
|
||||
TokenBucketFilter.Rate, config_parse_token_bucket_filter_rate, QDISC_KIND_TBF, 0
|
||||
TokenBucketFilter.BurstBytes, config_parse_token_bucket_filter_size, QDISC_KIND_TBF, 0
|
||||
TokenBucketFilter.LimitBytes, config_parse_token_bucket_filter_size, QDISC_KIND_TBF, 0
|
||||
TokenBucketFilter.MTUBytes, config_parse_token_bucket_filter_size, QDISC_KIND_TBF, 0
|
||||
TokenBucketFilter.MPUBytes, config_parse_token_bucket_filter_size, QDISC_KIND_TBF, 0
|
||||
TokenBucketFilter.PeakRate, config_parse_token_bucket_filter_size, QDISC_KIND_TBF, 0
|
||||
TokenBucketFilter.PeakRate, config_parse_token_bucket_filter_rate, QDISC_KIND_TBF, 0
|
||||
TokenBucketFilter.LatencySec, config_parse_token_bucket_filter_latency, QDISC_KIND_TBF, 0
|
||||
TrivialLinkEqualizer.Parent, config_parse_qdisc_parent, QDISC_KIND_TEQL, 0
|
||||
TrivialLinkEqualizer.Handle, config_parse_qdisc_handle, QDISC_KIND_TEQL, 0
|
||||
@ -446,3 +446,9 @@ TrafficControlQueueingDiscipline.NetworkEmulatorDelayJitterSec, config_parse_net
|
||||
TrafficControlQueueingDiscipline.NetworkEmulatorLossRate, config_parse_network_emulator_rate, 0, 0
|
||||
TrafficControlQueueingDiscipline.NetworkEmulatorDuplicateRate, config_parse_network_emulator_rate, 0, 0
|
||||
TrafficControlQueueingDiscipline.NetworkEmulatorPacketLimit, config_parse_network_emulator_packet_limit, 0, 0
|
||||
FairQueueing.Quantum, config_parse_fair_queueing_size, QDISC_KIND_FQ, 0
|
||||
FairQueueing.InitialQuantum, config_parse_fair_queueing_size, QDISC_KIND_FQ, 0
|
||||
FairQueueingControlledDelay.MemoryLimit, config_parse_fair_queueing_controlled_delay_size, QDISC_KIND_FQ_CODEL, 0
|
||||
FairQueueingControlledDelay.Quantum, config_parse_fair_queueing_controlled_delay_size, QDISC_KIND_FQ_CODEL, 0
|
||||
TokenBucketFilter.Burst, config_parse_token_bucket_filter_size, QDISC_KIND_TBF, 0
|
||||
TokenBucketFilter.LimitSize, config_parse_token_bucket_filter_size, QDISC_KIND_TBF, 0
|
||||
|
@ -136,14 +136,14 @@ int config_parse_cake_overhead(
|
||||
r = safe_atoi32(rvalue, &v);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_ERR, filename, line, r,
|
||||
"Failed to parse 'Overhead=', ignoring assignment: %s",
|
||||
rvalue);
|
||||
"Failed to parse '%s=', ignoring assignment: %s",
|
||||
lvalue, rvalue);
|
||||
return 0;
|
||||
}
|
||||
if (v < -64 || v > 256) {
|
||||
log_syntax(unit, LOG_ERR, filename, line, 0,
|
||||
"Invalid 'Overhead=', ignoring assignment: %s",
|
||||
rvalue);
|
||||
"Invalid '%s=', ignoring assignment: %s",
|
||||
lvalue, rvalue);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ int config_parse_drr_size(
|
||||
return 0;
|
||||
}
|
||||
|
||||
r = parse_size(rvalue, 1000, &u);
|
||||
r = parse_size(rvalue, 1024, &u);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_ERR, filename, line, r,
|
||||
"Failed to parse '%s=', ignoring assignment: %s",
|
||||
|
@ -140,7 +140,7 @@ int config_parse_bfifo_size(
|
||||
return 0;
|
||||
}
|
||||
|
||||
r = parse_size(rvalue, 1000, &u);
|
||||
r = parse_size(rvalue, 1024, &u);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_ERR, filename, line, r,
|
||||
"Failed to parse '%s=', ignoring assignment: %s",
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "parse-util.h"
|
||||
#include "qdisc.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
|
||||
static int fair_queueing_controlled_delay_init(QDisc *qdisc) {
|
||||
FairQueueingControlledDelay *fqcd;
|
||||
@ -301,15 +302,15 @@ int config_parse_fair_queueing_controlled_delay_size(
|
||||
|
||||
fqcd = FQ_CODEL(qdisc);
|
||||
|
||||
if (streq(lvalue, "MemoryLimit"))
|
||||
if (STR_IN_SET(lvalue, "MemoryLimitBytes", "MemoryLimit"))
|
||||
p = &fqcd->memory_limit;
|
||||
else if (streq(lvalue, "Quantum"))
|
||||
else if (STR_IN_SET(lvalue, "QuantumBytes", "Quantum"))
|
||||
p = &fqcd->quantum;
|
||||
else
|
||||
assert_not_reached("Invalid lvalue.");
|
||||
|
||||
if (isempty(rvalue)) {
|
||||
if (streq(lvalue, "MemoryLimit"))
|
||||
if (STR_IN_SET(lvalue, "MemoryLimitBytes", "MemoryLimit"))
|
||||
*p = UINT32_MAX;
|
||||
else
|
||||
*p = 0;
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "netlink-util.h"
|
||||
#include "parse-util.h"
|
||||
#include "string-util.h"
|
||||
#include "util.h"
|
||||
#include "strv.h"
|
||||
|
||||
static int fair_queueing_init(QDisc *qdisc) {
|
||||
FairQueueing *fq;
|
||||
@ -198,9 +198,9 @@ int config_parse_fair_queueing_size(
|
||||
|
||||
fq = FQ(qdisc);
|
||||
|
||||
if (streq(lvalue, "Quantum"))
|
||||
if (STR_IN_SET(lvalue, "QuantumBytes", "Quantum"))
|
||||
p = &fq->quantum;
|
||||
else if (streq(lvalue, "InitialQuantum"))
|
||||
else if (STR_IN_SET(lvalue, "InitialQuantumBytes", "InitialQuantum"))
|
||||
p = &fq->initial_quantum;
|
||||
else
|
||||
assert_not_reached("Invalid lvalue");
|
||||
|
@ -142,7 +142,7 @@ int config_parse_quick_fair_queueing_max_packet(
|
||||
return 0;
|
||||
}
|
||||
|
||||
r = parse_size(rvalue, 1000, &v);
|
||||
r = parse_size(rvalue, 1024, &v);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_ERR, filename, line, r,
|
||||
"Failed to parse '%s=', ignoring assignment: %s",
|
||||
|
@ -12,8 +12,8 @@
|
||||
#include "parse-util.h"
|
||||
#include "qdisc.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "tc-util.h"
|
||||
#include "util.h"
|
||||
|
||||
static int token_bucket_filter_fill_message(Link *link, QDisc *qdisc, sd_netlink_message *req) {
|
||||
uint32_t rtab[256], ptab[256];
|
||||
@ -143,18 +143,85 @@ int config_parse_token_bucket_filter_size(
|
||||
tbf = TBF(qdisc);
|
||||
|
||||
if (isempty(rvalue)) {
|
||||
if (streq(lvalue, "Rate"))
|
||||
tbf->rate = 0;
|
||||
else if (streq(lvalue, "Burst"))
|
||||
if (STR_IN_SET(lvalue, "BurstBytes", "Burst"))
|
||||
tbf->burst = 0;
|
||||
else if (streq(lvalue, "LimitSize"))
|
||||
else if (STR_IN_SET(lvalue, "LimitBytes", "LimitSize"))
|
||||
tbf->limit = 0;
|
||||
else if (streq(lvalue, "MTUBytes"))
|
||||
tbf->mtu = 0;
|
||||
else if (streq(lvalue, "MPUBytes"))
|
||||
tbf->mpu = 0;
|
||||
else if (streq(lvalue, "PeakRate"))
|
||||
tbf->peak_rate = 0;
|
||||
else
|
||||
assert_not_reached("unknown lvalue");
|
||||
|
||||
qdisc = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
r = parse_size(rvalue, 1024, &k);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_ERR, filename, line, r,
|
||||
"Failed to parse '%s=', ignoring assignment: %s",
|
||||
lvalue, rvalue);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (STR_IN_SET(lvalue, "BurstBytes", "Burst"))
|
||||
tbf->burst = k;
|
||||
else if (STR_IN_SET(lvalue, "LimitBytes", "LimitSize"))
|
||||
tbf->limit = k;
|
||||
else if (streq(lvalue, "MPUBytes"))
|
||||
tbf->mpu = k;
|
||||
else if (streq(lvalue, "MTUBytes"))
|
||||
tbf->mtu = k;
|
||||
else
|
||||
assert_not_reached("unknown lvalue");
|
||||
|
||||
qdisc = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int config_parse_token_bucket_filter_rate(
|
||||
const char *unit,
|
||||
const char *filename,
|
||||
unsigned line,
|
||||
const char *section,
|
||||
unsigned section_line,
|
||||
const char *lvalue,
|
||||
int ltype,
|
||||
const char *rvalue,
|
||||
void *data,
|
||||
void *userdata) {
|
||||
|
||||
_cleanup_(qdisc_free_or_set_invalidp) QDisc *qdisc = NULL;
|
||||
Network *network = data;
|
||||
TokenBucketFilter *tbf;
|
||||
uint64_t k, *p;
|
||||
int r;
|
||||
|
||||
assert(filename);
|
||||
assert(lvalue);
|
||||
assert(rvalue);
|
||||
assert(data);
|
||||
|
||||
r = qdisc_new_static(QDISC_KIND_TBF, network, filename, section_line, &qdisc);
|
||||
if (r == -ENOMEM)
|
||||
return log_oom();
|
||||
if (r < 0)
|
||||
return log_syntax(unit, LOG_ERR, filename, line, r,
|
||||
"More than one kind of queueing discipline, ignoring assignment: %m");
|
||||
|
||||
tbf = TBF(qdisc);
|
||||
if (streq(lvalue, "Rate"))
|
||||
p = &tbf->rate;
|
||||
else if (streq(lvalue, "PeakRate"))
|
||||
p = &tbf->peak_rate;
|
||||
else
|
||||
assert_not_reached("unknown lvalue");
|
||||
|
||||
if (isempty(rvalue)) {
|
||||
*p = 0;
|
||||
|
||||
qdisc = NULL;
|
||||
return 0;
|
||||
@ -168,18 +235,7 @@ int config_parse_token_bucket_filter_size(
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (streq(lvalue, "Rate"))
|
||||
tbf->rate = k / 8;
|
||||
else if (streq(lvalue, "Burst"))
|
||||
tbf->burst = k;
|
||||
else if (streq(lvalue, "LimitSize"))
|
||||
tbf->limit = k;
|
||||
else if (streq(lvalue, "MPUBytes"))
|
||||
tbf->mpu = k;
|
||||
else if (streq(lvalue, "MTUBytes"))
|
||||
tbf->mtu = k;
|
||||
else if (streq(lvalue, "PeakRate"))
|
||||
tbf->peak_rate = k / 8;
|
||||
*p = k / 8;
|
||||
|
||||
qdisc = NULL;
|
||||
|
||||
|
@ -23,3 +23,4 @@ extern const QDiscVTable tbf_vtable;
|
||||
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_token_bucket_filter_latency);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_token_bucket_filter_size);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_token_bucket_filter_rate);
|
||||
|
@ -332,7 +332,9 @@ PacketLimit=
|
||||
Parent=
|
||||
Handle=
|
||||
Rate=
|
||||
BurstBytes=
|
||||
Burst=
|
||||
LimitBytes=
|
||||
LimitSize=
|
||||
MTUBytes=
|
||||
MPUBytes=
|
||||
@ -346,8 +348,10 @@ PerturbPeriodSec=
|
||||
Parent=
|
||||
Handle=
|
||||
PacketLimit=
|
||||
MemoryLimitBytes=
|
||||
MemoryLimit=
|
||||
Flows=
|
||||
QuantumBytes=
|
||||
Quantum=
|
||||
TargetSec=
|
||||
IntervalSec=
|
||||
@ -358,7 +362,9 @@ Parent=
|
||||
Handle=
|
||||
PacketLimit=
|
||||
FlowLimit=
|
||||
QuantumBytes=
|
||||
Quantum=
|
||||
InitialQuantumBytes=
|
||||
InitialQuantum=
|
||||
MaximumRate=
|
||||
Buckets=
|
||||
@ -377,7 +383,7 @@ ECN=
|
||||
Parent=
|
||||
Handle=
|
||||
Bandwidth=
|
||||
Overhead=
|
||||
OverheadBytes=
|
||||
[TrafficControlQueueingDiscipline]
|
||||
Parent=
|
||||
NetworkEmulatorDelaySec=
|
||||
@ -408,7 +414,7 @@ CeilBufferBytes=
|
||||
[BFIFO]
|
||||
Parent=
|
||||
Handle=
|
||||
LimitSize=
|
||||
LimitBytes=
|
||||
[PFIFO]
|
||||
Parent=
|
||||
Handle=
|
||||
@ -441,14 +447,14 @@ Handle=
|
||||
Parent=
|
||||
ClassId=
|
||||
Weight=
|
||||
MaxPacketSize=
|
||||
MaxPacketBytes=
|
||||
[DeficitRoundRobinScheduler]
|
||||
Parent=
|
||||
Handle=
|
||||
[DeficitRoundRobinSchedulerClass]
|
||||
Parent=
|
||||
ClassId=
|
||||
Quantum=
|
||||
QuantumBytes=
|
||||
[EnhancedTransmissionSelection]
|
||||
Parent=
|
||||
Handle=
|
||||
|
@ -8,5 +8,5 @@ Address=10.1.2.3/16
|
||||
[CAKE]
|
||||
Parent=root
|
||||
Handle=3a
|
||||
Overhead=128
|
||||
OverheadBytes=128
|
||||
Bandwidth=500M
|
||||
|
@ -58,8 +58,8 @@ Parent=2:32
|
||||
Handle=0032
|
||||
PacketLimit=1000
|
||||
FlowLimit=200
|
||||
Quantum=1500
|
||||
InitialQuantum=13000
|
||||
QuantumBytes=1500
|
||||
InitialQuantumBytes=13000
|
||||
MaximumRate=1M
|
||||
Buckets=512
|
||||
OrphanMask=511
|
||||
@ -93,11 +93,11 @@ CeilRate=0.5M
|
||||
Parent=2:34
|
||||
Handle=0034
|
||||
PacketLimit=20480
|
||||
MemoryLimit=64M
|
||||
MemoryLimitBytes=64M
|
||||
Flows=2048
|
||||
TargetSec=10ms
|
||||
IntervalSec=200ms
|
||||
Quantum=1400
|
||||
QuantumBytes=1400
|
||||
ECN=yes
|
||||
CEThresholdSec=100ms
|
||||
|
||||
@ -112,10 +112,10 @@ CeilRate=0.5M
|
||||
Parent=2:35
|
||||
Handle=0035
|
||||
Rate=1G
|
||||
Burst=5K
|
||||
BurstBytes=5000
|
||||
LatencySec=70msec
|
||||
PeakRate=100G
|
||||
MTUBytes=1M
|
||||
MTUBytes=1000000
|
||||
|
||||
[HierarchyTokenBucketClass]
|
||||
Parent=root
|
||||
@ -177,7 +177,7 @@ CeilRate=0.5M
|
||||
[BFIFO]
|
||||
Parent=2:3a
|
||||
Handle=003a
|
||||
LimitSize=1M
|
||||
LimitBytes=1000000
|
||||
|
||||
[HierarchyTokenBucketClass]
|
||||
Parent=root
|
||||
|
@ -12,4 +12,4 @@ Handle=0002
|
||||
[DeficitRoundRobinSchedulerClass]
|
||||
Parent=root
|
||||
ClassId=0002:0030
|
||||
Quantum=2000
|
||||
QuantumBytes=2000
|
||||
|
@ -13,10 +13,10 @@ Handle=0002
|
||||
Parent=root
|
||||
ClassId=0002:0030
|
||||
Weight=2
|
||||
MaxPacketSize=16000
|
||||
MaxPacketBytes=16000
|
||||
|
||||
[QuickFairQueueingClass]
|
||||
Parent=root
|
||||
ClassId=0002:0031
|
||||
Weight=10
|
||||
MaxPacketSize=8000
|
||||
MaxPacketBytes=8000
|
||||
|
Loading…
x
Reference in New Issue
Block a user