* [Cake] eliminating link_ms and increasing packets to 64 bits
@ 2018-03-22 21:59 Dave Taht
2018-03-23 9:58 ` Toke Høiland-Jørgensen
0 siblings, 1 reply; 4+ messages in thread
From: Dave Taht @ 2018-03-22 21:59 UTC (permalink / raw)
To: Cake List
[-- Attachment #1: Type: text/plain, Size: 189 bytes --]
It looks like tc-adv is currently canonical?
I've briefly tested the attached against net-next.
--
Dave Täht
CEO, TekLibre, LLC
http://www.teklibre.com
Tel: 1-669-226-2619
[-- Attachment #2: 0001-retire-link_ms-and-increase-packets-to-64-bits.patch --]
[-- Type: text/x-patch, Size: 706 bytes --]
From 21d25530b42d6c6e484b673182834275dba6b495 Mon Sep 17 00:00:00 2001
From: Dave Taht <dave.taht@gmail.com>
Date: Thu, 22 Mar 2018 14:53:59 -0700
Subject: [PATCH] retire link_ms and increase packets to 64 bits
the link_ms field was entirely unused
I have certainly managed to overrun the 32 bit packet field, so
increase that to 64 bits.
---
pkt_sched.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/pkt_sched.h b/pkt_sched.h
index 71288fb..105dd75 100644
--- a/pkt_sched.h
+++ b/pkt_sched.h
@@ -881,8 +881,7 @@ enum {
#define TCA_CAKE_MAX (__TCA_CAKE_MAX - 1)
struct tc_cake_traffic_stats {
- __u32 packets;
- __u32 link_ms;
+ __u64 packets;
__u64 bytes;
};
--
2.7.4
[-- Attachment #3: tc-adv-u64_packets.patch --]
[-- Type: text/x-patch, Size: 1382 bytes --]
diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
index c63b7a8..04260ae 100644
--- a/include/uapi/linux/pkt_sched.h
+++ b/include/uapi/linux/pkt_sched.h
@@ -957,8 +957,7 @@ enum {
#define TCA_CAKE_MAX (__TCA_CAKE_MAX - 1)
struct tc_cake_traffic_stats {
- __u32 packets;
- __u32 link_ms;
+ __u64 packets;
__u64 bytes;
};
diff --git a/tc/q_cake.c b/tc/q_cake.c
index d195093..e544f67 100644
--- a/tc/q_cake.c
+++ b/tc/q_cake.c
@@ -702,7 +702,7 @@ static int cake_print_xstats(struct qdisc_util *qu, FILE *f,
fprintf(f, " pkts ");
FOR_EACH_TIN(stnc, tst, i)
- fprintf(f, " %12u", tst->sent.packets);
+ fprintf(f, " %12llu", tst->sent.packets);
fprintf(f, "\n");
fprintf(f, " bytes ");
@@ -727,17 +727,17 @@ static int cake_print_xstats(struct qdisc_util *qu, FILE *f,
fprintf(f, " drops ");
FOR_EACH_TIN(stnc, tst, i)
- fprintf(f, " %12u", tst->dropped.packets);
+ fprintf(f, " %12llu", tst->dropped.packets);
fprintf(f, "\n");
fprintf(f, " marks ");
FOR_EACH_TIN(stnc, tst, i)
- fprintf(f, " %12u", tst->ecn_marked.packets);
+ fprintf(f, " %12llu", tst->ecn_marked.packets);
fprintf(f, "\n");
fprintf(f, " ack_drop");
FOR_EACH_TIN(stnc, tst, i)
- fprintf(f, " %12u", tst->ack_drops.packets);
+ fprintf(f, " %12llu", tst->ack_drops.packets);
fprintf(f, "\n");
fprintf(f, " sp_flows");
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Cake] eliminating link_ms and increasing packets to 64 bits
2018-03-22 21:59 [Cake] eliminating link_ms and increasing packets to 64 bits Dave Taht
@ 2018-03-23 9:58 ` Toke Høiland-Jørgensen
2018-03-23 15:57 ` Dave Taht
0 siblings, 1 reply; 4+ messages in thread
From: Toke Høiland-Jørgensen @ 2018-03-23 9:58 UTC (permalink / raw)
To: Dave Taht, Cake List
Dave Taht <dave.taht@gmail.com> writes:
> fprintf(f, " pkts ");
> FOR_EACH_TIN(stnc, tst, i)
> - fprintf(f, " %12u", tst->sent.packets);
> + fprintf(f, " %12llu", tst->sent.packets);
> fprintf(f, "\n");
Presumably this can potentially break column alignment? Not sure that is
too much of a problem, though; mostly cosmetic?
-Toke
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Cake] eliminating link_ms and increasing packets to 64 bits
2018-03-23 9:58 ` Toke Høiland-Jørgensen
@ 2018-03-23 15:57 ` Dave Taht
2018-03-23 23:01 ` Toke Høiland-Jørgensen
0 siblings, 1 reply; 4+ messages in thread
From: Dave Taht @ 2018-03-23 15:57 UTC (permalink / raw)
To: Toke Høiland-Jørgensen; +Cc: Cake List
the preceding space handles column alignment. the %12 is probably
going to be misleading.
On Fri, Mar 23, 2018 at 2:58 AM, Toke Høiland-Jørgensen <toke@toke.dk> wrote:
> Dave Taht <dave.taht@gmail.com> writes:
>
>> fprintf(f, " pkts ");
>> FOR_EACH_TIN(stnc, tst, i)
>> - fprintf(f, " %12u", tst->sent.packets);
>> + fprintf(f, " %12llu", tst->sent.packets);
>> fprintf(f, "\n");
>
> Presumably this can potentially break column alignment? Not sure that is
> too much of a problem, though; mostly cosmetic?
>
> -Toke
--
Dave Täht
CEO, TekLibre, LLC
http://www.teklibre.com
Tel: 1-669-226-2619
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Cake] eliminating link_ms and increasing packets to 64 bits
2018-03-23 15:57 ` Dave Taht
@ 2018-03-23 23:01 ` Toke Høiland-Jørgensen
0 siblings, 0 replies; 4+ messages in thread
From: Toke Høiland-Jørgensen @ 2018-03-23 23:01 UTC (permalink / raw)
To: Dave Taht; +Cc: Cake List
Dave Taht <dave.taht@gmail.com> writes:
> the preceding space handles column alignment. the %12 is probably
> going to be misleading.
The space separates columns, the %12 aligns them. So it will break
alignment. But as I said, mostly a cosmetic issue, so probably not
something we should spend a lot of time on fixing.
-Toke
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-03-23 23:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-22 21:59 [Cake] eliminating link_ms and increasing packets to 64 bits Dave Taht
2018-03-23 9:58 ` Toke Høiland-Jørgensen
2018-03-23 15:57 ` Dave Taht
2018-03-23 23:01 ` Toke Høiland-Jørgensen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox