1 diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
2 index 8d2530d..028b83c 100644
3 --- a/include/linux/pkt_sched.h
4 +++ b/include/linux/pkt_sched.h
5 @@ -850,4 +850,59 @@ struct tc_pie_xstats {
6 __u32 maxq; /* maximum queue size */
7 __u32 ecn_mark; /* packets marked with ecn*/
14 + TCA_CAKE_DIFFSERV_MODE,
27 +#define TCA_CAKE_MAX (__TCA_CAKE_MAX - 1)
29 +struct tc_cake_traffic_stats {
35 +#define TC_CAKE_MAX_TINS (8)
36 +struct tc_cake_xstats {
37 + __u16 version; /* == 4, increments when struct extended */
38 + __u8 max_tins; /* == TC_CAKE_MAX_TINS */
39 + __u8 tin_cnt; /* <= TC_CAKE_MAX_TINS */
41 + __u32 threshold_rate [TC_CAKE_MAX_TINS];
42 + __u32 target_us [TC_CAKE_MAX_TINS];
43 + struct tc_cake_traffic_stats sent [TC_CAKE_MAX_TINS];
44 + struct tc_cake_traffic_stats dropped [TC_CAKE_MAX_TINS];
45 + struct tc_cake_traffic_stats ecn_marked[TC_CAKE_MAX_TINS];
46 + struct tc_cake_traffic_stats backlog [TC_CAKE_MAX_TINS];
47 + __u32 interval_us [TC_CAKE_MAX_TINS];
48 + __u32 way_indirect_hits[TC_CAKE_MAX_TINS];
49 + __u32 way_misses [TC_CAKE_MAX_TINS];
50 + __u32 way_collisions [TC_CAKE_MAX_TINS];
51 + __u32 peak_delay_us [TC_CAKE_MAX_TINS]; /* ~= delay to bulk flows */
52 + __u32 avge_delay_us [TC_CAKE_MAX_TINS];
53 + __u32 base_delay_us [TC_CAKE_MAX_TINS]; /* ~= delay to sparse flows */
54 + __u16 sparse_flows [TC_CAKE_MAX_TINS];
55 + __u16 bulk_flows [TC_CAKE_MAX_TINS];
56 + __u16 unresponse_flows [TC_CAKE_MAX_TINS]; /* v4 - was u32 last_len */
57 + __u16 spare [TC_CAKE_MAX_TINS]; /* v4 - split last_len */
58 + __u32 max_skblen [TC_CAKE_MAX_TINS];
59 + __u32 capacity_estimate; /* version 2 */
60 + __u32 memory_limit; /* version 3 */
61 + __u32 memory_used; /* version 3 */
65 diff --git a/tc/Makefile b/tc/Makefile
66 index 56acbaa..d421b8e 100644
69 @@ -63,6 +63,7 @@ TCMODULES += q_codel.o
70 TCMODULES += q_fq_codel.o
73 +TCMODULES += q_cake.o
77 diff --git a/tc/q_cake.c b/tc/q_cake.c
79 index 0000000..14e5aab
84 + * Common Applications Kept Enhanced -- CAKE
86 + * Copyright (C) 2014-2015 Jonathan Morton <chromatix99@gmail.com>
88 + * Redistribution and use in source and binary forms, with or without
89 + * modification, are permitted provided that the following conditions
91 + * 1. Redistributions of source code must retain the above copyright
92 + * notice, this list of conditions, and the following disclaimer,
93 + * without modification.
94 + * 2. Redistributions in binary form must reproduce the above copyright
95 + * notice, this list of conditions and the following disclaimer in the
96 + * documentation and/or other materials provided with the distribution.
97 + * 3. The names of the authors may not be used to endorse or promote products
98 + * derived from this software without specific prior written permission.
100 + * Alternatively, provided that this notice is retained in full, this
101 + * software may be distributed under the terms of the GNU General
102 + * Public License ("GPL") version 2, in which case the provisions of the
103 + * GPL apply INSTEAD OF those given above.
105 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
106 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
107 + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
108 + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
109 + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
110 + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
111 + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
112 + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
113 + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
114 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
115 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
126 +#include <sys/socket.h>
127 +#include <netinet/in.h>
128 +#include <arpa/inet.h>
132 +#include "tc_util.h"
134 +static void explain(void)
136 + fprintf(stderr, "Usage: ... cake [ bandwidth RATE | unlimited* | autorate_ingress ]\n"
137 + " [ rtt TIME | datacentre | lan | metro | regional | internet* | oceanic | satellite | interplanetary ]\n"
138 + " [ besteffort | precedence | diffserv8 | diffserv4* ]\n"
139 + " [ flowblind | srchost | dsthost | hosts | flows* | dual-srchost | dual-dsthost | triple-isolate ] [ nat | nonat* ]\n"
140 + " [ ptm | atm | noatm* ] [ overhead N | conservative | raw* ]\n"
141 + " [ wash | nowash* ]\n"
142 + " [ memlimit LIMIT ]\n"
143 + " (* marks defaults)\n");
146 +static int cake_parse_opt(struct qdisc_util *qu, int argc, char **argv,
147 + struct nlmsghdr *n)
150 + unsigned bandwidth = 0;
151 + unsigned interval = 0;
152 + unsigned target = 0;
153 + unsigned diffserv = 0;
154 + unsigned memlimit = 0;
156 + bool overhead_set = false;
157 + bool overhead_override = false;
163 + struct rtattr *tail;
166 + if (strcmp(*argv, "bandwidth") == 0) {
168 + if (get_rate(&bandwidth, *argv)) {
169 + fprintf(stderr, "Illegal \"bandwidth\"\n");
174 + } else if (strcmp(*argv, "unlimited") == 0) {
178 + } else if (strcmp(*argv, "autorate_ingress") == 0) {
181 + } else if (strcmp(*argv, "rtt") == 0) {
183 + if (get_time(&interval, *argv)) {
184 + fprintf(stderr, "Illegal \"rtt\"\n");
187 + target = interval / 20;
190 + } else if (strcmp(*argv, "datacentre") == 0) {
193 + } else if (strcmp(*argv, "lan") == 0) {
196 + } else if (strcmp(*argv, "metro") == 0) {
199 + } else if (strcmp(*argv, "regional") == 0) {
202 + } else if (strcmp(*argv, "internet") == 0) {
205 + } else if (strcmp(*argv, "oceanic") == 0) {
208 + } else if (strcmp(*argv, "satellite") == 0) {
209 + interval = 1000000;
211 + } else if (strcmp(*argv, "interplanetary") == 0) {
212 + interval = 3600000000U;
215 + } else if (strcmp(*argv, "besteffort") == 0) {
217 + } else if (strcmp(*argv, "precedence") == 0) {
219 + } else if (strcmp(*argv, "diffserv8") == 0) {
221 + } else if (strcmp(*argv, "diffserv4") == 0) {
223 + } else if (strcmp(*argv, "diffserv") == 0) {
225 + } else if (strcmp(*argv, "diffserv-llt") == 0) {
228 + } else if (strcmp(*argv, "nowash") == 0) {
230 + } else if (strcmp(*argv, "wash") == 0) {
233 + } else if (strcmp(*argv, "flowblind") == 0) {
235 + } else if (strcmp(*argv, "srchost") == 0) {
237 + } else if (strcmp(*argv, "dsthost") == 0) {
239 + } else if (strcmp(*argv, "hosts") == 0) {
241 + } else if (strcmp(*argv, "flows") == 0) {
243 + } else if (strcmp(*argv, "dual-srchost") == 0) {
245 + } else if (strcmp(*argv, "dual-dsthost") == 0) {
247 + } else if (strcmp(*argv, "triple-isolate") == 0) {
250 + } else if (strcmp(*argv, "nat") == 0) {
252 + } else if (strcmp(*argv, "nonat") == 0) {
255 + } else if (strcmp(*argv, "ptm") == 0) {
257 + } else if (strcmp(*argv, "atm") == 0) {
259 + } else if (strcmp(*argv, "noatm") == 0) {
262 + } else if (strcmp(*argv, "raw") == 0) {
265 + overhead_set = true;
266 + overhead_override = true;
267 + } else if (strcmp(*argv, "conservative") == 0) {
269 + * Deliberately over-estimate overhead:
270 + * one whole ATM cell plus ATM framing.
271 + * A safe choice if the actual overhead is unknown.
275 + overhead_set = true;
277 + /* Various ADSL framing schemes, all over ATM cells */
278 + } else if (strcmp(*argv, "ipoa-vcmux") == 0) {
281 + overhead_set = true;
282 + } else if (strcmp(*argv, "ipoa-llcsnap") == 0) {
285 + overhead_set = true;
286 + } else if (strcmp(*argv, "bridged-vcmux") == 0) {
289 + overhead_set = true;
290 + } else if (strcmp(*argv, "bridged-llcsnap") == 0) {
293 + overhead_set = true;
294 + } else if (strcmp(*argv, "pppoa-vcmux") == 0) {
297 + overhead_set = true;
298 + } else if (strcmp(*argv, "pppoa-llc") == 0) {
301 + overhead_set = true;
302 + } else if (strcmp(*argv, "pppoe-vcmux") == 0) {
305 + overhead_set = true;
306 + } else if (strcmp(*argv, "pppoe-llcsnap") == 0) {
309 + overhead_set = true;
311 + /* Typical VDSL2 framing schemes, both over PTM */
312 + /* PTM has 64b/65b coding which absorbs some bandwidth */
313 + } else if (strcmp(*argv, "pppoe-ptm") == 0) {
316 + overhead_set = true;
317 + } else if (strcmp(*argv, "bridged-ptm") == 0) {
320 + overhead_set = true;
322 + } else if (strcmp(*argv, "via-ethernet") == 0) {
324 + * We used to use this flag to manually compensate for
325 + * Linux including the Ethernet header on Ethernet-type
326 + * interfaces, but not on IP-type interfaces.
328 + * It is no longer needed, because Cake now adjusts for
329 + * that automatically, and is thus ignored.
331 + * It would be deleted entirely, but it appears in the
332 + * stats output when the automatic compensation is active.
335 + } else if (strcmp(*argv, "ethernet") == 0) {
336 + /* ethernet pre-amble & interframe gap & FCS
337 + * you may need to add vlan tag */
339 + overhead_set = true;
341 + /* Additional Ethernet-related overhead used by some ISPs */
342 + } else if (strcmp(*argv, "ether-vlan") == 0) {
343 + /* 802.1q VLAN tag - may be repeated */
345 + overhead_set = true;
348 + * DOCSIS cable shapers account for Ethernet frame with FCS,
349 + * but not interframe gap nor preamble.
351 + } else if (strcmp(*argv, "docsis") == 0) {
354 + overhead_set = true;
356 + } else if (strcmp(*argv, "overhead") == 0) {
359 + overhead = strtol(*argv, &p, 10);
360 + if(!p || *p || !*argv || overhead < -64 || overhead > 256) {
361 + fprintf(stderr, "Illegal \"overhead\", valid range is -64 to 256\\n");
364 + overhead_set = true;
366 + } else if (strcmp(*argv, "memlimit") == 0) {
368 + if(get_size(&memlimit, *argv)) {
369 + fprintf(stderr, "Illegal value for \"memlimit\": \"%s\"\n", *argv);
373 + } else if (strcmp(*argv, "help") == 0) {
377 + fprintf(stderr, "What is \"%s\"?\n", *argv);
384 + tail = NLMSG_TAIL(n);
385 + addattr_l(n, 1024, TCA_OPTIONS, NULL, 0);
386 + if (bandwidth || unlimited)
387 + addattr_l(n, 1024, TCA_CAKE_BASE_RATE, &bandwidth, sizeof(bandwidth));
389 + addattr_l(n, 1024, TCA_CAKE_DIFFSERV_MODE, &diffserv, sizeof(diffserv));
391 + addattr_l(n, 1024, TCA_CAKE_ATM, &atm, sizeof(atm));
392 + if (flowmode != -1)
393 + addattr_l(n, 1024, TCA_CAKE_FLOW_MODE, &flowmode, sizeof(flowmode));
395 + addattr_l(n, 1024, TCA_CAKE_OVERHEAD, &overhead, sizeof(overhead));
396 + if (overhead_override) {
398 + addattr_l(n, 1024, TCA_CAKE_ETHERNET, &zero, sizeof(zero));
401 + addattr_l(n, 1024, TCA_CAKE_RTT, &interval, sizeof(interval));
403 + addattr_l(n, 1024, TCA_CAKE_TARGET, &target, sizeof(target));
404 + if (autorate != -1)
405 + addattr_l(n, 1024, TCA_CAKE_AUTORATE, &autorate, sizeof(autorate));
407 + addattr_l(n, 1024, TCA_CAKE_MEMORY, &memlimit, sizeof(memlimit));
409 + addattr_l(n, 1024, TCA_CAKE_NAT, &nat, sizeof(nat));
411 + addattr_l(n, 1024, TCA_CAKE_WASH, &wash, sizeof(wash));
413 + tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
418 +static int cake_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
420 + struct rtattr *tb[TCA_CAKE_MAX + 1];
421 + unsigned bandwidth = 0;
422 + unsigned diffserv = 0;
423 + unsigned flowmode = 0;
424 + unsigned interval = 0;
425 + unsigned memlimit = 0;
438 + parse_rtattr_nested(tb, TCA_CAKE_MAX, opt);
440 + if (tb[TCA_CAKE_BASE_RATE] &&
441 + RTA_PAYLOAD(tb[TCA_CAKE_BASE_RATE]) >= sizeof(__u32)) {
442 + bandwidth = rta_getattr_u32(tb[TCA_CAKE_BASE_RATE]);
444 + fprintf(f, "bandwidth %s ", sprint_rate(bandwidth, b1));
446 + fprintf(f, "unlimited ");
448 + if (tb[TCA_CAKE_AUTORATE] &&
449 + RTA_PAYLOAD(tb[TCA_CAKE_AUTORATE]) >= sizeof(__u32)) {
450 + autorate = rta_getattr_u32(tb[TCA_CAKE_AUTORATE]);
452 + fprintf(f, "autorate_ingress ");
454 + fprintf(f, "(?autorate?) ");
456 + if (tb[TCA_CAKE_DIFFSERV_MODE] &&
457 + RTA_PAYLOAD(tb[TCA_CAKE_DIFFSERV_MODE]) >= sizeof(__u32)) {
458 + diffserv = rta_getattr_u32(tb[TCA_CAKE_DIFFSERV_MODE]);
461 + fprintf(f, "besteffort ");
464 + fprintf(f, "precedence ");
467 + fprintf(f, "diffserv8 ");
470 + fprintf(f, "diffserv4 ");
473 + fprintf(f, "diffserv-llt ");
476 + fprintf(f, "(?diffserv?) ");
480 + if (tb[TCA_CAKE_FLOW_MODE] &&
481 + RTA_PAYLOAD(tb[TCA_CAKE_FLOW_MODE]) >= sizeof(__u32)) {
482 + flowmode = rta_getattr_u32(tb[TCA_CAKE_FLOW_MODE]);
483 + nat = !!(flowmode & 64);
487 + fprintf(f, "flowblind ");
490 + fprintf(f, "srchost ");
493 + fprintf(f, "dsthost ");
496 + fprintf(f, "hosts ");
499 + fprintf(f, "flows ");
502 + fprintf(f, "dual-srchost ");
505 + fprintf(f, "dual-dsthost ");
508 + fprintf(f, "triple-isolate ");
511 + fprintf(f, "(?flowmode?) ");
516 + fprintf(f, "nat ");
518 + if (tb[TCA_CAKE_WASH] &&
519 + RTA_PAYLOAD(tb[TCA_CAKE_WASH]) >= sizeof(__u32)) {
520 + wash = rta_getattr_u32(tb[TCA_CAKE_WASH]);
522 + if (tb[TCA_CAKE_ATM] &&
523 + RTA_PAYLOAD(tb[TCA_CAKE_ATM]) >= sizeof(__u32)) {
524 + atm = rta_getattr_u32(tb[TCA_CAKE_ATM]);
526 + if (tb[TCA_CAKE_OVERHEAD] &&
527 + RTA_PAYLOAD(tb[TCA_CAKE_OVERHEAD]) >= sizeof(__u32)) {
528 + overhead = rta_getattr_u32(tb[TCA_CAKE_OVERHEAD]);
530 + if (tb[TCA_CAKE_ETHERNET] &&
531 + RTA_PAYLOAD(tb[TCA_CAKE_ETHERNET]) >= sizeof(__u32)) {
532 + ethernet = rta_getattr_u32(tb[TCA_CAKE_ETHERNET]);
534 + if (tb[TCA_CAKE_RTT] &&
535 + RTA_PAYLOAD(tb[TCA_CAKE_RTT]) >= sizeof(__u32)) {
536 + interval = rta_getattr_u32(tb[TCA_CAKE_RTT]);
540 + fprintf(f,"wash ");
543 + fprintf(f, "rtt %s ", sprint_time(interval, b2));
545 + if (!atm && overhead == ethernet) {
546 + fprintf(f, "raw ");
549 + fprintf(f, "atm ");
551 + fprintf(f, "ptm ");
553 + fprintf(f, "noatm ");
555 + fprintf(f, "overhead %d ", overhead);
557 + // This is actually the *amount* of automatic compensation, but we only report
558 + // its presence as a boolean for now.
560 + fprintf(f, "via-ethernet ");
564 + fprintf(f, "memlimit %s", sprint_size(memlimit, b1));
569 +static int cake_print_xstats(struct qdisc_util *qu, FILE *f,
570 + struct rtattr *xstats)
572 + /* fq_codel stats format borrowed */
573 + struct tc_fq_codel_xstats *st;
574 + struct tc_cake_xstats *stnc;
578 + if (xstats == NULL)
581 + if (RTA_PAYLOAD(xstats) < sizeof(st->type))
584 + st = RTA_DATA(xstats);
585 + stnc = RTA_DATA(xstats);
587 + if (st->type == TCA_FQ_CODEL_XSTATS_QDISC && RTA_PAYLOAD(xstats) >= sizeof(*st)) {
588 + fprintf(f, " maxpacket %u drop_overlimit %u new_flow_count %u ecn_mark %u",
589 + st->qdisc_stats.maxpacket,
590 + st->qdisc_stats.drop_overlimit,
591 + st->qdisc_stats.new_flow_count,
592 + st->qdisc_stats.ecn_mark);
593 + fprintf(f, "\n new_flows_len %u old_flows_len %u",
594 + st->qdisc_stats.new_flows_len,
595 + st->qdisc_stats.old_flows_len);
596 + } else if (st->type == TCA_FQ_CODEL_XSTATS_CLASS && RTA_PAYLOAD(xstats) >= sizeof(*st)) {
597 + fprintf(f, " deficit %d count %u lastcount %u ldelay %s",
598 + st->class_stats.deficit,
599 + st->class_stats.count,
600 + st->class_stats.lastcount,
601 + sprint_time(st->class_stats.ldelay, b1));
602 + if (st->class_stats.dropping) {
603 + fprintf(f, " dropping");
604 + if (st->class_stats.drop_next < 0)
605 + fprintf(f, " drop_next -%s",
606 + sprint_time(-st->class_stats.drop_next, b1));
608 + fprintf(f, " drop_next %s",
609 + sprint_time(st->class_stats.drop_next, b1));
611 + } else if (stnc->version >= 1 && stnc->version < 0xFF
612 + && stnc->max_tins == TC_CAKE_MAX_TINS
613 + && RTA_PAYLOAD(xstats) >= offsetof(struct tc_cake_xstats, capacity_estimate))
617 + if(stnc->version >= 3)
618 + fprintf(f, " memory used: %s of %s\n", sprint_size(stnc->memory_used, b1), sprint_size(stnc->memory_limit, b2));
620 + if(stnc->version >= 2)
621 + fprintf(f, " capacity estimate: %s\n", sprint_rate(stnc->capacity_estimate, b1));
623 + switch(stnc->tin_cnt) {
625 + fprintf(f, " Bulk Best Effort Video Voice\n");
629 + fprintf(f, " Low Loss Best Effort Low Delay Bulk Net Control\n");
634 + for(i=0; i < stnc->tin_cnt; i++)
635 + fprintf(f, " Tin %u", i);
639 + fprintf(f, " thresh ");
640 + for(i=0; i < stnc->tin_cnt; i++)
641 + fprintf(f, "%12s", sprint_rate(stnc->threshold_rate[i], b1));
644 + fprintf(f, " target ");
645 + for(i=0; i < stnc->tin_cnt; i++)
646 + fprintf(f, "%12s", sprint_time(stnc->target_us[i], b1));
649 + fprintf(f, " interval");
650 + for(i=0; i < stnc->tin_cnt; i++)
651 + fprintf(f, "%12s", sprint_time(stnc->interval_us[i], b1));
654 + fprintf(f, " pk_delay");
655 + for(i=0; i < stnc->tin_cnt; i++)
656 + fprintf(f, "%12s", sprint_time(stnc->peak_delay_us[i], b1));
659 + fprintf(f, " av_delay");
660 + for(i=0; i < stnc->tin_cnt; i++)
661 + fprintf(f, "%12s", sprint_time(stnc->avge_delay_us[i], b1));
664 + fprintf(f, " sp_delay");
665 + for(i=0; i < stnc->tin_cnt; i++)
666 + fprintf(f, "%12s", sprint_time(stnc->base_delay_us[i], b1));
669 + fprintf(f, " pkts ");
670 + for(i=0; i < stnc->tin_cnt; i++)
671 + fprintf(f, "%12u", stnc->sent[i].packets);
674 + fprintf(f, " bytes ");
675 + for(i=0; i < stnc->tin_cnt; i++)
676 + fprintf(f, "%12llu", stnc->sent[i].bytes);
679 + fprintf(f, " way_inds");
680 + for(i=0; i < stnc->tin_cnt; i++)
681 + fprintf(f, "%12u", stnc->way_indirect_hits[i]);
684 + fprintf(f, " way_miss");
685 + for(i=0; i < stnc->tin_cnt; i++)
686 + fprintf(f, "%12u", stnc->way_misses[i]);
689 + fprintf(f, " way_cols");
690 + for(i=0; i < stnc->tin_cnt; i++)
691 + fprintf(f, "%12u", stnc->way_collisions[i]);
694 + fprintf(f, " drops ");
695 + for(i=0; i < stnc->tin_cnt; i++)
696 + fprintf(f, "%12u", stnc->dropped[i].packets);
699 + fprintf(f, " marks ");
700 + for(i=0; i < stnc->tin_cnt; i++)
701 + fprintf(f, "%12u", stnc->ecn_marked[i].packets);
704 + fprintf(f, " sp_flows");
705 + for(i=0; i < stnc->tin_cnt; i++)
706 + fprintf(f, "%12u", stnc->sparse_flows[i]);
709 + fprintf(f, " bk_flows");
710 + for(i=0; i < stnc->tin_cnt; i++)
711 + fprintf(f, "%12u", stnc->bulk_flows[i]);
714 + if(stnc->version >= 4) {
715 + fprintf(f, " un_flows");
716 + for(i=0; i < stnc->tin_cnt; i++)
717 + fprintf(f, "%12u", stnc->unresponse_flows[i]);
721 + fprintf(f, " max_len ");
722 + for(i=0; i < stnc->tin_cnt; i++)
723 + fprintf(f, "%12u", stnc->max_skblen[i]);
731 +struct qdisc_util cake_qdisc_util = {
733 + .parse_qopt = cake_parse_opt,
734 + .print_qopt = cake_print_opt,
735 + .print_xstats = cake_print_xstats,