[v4,5/8] app/proc-info: enhance mempool to print ops name
diff mbox series

Message ID 20200721182242.5366-6-stephen@networkplumber.org
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show
Series
  • app/proc-info enhancements
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger July 21, 2020, 6:22 p.m. UTC
From: Hemant Agrawal <hemant.agrawal@nxp.com>

Enhance the mempool details to also print the ops index and name

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/proc-info/main.c | 5 +++++
 1 file changed, 5 insertions(+)

Patch
diff mbox series

diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index 7c1276b7fbc1..f3f83c0cea37 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -1219,7 +1219,10 @@  show_mempool(char *name)
 	if (name != NULL) {
 		struct rte_mempool *ptr = rte_mempool_lookup(name);
 		if (ptr != NULL) {
+			struct rte_mempool_ops *ops;
+
 			flags = ptr->flags;
+			ops = rte_mempool_get_ops(ptr->ops_index);
 			printf("  - Name: %s on socket %d\n"
 				"  - flags:\n"
 				"\t  -- No spread (%c)\n"
@@ -1249,6 +1252,8 @@  show_mempool(char *name)
 			printf("  - Count: avail (%u), in use (%u)\n",
 				rte_mempool_avail_count(ptr),
 				rte_mempool_in_use_count(ptr));
+			printf("  - ops_index %d ops_name %s\n",
+				ptr->ops_index, ops ? ops->name : "NA");
 
 			return;
 		}