From: Andrew Rybchenko <arybchenko@solarflare.com>
To: Hemant Agrawal <hemant.agrawal@nxp.com>, <dev@dpdk.org>
Cc: <olivier.matz@6wind.com>
Subject: Re: [dpdk-dev] [PATCH v2] mempool: enhance dump function to print ops name
Date: Sat, 29 Aug 2020 14:29:53 +0300 [thread overview]
Message-ID: <dc970ec5-55d6-31b4-c4ca-7876d09abf81@solarflare.com> (raw)
In-Reply-To: <20200817111507.30698-1-hemant.agrawal@nxp.com>
On 8/17/20 2:15 PM, Hemant Agrawal wrote:
> Enhance the dump function to also print the ops index
> and associated mempool ops name
>
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
with a nit below
> ---
> lib/librte_mempool/rte_mempool.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
> index 7774f0c8da..10c5cb708f 100644
> --- a/lib/librte_mempool/rte_mempool.c
> +++ b/lib/librte_mempool/rte_mempool.c
> @@ -1266,6 +1266,7 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp)
> unsigned lcore_id;
> #endif
> struct rte_mempool_memhdr *memhdr;
> + struct rte_mempool_ops *ops;
> unsigned common_count;
> unsigned cache_count;
> size_t mem_len = 0;
> @@ -1288,6 +1289,10 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp)
>
> fprintf(f, " private_data_size=%"PRIu32"\n", mp->private_data_size);
>
> + fprintf(f, " ops_index=%d\n", mp->ops_index);
> + ops = rte_mempool_get_ops(mp->ops_index);
> + fprintf(f, " ops_name: <%s>\n", ops ? ops->name : "NA");
DPDK coding style suggests to use explicit comparison vs NULL, i.e.
ops != NULL ? ops->name : "NA"
> +
> STAILQ_FOREACH(memhdr, &mp->mem_list, next)
> mem_len += memhdr->len;
> if (mem_len != 0) {
next prev parent reply other threads:[~2020-08-29 11:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-11 9:59 [dpdk-dev] [PATCH] mempool: enhance dump function to print ops name Hemant Agrawal
2020-07-31 12:55 ` Olivier Matz
2020-08-17 11:15 ` [dpdk-dev] [PATCH v2] " Hemant Agrawal
2020-08-29 11:29 ` Andrew Rybchenko [this message]
2020-09-08 5:41 ` [dpdk-dev] [PATCH v3] " Hemant Agrawal
2020-10-06 21:43 ` Thomas Monjalon
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=dc970ec5-55d6-31b4-c4ca-7876d09abf81@solarflare.com \
--to=arybchenko@solarflare.com \
--cc=dev@dpdk.org \
--cc=hemant.agrawal@nxp.com \
--cc=olivier.matz@6wind.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.