summaryrefslogtreecommitdiff
path: root/lib/netdev-dpdk.c
diff options
context:
space:
mode:
authorWan Junjie <wanjunjie@bytedance.com>2022-01-25 17:41:25 +0800
committerIlya Maximets <i.maximets@ovn.org>2022-03-04 19:58:15 +0100
commit9016592ca09043d5c10f424fb6c8717f270fdfaf (patch)
treed6bc3c5e32d83bed2cc26825e10acc816b7ab222 /lib/netdev-dpdk.c
parent7ed60839d043777aba80c57a171d10e96077a989 (diff)
downloadopenvswitch-9016592ca09043d5c10f424fb6c8717f270fdfaf.tar.gz
netdev-dpdk: Add mempool count in cmd get-mempool-info.
The rte_mempool_avail_count() and rte_mempool_in_use_count() DPDK API 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) Acked-by: Aaron Conole <aconole@redhat.com> Acked-by: Kevin Traynor <ktraynor@redhat.com> Signed-off-by: Wan Junjie <wanjunjie@bytedance.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'lib/netdev-dpdk.c')
-rw-r--r--lib/netdev-dpdk.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 667d758b2..fbc3b42d8 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -3865,6 +3865,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);