Compare commits

...

6 Commits

Author SHA1 Message Date
Yu Watanabe 1034044260
Merge pull request #15050 from ssahani/fq-pie
network: tc: add support for FQ-PIE packet scheduler
2020-09-18 03:50:02 +09:00
ErrantSpore 450fb174e7
hwdb: Chuwi Hi12 (#17042)
Different bios version includes different pn. Submitted change fixed my inverted screen after reboot.
I've stepped back to the bios version 5.11 28.04.2016 in an attempt to troubleshoot Windows Hello locking the sign
in on reboot. The screen again rotated, but 90 degrees to the right. I created a new hwdb line to resolve that issue. The bios version changes the dmi string including the svn and pn.
2020-09-17 16:52:52 +02:00
Yu Watanabe 1578266b02 test-network: add tests for FQ-PIE 2020-09-17 17:18:48 +09:00
Yu Watanabe fdeecf7bba network: tc: refuse to set 0 for FlowQueuePIE.PacketLimit= 2020-09-17 17:16:49 +09:00
Susant Sahani 8f6b6d7091 network: TC - introduce fq pie
see https://patchwork.ozlabs.org/patch/1233253/
2020-09-17 17:12:07 +09:00
Susant Sahani 3428b32a04 sd-netlink: add fq pie options 2020-09-17 17:06:47 +09:00
14 changed files with 199 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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),

View File

@ -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,

View File

@ -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

View File

@ -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

View File

@ -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"

103
src/network/tc/fq-pie.c Normal file
View File

@ -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,
};

17
src/network/tc/fq-pie.h Normal file
View File

@ -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);

View File

@ -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,

View File

@ -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"

View File

@ -471,3 +471,7 @@ PriorityMap=
Parent=
Handle=
PacketLimit=
[FlowQueuePIE]
Parent=
Handle=
PacketLimit=

View File

@ -0,0 +1,11 @@
[Match]
Name=dummy98
[Network]
IPv6AcceptRA=no
Address=10.1.2.3/16
[FlowQueuePIE]
Parent=root
Handle=3a
PacketLimit=200000

View File

@ -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)