From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: idosch@mellanox.com, jiri@resnulli.us, dsahern@gmail.com
Cc: stephen@networkplumber.org, oss-drivers@netronome.com,
netdev@vger.kernel.org,
Jakub Kicinski <jakub.kicinski@netronome.com>
Subject: [PATCH iproute2-next v2] devlink: report cell size
Date: Mon, 4 Feb 2019 06:44:42 -0800 [thread overview]
Message-ID: <20190204144442.5704-1-jakub.kicinski@netronome.com> (raw)
Print the value of DEVLINK_ATTR_SB_POOL_CELL_SIZE, if reported.
Example:
pci/0000:82:00.0:
sb 1 pool 0 type egress size 40945664 thtype static cell_size 2048
sb 2 pool 0 type egress size 258867200 thtype static cell_size 10240
...
v2: - fix spelling.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
---
devlink/devlink.c | 3 +++
man/man8/devlink-sb.8 | 10 ++++++++++
2 files changed, 13 insertions(+)
diff --git a/devlink/devlink.c b/devlink/devlink.c
index fc4b18d1b613..40f6105af109 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -2891,6 +2891,9 @@ static void pr_out_sb_pool(struct dl *dl, struct nlattr **tb)
mnl_attr_get_u32(tb[DEVLINK_ATTR_SB_POOL_SIZE]));
pr_out_str(dl, "thtype",
threshold_type_name(mnl_attr_get_u8(tb[DEVLINK_ATTR_SB_POOL_THRESHOLD_TYPE])));
+ if (tb[DEVLINK_ATTR_SB_POOL_CELL_SIZE])
+ pr_out_uint(dl, "cell_size",
+ mnl_attr_get_u32(tb[DEVLINK_ATTR_SB_POOL_CELL_SIZE]));
pr_out_handle_end(dl);
}
diff --git a/man/man8/devlink-sb.8 b/man/man8/devlink-sb.8
index 1882833a3fa7..0deacd9ccd23 100644
--- a/man/man8/devlink-sb.8
+++ b/man/man8/devlink-sb.8
@@ -128,6 +128,16 @@ Behaviour of this argument it the same for every command.
- specifies the devlink device to show pools.
If this argument is omitted all pools of all devices are listed.
+Display available pools listing their
+.B type, size, thtype
+and
+.B cell_size. cell_size
+is the allocation granularity of memory within the shared buffer. Drivers
+may round up, round down or reject
+.B size
+passed to the set command if it is not multiple of
+.B cell_size.
+
.SS devlink sb pool set - set attributes of pool
.PP
--
2.19.2
next reply other threads:[~2019-02-04 14:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-04 14:44 Jakub Kicinski [this message]
2019-02-04 14:51 ` [PATCH iproute2-next v2] devlink: report cell size Jiri Pirko
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=20190204144442.5704-1-jakub.kicinski@netronome.com \
--to=jakub.kicinski@netronome.com \
--cc=dsahern@gmail.com \
--cc=idosch@mellanox.com \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@netronome.com \
--cc=stephen@networkplumber.org \
/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