summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rw-r--r--lib/dpdk-unixctl.man2
-rw-r--r--lib/dpdk.c10
3 files changed, 13 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index ebba17b22..db3faf4cc 100644
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,7 @@ Post-v2.15.0
- DPDK:
* OVS validated with DPDK 20.11.1. It is recommended to use this version
until further releases.
+ * New debug appctl command 'dpdk/get-malloc-stats'.
- ovsdb-tool:
* New option '--election-timer' to the 'create-cluster' command to set the
leader election timer during cluster creation.
diff --git a/lib/dpdk-unixctl.man b/lib/dpdk-unixctl.man
index 2d6d576f2..a0d1fa2ea 100644
--- a/lib/dpdk-unixctl.man
+++ b/lib/dpdk-unixctl.man
@@ -10,5 +10,7 @@ list of words separated by spaces: a word can be either a logging \fBlevel\fR
\fBnotice\fR, \fBinfo\fR or \fBdebug\fR) or a \fBpattern\fR matching DPDK
components (see \fBdpdk/log-list\fR command on \fBovs\-appctl\fR(8)) separated
by a colon from the logging \fBlevel\fR to apply.
+.IP "\fBdpdk/get-malloc-stats\fR"
+Prints the heap information statistics about DPDK malloc.
.RE
.
diff --git a/lib/dpdk.c b/lib/dpdk.c
index 319540394..2eaaa569c 100644
--- a/lib/dpdk.c
+++ b/lib/dpdk.c
@@ -25,6 +25,7 @@
#include <rte_cpuflags.h>
#include <rte_errno.h>
#include <rte_log.h>
+#include <rte_malloc.h>
#include <rte_memzone.h>
#include <rte_version.h>
@@ -356,6 +357,12 @@ dpdk_unixctl_log_set(struct unixctl_conn *conn, int argc, const char *argv[],
unixctl_command_reply(conn, NULL);
}
+static void
+malloc_dump_stats_wrapper(FILE *stream)
+{
+ rte_malloc_dump_stats(stream, NULL);
+}
+
static bool
dpdk_init__(const struct smap *ovs_other_config)
{
@@ -525,6 +532,9 @@ dpdk_init__(const struct smap *ovs_other_config)
dpdk_unixctl_mem_stream, rte_log_dump);
unixctl_command_register("dpdk/log-set", "{level | pattern:level}", 0,
INT_MAX, dpdk_unixctl_log_set, NULL);
+ unixctl_command_register("dpdk/get-malloc-stats", "", 0, 0,
+ dpdk_unixctl_mem_stream,
+ malloc_dump_stats_wrapper);
/* We are called from the main thread here */
RTE_PER_LCORE(_lcore_id) = NON_PMD_CORE_ID;