summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSusant Sahani <ssahani@vmware.com>2020-03-11 11:02:20 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2020-03-12 07:38:18 +0100
commit1a95964bfa00eea15203a3fc27189189bbdb5bde (patch)
treef6dacf4c5508fedd501afa053ec129a4543aa5ba /src
parenttest-network: add a test case for PFIFOHeadDrop (diff)
downloadsystemd-1a95964bfa00eea15203a3fc27189189bbdb5bde.tar.xz
systemd-1a95964bfa00eea15203a3fc27189189bbdb5bde.zip
network: TC - introduce pfifo_fast
pfifo_fast - three-band first in, first out queue Please see https://linux.die.net/man/8/tc-pfifo_fast
Diffstat (limited to 'src')
-rw-r--r--src/network/networkd-network-gperf.gperf2
-rw-r--r--src/network/networkd-network.c1
-rw-r--r--src/network/tc/fifo.c5
-rw-r--r--src/network/tc/fifo.h2
-rw-r--r--src/network/tc/qdisc.c1
-rw-r--r--src/network/tc/qdisc.h1
6 files changed, 12 insertions, 0 deletions
diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf
index 0e8ecabc67..3b7b9ebd8b 100644
--- a/src/network/networkd-network-gperf.gperf
+++ b/src/network/networkd-network-gperf.gperf
@@ -280,6 +280,8 @@ DeficitRoundRobinSchedulerClass.Quantum, config_parse_drr_size,
PFIFO.Parent, config_parse_qdisc_parent, QDISC_KIND_PFIFO, 0
PFIFO.Handle, config_parse_qdisc_handle, QDISC_KIND_PFIFO, 0
PFIFO.PacketLimit, config_parse_pfifo_size, QDISC_KIND_PFIFO, 0
+PFIFOFast.Parent, config_parse_qdisc_parent, QDISC_KIND_PFIFO_FAST, 0
+PFIFOFast.Handle, config_parse_qdisc_handle, QDISC_KIND_PFIFO_FAST, 0
PFIFOHeadDrop.Parent, config_parse_qdisc_parent, QDISC_KIND_PFIFO_HEAD_DROP, 0
PFIFOHeadDrop.Handle, config_parse_qdisc_handle, QDISC_KIND_PFIFO_HEAD_DROP, 0
PFIFOHeadDrop.PacketLimit, config_parse_pfifo_size, QDISC_KIND_PFIFO_HEAD_DROP, 0
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
index 6b1f00c099..728191728f 100644
--- a/src/network/networkd-network.c
+++ b/src/network/networkd-network.c
@@ -492,6 +492,7 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi
"DeficitRoundRobinScheduler\0"
"DeficitRoundRobinSchedulerClass\0"
"PFIFO\0"
+ "PFIFOFast\0"
"PFIFOHeadDrop\0"
"FairQueueing\0"
"FairQueueingControlledDelay\0"
diff --git a/src/network/tc/fifo.c b/src/network/tc/fifo.c
index a524b614b9..8ef6e513bb 100644
--- a/src/network/tc/fifo.c
+++ b/src/network/tc/fifo.c
@@ -176,3 +176,8 @@ const QDiscVTable pfifo_head_drop_vtable = {
.tca_kind = "pfifo_head_drop",
.fill_message = fifo_fill_message,
};
+
+const QDiscVTable pfifo_fast_vtable = {
+ .object_size = sizeof(FirstInFirstOut),
+ .tca_kind = "pfifo_fast",
+};
diff --git a/src/network/tc/fifo.h b/src/network/tc/fifo.h
index bba5f17abe..e4c976b942 100644
--- a/src/network/tc/fifo.h
+++ b/src/network/tc/fifo.h
@@ -14,10 +14,12 @@ typedef struct FirstInFirstOut {
DEFINE_QDISC_CAST(PFIFO, FirstInFirstOut);
DEFINE_QDISC_CAST(BFIFO, FirstInFirstOut);
DEFINE_QDISC_CAST(PFIFO_HEAD_DROP, FirstInFirstOut);
+DEFINE_QDISC_CAST(PFIFO_FAST, FirstInFirstOut);
extern const QDiscVTable pfifo_vtable;
extern const QDiscVTable bfifo_vtable;
extern const QDiscVTable pfifo_head_drop_vtable;
+extern const QDiscVTable pfifo_fast_vtable;
CONFIG_PARSER_PROTOTYPE(config_parse_pfifo_size);
CONFIG_PARSER_PROTOTYPE(config_parse_bfifo_size);
diff --git a/src/network/tc/qdisc.c b/src/network/tc/qdisc.c
index da0f43f7d2..57f0890099 100644
--- a/src/network/tc/qdisc.c
+++ b/src/network/tc/qdisc.c
@@ -27,6 +27,7 @@ const QDiscVTable * const qdisc_vtable[_QDISC_KIND_MAX] = {
[QDISC_KIND_NETEM] = &netem_vtable,
[QDISC_KIND_PIE] = &pie_vtable,
[QDISC_KIND_PFIFO] = &pfifo_vtable,
+ [QDISC_KIND_PFIFO_FAST] = &pfifo_fast_vtable,
[QDISC_KIND_PFIFO_HEAD_DROP] = &pfifo_head_drop_vtable,
[QDISC_KIND_SFB] = &sfb_vtable,
[QDISC_KIND_SFQ] = &sfq_vtable,
diff --git a/src/network/tc/qdisc.h b/src/network/tc/qdisc.h
index 8f348d69e3..0d606bf824 100644
--- a/src/network/tc/qdisc.h
+++ b/src/network/tc/qdisc.h
@@ -19,6 +19,7 @@ typedef enum QDiscKind {
QDISC_KIND_HTB,
QDISC_KIND_NETEM,
QDISC_KIND_PFIFO,
+ QDISC_KIND_PFIFO_FAST,
QDISC_KIND_PFIFO_HEAD_DROP,
QDISC_KIND_PIE,
QDISC_KIND_SFB,