The ```rte_mempool_avail_count``` and ```rte_mempool_in_use_count```
can tell us the usage of the mempool. It could be helpful for debug
on any memleak in the mempool.
Add a line in the cmd's output.
- Count: avail (118988), in use (12084)

Signed-off-by: Wan Junjie <wanjun...@bytedance.com>
---
 lib/netdev-dpdk.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index b6b29c75e..e5d40a816 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -3864,6 +3864,9 @@ netdev_dpdk_get_mempool_info(struct unixctl_conn *conn,
         ovs_mutex_lock(&dpdk_mp_mutex);
 
         rte_mempool_dump(stream, dev->dpdk_mp->mp);
+        fprintf(stream, "  - Count: avail (%u), in use (%u)\n",
+                rte_mempool_avail_count(dev->dpdk_mp->mp),
+                rte_mempool_in_use_count(dev->dpdk_mp->mp));
 
         ovs_mutex_unlock(&dpdk_mp_mutex);
         ovs_mutex_unlock(&dev->mutex);
-- 
2.33.0

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to