From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Bruce Richardson" <bruce.richardson@intel.com>,
"Andre Muezerie" <andremue@linux.microsoft.com>
Cc: <dev@dpdk.org>, <sameh.gobriel@intel.com>,
<vladimir.medvedkin@intel.com>, <yipeng1.wang@intel.com>
Subject: RE: [PATCH v3 1/3] eal: add function rte_size_to_str
Date: Thu, 13 Mar 2025 11:07:47 +0100 [thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9FAFC@smartserver.smartshare.dk> (raw)
In-Reply-To: <Z9Kg3C-L22fTKebl@bricha3-mobl1.ger.corp.intel.com>
> > +{
> > + const char *prefix = "kMGTPE";
>
> Why is "k" in lower case compared to the others all in upper-case?
That's what the standardization bodies decided. Let's stick with that!
> > + * Sample outputs with "use_iec" disabled and enabled:
> > + * 0 : "0 ", "0 "
> > + * 700 : "700 ", "700 "
> > + * 1000 : "1.00 k", "1000 "
> > + * 1024 : "1.02 k", "1.00 ki"
> > + * 21474836480 : "21.5 G", "20.0 Gi"
> > + * 109951162777600 : "110 T", "100 Ti"
> > + *
>
> I would omit the space before the suffixes in the output. As well as
> looking better to me, it also solves the issue of the non-suffixed
> numbers
> having a trailing space.
The space could be optional, like the "use_iec" parameter.
I would certainly expect the space when appending a unit, e.g. "bit/s":
"700 bit/s" or "1.00 kbit/s".
Or when the appended unit is seconds, e.g. for latency/jitter:
"12.3 ms" or "123 us".
With raw numbers (i.e. without a unit appended), it's probably a matter of personal preference, so I'm not going to insist here.
I still prefer it, but only when a postfix is present.
In the SmartShare GUI, we output with the space, and accept input both with and without it.
next prev parent reply other threads:[~2025-03-13 10:07 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-06 20:03 [PATCH] hash_readwrite_autotest: fix printf parameters Andre Muezerie
2025-03-07 9:01 ` Bruce Richardson
2025-03-07 22:34 ` Andre Muezerie
2025-03-10 10:51 ` Bruce Richardson
2025-03-10 15:36 ` Stephen Hemminger
2025-03-11 14:39 ` Andre Muezerie
2025-03-11 15:01 ` Morten Brørup
2025-03-11 15:33 ` [PATCH v2 1/3] eal: add function rte_size_to_str Andre Muezerie
2025-03-11 15:33 ` [PATCH v2 2/3] hash_multiwriter_autotest: fix printf parameters Andre Muezerie
2025-03-11 15:33 ` [PATCH v2 3/3] hash_readwrite_autotest: " Andre Muezerie
2025-03-11 15:49 ` [PATCH v2 1/3] eal: add function rte_size_to_str Stephen Hemminger
2025-03-11 15:51 ` Bruce Richardson
2025-03-11 16:21 ` Morten Brørup
2025-03-12 19:28 ` [PATCH v3 0/3] fix how large numbers are printed by hash tests Andre Muezerie
2025-03-12 19:28 ` [PATCH v3 1/3] eal: add function rte_size_to_str Andre Muezerie
2025-03-13 9:09 ` Bruce Richardson
2025-03-13 10:07 ` Morten Brørup [this message]
2025-03-13 10:35 ` Bruce Richardson
2025-03-13 10:41 ` Bruce Richardson
2025-03-13 14:06 ` Andre Muezerie
2025-03-12 19:28 ` [PATCH v3 2/3] hash_multiwriter_autotest: fix printf parameters Andre Muezerie
2025-03-12 19:28 ` [PATCH v3 3/3] hash_readwrite_autotest: " Andre Muezerie
2025-03-13 16:51 ` [PATCH v4 0/3] fix how large numbers are printed by hash tests Andre Muezerie
2025-03-13 16:51 ` [PATCH v4 1/3] eal: add function rte_size_to_str Andre Muezerie
2025-03-13 16:59 ` Morten Brørup
2025-03-13 16:51 ` [PATCH v4 2/3] hash_multiwriter_autotest: fix printf parameters Andre Muezerie
2025-03-13 16:51 ` [PATCH v4 3/3] hash_readwrite_autotest: " Andre Muezerie
2025-03-13 17:33 ` [PATCH v4 0/3] fix how large numbers are printed by hash tests Bruce Richardson
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=98CBD80474FA8B44BF855DF32C47DC35E9FAFC@smartserver.smartshare.dk \
--to=mb@smartsharesystems.com \
--cc=andremue@linux.microsoft.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=sameh.gobriel@intel.com \
--cc=vladimir.medvedkin@intel.com \
--cc=yipeng1.wang@intel.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).