mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-21 18:03:41 +03:00
network: TokenBufferFilter→TokenBucketFilter
This never made into a release, so we can change the name with impunity. Noticed by Davide Pesavento.
This commit is contained in:
parent
18de0969c5
commit
60ed2dcfc7
2
NEWS
2
NEWS
@ -125,7 +125,7 @@ CHANGES WITH 245 in spe:
|
||||
marking a process so that it is killed implicitly whenever the event
|
||||
source watching it is freed).
|
||||
|
||||
* systemd-networkd gained support for configuring Token Buffer Filter
|
||||
* systemd-networkd gained support for configuring Token Bucket Filter
|
||||
(TBF) parameters in its qdisc configuration support. Similar, support
|
||||
for Stochastic Fairness Queuing (SFQ), Controlled-Delay Active
|
||||
Queue Management (CoDel), Fair Queue (FQ) has been added.
|
||||
|
@ -2321,9 +2321,9 @@
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>[TokenBufferFilter] Section Options</title>
|
||||
<para>The <literal>[TokenBufferFilter]</literal> section manages the queueing discipline (qdisc) of
|
||||
token buffer filter (tbf).</para>
|
||||
<title>[TokenBucketFilter] Section Options</title>
|
||||
<para>The <literal>[TokenBucketFilter]</literal> section manages the queueing discipline (qdisc) of
|
||||
token bucket filter (tbf).</para>
|
||||
|
||||
<variablelist class='network-directives'>
|
||||
<varlistentry>
|
||||
@ -2338,7 +2338,7 @@
|
||||
<term><varname>LatencySec=</varname></term>
|
||||
<listitem>
|
||||
<para>Specifies the latency parameter, which specifies the maximum amount of time a
|
||||
packet can sit in the Token Buffer Filter (TBF). Defaults to unset.</para>
|
||||
packet can sit in the Token Bucket Filter (TBF). Defaults to unset.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
@ -284,14 +284,14 @@ NetworkEmulator.DuplicateRate, config_parse_network_emulator_rate,
|
||||
NetworkEmulator.PacketLimit, config_parse_network_emulator_packet_limit, QDISC_KIND_NETEM, 0
|
||||
StochasticFairnessQueueing.Parent, config_parse_qdisc_parent, QDISC_KIND_SFQ, 0
|
||||
StochasticFairnessQueueing.PerturbPeriodSec, config_parse_stochastic_fairness_queueing_perturb_period, QDISC_KIND_SFQ, 0
|
||||
TokenBufferFilter.Parent, config_parse_qdisc_parent, QDISC_KIND_TBF, 0
|
||||
TokenBufferFilter.Rate, config_parse_token_buffer_filter_size, QDISC_KIND_TBF, 0
|
||||
TokenBufferFilter.Burst, config_parse_token_buffer_filter_size, QDISC_KIND_TBF, 0
|
||||
TokenBufferFilter.LimitSize, config_parse_token_buffer_filter_size, QDISC_KIND_TBF, 0
|
||||
TokenBufferFilter.MTUBytes, config_parse_token_buffer_filter_size, QDISC_KIND_TBF, 0
|
||||
TokenBufferFilter.MPUBytes, config_parse_token_buffer_filter_size, QDISC_KIND_TBF, 0
|
||||
TokenBufferFilter.PeakRate, config_parse_token_buffer_filter_size, QDISC_KIND_TBF, 0
|
||||
TokenBufferFilter.LatencySec, config_parse_token_buffer_filter_latency, QDISC_KIND_TBF, 0
|
||||
TokenBucketFilter.Parent, config_parse_qdisc_parent, 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.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.LatencySec, config_parse_token_bucket_filter_latency, QDISC_KIND_TBF, 0
|
||||
/* backwards compatibility: do not add new entries to this section */
|
||||
Network.IPv4LL, config_parse_ipv4ll, 0, offsetof(Network, link_local)
|
||||
DHCP.ClientIdentifier, config_parse_dhcp_client_identifier, 0, offsetof(Network, dhcp_client_identifier)
|
||||
|
@ -487,7 +487,7 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi
|
||||
"FairQueueingControlledDelay\0"
|
||||
"NetworkEmulator\0"
|
||||
"StochasticFairnessQueueing\0"
|
||||
"TokenBufferFilter\0",
|
||||
"TokenBucketFilter\0",
|
||||
config_item_perf_lookup, network_network_gperf_lookup,
|
||||
CONFIG_PARSE_WARN, network);
|
||||
if (r < 0)
|
||||
|
@ -15,10 +15,10 @@
|
||||
#include "tc-util.h"
|
||||
#include "util.h"
|
||||
|
||||
static int token_buffer_filter_fill_message(Link *link, QDisc *qdisc, sd_netlink_message *req) {
|
||||
static int token_bucket_filter_fill_message(Link *link, QDisc *qdisc, sd_netlink_message *req) {
|
||||
uint32_t rtab[256], ptab[256];
|
||||
struct tc_tbf_qopt opt = {};
|
||||
TokenBufferFilter *tbf;
|
||||
TokenBucketFilter *tbf;
|
||||
int r;
|
||||
|
||||
assert(link);
|
||||
@ -110,7 +110,7 @@ static int token_buffer_filter_fill_message(Link *link, QDisc *qdisc, sd_netlink
|
||||
return 0;
|
||||
}
|
||||
|
||||
int config_parse_token_buffer_filter_size(
|
||||
int config_parse_token_bucket_filter_size(
|
||||
const char *unit,
|
||||
const char *filename,
|
||||
unsigned line,
|
||||
@ -124,7 +124,7 @@ int config_parse_token_buffer_filter_size(
|
||||
|
||||
_cleanup_(qdisc_free_or_set_invalidp) QDisc *qdisc = NULL;
|
||||
Network *network = data;
|
||||
TokenBufferFilter *tbf;
|
||||
TokenBucketFilter *tbf;
|
||||
uint64_t k;
|
||||
int r;
|
||||
|
||||
@ -186,7 +186,7 @@ int config_parse_token_buffer_filter_size(
|
||||
return 0;
|
||||
}
|
||||
|
||||
int config_parse_token_buffer_filter_latency(
|
||||
int config_parse_token_bucket_filter_latency(
|
||||
const char *unit,
|
||||
const char *filename,
|
||||
unsigned line,
|
||||
@ -200,7 +200,7 @@ int config_parse_token_buffer_filter_latency(
|
||||
|
||||
_cleanup_(qdisc_free_or_set_invalidp) QDisc *qdisc = NULL;
|
||||
Network *network = data;
|
||||
TokenBufferFilter *tbf;
|
||||
TokenBucketFilter *tbf;
|
||||
usec_t u;
|
||||
int r;
|
||||
|
||||
@ -240,45 +240,45 @@ int config_parse_token_buffer_filter_latency(
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int token_buffer_filter_verify(QDisc *qdisc) {
|
||||
TokenBufferFilter *tbf = TBF(qdisc);
|
||||
static int token_bucket_filter_verify(QDisc *qdisc) {
|
||||
TokenBucketFilter *tbf = TBF(qdisc);
|
||||
|
||||
if (tbf->limit > 0 && tbf->latency > 0)
|
||||
return log_warning_errno(SYNTHETIC_ERRNO(EINVAL),
|
||||
"%s: Specifying both LimitSize= and LatencySec= is not allowed. "
|
||||
"Ignoring [TokenBufferFilter] section from line %u.",
|
||||
"Ignoring [TokenBucketFilter] section from line %u.",
|
||||
qdisc->section->filename, qdisc->section->line);
|
||||
|
||||
if (tbf->limit == 0 && tbf->latency == 0)
|
||||
return log_warning_errno(SYNTHETIC_ERRNO(EINVAL),
|
||||
"%s: Either LimitSize= or LatencySec= is required. "
|
||||
"Ignoring [TokenBufferFilter] section from line %u.",
|
||||
"Ignoring [TokenBucketFilter] section from line %u.",
|
||||
qdisc->section->filename, qdisc->section->line);
|
||||
|
||||
if (tbf->rate == 0)
|
||||
return log_warning_errno(SYNTHETIC_ERRNO(EINVAL),
|
||||
"%s: Rate= is mandatory. "
|
||||
"Ignoring [TokenBufferFilter] section from line %u.",
|
||||
"Ignoring [TokenBucketFilter] section from line %u.",
|
||||
qdisc->section->filename, qdisc->section->line);
|
||||
|
||||
if (tbf->burst == 0)
|
||||
return log_warning_errno(SYNTHETIC_ERRNO(EINVAL),
|
||||
"%s: Burst= is mandatory. "
|
||||
"Ignoring [TokenBufferFilter] section from line %u.",
|
||||
"Ignoring [TokenBucketFilter] section from line %u.",
|
||||
qdisc->section->filename, qdisc->section->line);
|
||||
|
||||
if (tbf->peak_rate > 0 && tbf->mtu == 0)
|
||||
return log_warning_errno(SYNTHETIC_ERRNO(EINVAL),
|
||||
"%s: MTUBytes= is mandatory when PeakRate= is specified. "
|
||||
"Ignoring [TokenBufferFilter] section from line %u.",
|
||||
"Ignoring [TokenBucketFilter] section from line %u.",
|
||||
qdisc->section->filename, qdisc->section->line);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
const QDiscVTable tbf_vtable = {
|
||||
.object_size = sizeof(TokenBufferFilter),
|
||||
.object_size = sizeof(TokenBucketFilter),
|
||||
.tca_kind = "tbf",
|
||||
.fill_message = token_buffer_filter_fill_message,
|
||||
.verify = token_buffer_filter_verify
|
||||
.fill_message = token_bucket_filter_fill_message,
|
||||
.verify = token_bucket_filter_verify
|
||||
};
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "qdisc.h"
|
||||
#include "time-util.h"
|
||||
|
||||
typedef struct TokenBufferFilter {
|
||||
typedef struct TokenBucketFilter {
|
||||
QDisc meta;
|
||||
|
||||
uint64_t rate;
|
||||
@ -16,10 +16,10 @@ typedef struct TokenBufferFilter {
|
||||
usec_t latency;
|
||||
size_t limit;
|
||||
size_t mpu;
|
||||
} TokenBufferFilter;
|
||||
} TokenBucketFilter;
|
||||
|
||||
DEFINE_QDISC_CAST(TBF, TokenBufferFilter);
|
||||
DEFINE_QDISC_CAST(TBF, TokenBucketFilter);
|
||||
extern const QDiscVTable tbf_vtable;
|
||||
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_token_buffer_filter_latency);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_token_buffer_filter_size);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_token_bucket_filter_latency);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_token_bucket_filter_size);
|
||||
|
@ -277,7 +277,7 @@ DelayJitterSec=
|
||||
LossRate=
|
||||
DuplicateRate=
|
||||
PacketLimit=
|
||||
[TokenBufferFilter]
|
||||
[TokenBucketFilter]
|
||||
Parent=
|
||||
Rate=
|
||||
Burst=
|
||||
|
@ -5,7 +5,7 @@ Name=test1
|
||||
IPv6AcceptRA=no
|
||||
Address=10.1.2.4/16
|
||||
|
||||
[TokenBufferFilter]
|
||||
[TokenBucketFilter]
|
||||
Parent=root
|
||||
Rate=1G
|
||||
Burst=5K
|
||||
|
Loading…
x
Reference in New Issue
Block a user