--- a/include/linux/pkt_sched.h
+++ b/include/linux/pkt_sched.h
-@@ -850,4 +850,59 @@ struct tc_pie_xstats {
+@@ -850,4 +850,60 @@ struct tc_pie_xstats {
__u32 maxq; /* maximum queue size */
__u32 ecn_mark; /* packets marked with ecn*/
};
+ TCA_CAKE_ATM,
+ TCA_CAKE_FLOW_MODE,
+ TCA_CAKE_OVERHEAD,
++ TCA_CAKE_MPU,
+ TCA_CAKE_RTT,
+ TCA_CAKE_TARGET,
+ TCA_CAKE_AUTORATE,
--- /dev/null
+++ b/tc/q_cake.c
-@@ -0,0 +1,663 @@
+@@ -0,0 +1,686 @@
+/*
+ * Common Applications Kept Enhanced -- CAKE
+ *
+ " [ rtt TIME | datacentre | lan | metro | regional | internet* | oceanic | satellite | interplanetary ]\n"
+ " [ besteffort | precedence | diffserv8 | diffserv4 | diffserv-llt | diffserv3* ]\n"
+ " [ flowblind | srchost | dsthost | hosts | flows | dual-srchost | dual-dsthost | triple-isolate* ] [ nat | nonat* ]\n"
-+ " [ ptm | atm | noatm* ] [ overhead N | conservative | raw* ]\n"
++ " [ ptm | atm | noatm* ] [ overhead N | conservative | raw* ] [ mpu N ]\n"
+ " [ wash | nowash* ]\n"
+ " [ memlimit LIMIT ]\n"
+ " (* marks defaults)\n");
+ bool overhead_set = false;
+ bool overhead_override = false;
+ int wash = -1;
++ int mpu = 0;
+ int flowmode = -1;
+ int nat = -1;
+ int atm = -1;
+ * you may need to add vlan tag */
+ overhead += 38;
+ overhead_set = true;
++ mpu = 84;
+
+ /* Additional Ethernet-related overhead used by some ISPs */
+ } else if (strcmp(*argv, "ether-vlan") == 0) {
+ atm = 0;
+ overhead += 18;
+ overhead_set = true;
++ mpu = 64;
+
+ } else if (strcmp(*argv, "overhead") == 0) {
+ char* p = NULL;
+ }
+ overhead_set = true;
+
++ } else if (strcmp(*argv, "mpu") == 0) {
++ char* p = NULL;
++ NEXT_ARG();
++ mpu = strtol(*argv, &p, 10);
++ if(!p || *p || !*argv || mpu < 0 || mpu > 256) {
++ fprintf(stderr, "Illegal \"mpu\", valid range is 0 to 256\\n");
++ return -1;
++ }
++
+ } else if (strcmp(*argv, "memlimit") == 0) {
+ NEXT_ARG();
+ if(get_size(&memlimit, *argv)) {
+ unsigned zero = 0;
+ addattr_l(n, 1024, TCA_CAKE_ETHERNET, &zero, sizeof(zero));
+ }
++ if (mpu > 0)
++ addattr_l(n, 1024, TCA_CAKE_MPU, &mpu, sizeof(mpu));
+ if (interval)
+ addattr_l(n, 1024, TCA_CAKE_RTT, &interval, sizeof(interval));
+ if (target)
+ unsigned memlimit = 0;
+ int overhead = 0;
+ int ethernet = 0;
++ int mpu = 0;
+ int atm = 0;
+ int nat = 0;
+ int autorate = 0;
+ RTA_PAYLOAD(tb[TCA_CAKE_OVERHEAD]) >= sizeof(__u32)) {
+ overhead = rta_getattr_u32(tb[TCA_CAKE_OVERHEAD]);
+ }
++ if (tb[TCA_CAKE_MPU] &&
++ RTA_PAYLOAD(tb[TCA_CAKE_MPU]) >= sizeof(__u32)) {
++ mpu = rta_getattr_u32(tb[TCA_CAKE_MPU]);
++ }
+ if (tb[TCA_CAKE_ETHERNET] &&
+ RTA_PAYLOAD(tb[TCA_CAKE_ETHERNET]) >= sizeof(__u32)) {
+ ethernet = rta_getattr_u32(tb[TCA_CAKE_ETHERNET]);
+ fprintf(f, "via-ethernet ");
+ }
+
++ if (mpu) {
++ fprintf(f, "mpu %d ", mpu);
++ }
++
+ if (memlimit)
+ fprintf(f, "memlimit %s", sprint_size(memlimit, b1));
+