DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] mempool: hide zero value items when dump cache
@ 2025-09-04 12:09 Chengwen Feng
  2025-09-04 12:15 ` Morten Brørup
  0 siblings, 1 reply; 2+ messages in thread
From: Chengwen Feng @ 2025-09-04 12:09 UTC (permalink / raw)
  To: thomas; +Cc: dev

Hide zero value items when dump mempool cache.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
 lib/mempool/rte_mempool.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c
index 1021ede0c2..3042d94c14 100644
--- a/lib/mempool/rte_mempool.c
+++ b/lib/mempool/rte_mempool.c
@@ -1057,7 +1057,7 @@ rte_mempool_dump_cache(FILE *f, const struct rte_mempool *mp)
 	unsigned count = 0;
 	unsigned cache_count;
 
-	fprintf(f, "  internal cache infos:\n");
+	fprintf(f, "  internal cache infos (hide zero value items):\n");
 	fprintf(f, "    cache_size=%"PRIu32"\n", mp->cache_size);
 
 	if (mp->cache_size == 0)
@@ -1065,6 +1065,8 @@ rte_mempool_dump_cache(FILE *f, const struct rte_mempool *mp)
 
 	for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
 		cache_count = mp->local_cache[lcore_id].len;
+		if (cache_count == 0)
+			continue;
 		fprintf(f, "    cache_count[%u]=%"PRIu32"\n",
 			lcore_id, cache_count);
 		count += cache_count;
-- 
2.17.1


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

* RE: [PATCH] mempool: hide zero value items when dump cache
  2025-09-04 12:09 [PATCH] mempool: hide zero value items when dump cache Chengwen Feng
@ 2025-09-04 12:15 ` Morten Brørup
  0 siblings, 0 replies; 2+ messages in thread
From: Morten Brørup @ 2025-09-04 12:15 UTC (permalink / raw)
  To: Chengwen Feng, thomas; +Cc: dev

> From: Chengwen Feng [mailto:fengchengwen@huawei.com]
> Sent: Thursday, 4 September 2025 14.10
> 
> Hide zero value items when dump mempool cache.
> 
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> ---

Yes, they were annoying. Thank you.

Acked-by: Morten Brørup <mb@smartsharesystems.com>


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

end of thread, other threads:[~2025-09-04 12:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-04 12:09 [PATCH] mempool: hide zero value items when dump cache Chengwen Feng
2025-09-04 12:15 ` Morten Brørup

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