1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00

network: TC - introduce DRR

Introduce the Deficit Round Robin Scheduler is a classful queuing discipline as
a more flexible replacement for Stochastic Fairness Queuing.

http://man7.org/linux/man-pages/man8/tc-drr.8.html
This commit is contained in:
Susant Sahani 2020-03-10 08:46:40 +01:00 committed by Yu Watanabe
parent 5c21b46e49
commit f5fc04417e
9 changed files with 58 additions and 0 deletions

View File

@ -2739,6 +2739,32 @@
</variablelist>
</refsect1>
<refsect1>
<title>[DeficitRoundRobinScheduler] Section Options</title>
<para>The <literal>[DeficitRoundRobinScheduler]</literal> section manages the queueing discipline (qdisc) of
Deficit Round Robin Scheduler (DRR).</para>
<variablelist class='network-directives'>
<varlistentry>
<term><varname>Parent=</varname></term>
<listitem>
<para>Specifies the parent Queueing Discipline (qdisc). Takes one of <literal>root</literal>,
<literal>clsact</literal>, <literal>ingress</literal> or a class id. The class id takes the
major and minor number in hexadecimal ranges 1 to ffff separated with a colon
(<literal>major:minor</literal>). Defaults to <literal>root</literal>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>Handle=</varname></term>
<listitem>
<para>Specifies the major number of unique identifier of the qdisc, known as the handle.
Takes a number in hexadecimal ranges 1 to ffff. Defaults to unset.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>[GenericRandomEarlyDetection] Section Options</title>
<para>The <literal>[GenericRandomEarlyDetection]</literal> section manages the queueing discipline

View File

@ -111,6 +111,8 @@ sources = files('''
tc/cake.h
tc/codel.c
tc/codel.h
tc/drr.c
tc/drr.h
tc/fifo.c
tc/fifo.h
tc/fq.c

View File

@ -269,6 +269,8 @@ ControlledDelay.TargetSec, config_parse_controlled_delay_usec,
ControlledDelay.IntervalSec, config_parse_controlled_delay_usec, QDISC_KIND_CODEL, 0
ControlledDelay.CEThresholdSec, config_parse_controlled_delay_usec, QDISC_KIND_CODEL, 0
ControlledDelay.ECN, config_parse_controlled_delay_bool, QDISC_KIND_CODEL, 0
DeficitRoundRobinScheduler.Parent, config_parse_qdisc_parent, QDISC_KIND_DRR, 0
DeficitRoundRobinScheduler.Handle, config_parse_qdisc_handle, QDISC_KIND_DRR, 0
PFIFO.Parent, config_parse_qdisc_parent, QDISC_KIND_PFIFO, 0
PFIFO.Handle, config_parse_qdisc_handle, QDISC_KIND_PFIFO, 0
PFIFO.PacketLimit, config_parse_fifo_size, QDISC_KIND_PFIFO, 0

View File

@ -488,6 +488,7 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi
"QDisc\0"
"CAKE\0"
"ControlledDelay\0"
"DeficitRoundRobinScheduler\0"
"PFIFO\0"
"FairQueueing\0"
"FairQueueingControlledDelay\0"

9
src/network/tc/drr.c Normal file
View File

@ -0,0 +1,9 @@
/* SPDX-License-Identifier: LGPL-2.1+
* Copyright © 2020 VMware, Inc. */
#include "drr.h"
const QDiscVTable drr_vtable = {
.object_size = sizeof(DeficitRoundRobinScheduler),
.tca_kind = "drr",
};

12
src/network/tc/drr.h Normal file
View File

@ -0,0 +1,12 @@
/* SPDX-License-Identifier: LGPL-2.1+
* Copyright © 2020 VMware, Inc. */
#pragma once
#include "qdisc.h"
typedef struct DeficitRoundRobinScheduler {
QDisc meta;
} DeficitRoundRobinScheduler;
DEFINE_QDISC_CAST(DRR, DeficitRoundRobinScheduler);
extern const QDiscVTable drr_vtable;

View File

@ -18,6 +18,7 @@
const QDiscVTable * const qdisc_vtable[_QDISC_KIND_MAX] = {
[QDISC_KIND_CAKE] = &cake_vtable,
[QDISC_KIND_CODEL] = &codel_vtable,
[QDISC_KIND_DRR] = &drr_vtable,
[QDISC_KIND_FQ] = &fq_vtable,
[QDISC_KIND_FQ_CODEL] = &fq_codel_vtable,
[QDISC_KIND_GRED] = &gred_vtable,

View File

@ -11,6 +11,7 @@
typedef enum QDiscKind {
QDISC_KIND_CAKE,
QDISC_KIND_CODEL,
QDISC_KIND_DRR,
QDISC_KIND_FQ,
QDISC_KIND_FQ_CODEL,
QDISC_KIND_GRED,
@ -88,6 +89,7 @@ CONFIG_PARSER_PROTOTYPE(config_parse_qdisc_handle);
#include "htb.h"
#include "pie.h"
#include "netem.h"
#include "drr.h"
#include "sfb.h"
#include "sfq.h"
#include "tbf.h"

View File

@ -374,3 +374,6 @@ PacketLimit=
Parent=
Handle=
PacketLimit=
[DeficitRoundRobinScheduler]
Parent=
Handle=