[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200415143936.18924-3-odin@ugedal.com>
Date: Wed, 15 Apr 2020 16:39:35 +0200
From: Odin Ugedal <odin@...dal.com>
To: toke@...hat.com, netdev@...r.kernel.org
Cc: Odin Ugedal <odin@...dal.com>
Subject: [PATCH 2/3] q_cake: properly print memlimit
Load memlimit so that it will be printed if it isn't set to zero.
Also add a space to properly print it.
Signed-off-by: Odin Ugedal <odin@...dal.com>
---
tc/q_cake.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tc/q_cake.c b/tc/q_cake.c
index 9ebb270c..12d648d7 100644
--- a/tc/q_cake.c
+++ b/tc/q_cake.c
@@ -520,6 +520,10 @@ static int cake_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
RTA_PAYLOAD(tb[TCA_CAKE_RTT]) >= sizeof(__u32)) {
interval = rta_getattr_u32(tb[TCA_CAKE_RTT]);
}
+ if (tb[TCA_CAKE_MEMORY] &&
+ RTA_PAYLOAD(tb[TCA_CAKE_MEMORY]) >= sizeof(__u32)) {
+ memlimit = rta_getattr_u32(tb[TCA_CAKE_MEMORY]);
+ }
if (tb[TCA_CAKE_FWMARK] &&
RTA_PAYLOAD(tb[TCA_CAKE_FWMARK]) >= sizeof(__u32)) {
fwmark = rta_getattr_u32(tb[TCA_CAKE_FWMARK]);
@@ -572,7 +576,7 @@ static int cake_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
if (memlimit) {
print_uint(PRINT_JSON, "memlimit", NULL, memlimit);
- print_string(PRINT_FP, NULL, "memlimit %s",
+ print_string(PRINT_FP, NULL, "memlimit %s ",
sprint_size(memlimit, b1));
}
--
2.26.1
Powered by blists - more mailing lists