From 9e36fa0f4e96337c1c03a35500dfd5acd5d243b5 Mon Sep 17 00:00:00 2001 From: Ilya Maximets Date: Thu, 14 Mar 2019 17:43:48 +0300 Subject: [PATCH] dpdk: Stop dumping memzones to stdout. Information about memzones reserved on init is not much useful. Anyway, we need to log it in more civilized manner, i.e. through the OVS logging subsystem. Signed-off-by: Ilya Maximets Acked-by: Aaron Conole Signed-off-by: Ian Stokes --- lib/dpdk.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/dpdk.c b/lib/dpdk.c index d2df22b51c9..3f208461a51 100644 --- a/lib/dpdk.c +++ b/lib/dpdk.c @@ -474,7 +474,23 @@ dpdk_init__(const struct smap *ovs_other_config) return false; } - rte_memzone_dump(stdout); + if (VLOG_IS_DBG_ENABLED()) { + size_t size; + char *response = NULL; + FILE *stream = open_memstream(&response, &size); + + if (stream) { + rte_memzone_dump(stream); + fclose(stream); + if (size) { + VLOG_DBG("rte_memzone_dump:\n%s", response); + } + free(response); + } else { + VLOG_DBG("Could not dump memzone. Unable to open memstream: %s.", + ovs_strerror(errno)); + } + } /* We are called from the main thread here */ RTE_PER_LCORE(_lcore_id) = NON_PMD_CORE_ID;