From: Odin Ugedal <odin@ugedal.com>
To: toke@redhat.com, netdev@vger.kernel.org
Cc: Odin Ugedal <odin@ugedal.com>
Subject: [PATCH 2/3] q_cake: properly print memlimit
Date: Wed, 15 Apr 2020 16:39:35 +0200 [thread overview]
Message-ID: <20200415143936.18924-3-odin@ugedal.com> (raw)
In-Reply-To: <20200415143936.18924-1-odin@ugedal.com>
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@ugedal.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
next prev parent reply other threads:[~2020-04-15 14:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-15 14:39 [PATCH 0/3] q_cake: minor fixes and cleanups Odin Ugedal
2020-04-15 14:39 ` [PATCH 1/3] q_cake: Make fwmark uint instead of int Odin Ugedal
2020-04-16 8:47 ` Toke Høiland-Jørgensen
2020-04-15 14:39 ` Odin Ugedal [this message]
2020-04-16 8:47 ` [PATCH 2/3] q_cake: properly print memlimit Toke Høiland-Jørgensen
2020-04-15 14:39 ` [PATCH 3/3] q_cake: detect overflow in get_size Odin Ugedal
2020-04-16 8:49 ` Toke Høiland-Jørgensen
2020-04-16 14:11 ` Odin Ugedal
2020-04-16 14:08 ` [PATCH v2 3/3] tc_util: " Odin Ugedal
2020-04-16 14:16 ` Toke Høiland-Jørgensen
2020-04-20 16:37 ` [PATCH 0/3] q_cake: minor fixes and cleanups Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200415143936.18924-3-odin@ugedal.com \
--to=odin@ugedal.com \
--cc=netdev@vger.kernel.org \
--cc=toke@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).