Compare commits
6 Commits
7b8c70ed20
...
1034044260
Author | SHA1 | Date |
---|---|---|
Yu Watanabe | 1034044260 | |
ErrantSpore | 450fb174e7 | |
Yu Watanabe | 1578266b02 | |
Yu Watanabe | fdeecf7bba | |
Susant Sahani | 8f6b6d7091 | |
Susant Sahani | 3428b32a04 |
|
@ -191,6 +191,8 @@ sensor:modalias:acpi:MXC6655*:dmi:*:svnCHUWIInnovationAndTechnology*:pnHi10X:*
|
|||
|
||||
# Chuwi Hi12
|
||||
sensor:modalias:acpi:BOSC0200*:dmi:*:svnHampoo:pnP02BD6_HI-122LP:*
|
||||
sensor:modalias:acpi:BOSC0200*:dmi:*:svnDefaultstring:pnDefaultstring:*
|
||||
sensor:modalias:acpi:BOSC0200*:dmi:*:svnHampoo:pnE4D6_HI-122LP:*
|
||||
ACCEL_MOUNT_MATRIX=1, 0, 0; 0, -1, 0; 0, 0, 1
|
||||
|
||||
# Chuwi Hi13
|
||||
|
|
|
@ -2823,6 +2823,25 @@ IPv6Token=prefixstable:2002:da8:1::</programlisting></para>
|
|||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>[FlowQueuePIE] Section Options</title>
|
||||
<para>The <literal>[FlowQueuePIE]</literal> section manages the queueing discipline
|
||||
(qdisc) of Flow Queue Proportional Integral controller-Enhanced (fq_pie).</para>
|
||||
|
||||
<variablelist class='network-directives'>
|
||||
<xi:include href="tc.xml" xpointer="qdisc-parent" />
|
||||
<xi:include href="tc.xml" xpointer="qdisc-handle" />
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>PacketLimit=</varname></term>
|
||||
<listitem>
|
||||
<para>Specifies the hard limit on the queue size in number of packets. When this limit is reached, incoming packets are
|
||||
dropped. An unsigned integer ranges 1 to 4294967294. Defaults to unset and kernel's default is used.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>[StochasticFairBlue] Section Options</title>
|
||||
<para>The [StochasticFairBlue] section manages the queueing discipline (qdisc) of stochastic fair blue
|
||||
|
|
|
@ -870,6 +870,10 @@ static const NLType rtnl_tca_option_data_fq_codel_types[] = {
|
|||
[TCA_FQ_CODEL_MEMORY_LIMIT] = { .type = NETLINK_TYPE_U32 },
|
||||
};
|
||||
|
||||
static const NLType rtnl_tca_option_data_fq_pie_types[] = {
|
||||
[TCA_FQ_PIE_LIMIT] = { .type = NETLINK_TYPE_U32 },
|
||||
};
|
||||
|
||||
static const NLType rtnl_tca_option_data_gred_types[] = {
|
||||
[TCA_GRED_DPS] = { .size = sizeof(struct tc_gred_sopt) },
|
||||
};
|
||||
|
@ -917,6 +921,7 @@ static const char* const nl_union_tca_option_data_table[] = {
|
|||
[NL_UNION_TCA_OPTION_DATA_ETS] = "ets",
|
||||
[NL_UNION_TCA_OPTION_DATA_FQ] = "fq",
|
||||
[NL_UNION_TCA_OPTION_DATA_FQ_CODEL] = "fq_codel",
|
||||
[NL_UNION_TCA_OPTION_DATA_FQ_PIE] = "fq_pie",
|
||||
[NL_UNION_TCA_OPTION_DATA_GRED] = "gred",
|
||||
[NL_UNION_TCA_OPTION_DATA_HHF] = "hhf",
|
||||
[NL_UNION_TCA_OPTION_DATA_HTB] = "htb",
|
||||
|
@ -941,6 +946,8 @@ static const NLTypeSystem rtnl_tca_option_data_type_systems[] = {
|
|||
.types = rtnl_tca_option_data_fq_types },
|
||||
[NL_UNION_TCA_OPTION_DATA_FQ_CODEL] = { .count = ELEMENTSOF(rtnl_tca_option_data_fq_codel_types),
|
||||
.types = rtnl_tca_option_data_fq_codel_types },
|
||||
[NL_UNION_TCA_OPTION_DATA_FQ_PIE] = { .count = ELEMENTSOF(rtnl_tca_option_data_fq_pie_types),
|
||||
.types = rtnl_tca_option_data_fq_pie_types },
|
||||
[NL_UNION_TCA_OPTION_DATA_GRED] = { .count = ELEMENTSOF(rtnl_tca_option_data_gred_types),
|
||||
.types = rtnl_tca_option_data_gred_types },
|
||||
[NL_UNION_TCA_OPTION_DATA_HHF] = { .count = ELEMENTSOF(rtnl_tca_option_data_hhf_types),
|
||||
|
|
|
@ -103,6 +103,7 @@ typedef enum NLUnionTCAOptionData {
|
|||
NL_UNION_TCA_OPTION_DATA_ETS,
|
||||
NL_UNION_TCA_OPTION_DATA_FQ,
|
||||
NL_UNION_TCA_OPTION_DATA_FQ_CODEL,
|
||||
NL_UNION_TCA_OPTION_DATA_FQ_PIE,
|
||||
NL_UNION_TCA_OPTION_DATA_GRED,
|
||||
NL_UNION_TCA_OPTION_DATA_HHF,
|
||||
NL_UNION_TCA_OPTION_DATA_HTB,
|
||||
|
|
|
@ -129,6 +129,8 @@ sources = files('''
|
|||
tc/fq.h
|
||||
tc/fq-codel.c
|
||||
tc/fq-codel.h
|
||||
tc/fq-pie.c
|
||||
tc/fq-pie.h
|
||||
tc/gred.c
|
||||
tc/gred.h
|
||||
tc/hhf.c
|
||||
|
|
|
@ -364,6 +364,9 @@ FairQueueingControlledDelay.TargetSec, config_parse_fair_queueing_controll
|
|||
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
|
||||
FairQueueingControlledDelay.ECN, config_parse_fair_queueing_controlled_delay_bool, QDISC_KIND_FQ_CODEL, 0
|
||||
FlowQueuePIE.Parent, config_parse_qdisc_parent, QDISC_KIND_FQ_PIE, 0
|
||||
FlowQueuePIE.Handle, config_parse_qdisc_handle, QDISC_KIND_FQ_PIE, 0
|
||||
FlowQueuePIE.PacketLimit, config_parse_fq_pie_packet_limit, QDISC_KIND_FQ_PIE, 0
|
||||
GenericRandomEarlyDetection.Parent, config_parse_qdisc_parent, QDISC_KIND_GRED, 0
|
||||
GenericRandomEarlyDetection.Handle, config_parse_qdisc_handle, QDISC_KIND_GRED, 0
|
||||
GenericRandomEarlyDetection.VirtualQueues, config_parse_generic_random_early_detection_u32, QDISC_KIND_GRED, 0
|
||||
|
|
|
@ -538,6 +538,7 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi
|
|||
"EnhancedTransmissionSelection\0"
|
||||
"FairQueueing\0"
|
||||
"FairQueueingControlledDelay\0"
|
||||
"FlowQueuePIE\0"
|
||||
"GenericRandomEarlyDetection\0"
|
||||
"HeavyHitterFilter\0"
|
||||
"HierarchyTokenBucket\0"
|
||||
|
|
|
@ -0,0 +1,103 @@
|
|||
/* SPDX-License-Identifier: LGPL-2.1+
|
||||
* Copyright © 2020 VMware, Inc. */
|
||||
|
||||
#include <linux/pkt_sched.h>
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "conf-parser.h"
|
||||
#include "fq-pie.h"
|
||||
#include "netlink-util.h"
|
||||
#include "parse-util.h"
|
||||
#include "string-util.h"
|
||||
|
||||
static int fq_pie_fill_message(Link *link, QDisc *qdisc, sd_netlink_message *req) {
|
||||
FlowQueuePIE *fq_pie;
|
||||
int r;
|
||||
|
||||
assert(link);
|
||||
assert(qdisc);
|
||||
assert(req);
|
||||
|
||||
fq_pie = FQ_PIE(qdisc);
|
||||
|
||||
r = sd_netlink_message_open_container_union(req, TCA_OPTIONS, "fq_pie");
|
||||
if (r < 0)
|
||||
return log_link_error_errno(link, r, "Could not open container TCA_OPTIONS: %m");
|
||||
|
||||
if (fq_pie->packet_limit > 0) {
|
||||
r = sd_netlink_message_append_u32(req, TCA_FQ_PIE_LIMIT, fq_pie->packet_limit);
|
||||
if (r < 0)
|
||||
return log_link_error_errno(link, r, "Could not append TCA_FQ_PIE_PLIMIT attribute: %m");
|
||||
}
|
||||
|
||||
r = sd_netlink_message_close_container(req);
|
||||
if (r < 0)
|
||||
return log_link_error_errno(link, r, "Could not close container TCA_OPTIONS: %m");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int config_parse_fq_pie_packet_limit(
|
||||
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;
|
||||
FlowQueuePIE *fq_pie;
|
||||
Network *network = data;
|
||||
uint32_t val;
|
||||
int r;
|
||||
|
||||
assert(filename);
|
||||
assert(lvalue);
|
||||
assert(rvalue);
|
||||
assert(data);
|
||||
|
||||
r = qdisc_new_static(QDISC_KIND_FQ_PIE, network, filename, section_line, &qdisc);
|
||||
if (r == -ENOMEM)
|
||||
return log_oom();
|
||||
if (r < 0)
|
||||
return log_syntax(unit, LOG_WARNING, filename, line, r,
|
||||
"More than one kind of queueing discipline, ignoring assignment: %m");
|
||||
|
||||
fq_pie = FQ_PIE(qdisc);
|
||||
|
||||
if (isempty(rvalue)) {
|
||||
fq_pie->packet_limit = 0;
|
||||
|
||||
qdisc = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
r = safe_atou32(rvalue, &val);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, r,
|
||||
"Failed to parse '%s=', ignoring assignment: %s",
|
||||
lvalue, rvalue);
|
||||
return 0;
|
||||
}
|
||||
if (val == 0) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, 0,
|
||||
"Invalid '%s=', ignoring assignment: %s",
|
||||
lvalue, rvalue);
|
||||
return 0;
|
||||
}
|
||||
|
||||
fq_pie->packet_limit = val;
|
||||
qdisc = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
const QDiscVTable fq_pie_vtable = {
|
||||
.object_size = sizeof(FlowQueuePIE),
|
||||
.tca_kind = "fq_pie",
|
||||
.fill_message = fq_pie_fill_message,
|
||||
};
|
|
@ -0,0 +1,17 @@
|
|||
/* SPDX-License-Identifier: LGPL-2.1+
|
||||
* Copyright © 2020 VMware, Inc. */
|
||||
#pragma once
|
||||
|
||||
#include "conf-parser.h"
|
||||
#include "qdisc.h"
|
||||
|
||||
typedef struct FlowQueuePIE {
|
||||
QDisc meta;
|
||||
|
||||
uint32_t packet_limit;
|
||||
} FlowQueuePIE;
|
||||
|
||||
DEFINE_QDISC_CAST(FQ_PIE, FlowQueuePIE);
|
||||
extern const QDiscVTable fq_pie_vtable;
|
||||
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_fq_pie_packet_limit);
|
|
@ -23,6 +23,7 @@ const QDiscVTable * const qdisc_vtable[_QDISC_KIND_MAX] = {
|
|||
[QDISC_KIND_ETS] = &ets_vtable,
|
||||
[QDISC_KIND_FQ] = &fq_vtable,
|
||||
[QDISC_KIND_FQ_CODEL] = &fq_codel_vtable,
|
||||
[QDISC_KIND_FQ_PIE] = &fq_pie_vtable,
|
||||
[QDISC_KIND_GRED] = &gred_vtable,
|
||||
[QDISC_KIND_HHF] = &hhf_vtable,
|
||||
[QDISC_KIND_HTB] = &htb_vtable,
|
||||
|
|
|
@ -16,6 +16,7 @@ typedef enum QDiscKind {
|
|||
QDISC_KIND_ETS,
|
||||
QDISC_KIND_FQ,
|
||||
QDISC_KIND_FQ_CODEL,
|
||||
QDISC_KIND_FQ_PIE,
|
||||
QDISC_KIND_GRED,
|
||||
QDISC_KIND_HHF,
|
||||
QDISC_KIND_HTB,
|
||||
|
@ -91,6 +92,7 @@ CONFIG_PARSER_PROTOTYPE(config_parse_qdisc_handle);
|
|||
#include "ets.h"
|
||||
#include "fifo.h"
|
||||
#include "fq-codel.h"
|
||||
#include "fq-pie.h"
|
||||
#include "fq.h"
|
||||
#include "gred.h"
|
||||
#include "hhf.h"
|
||||
|
|
|
@ -471,3 +471,7 @@ PriorityMap=
|
|||
Parent=
|
||||
Handle=
|
||||
PacketLimit=
|
||||
[FlowQueuePIE]
|
||||
Parent=
|
||||
Handle=
|
||||
PacketLimit=
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
[Match]
|
||||
Name=dummy98
|
||||
|
||||
[Network]
|
||||
IPv6AcceptRA=no
|
||||
Address=10.1.2.3/16
|
||||
|
||||
[FlowQueuePIE]
|
||||
Parent=root
|
||||
Handle=3a
|
||||
PacketLimit=200000
|
|
@ -233,6 +233,18 @@ def expectedFailureIfETSIsNotAvailable():
|
|||
|
||||
return f
|
||||
|
||||
def expectedFailureIfFQPIEIsNotAvailable():
|
||||
def f(func):
|
||||
call('ip link add dummy98 type dummy', stderr=subprocess.DEVNULL)
|
||||
rc = call('tc qdisc add dev dummy98 parent root fq_pie', stderr=subprocess.DEVNULL)
|
||||
call('ip link del dummy98', stderr=subprocess.DEVNULL)
|
||||
if rc == 0:
|
||||
return func
|
||||
else:
|
||||
return unittest.expectedFailure(func)
|
||||
|
||||
return f
|
||||
|
||||
def setUpModule():
|
||||
global running_units
|
||||
|
||||
|
@ -1734,6 +1746,7 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
|
|||
'25-qdisc-clsact-and-htb.network',
|
||||
'25-qdisc-drr.network',
|
||||
'25-qdisc-ets.network',
|
||||
'25-qdisc-fq_pie.network',
|
||||
'25-qdisc-hhf.network',
|
||||
'25-qdisc-ingress-netem-compat.network',
|
||||
'25-qdisc-pie.network',
|
||||
|
@ -2667,11 +2680,24 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
|
|||
|
||||
output = check_output('tc qdisc show dev dummy98')
|
||||
print(output)
|
||||
|
||||
self.assertRegex(output, 'qdisc ets 3a: root')
|
||||
self.assertRegex(output, 'bands 10 strict 3')
|
||||
self.assertRegex(output, 'quanta 1 2 3 4 5')
|
||||
self.assertRegex(output, 'priomap 3 4 5 6 7')
|
||||
|
||||
@expectedFailureIfFQPIEIsNotAvailable()
|
||||
def test_qdisc_fq_pie(self):
|
||||
copy_unit_to_networkd_unit_path('25-qdisc-fq_pie.network', '12-dummy.netdev')
|
||||
start_networkd()
|
||||
self.wait_online(['dummy98:routable'])
|
||||
|
||||
output = check_output('tc qdisc show dev dummy98')
|
||||
print(output)
|
||||
|
||||
self.assertRegex(output, 'qdisc fq_pie 3a: root')
|
||||
self.assertRegex(output, 'limit 200000p')
|
||||
|
||||
@expectedFailureIfNetdevsimWithSRIOVIsNotAvailable()
|
||||
def test_sriov(self):
|
||||
call('rmmod netdevsim', stderr=subprocess.DEVNULL)
|
||||
|
|
Loading…
Reference in New Issue