From: Leon Romanovsky <leon@kernel.org>
To: Shangyan Zhou <sy.zhou@hotmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH v3] rdma: Fix res_print_uint() and add res_print_u64()
Date: Fri, 4 Mar 2022 19:33:51 +0200 [thread overview]
Message-ID: <YiJNfx85POmhzGQV@unreal> (raw)
In-Reply-To: <OSAPR01MB7567AF3E28F7D2D72FFA876BE3059@OSAPR01MB7567.jpnprd01.prod.outlook.com>
On Fri, Mar 04, 2022 at 08:46:37PM +0800, Shangyan Zhou wrote:
> Use the corresponding function and fmt string to print unsigned int32
> and int64.
>
> Signed-off-by: Shangyan Zhou <sy.zhou@hotmail.com>
> ---
> rdma/res-cq.c | 2 +-
> rdma/res-mr.c | 2 +-
> rdma/res-pd.c | 2 +-
> rdma/res.c | 15 ++++++++++++---
> rdma/res.h | 4 +++-
> rdma/stat.c | 4 ++--
> 6 files changed, 20 insertions(+), 9 deletions(-)
>
> diff --git a/rdma/res-cq.c b/rdma/res-cq.c
> index 9e7c4f51..475179c8 100644
> --- a/rdma/res-cq.c
> +++ b/rdma/res-cq.c
> @@ -112,7 +112,7 @@ static int res_cq_line(struct rd *rd, const char *name, int idx,
> print_dev(rd, idx, name);
> res_print_uint(rd, "cqn", cqn, nla_line[RDMA_NLDEV_ATTR_RES_CQN]);
> res_print_uint(rd, "cqe", cqe, nla_line[RDMA_NLDEV_ATTR_RES_CQE]);
> - res_print_uint(rd, "users", users,
> + res_print_u64(rd, "users", users,
> nla_line[RDMA_NLDEV_ATTR_RES_USECNT]);
> print_poll_ctx(rd, poll_ctx, nla_line[RDMA_NLDEV_ATTR_RES_POLL_CTX]);
> print_cq_dim_setting(rd, nla_line[RDMA_NLDEV_ATTR_DEV_DIM]);
> diff --git a/rdma/res-mr.c b/rdma/res-mr.c
> index 1bf73f3a..a5b1ec5d 100644
> --- a/rdma/res-mr.c
> +++ b/rdma/res-mr.c
> @@ -77,7 +77,7 @@ static int res_mr_line(struct rd *rd, const char *name, int idx,
> print_key(rd, "rkey", rkey, nla_line[RDMA_NLDEV_ATTR_RES_RKEY]);
> print_key(rd, "lkey", lkey, nla_line[RDMA_NLDEV_ATTR_RES_LKEY]);
> print_key(rd, "iova", iova, nla_line[RDMA_NLDEV_ATTR_RES_IOVA]);
> - res_print_uint(rd, "mrlen", mrlen, nla_line[RDMA_NLDEV_ATTR_RES_MRLEN]);
> + res_print_u64(rd, "mrlen", mrlen, nla_line[RDMA_NLDEV_ATTR_RES_MRLEN]);
> res_print_uint(rd, "pdn", pdn, nla_line[RDMA_NLDEV_ATTR_RES_PDN]);
> res_print_uint(rd, "pid", pid, nla_line[RDMA_NLDEV_ATTR_RES_PID]);
> print_comm(rd, comm, nla_line);
> diff --git a/rdma/res-pd.c b/rdma/res-pd.c
> index df538010..6fec787c 100644
> --- a/rdma/res-pd.c
> +++ b/rdma/res-pd.c
> @@ -65,7 +65,7 @@ static int res_pd_line(struct rd *rd, const char *name, int idx,
> res_print_uint(rd, "pdn", pdn, nla_line[RDMA_NLDEV_ATTR_RES_PDN]);
> print_key(rd, "local_dma_lkey", local_dma_lkey,
> nla_line[RDMA_NLDEV_ATTR_RES_LOCAL_DMA_LKEY]);
> - res_print_uint(rd, "users", users,
> + res_print_u64(rd, "users", users,
> nla_line[RDMA_NLDEV_ATTR_RES_USECNT]);
> print_key(rd, "unsafe_global_rkey", unsafe_global_rkey,
> nla_line[RDMA_NLDEV_ATTR_RES_UNSAFE_GLOBAL_RKEY]);
> diff --git a/rdma/res.c b/rdma/res.c
> index 21fef9bd..62599095 100644
> --- a/rdma/res.c
> +++ b/rdma/res.c
> @@ -51,7 +51,7 @@ static int res_print_summary(struct rd *rd, struct nlattr **tb)
>
> name = mnl_attr_get_str(nla_line[RDMA_NLDEV_ATTR_RES_SUMMARY_ENTRY_NAME]);
> curr = mnl_attr_get_u64(nla_line[RDMA_NLDEV_ATTR_RES_SUMMARY_ENTRY_CURR]);
> - res_print_uint(
> + res_print_u64(
> rd, name, curr,
> nla_line[RDMA_NLDEV_ATTR_RES_SUMMARY_ENTRY_CURR]);
> }
> @@ -208,13 +208,22 @@ void print_key(struct rd *rd, const char *name, uint64_t val,
> print_color_hex(PRINT_ANY, COLOR_NONE, name, " 0x%" PRIx64 " ", val);
> }
>
> -void res_print_uint(struct rd *rd, const char *name, uint64_t val,
> +void res_print_uint(struct rd *rd, const char *name, uint32_t val,
> struct nlattr *nlattr)
It is res_print_u32() now and not res_print_uint().
But it is nitpicking.
Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
next prev parent reply other threads:[~2022-03-04 17:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-02 3:06 [PATCH] rdma: Fix res_print_uint() Shangyan Zhou
2022-03-03 18:44 ` Leon Romanovsky
2022-03-04 3:17 ` Shangyan Zhou
2022-03-04 3:00 ` [PATCH v2] " Shangyan Zhou
2022-03-04 7:02 ` Leon Romanovsky
2022-03-04 12:47 ` Shangyan Zhou
2022-03-04 12:46 ` [PATCH v3] rdma: Fix res_print_uint() and add res_print_u64() Shangyan Zhou
2022-03-04 17:33 ` Leon Romanovsky [this message]
2022-03-06 7:00 ` Shangyan Zhou
2022-03-06 6:56 ` [PATCH v4] rdma: Fix the logic to print unsigned int Shangyan Zhou
2022-03-07 12:49 ` Leon Romanovsky
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=YiJNfx85POmhzGQV@unreal \
--to=leon@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sy.zhou@hotmail.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).