]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
sch_cake: Make gso-splitting configurable
authorToke Høiland-Jørgensen <toke@toke.dk>
Mon, 13 Aug 2018 11:36:17 +0000 (13:36 +0200)
committerDavid Ahern <dsahern@gmail.com>
Mon, 13 Aug 2018 14:41:44 +0000 (07:41 -0700)
This patch makes sch_cake's gso/gro splitting configurable
from userspace.

To disable breaking apart superpackets in sch_cake:

tc qdisc replace dev whatever root cake no-split-gso

to enable:

tc qdisc replace dev whatever root cake split-gso

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
Signed-off-by: Dave Taht <dave.taht@gmail.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
man/man8/tc-cake.8
tc/q_cake.c

index bc595c9c774cdcf6f7c1858a00b4690f7c80f890..c1e751d68d8d6c9a86d981e17fa1e393454d4a88 100644 (file)
@@ -73,6 +73,12 @@ TIME |
 ]
 .br
 [
+.BR split-gso*
+|
+.BR no-split-gso
+]
+.br
+[
 .BR ack-filter
 |
 .BR ack-filter-aggressive
@@ -546,6 +552,23 @@ If you are shaping inbound, and cannot trust the diffserv markings (as is the
 case for Comcast Cable, among others), it is best to use a single queue
 "besteffort" mode with wash.
 
+.PP
+.B split-gso
+
+.br
+       This option controls whether CAKE will split General Segmentation
+Offload (GSO) super-packets into their on-the-wire components and
+dequeue them individually.
+
+.br
+Super-packets are created by the networking stack to improve efficiency.
+However, because they are larger they take longer to dequeue, which
+translates to higher latency for competing flows, especially at lower
+bandwidths. CAKE defaults to splitting GSO packets to achieve the lowest
+possible latency. At link speeds higher than 10 Gbps, setting the
+no-split-gso parameter can increase the maximum achievable throughput by
+retaining the full GSO packets.
+
 .SH EXAMPLES
 # tc qdisc delete root dev eth0
 .br
index f1e232a6bb8fad86de97a555ad2d30a70aae8345..50de46a702645c77c4f4be071c444ec999b3991f 100644 (file)
@@ -79,6 +79,7 @@ static void explain(void)
 "                  dual-srchost | dual-dsthost | triple-isolate* ]\n"
 "                [ nat | nonat* ]\n"
 "                [ wash | nowash* ]\n"
+"                [ split-gso* | no-split-gso ]\n"
 "                [ ack-filter | ack-filter-aggressive | no-ack-filter* ]\n"
 "                [ memlimit LIMIT ]\n"
 "                [ ptm | atm | noatm* ] [ overhead N | conservative | raw* ]\n"
@@ -99,6 +100,7 @@ static int cake_parse_opt(struct qdisc_util *qu, int argc, char **argv,
        __u64 bandwidth = 0;
        int ack_filter = -1;
        struct rtattr *tail;
+       int split_gso = -1;
        int unlimited = 0;
        int flowmode = -1;
        int autorate = -1;
@@ -155,6 +157,10 @@ static int cake_parse_opt(struct qdisc_util *qu, int argc, char **argv,
                        wash = 0;
                } else if (strcmp(*argv, "wash") == 0) {
                        wash = 1;
+               } else if (strcmp(*argv, "split-gso") == 0) {
+                       split_gso = 1;
+               } else if (strcmp(*argv, "no-split-gso") == 0) {
+                       split_gso = 0;
                } else if (strcmp(*argv, "flowblind") == 0) {
                        flowmode = CAKE_FLOW_NONE;
                } else if (strcmp(*argv, "srchost") == 0) {
@@ -374,6 +380,9 @@ static int cake_parse_opt(struct qdisc_util *qu, int argc, char **argv,
                addattr_l(n, 1024, TCA_CAKE_NAT, &nat, sizeof(nat));
        if (wash != -1)
                addattr_l(n, 1024, TCA_CAKE_WASH, &wash, sizeof(wash));
+       if (split_gso != -1)
+               addattr_l(n, 1024, TCA_CAKE_SPLIT_GSO, &split_gso,
+                         sizeof(split_gso));
        if (ingress != -1)
                addattr_l(n, 1024, TCA_CAKE_INGRESS, &ingress, sizeof(ingress));
        if (ack_filter != -1)