1 --- a/include/linux/pkt_sched.h
2 +++ b/include/linux/pkt_sched.h
3 @@ -850,4 +850,63 @@ struct tc_pie_xstats {
4 __u32 maxq; /* maximum queue size */
5 __u32 ecn_mark; /* packets marked with ecn*/
12 + TCA_CAKE_DIFFSERV_MODE,
25 + TCA_CAKE_ACK_FILTER,
28 +#define TCA_CAKE_MAX (__TCA_CAKE_MAX - 1)
30 +struct tc_cake_traffic_stats {
36 +#define TC_CAKE_MAX_TINS (8)
37 +struct tc_cake_xstats {
38 + __u16 version; /* == 5, increments when struct extended */
39 + __u8 max_tins; /* == TC_CAKE_MAX_TINS */
40 + __u8 tin_cnt; /* <= TC_CAKE_MAX_TINS */
42 + __u32 threshold_rate [TC_CAKE_MAX_TINS];
43 + __u32 target_us [TC_CAKE_MAX_TINS];
44 + struct tc_cake_traffic_stats sent [TC_CAKE_MAX_TINS];
45 + struct tc_cake_traffic_stats dropped [TC_CAKE_MAX_TINS];
46 + struct tc_cake_traffic_stats ecn_marked[TC_CAKE_MAX_TINS];
47 + struct tc_cake_traffic_stats backlog [TC_CAKE_MAX_TINS];
48 + __u32 interval_us [TC_CAKE_MAX_TINS];
49 + __u32 way_indirect_hits[TC_CAKE_MAX_TINS];
50 + __u32 way_misses [TC_CAKE_MAX_TINS];
51 + __u32 way_collisions [TC_CAKE_MAX_TINS];
52 + __u32 peak_delay_us [TC_CAKE_MAX_TINS]; /* ~= bulk flow delay */
53 + __u32 avge_delay_us [TC_CAKE_MAX_TINS];
54 + __u32 base_delay_us [TC_CAKE_MAX_TINS]; /* ~= sparse flows delay */
55 + __u16 sparse_flows [TC_CAKE_MAX_TINS];
56 + __u16 bulk_flows [TC_CAKE_MAX_TINS];
57 + __u16 unresponse_flows [TC_CAKE_MAX_TINS]; /* v4 - was u32 last_len */
58 + __u16 spare [TC_CAKE_MAX_TINS]; /* v4 - split last_len */
59 + __u32 max_skblen [TC_CAKE_MAX_TINS];
60 + __u32 capacity_estimate; /* version 2 */
61 + __u32 memory_limit; /* version 3 */
62 + __u32 memory_used; /* version 3 */
63 + struct tc_cake_traffic_stats ack_drops [TC_CAKE_MAX_TINS]; /* v5 */
69 @@ -63,6 +63,7 @@ TCMODULES += q_codel.o
70 TCMODULES += q_fq_codel.o
73 +TCMODULES += q_cake.o
81 + * Common Applications Kept Enhanced -- CAKE
83 + * Copyright (C) 2014-2015 Jonathan Morton <chromatix99@gmail.com>
85 + * Redistribution and use in source and binary forms, with or without
86 + * modification, are permitted provided that the following conditions
88 + * 1. Redistributions of source code must retain the above copyright
89 + * notice, this list of conditions, and the following disclaimer,
90 + * without modification.
91 + * 2. Redistributions in binary form must reproduce the above copyright
92 + * notice, this list of conditions and the following disclaimer in the
93 + * documentation and/or other materials provided with the distribution.
94 + * 3. The names of the authors may not be used to endorse or promote products
95 + * derived from this software without specific prior written permission.
97 + * Alternatively, provided that this notice is retained in full, this
98 + * software may be distributed under the terms of the GNU General
99 + * Public License ("GPL") version 2, in which case the provisions of the
100 + * GPL apply INSTEAD OF those given above.
102 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
103 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
104 + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
105 + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
106 + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
107 + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
108 + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
109 + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
110 + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
111 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
112 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
123 +#include <sys/socket.h>
124 +#include <netinet/in.h>
125 +#include <arpa/inet.h>
129 +#include "tc_util.h"
131 +static void explain(void)
134 +"Usage: ... cake [ bandwidth RATE | unlimited* | autorate_ingress ]\n"
135 +" [ rtt TIME | datacentre | lan | metro | regional |\n"
136 +" internet* | oceanic | satellite | interplanetary ]\n"
137 +" [ besteffort | diffserv8 | diffserv4 | diffserv-llt |\n"
139 +" [ flowblind | srchost | dsthost | hosts | flows |\n"
140 +" dual-srchost | dual-dsthost | triple-isolate* ]\n"
141 +" [ nat | nonat* ]\n"
142 +" [ wash | nowash * ]\n"
143 +" [ ack-filter | ack-filter-aggressive | no-ack-filter * ]\n"
144 +" [ memlimit LIMIT ]\n"
145 +" [ ptm | atm | noatm* ] [ overhead N | conservative | raw* ]\n"
146 +" [ mpu N ] [ ingress | egress* ]\n"
147 +" (* marks defaults)\n");
150 +static int cake_parse_opt(struct qdisc_util *qu, int argc, char **argv,
151 + struct nlmsghdr *n)
154 + unsigned bandwidth = 0;
155 + unsigned interval = 0;
156 + unsigned target = 0;
157 + unsigned diffserv = 0;
158 + unsigned memlimit = 0;
160 + bool overhead_set = false;
161 + bool overhead_override = false;
169 + int ack_filter = -1;
170 + struct rtattr *tail;
173 + if (strcmp(*argv, "bandwidth") == 0) {
175 + if (get_rate(&bandwidth, *argv)) {
176 + fprintf(stderr, "Illegal \"bandwidth\"\n");
181 + } else if (strcmp(*argv, "unlimited") == 0) {
185 + } else if (strcmp(*argv, "autorate_ingress") == 0) {
188 + } else if (strcmp(*argv, "rtt") == 0) {
190 + if (get_time(&interval, *argv)) {
191 + fprintf(stderr, "Illegal \"rtt\"\n");
194 + target = interval / 20;
197 + } else if (strcmp(*argv, "datacentre") == 0) {
200 + } else if (strcmp(*argv, "lan") == 0) {
203 + } else if (strcmp(*argv, "metro") == 0) {
206 + } else if (strcmp(*argv, "regional") == 0) {
209 + } else if (strcmp(*argv, "internet") == 0) {
212 + } else if (strcmp(*argv, "oceanic") == 0) {
215 + } else if (strcmp(*argv, "satellite") == 0) {
216 + interval = 1000000;
218 + } else if (strcmp(*argv, "interplanetary") == 0) {
219 + interval = 3600000000U;
222 + } else if (strcmp(*argv, "besteffort") == 0) {
224 + } else if (strcmp(*argv, "precedence") == 0) {
226 + } else if (strcmp(*argv, "diffserv8") == 0) {
228 + } else if (strcmp(*argv, "diffserv4") == 0) {
230 + } else if (strcmp(*argv, "diffserv") == 0) {
232 + } else if (strcmp(*argv, "diffserv-llt") == 0) {
234 + } else if (strcmp(*argv, "diffserv3") == 0) {
237 + } else if (strcmp(*argv, "nowash") == 0) {
239 + } else if (strcmp(*argv, "wash") == 0) {
242 + } else if (strcmp(*argv, "flowblind") == 0) {
244 + } else if (strcmp(*argv, "srchost") == 0) {
246 + } else if (strcmp(*argv, "dsthost") == 0) {
248 + } else if (strcmp(*argv, "hosts") == 0) {
250 + } else if (strcmp(*argv, "flows") == 0) {
252 + } else if (strcmp(*argv, "dual-srchost") == 0) {
254 + } else if (strcmp(*argv, "dual-dsthost") == 0) {
256 + } else if (strcmp(*argv, "triple-isolate") == 0) {
259 + } else if (strcmp(*argv, "nat") == 0) {
261 + } else if (strcmp(*argv, "nonat") == 0) {
264 + } else if (strcmp(*argv, "ptm") == 0) {
266 + } else if (strcmp(*argv, "atm") == 0) {
268 + } else if (strcmp(*argv, "noatm") == 0) {
271 + } else if (strcmp(*argv, "raw") == 0) {
274 + overhead_set = true;
275 + overhead_override = true;
276 + } else if (strcmp(*argv, "conservative") == 0) {
278 + * Deliberately over-estimate overhead:
279 + * one whole ATM cell plus ATM framing.
280 + * A safe choice if the actual overhead is unknown.
284 + overhead_set = true;
286 + /* Various ADSL framing schemes, all over ATM cells */
287 + } else if (strcmp(*argv, "ipoa-vcmux") == 0) {
290 + overhead_set = true;
291 + } else if (strcmp(*argv, "ipoa-llcsnap") == 0) {
294 + overhead_set = true;
295 + } else if (strcmp(*argv, "bridged-vcmux") == 0) {
298 + overhead_set = true;
299 + } else if (strcmp(*argv, "bridged-llcsnap") == 0) {
302 + overhead_set = true;
303 + } else if (strcmp(*argv, "pppoa-vcmux") == 0) {
306 + overhead_set = true;
307 + } else if (strcmp(*argv, "pppoa-llc") == 0) {
310 + overhead_set = true;
311 + } else if (strcmp(*argv, "pppoe-vcmux") == 0) {
314 + overhead_set = true;
315 + } else if (strcmp(*argv, "pppoe-llcsnap") == 0) {
318 + overhead_set = true;
320 + /* Typical VDSL2 framing schemes, both over PTM */
321 + /* PTM has 64b/65b coding which absorbs some bandwidth */
322 + } else if (strcmp(*argv, "pppoe-ptm") == 0) {
323 + /* 2B PPP + 6B PPPoE + 6B dest MAC + 6B src MAC
324 + * + 2B ethertype + 4B Frame Check Sequence
325 + * + 1B Start of Frame (S) + 1B End of Frame (Ck)
326 + * + 2B TC-CRC (PTM-FCS) = 30B
330 + overhead_set = true;
331 + } else if (strcmp(*argv, "bridged-ptm") == 0) {
332 + /* 6B dest MAC + 6B src MAC + 2B ethertype
333 + * + 4B Frame Check Sequence
334 + * + 1B Start of Frame (S) + 1B End of Frame (Ck)
335 + * + 2B TC-CRC (PTM-FCS) = 22B
339 + overhead_set = true;
341 + } else if (strcmp(*argv, "via-ethernet") == 0) {
343 + * We used to use this flag to manually compensate for
344 + * Linux including the Ethernet header on Ethernet-type
345 + * interfaces, but not on IP-type interfaces.
347 + * It is no longer needed, because Cake now adjusts for
348 + * that automatically, and is thus ignored.
350 + * It would be deleted entirely, but it appears in the
351 + * stats output when the automatic compensation is
355 + } else if (strcmp(*argv, "total_overhead") == 0) {
357 + * This is the overhead cake accounts for; added here so
358 + * that cake's "tc -s qdisc" output can be directly
359 + * pasted into the tc command to instantate a new cake..
363 + } else if (strcmp(*argv, "hard_header_len") == 0) {
365 + * This is the overhead the kernel automatically
366 + * accounted for; added here so that cake's "tc -s
367 + * qdisc" output can be directly pasted into the tc
368 + * command to instantiate a new cake..
372 + } else if (strcmp(*argv, "ethernet") == 0) {
373 + /* ethernet pre-amble & interframe gap & FCS
374 + * you may need to add vlan tag */
376 + overhead_set = true;
379 + /* Additional Ethernet-related overhead used by some ISPs */
380 + } else if (strcmp(*argv, "ether-vlan") == 0) {
381 + /* 802.1q VLAN tag - may be repeated */
383 + overhead_set = true;
386 + * DOCSIS cable shapers account for Ethernet frame with FCS,
387 + * but not interframe gap or preamble.
389 + } else if (strcmp(*argv, "docsis") == 0) {
392 + overhead_set = true;
395 + } else if (strcmp(*argv, "overhead") == 0) {
398 + overhead = strtol(*argv, &p, 10);
399 + if(!p || *p || !*argv || overhead < -64 || overhead > 256) {
400 + fprintf(stderr, "Illegal \"overhead\", valid range is -64 to 256\\n");
403 + overhead_set = true;
405 + } else if (strcmp(*argv, "mpu") == 0) {
408 + mpu = strtol(*argv, &p, 10);
409 + if(!p || *p || !*argv || mpu < 0 || mpu > 256) {
410 + fprintf(stderr, "Illegal \"mpu\", valid range is 0 to 256\\n");
414 + } else if (strcmp(*argv, "ingress") == 0) {
416 + } else if (strcmp(*argv, "egress") == 0) {
419 + } else if (strcmp(*argv, "no-ack-filter") == 0) {
421 + } else if (strcmp(*argv, "ack-filter") == 0) {
422 + ack_filter = 0x0200;
423 + } else if (strcmp(*argv, "ack-filter-aggressive") == 0) {
424 + ack_filter = 0x0600;
426 + } else if (strcmp(*argv, "memlimit") == 0) {
428 + if(get_size(&memlimit, *argv)) {
429 + fprintf(stderr, "Illegal value for \"memlimit\": \"%s\"\n", *argv);
433 + } else if (strcmp(*argv, "help") == 0) {
437 + fprintf(stderr, "What is \"%s\"?\n", *argv);
444 + tail = NLMSG_TAIL(n);
445 + addattr_l(n, 1024, TCA_OPTIONS, NULL, 0);
446 + if (bandwidth || unlimited)
447 + addattr_l(n, 1024, TCA_CAKE_BASE_RATE, &bandwidth, sizeof(bandwidth));
449 + addattr_l(n, 1024, TCA_CAKE_DIFFSERV_MODE, &diffserv, sizeof(diffserv));
451 + addattr_l(n, 1024, TCA_CAKE_ATM, &atm, sizeof(atm));
452 + if (flowmode != -1)
453 + addattr_l(n, 1024, TCA_CAKE_FLOW_MODE, &flowmode, sizeof(flowmode));
455 + addattr_l(n, 1024, TCA_CAKE_OVERHEAD, &overhead, sizeof(overhead));
456 + if (overhead_override) {
458 + addattr_l(n, 1024, TCA_CAKE_ETHERNET, &zero, sizeof(zero));
461 + addattr_l(n, 1024, TCA_CAKE_MPU, &mpu, sizeof(mpu));
463 + addattr_l(n, 1024, TCA_CAKE_RTT, &interval, sizeof(interval));
465 + addattr_l(n, 1024, TCA_CAKE_TARGET, &target, sizeof(target));
466 + if (autorate != -1)
467 + addattr_l(n, 1024, TCA_CAKE_AUTORATE, &autorate, sizeof(autorate));
469 + addattr_l(n, 1024, TCA_CAKE_MEMORY, &memlimit, sizeof(memlimit));
471 + addattr_l(n, 1024, TCA_CAKE_NAT, &nat, sizeof(nat));
473 + addattr_l(n, 1024, TCA_CAKE_WASH, &wash, sizeof(wash));
475 + addattr_l(n, 1024, TCA_CAKE_INGRESS, &ingress, sizeof(ingress));
476 + if (ack_filter != -1)
477 + addattr_l(n, 1024, TCA_CAKE_ACK_FILTER, &ack_filter, sizeof(ack_filter));
479 + tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
484 +static int cake_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
486 + struct rtattr *tb[TCA_CAKE_MAX + 1];
487 + unsigned bandwidth = 0;
488 + unsigned diffserv = 0;
489 + unsigned flowmode = 0;
490 + unsigned interval = 0;
491 + unsigned memlimit = 0;
500 + int ack_filter = 0;
507 + parse_rtattr_nested(tb, TCA_CAKE_MAX, opt);
509 + if (tb[TCA_CAKE_BASE_RATE] &&
510 + RTA_PAYLOAD(tb[TCA_CAKE_BASE_RATE]) >= sizeof(__u32)) {
511 + bandwidth = rta_getattr_u32(tb[TCA_CAKE_BASE_RATE]);
513 + fprintf(f, "bandwidth %s ", sprint_rate(bandwidth, b1));
515 + fprintf(f, "unlimited ");
517 + if (tb[TCA_CAKE_AUTORATE] &&
518 + RTA_PAYLOAD(tb[TCA_CAKE_AUTORATE]) >= sizeof(__u32)) {
519 + autorate = rta_getattr_u32(tb[TCA_CAKE_AUTORATE]);
521 + fprintf(f, "autorate_ingress ");
523 + fprintf(f, "(?autorate?) ");
525 + if (tb[TCA_CAKE_DIFFSERV_MODE] &&
526 + RTA_PAYLOAD(tb[TCA_CAKE_DIFFSERV_MODE]) >= sizeof(__u32)) {
527 + diffserv = rta_getattr_u32(tb[TCA_CAKE_DIFFSERV_MODE]);
530 + fprintf(f, "besteffort ");
533 + fprintf(f, "precedence ");
536 + fprintf(f, "diffserv8 ");
539 + fprintf(f, "diffserv4 ");
542 + fprintf(f, "diffserv-llt ");
545 + fprintf(f, "diffserv3 ");
548 + fprintf(f, "(?diffserv?) ");
552 + if (tb[TCA_CAKE_FLOW_MODE] &&
553 + RTA_PAYLOAD(tb[TCA_CAKE_FLOW_MODE]) >= sizeof(__u32)) {
554 + flowmode = rta_getattr_u32(tb[TCA_CAKE_FLOW_MODE]);
555 + nat = !!(flowmode & 64);
559 + fprintf(f, "flowblind ");
562 + fprintf(f, "srchost ");
565 + fprintf(f, "dsthost ");
568 + fprintf(f, "hosts ");
571 + fprintf(f, "flows ");
574 + fprintf(f, "dual-srchost ");
577 + fprintf(f, "dual-dsthost ");
580 + fprintf(f, "triple-isolate ");
583 + fprintf(f, "(?flowmode?) ");
588 + fprintf(f, "nat ");
590 + if (tb[TCA_CAKE_WASH] &&
591 + RTA_PAYLOAD(tb[TCA_CAKE_WASH]) >= sizeof(__u32)) {
592 + wash = rta_getattr_u32(tb[TCA_CAKE_WASH]);
594 + if (tb[TCA_CAKE_ATM] &&
595 + RTA_PAYLOAD(tb[TCA_CAKE_ATM]) >= sizeof(__u32)) {
596 + atm = rta_getattr_u32(tb[TCA_CAKE_ATM]);
598 + if (tb[TCA_CAKE_OVERHEAD] &&
599 + RTA_PAYLOAD(tb[TCA_CAKE_OVERHEAD]) >= sizeof(__u32)) {
600 + overhead = rta_getattr_u32(tb[TCA_CAKE_OVERHEAD]);
602 + if (tb[TCA_CAKE_MPU] &&
603 + RTA_PAYLOAD(tb[TCA_CAKE_MPU]) >= sizeof(__u32)) {
604 + mpu = rta_getattr_u32(tb[TCA_CAKE_MPU]);
606 + if (tb[TCA_CAKE_INGRESS] &&
607 + RTA_PAYLOAD(tb[TCA_CAKE_INGRESS]) >= sizeof(__u32)) {
608 + ingress = rta_getattr_u32(tb[TCA_CAKE_INGRESS]);
610 + if (tb[TCA_CAKE_ACK_FILTER] &&
611 + RTA_PAYLOAD(tb[TCA_CAKE_ACK_FILTER]) >= sizeof(__u32)) {
612 + ack_filter = rta_getattr_u32(tb[TCA_CAKE_ACK_FILTER]);
614 + if (tb[TCA_CAKE_ETHERNET] &&
615 + RTA_PAYLOAD(tb[TCA_CAKE_ETHERNET]) >= sizeof(__u32)) {
616 + ethernet = rta_getattr_u32(tb[TCA_CAKE_ETHERNET]);
618 + if (tb[TCA_CAKE_RTT] &&
619 + RTA_PAYLOAD(tb[TCA_CAKE_RTT]) >= sizeof(__u32)) {
620 + interval = rta_getattr_u32(tb[TCA_CAKE_RTT]);
624 + fprintf(f,"wash ");
627 + fprintf(f,"ingress ");
629 + if (ack_filter == 0x0600)
630 + fprintf(f,"ack-filter-aggressive ");
631 + else if (ack_filter)
632 + fprintf(f,"ack-filter ");
635 + fprintf(f, "rtt %s ", sprint_time(interval, b2));
637 + if (!atm && overhead == ethernet) {
638 + fprintf(f, "raw ");
641 + fprintf(f, "atm ");
643 + fprintf(f, "ptm ");
645 + fprintf(f, "noatm ");
647 + fprintf(f, "overhead %d ", overhead);
649 + /* This is actually the *amount* of automatic compensation, but
650 + * we only report its presence as a boolean for now.
653 + fprintf(f, "via-ethernet ");
656 + /* unconditionally report the overhead and hard_header_len overhead the
657 + * kernel added automatically
659 + fprintf(f, "total_overhead %d ", overhead);
660 + fprintf(f, "hard_header_len %d ", ethernet);
663 + fprintf(f, "mpu %d ", mpu);
667 + fprintf(f, "memlimit %s", sprint_size(memlimit, b1));
672 +static int cake_print_xstats(struct qdisc_util *qu, FILE *f,
673 + struct rtattr *xstats)
675 + /* fq_codel stats format borrowed */
676 + struct tc_fq_codel_xstats *st;
677 + struct tc_cake_xstats *stnc;
681 + if (xstats == NULL)
684 + if (RTA_PAYLOAD(xstats) < sizeof(st->type))
687 + st = RTA_DATA(xstats);
688 + stnc = RTA_DATA(xstats);
690 + if (st->type == TCA_FQ_CODEL_XSTATS_QDISC && RTA_PAYLOAD(xstats) >= sizeof(*st)) {
691 + fprintf(f, " maxpacket %u drop_overlimit %u new_flow_count %u ecn_mark %u",
692 + st->qdisc_stats.maxpacket,
693 + st->qdisc_stats.drop_overlimit,
694 + st->qdisc_stats.new_flow_count,
695 + st->qdisc_stats.ecn_mark);
696 + fprintf(f, "\n new_flows_len %u old_flows_len %u",
697 + st->qdisc_stats.new_flows_len,
698 + st->qdisc_stats.old_flows_len);
699 + } else if (st->type == TCA_FQ_CODEL_XSTATS_CLASS && RTA_PAYLOAD(xstats) >= sizeof(*st)) {
700 + fprintf(f, " deficit %d count %u lastcount %u ldelay %s",
701 + st->class_stats.deficit,
702 + st->class_stats.count,
703 + st->class_stats.lastcount,
704 + sprint_time(st->class_stats.ldelay, b1));
705 + if (st->class_stats.dropping) {
706 + fprintf(f, " dropping");
707 + if (st->class_stats.drop_next < 0)
708 + fprintf(f, " drop_next -%s",
709 + sprint_time(-st->class_stats.drop_next, b1));
711 + fprintf(f, " drop_next %s",
712 + sprint_time(st->class_stats.drop_next, b1));
714 + } else if (stnc->version >= 1 && stnc->version < 0xFF
715 + && stnc->max_tins == TC_CAKE_MAX_TINS
716 + && RTA_PAYLOAD(xstats) >= offsetof(struct tc_cake_xstats, capacity_estimate))
720 + if(stnc->version >= 3)
721 + fprintf(f, " memory used: %s of %s\n", sprint_size(stnc->memory_used, b1), sprint_size(stnc->memory_limit, b2));
723 + if(stnc->version >= 2)
724 + fprintf(f, " capacity estimate: %s\n", sprint_rate(stnc->capacity_estimate, b1));
726 + switch(stnc->tin_cnt) {
728 + fprintf(f, " Bulk Best Effort Voice\n");
732 + fprintf(f, " Bulk Best Effort Video Voice\n");
736 + fprintf(f, " Low Loss Best Effort Low Delay Bulk Net Control\n");
741 + for(i=0; i < stnc->tin_cnt; i++)
742 + fprintf(f, " Tin %u", i);
746 + fprintf(f, " thresh ");
747 + for(i=0; i < stnc->tin_cnt; i++)
748 + fprintf(f, " %12s", sprint_rate(stnc->threshold_rate[i], b1));
751 + fprintf(f, " target ");
752 + for(i=0; i < stnc->tin_cnt; i++)
753 + fprintf(f, " %12s", sprint_time(stnc->target_us[i], b1));
756 + fprintf(f, " interval");
757 + for(i=0; i < stnc->tin_cnt; i++)
758 + fprintf(f, " %12s", sprint_time(stnc->interval_us[i], b1));
761 + fprintf(f, " pk_delay");
762 + for(i=0; i < stnc->tin_cnt; i++)
763 + fprintf(f, " %12s", sprint_time(stnc->peak_delay_us[i], b1));
766 + fprintf(f, " av_delay");
767 + for(i=0; i < stnc->tin_cnt; i++)
768 + fprintf(f, " %12s", sprint_time(stnc->avge_delay_us[i], b1));
771 + fprintf(f, " sp_delay");
772 + for(i=0; i < stnc->tin_cnt; i++)
773 + fprintf(f, " %12s", sprint_time(stnc->base_delay_us[i], b1));
776 + fprintf(f, " pkts ");
777 + for(i=0; i < stnc->tin_cnt; i++)
778 + fprintf(f, " %12u", stnc->sent[i].packets);
781 + fprintf(f, " bytes ");
782 + for(i=0; i < stnc->tin_cnt; i++)
783 + fprintf(f, " %12llu", stnc->sent[i].bytes);
786 + fprintf(f, " way_inds");
787 + for(i=0; i < stnc->tin_cnt; i++)
788 + fprintf(f, " %12u", stnc->way_indirect_hits[i]);
791 + fprintf(f, " way_miss");
792 + for(i=0; i < stnc->tin_cnt; i++)
793 + fprintf(f, " %12u", stnc->way_misses[i]);
796 + fprintf(f, " way_cols");
797 + for(i=0; i < stnc->tin_cnt; i++)
798 + fprintf(f, " %12u", stnc->way_collisions[i]);
801 + fprintf(f, " drops ");
802 + for(i=0; i < stnc->tin_cnt; i++)
803 + fprintf(f, " %12u", stnc->dropped[i].packets);
806 + fprintf(f, " marks ");
807 + for(i=0; i < stnc->tin_cnt; i++)
808 + fprintf(f, " %12u", stnc->ecn_marked[i].packets);
811 + if(stnc->version >= 5) {
812 + fprintf(f, " ack_drop");
813 + for(i=0; i < stnc->tin_cnt; i++)
814 + fprintf(f, " %12u", stnc->ack_drops[i].packets);
818 + fprintf(f, " sp_flows");
819 + for(i=0; i < stnc->tin_cnt; i++)
820 + fprintf(f, " %12u", stnc->sparse_flows[i]);
823 + fprintf(f, " bk_flows");
824 + for(i=0; i < stnc->tin_cnt; i++)
825 + fprintf(f, " %12u", stnc->bulk_flows[i]);
828 + if(stnc->version >= 4) {
829 + fprintf(f, " un_flows");
830 + for(i=0; i < stnc->tin_cnt; i++)
831 + fprintf(f, " %12u", stnc->unresponse_flows[i]);
835 + fprintf(f, " max_len ");
836 + for(i=0; i < stnc->tin_cnt; i++)
837 + fprintf(f, " %12u", stnc->max_skblen[i]);
845 +struct qdisc_util cake_qdisc_util = {
847 + .parse_qopt = cake_parse_opt,
848 + .print_qopt = cake_print_opt,
849 + .print_xstats = cake_print_xstats,