DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] mempool: dump includes list of memory chunks
@ 2024-05-16  8:59 Morten Brørup
  2024-05-16 15:20 ` Stephen Hemminger
                   ` (7 more replies)
  0 siblings, 8 replies; 15+ messages in thread
From: Morten Brørup @ 2024-05-16  8:59 UTC (permalink / raw)
  To: andrew.rybchenko, konstantin.v.ananyev, paul.szczepanek
  Cc: dev, Morten Brørup

Added information about the memory chunks holding the objects in the
mempool when dumping the status of the mempool to a file.

Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
---
 lib/mempool/rte_mempool.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c
index 12390a2c81..e9a8a5b411 100644
--- a/lib/mempool/rte_mempool.c
+++ b/lib/mempool/rte_mempool.c
@@ -1230,6 +1230,7 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp)
 #endif
 	struct rte_mempool_memhdr *memhdr;
 	struct rte_mempool_ops *ops;
+	unsigned int n;
 	unsigned common_count;
 	unsigned cache_count;
 	size_t mem_len = 0;
@@ -1264,6 +1265,15 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp)
 			(long double)mem_len / mp->size);
 	}
 
+	fprintf(f, "  mem_list:\n");
+	n = 0;
+	STAILQ_FOREACH(memhdr, &mp->mem_list, next) {
+		fprintf(f, "    addr[%u]=%p\n", n, memhdr->addr);
+		fprintf(f, "    iova[%u]=0x%" PRIx64 "\n", n, memhdr->iova);
+		fprintf(f, "    len[%u]=%zu\n", n, memhdr->len);
+		n++;
+	}
+
 	cache_count = rte_mempool_dump_cache(f, mp);
 	common_count = rte_mempool_ops_get_count(mp);
 	if ((cache_count + common_count) > mp->size)
-- 
2.17.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] mempool: dump includes list of memory chunks
  2024-05-16  8:59 [PATCH] mempool: dump includes list of memory chunks Morten Brørup
@ 2024-05-16 15:20 ` Stephen Hemminger
  2024-05-17  7:29   ` Morten Brørup
  2024-05-29 12:55 ` Paul Szczepanek
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 15+ messages in thread
From: Stephen Hemminger @ 2024-05-16 15:20 UTC (permalink / raw)
  To: Morten Brørup
  Cc: andrew.rybchenko, konstantin.v.ananyev, paul.szczepanek, dev

On Thu, 16 May 2024 10:59:40 +0200
Morten Brørup <mb@smartsharesystems.com> wrote:

> +	fprintf(f, "  mem_list:\n");
> +	n = 0;
> +	STAILQ_FOREACH(memhdr, &mp->mem_list, next) {
> +		fprintf(f, "    addr[%u]=%p\n", n, memhdr->addr);
> +		fprintf(f, "    iova[%u]=0x%" PRIx64 "\n", n, memhdr->iova);
> +		fprintf(f, "    len[%u]=%zu\n", n, memhdr->len);
> +		n++;
> +	}

The output would look better if it was a table with one line per mempool, and the name first
and column headers, and n is redundant

mem_list:
Addr	Iova	Len
...

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: [PATCH] mempool: dump includes list of memory chunks
  2024-05-16 15:20 ` Stephen Hemminger
@ 2024-05-17  7:29   ` Morten Brørup
  0 siblings, 0 replies; 15+ messages in thread
From: Morten Brørup @ 2024-05-17  7:29 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: andrew.rybchenko, konstantin.v.ananyev, paul.szczepanek, dev

> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Thursday, 16 May 2024 17.21
> 
> On Thu, 16 May 2024 10:59:40 +0200
> Morten Brørup <mb@smartsharesystems.com> wrote:
> 
> > +	fprintf(f, "  mem_list:\n");
> > +	n = 0;
> > +	STAILQ_FOREACH(memhdr, &mp->mem_list, next) {
> > +		fprintf(f, "    addr[%u]=%p\n", n, memhdr->addr);
> > +		fprintf(f, "    iova[%u]=0x%" PRIx64 "\n", n, memhdr->iova);
> > +		fprintf(f, "    len[%u]=%zu\n", n, memhdr->len);
> > +		n++;
> > +	}
> 
> The output would look better if it was a table with one line per mempool, and
> the name first
> and column headers, and n is redundant
> 
> mem_list:
> Addr	Iova	Len
> ...

I agree, but I followed the existing convention for how the dump output is formatted.
That's also why I show the index in the mem_list; without it, the output would look silly, showing the same fields multiple times with different values.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] mempool: dump includes list of memory chunks
  2024-05-16  8:59 [PATCH] mempool: dump includes list of memory chunks Morten Brørup
  2024-05-16 15:20 ` Stephen Hemminger
@ 2024-05-29 12:55 ` Paul Szczepanek
  2024-05-29 14:03   ` Morten Brørup
  2024-06-10  9:13 ` Morten Brørup
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 15+ messages in thread
From: Paul Szczepanek @ 2024-05-29 12:55 UTC (permalink / raw)
  To: Morten Brørup, andrew.rybchenko, konstantin.v.ananyev; +Cc: nd, dev



On 16/05/2024 09:59, Morten Brørup wrote:
> Added information about the memory chunks holding the objects in the
> mempool when dumping the status of the mempool to a file.
> 
> Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
> ---
>  lib/mempool/rte_mempool.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c
> index 12390a2c81..e9a8a5b411 100644
> --- a/lib/mempool/rte_mempool.c
> +++ b/lib/mempool/rte_mempool.c
> @@ -1230,6 +1230,7 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp)
>  #endif
>  	struct rte_mempool_memhdr *memhdr;
>  	struct rte_mempool_ops *ops;
> +	unsigned int n;
>  	unsigned common_count;
>  	unsigned cache_count;
>  	size_t mem_len = 0;
> @@ -1264,6 +1265,15 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp)
>  			(long double)mem_len / mp->size);
>  	}
>  
> +	fprintf(f, "  mem_list:\n");
> +	n = 0;
> +	STAILQ_FOREACH(memhdr, &mp->mem_list, next) {
> +		fprintf(f, "    addr[%u]=%p\n", n, memhdr->addr);
> +		fprintf(f, "    iova[%u]=0x%" PRIx64 "\n", n, memhdr->iova);
> +		fprintf(f, "    len[%u]=%zu\n", n, memhdr->len);
> +		n++;
> +	}
> +
>  	cache_count = rte_mempool_dump_cache(f, mp);
>  	common_count = rte_mempool_ops_get_count(mp);
>  	if ((cache_count + common_count) > mp->size)

It's useful information to dump. Maybe consider adding something akin to
RTE_LIBRTE_MEMPOOL_STATS to gate this in case the prints are
overwhelming due to high list element number.

Reviewed-by: Paul Szczepanek <paul.szczepanek@arm.com>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: [PATCH] mempool: dump includes list of memory chunks
  2024-05-29 12:55 ` Paul Szczepanek
@ 2024-05-29 14:03   ` Morten Brørup
  0 siblings, 0 replies; 15+ messages in thread
From: Morten Brørup @ 2024-05-29 14:03 UTC (permalink / raw)
  To: Paul Szczepanek, andrew.rybchenko, konstantin.v.ananyev; +Cc: nd, dev

> From: Paul Szczepanek [mailto:paul.szczepanek@arm.com]
> Sent: Wednesday, 29 May 2024 14.55
> 
> On 16/05/2024 09:59, Morten Brørup wrote:
> > Added information about the memory chunks holding the objects in the
> > mempool when dumping the status of the mempool to a file.
> >
> > Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
> > ---
> >  lib/mempool/rte_mempool.c | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> >
> > diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c
> > index 12390a2c81..e9a8a5b411 100644
> > --- a/lib/mempool/rte_mempool.c
> > +++ b/lib/mempool/rte_mempool.c
> > @@ -1230,6 +1230,7 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp)
> >  #endif
> >  	struct rte_mempool_memhdr *memhdr;
> >  	struct rte_mempool_ops *ops;
> > +	unsigned int n;
> >  	unsigned common_count;
> >  	unsigned cache_count;
> >  	size_t mem_len = 0;
> > @@ -1264,6 +1265,15 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp)
> >  			(long double)mem_len / mp->size);
> >  	}
> >
> > +	fprintf(f, "  mem_list:\n");
> > +	n = 0;
> > +	STAILQ_FOREACH(memhdr, &mp->mem_list, next) {
> > +		fprintf(f, "    addr[%u]=%p\n", n, memhdr->addr);
> > +		fprintf(f, "    iova[%u]=0x%" PRIx64 "\n", n, memhdr->iova);
> > +		fprintf(f, "    len[%u]=%zu\n", n, memhdr->len);
> > +		n++;
> > +	}
> > +
> >  	cache_count = rte_mempool_dump_cache(f, mp);
> >  	common_count = rte_mempool_ops_get_count(mp);
> >  	if ((cache_count + common_count) > mp->size)
> 
> It's useful information to dump. Maybe consider adding something akin to
> RTE_LIBRTE_MEMPOOL_STATS to gate this in case the prints are
> overwhelming due to high list element number.

The dumps are often very verbose, and there are no means to control that.

The only reason the mempool stats are gated by RTE_LIBRTE_MEMPOOL_STATS is because they are an build time optional feature, and don't exist if built without.

> 
> Reviewed-by: Paul Szczepanek <paul.szczepanek@arm.com>

Thanks.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: [PATCH] mempool: dump includes list of memory chunks
  2024-05-16  8:59 [PATCH] mempool: dump includes list of memory chunks Morten Brørup
  2024-05-16 15:20 ` Stephen Hemminger
  2024-05-29 12:55 ` Paul Szczepanek
@ 2024-06-10  9:13 ` Morten Brørup
  2024-06-10 11:56 ` Andrew Rybchenko
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: Morten Brørup @ 2024-06-10  9:13 UTC (permalink / raw)
  To: andrew.rybchenko, Frank Du, Ferruh Yigit, stephen; +Cc: dev

PING (again) for review.

It's only 10 lines of very simple code to dump some info.
And it follows existing dump conventions.

-Morten

> From: Morten Brørup [mailto:mb@smartsharesystems.com]
> Sent: Thursday, 16 May 2024 11.00
> 
> Added information about the memory chunks holding the objects in the
> mempool when dumping the status of the mempool to a file.
> 
> Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
> ---
>  lib/mempool/rte_mempool.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c
> index 12390a2c81..e9a8a5b411 100644
> --- a/lib/mempool/rte_mempool.c
> +++ b/lib/mempool/rte_mempool.c
> @@ -1230,6 +1230,7 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp)
>  #endif
>  	struct rte_mempool_memhdr *memhdr;
>  	struct rte_mempool_ops *ops;
> +	unsigned int n;
>  	unsigned common_count;
>  	unsigned cache_count;
>  	size_t mem_len = 0;
> @@ -1264,6 +1265,15 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp)
>  			(long double)mem_len / mp->size);
>  	}
> 
> +	fprintf(f, "  mem_list:\n");
> +	n = 0;
> +	STAILQ_FOREACH(memhdr, &mp->mem_list, next) {
> +		fprintf(f, "    addr[%u]=%p\n", n, memhdr->addr);
> +		fprintf(f, "    iova[%u]=0x%" PRIx64 "\n", n, memhdr->iova);
> +		fprintf(f, "    len[%u]=%zu\n", n, memhdr->len);
> +		n++;
> +	}
> +
>  	cache_count = rte_mempool_dump_cache(f, mp);
>  	common_count = rte_mempool_ops_get_count(mp);
>  	if ((cache_count + common_count) > mp->size)
> --
> 2.17.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] mempool: dump includes list of memory chunks
  2024-05-16  8:59 [PATCH] mempool: dump includes list of memory chunks Morten Brørup
                   ` (2 preceding siblings ...)
  2024-06-10  9:13 ` Morten Brørup
@ 2024-06-10 11:56 ` Andrew Rybchenko
  2024-06-10 13:44 ` Konstantin Ananyev
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: Andrew Rybchenko @ 2024-06-10 11:56 UTC (permalink / raw)
  To: Morten Brørup, konstantin.v.ananyev, paul.szczepanek; +Cc: dev

On 5/16/24 11:59, Morten Brørup wrote:
> Added information about the memory chunks holding the objects in the
> mempool when dumping the status of the mempool to a file.
> 
> Signed-off-by: Morten Brørup <mb@smartsharesystems.com>

Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>


^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: [PATCH] mempool: dump includes list of memory chunks
  2024-05-16  8:59 [PATCH] mempool: dump includes list of memory chunks Morten Brørup
                   ` (3 preceding siblings ...)
  2024-06-10 11:56 ` Andrew Rybchenko
@ 2024-06-10 13:44 ` Konstantin Ananyev
  2024-06-10 14:51   ` Morten Brørup
  2024-06-11  6:38 ` [PATCH v2] " Morten Brørup
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 15+ messages in thread
From: Konstantin Ananyev @ 2024-06-10 13:44 UTC (permalink / raw)
  To: Morten Brørup, andrew.rybchenko, konstantin.v.ananyev,
	paul.szczepanek
  Cc: dev



> Added information about the memory chunks holding the objects in the
> mempool when dumping the status of the mempool to a file.
> 
> Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
> ---
>  lib/mempool/rte_mempool.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c
> index 12390a2c81..e9a8a5b411 100644
> --- a/lib/mempool/rte_mempool.c
> +++ b/lib/mempool/rte_mempool.c
> @@ -1230,6 +1230,7 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp)
>  #endif
>  	struct rte_mempool_memhdr *memhdr;
>  	struct rte_mempool_ops *ops;
> +	unsigned int n;
>  	unsigned common_count;
>  	unsigned cache_count;
>  	size_t mem_len = 0;
> @@ -1264,6 +1265,15 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp)
>  			(long double)mem_len / mp->size);
>  	}
> 
> +	fprintf(f, "  mem_list:\n");
> +	n = 0;
> +	STAILQ_FOREACH(memhdr, &mp->mem_list, next) {
> +		fprintf(f, "    addr[%u]=%p\n", n, memhdr->addr);
> +		fprintf(f, "    iova[%u]=0x%" PRIx64 "\n", n, memhdr->iova);
> +		fprintf(f, "    len[%u]=%zu\n", n, memhdr->len);
> +		n++;
> +	}
> +
>  	cache_count = rte_mempool_dump_cache(f, mp);
>  	common_count = rte_mempool_ops_get_count(mp);
>  	if ((cache_count + common_count) > mp->size)
> --

Just as a thought: do we want to print something (N/A?) when mp->mem_list is empty?

Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
 

> 2.17.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: [PATCH] mempool: dump includes list of memory chunks
  2024-06-10 13:44 ` Konstantin Ananyev
@ 2024-06-10 14:51   ` Morten Brørup
  2024-06-10 16:28     ` Konstantin Ananyev
  0 siblings, 1 reply; 15+ messages in thread
From: Morten Brørup @ 2024-06-10 14:51 UTC (permalink / raw)
  To: Konstantin Ananyev, andrew.rybchenko, konstantin.v.ananyev,
	paul.szczepanek, stephen
  Cc: dev

> From: Konstantin Ananyev [mailto:konstantin.ananyev@huawei.com]
> Sent: Monday, 10 June 2024 15.45
> 
> > Added information about the memory chunks holding the objects in the
> > mempool when dumping the status of the mempool to a file.
> >
> > Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
> > ---
> >  lib/mempool/rte_mempool.c | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> >
> > diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c
> > index 12390a2c81..e9a8a5b411 100644
> > --- a/lib/mempool/rte_mempool.c
> > +++ b/lib/mempool/rte_mempool.c
> > @@ -1230,6 +1230,7 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp)
> >  #endif
> >  	struct rte_mempool_memhdr *memhdr;
> >  	struct rte_mempool_ops *ops;
> > +	unsigned int n;
> >  	unsigned common_count;
> >  	unsigned cache_count;
> >  	size_t mem_len = 0;
> > @@ -1264,6 +1265,15 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp)
> >  			(long double)mem_len / mp->size);
> >  	}
> >
> > +	fprintf(f, "  mem_list:\n");
> > +	n = 0;
> > +	STAILQ_FOREACH(memhdr, &mp->mem_list, next) {
> > +		fprintf(f, "    addr[%u]=%p\n", n, memhdr->addr);
> > +		fprintf(f, "    iova[%u]=0x%" PRIx64 "\n", n, memhdr->iova);
> > +		fprintf(f, "    len[%u]=%zu\n", n, memhdr->len);
> > +		n++;
> > +	}
> > +
> >  	cache_count = rte_mempool_dump_cache(f, mp);
> >  	common_count = rte_mempool_ops_get_count(mp);
> >  	if ((cache_count + common_count) > mp->size)
> > --
> 
> Just as a thought: do we want to print something (N/A?) when mp->mem_list is
> empty?

Good idea, Konstantin.

Your feedback made me check what other dump functions print when the list is empty, and I saw that the mbuf library's dump function prints segments with multiple fields on the same line [1], as previously suggested by Stephen (and rejected by me, because I thought it was breaking conventions).

[1]: https://elixir.bootlin.com/dpdk/v24.03/source/lib/mbuf/rte_mbuf.c#L694

Admitting that Stephen was on the right track with his suggestion, and I was wrong to reject it, we could omit the "mem_list:" header and print the list like this instead:

STAILQ_FOREACH(memhdr, &mp->mem_list, next)
	fprintf(f, "    memory chunk at %p, addr=%p, iova=0x%" PRIx64 ", len=%zu\n",
			memhdr, memhdr->addr, memhdr->iova, memhdr->len);

The patch will be just these three lines of code, and nothing will be printed if the list is empty.

What do you think?

> 
> Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
> 
> 
> > 2.17.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: [PATCH] mempool: dump includes list of memory chunks
  2024-06-10 14:51   ` Morten Brørup
@ 2024-06-10 16:28     ` Konstantin Ananyev
  0 siblings, 0 replies; 15+ messages in thread
From: Konstantin Ananyev @ 2024-06-10 16:28 UTC (permalink / raw)
  To: Morten Brørup, andrew.rybchenko, konstantin.v.ananyev,
	paul.szczepanek, stephen
  Cc: dev



Hi Morten,

> > > Added information about the memory chunks holding the objects in the
> > > mempool when dumping the status of the mempool to a file.
> > >
> > > Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
> > > ---
> > >  lib/mempool/rte_mempool.c | 10 ++++++++++
> > >  1 file changed, 10 insertions(+)
> > >
> > > diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c
> > > index 12390a2c81..e9a8a5b411 100644
> > > --- a/lib/mempool/rte_mempool.c
> > > +++ b/lib/mempool/rte_mempool.c
> > > @@ -1230,6 +1230,7 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp)
> > >  #endif
> > >  	struct rte_mempool_memhdr *memhdr;
> > >  	struct rte_mempool_ops *ops;
> > > +	unsigned int n;
> > >  	unsigned common_count;
> > >  	unsigned cache_count;
> > >  	size_t mem_len = 0;
> > > @@ -1264,6 +1265,15 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp)
> > >  			(long double)mem_len / mp->size);
> > >  	}
> > >
> > > +	fprintf(f, "  mem_list:\n");
> > > +	n = 0;
> > > +	STAILQ_FOREACH(memhdr, &mp->mem_list, next) {
> > > +		fprintf(f, "    addr[%u]=%p\n", n, memhdr->addr);
> > > +		fprintf(f, "    iova[%u]=0x%" PRIx64 "\n", n, memhdr->iova);
> > > +		fprintf(f, "    len[%u]=%zu\n", n, memhdr->len);
> > > +		n++;
> > > +	}
> > > +
> > >  	cache_count = rte_mempool_dump_cache(f, mp);
> > >  	common_count = rte_mempool_ops_get_count(mp);
> > >  	if ((cache_count + common_count) > mp->size)
> > > --
> >
> > Just as a thought: do we want to print something (N/A?) when mp->mem_list is
> > empty?
> 
> Good idea, Konstantin.
> 
> Your feedback made me check what other dump functions print when the list is empty, and I saw that the mbuf library's dump
> function prints segments with multiple fields on the same line [1], as previously suggested by Stephen (and rejected by me, because I
> thought it was breaking conventions).
> 
> [1]: https://elixir.bootlin.com/dpdk/v24.03/source/lib/mbuf/rte_mbuf.c#L694
> 
> Admitting that Stephen was on the right track with his suggestion, and I was wrong to reject it, we could omit the "mem_list:" header
> and print the list like this instead:
> 
> STAILQ_FOREACH(memhdr, &mp->mem_list, next)
> 	fprintf(f, "    memory chunk at %p, addr=%p, iova=0x%" PRIx64 ", len=%zu\n",
> 			memhdr, memhdr->addr, memhdr->iova, memhdr->len);
> 
> The patch will be just these three lines of code, and nothing will be printed if the list is empty.
> 
> What do you think?

Sounds reasonable to me.

> 
> >
> > Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
> >
> >
> > > 2.17.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v2] mempool: dump includes list of memory chunks
  2024-05-16  8:59 [PATCH] mempool: dump includes list of memory chunks Morten Brørup
                   ` (4 preceding siblings ...)
  2024-06-10 13:44 ` Konstantin Ananyev
@ 2024-06-11  6:38 ` Morten Brørup
  2024-06-11  6:50 ` Morten Brørup
  2024-06-11  6:51 ` [PATCH v3] " Morten Brørup
  7 siblings, 0 replies; 15+ messages in thread
From: Morten Brørup @ 2024-06-11  6:38 UTC (permalink / raw)
  To: dev; +Cc: stephen, Morten Brørup

Added information about the memory chunks holding the objects in the
mempool when dumping the status of the mempool to a file.

Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Paul Szczepanek <paul.szczepanek@arm.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
---
v2:
* Dump one line per entry. Remove headline and index number.
  (Stephen, Konstantin.)
* Changed reviewed-by to acked-by.
---
 lib/mempool/rte_mempool.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c
index 12390a2c81..f72cbc7217 100644
--- a/lib/mempool/rte_mempool.c
+++ b/lib/mempool/rte_mempool.c
@@ -1264,6 +1264,10 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp)
 			(long double)mem_len / mp->size);
 	}
 
+	STAILQ_FOREACH(memhdr, &mp->mem_list, next)
+		fprintf(f, "    memory chunk at %p, addr=%p, iova=0x%" PRIx64 ", len=%zu\n",
+				memhdr, memhdr->addr, memhdr->iova, memhdr->len);
+
 	cache_count = rte_mempool_dump_cache(f, mp);
 	common_count = rte_mempool_ops_get_count(mp);
 	if ((cache_count + common_count) > mp->size)
-- 
2.17.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v2] mempool: dump includes list of memory chunks
  2024-05-16  8:59 [PATCH] mempool: dump includes list of memory chunks Morten Brørup
                   ` (5 preceding siblings ...)
  2024-06-11  6:38 ` [PATCH v2] " Morten Brørup
@ 2024-06-11  6:50 ` Morten Brørup
  2024-06-11  6:51 ` [PATCH v3] " Morten Brørup
  7 siblings, 0 replies; 15+ messages in thread
From: Morten Brørup @ 2024-06-11  6:50 UTC (permalink / raw)
  To: dev; +Cc: stephen, Morten Brørup

Added information about the memory chunks holding the objects in the
mempool when dumping the status of the mempool to a file.

Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Paul Szczepanek <paul.szczepanek@arm.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
---
v2:
* Dump one line per entry. Remove headline and index number.
  (Stephen, Konstantin.)
* Changed reviewed-by to acked-by.
---
 lib/mempool/rte_mempool.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c
index 12390a2c81..f72cbc7217 100644
--- a/lib/mempool/rte_mempool.c
+++ b/lib/mempool/rte_mempool.c
@@ -1264,6 +1264,10 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp)
 			(long double)mem_len / mp->size);
 	}
 
+	STAILQ_FOREACH(memhdr, &mp->mem_list, next)
+		fprintf(f, "    memory chunk at %p, addr=%p, iova=0x%" PRIx64 ", len=%zu\n",
+				memhdr, memhdr->addr, memhdr->iova, memhdr->len);
+
 	cache_count = rte_mempool_dump_cache(f, mp);
 	common_count = rte_mempool_ops_get_count(mp);
 	if ((cache_count + common_count) > mp->size)
-- 
2.17.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v3] mempool: dump includes list of memory chunks
  2024-05-16  8:59 [PATCH] mempool: dump includes list of memory chunks Morten Brørup
                   ` (6 preceding siblings ...)
  2024-06-11  6:50 ` Morten Brørup
@ 2024-06-11  6:51 ` Morten Brørup
  2024-06-11 11:27   ` lihuisong (C)
  2024-06-14 14:10   ` David Marchand
  7 siblings, 2 replies; 15+ messages in thread
From: Morten Brørup @ 2024-06-11  6:51 UTC (permalink / raw)
  To: dev; +Cc: stephen, Morten Brørup

Added information about the memory chunks holding the objects in the
mempool when dumping the status of the mempool to a file.

Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Paul Szczepanek <paul.szczepanek@arm.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
---
v3:
* Fix output indentation.
* Print in existing loop, instead of adding a new loop.
v2:
* Dump one line per entry. Remove index number and headline.
  (Stephen, Konstantin.)
* Changed reviewed-by to acked-by.
---
 lib/mempool/rte_mempool.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c
index 12390a2c81..7ab1fcb480 100644
--- a/lib/mempool/rte_mempool.c
+++ b/lib/mempool/rte_mempool.c
@@ -1257,8 +1257,11 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp)
 	ops = rte_mempool_get_ops(mp->ops_index);
 	fprintf(f, "  ops_name: <%s>\n", (ops != NULL) ? ops->name : "NA");
 
-	STAILQ_FOREACH(memhdr, &mp->mem_list, next)
+	STAILQ_FOREACH(memhdr, &mp->mem_list, next) {
+		fprintf(f, "  memory chunk at %p, addr=%p, iova=0x%" PRIx64 ", len=%zu\n",
+				memhdr, memhdr->addr, memhdr->iova, memhdr->len);
 		mem_len += memhdr->len;
+	}
 	if (mem_len != 0) {
 		fprintf(f, "  avg bytes/object=%#Lf\n",
 			(long double)mem_len / mp->size);
-- 
2.17.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3] mempool: dump includes list of memory chunks
  2024-06-11  6:51 ` [PATCH v3] " Morten Brørup
@ 2024-06-11 11:27   ` lihuisong (C)
  2024-06-14 14:10   ` David Marchand
  1 sibling, 0 replies; 15+ messages in thread
From: lihuisong (C) @ 2024-06-11 11:27 UTC (permalink / raw)
  To: Morten Brørup, dev; +Cc: stephen


在 2024/6/11 14:51, Morten Brørup 写道:
> Added information about the memory chunks holding the objects in the
> mempool when dumping the status of the mempool to a file.
>
> Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
> Acked-by: Paul Szczepanek <paul.szczepanek@arm.com>
> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
> ---
> v3:
> * Fix output indentation.
> * Print in existing loop, instead of adding a new loop.
> v2:
> * Dump one line per entry. Remove index number and headline.
>    (Stephen, Konstantin.)
> * Changed reviewed-by to acked-by.
> ---
>   lib/mempool/rte_mempool.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c
> index 12390a2c81..7ab1fcb480 100644
> --- a/lib/mempool/rte_mempool.c
> +++ b/lib/mempool/rte_mempool.c
> @@ -1257,8 +1257,11 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp)
>   	ops = rte_mempool_get_ops(mp->ops_index);
>   	fprintf(f, "  ops_name: <%s>\n", (ops != NULL) ? ops->name : "NA");
>   
> -	STAILQ_FOREACH(memhdr, &mp->mem_list, next)
> +	STAILQ_FOREACH(memhdr, &mp->mem_list, next) {
> +		fprintf(f, "  memory chunk at %p, addr=%p, iova=0x%" PRIx64 ", len=%zu\n",
> +				memhdr, memhdr->addr, memhdr->iova, memhdr->len);
>   		mem_len += memhdr->len;
> +	}
>   	if (mem_len != 0) {
>   		fprintf(f, "  avg bytes/object=%#Lf\n",
>   			(long double)mem_len / mp->size);
Acked-by: Huisong Li<lihuisong@huawei.com>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3] mempool: dump includes list of memory chunks
  2024-06-11  6:51 ` [PATCH v3] " Morten Brørup
  2024-06-11 11:27   ` lihuisong (C)
@ 2024-06-14 14:10   ` David Marchand
  1 sibling, 0 replies; 15+ messages in thread
From: David Marchand @ 2024-06-14 14:10 UTC (permalink / raw)
  To: Morten Brørup; +Cc: dev, stephen

On Tue, Jun 11, 2024 at 8:51 AM Morten Brørup <mb@smartsharesystems.com> wrote:
>
> Added information about the memory chunks holding the objects in the
> mempool when dumping the status of the mempool to a file.
>
> Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
> Acked-by: Paul Szczepanek <paul.szczepanek@arm.com>
> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
Acked-by: Huisong Li <lihuisong@huawei.com>

Applied, thanks.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2024-06-14 14:10 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-16  8:59 [PATCH] mempool: dump includes list of memory chunks Morten Brørup
2024-05-16 15:20 ` Stephen Hemminger
2024-05-17  7:29   ` Morten Brørup
2024-05-29 12:55 ` Paul Szczepanek
2024-05-29 14:03   ` Morten Brørup
2024-06-10  9:13 ` Morten Brørup
2024-06-10 11:56 ` Andrew Rybchenko
2024-06-10 13:44 ` Konstantin Ananyev
2024-06-10 14:51   ` Morten Brørup
2024-06-10 16:28     ` Konstantin Ananyev
2024-06-11  6:38 ` [PATCH v2] " Morten Brørup
2024-06-11  6:50 ` Morten Brørup
2024-06-11  6:51 ` [PATCH v3] " Morten Brørup
2024-06-11 11:27   ` lihuisong (C)
2024-06-14 14:10   ` David Marchand

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).