From 10980465ce97eceff05ac94a69a13d63d3cfa70a Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Mon, 22 May 2017 15:32:04 +0200 Subject: dpdk: make dpdk global debug level configurable Adds startup.conf knob: dpdk { log-level debug } Change-Id: I80dfbc00559528d7b0970958fba9f08d97aa7118 Signed-off-by: Damjan Marion --- src/plugins/dpdk/device/init.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/plugins/dpdk/device/init.c') diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c index 545a15e802c..a972394c374 100755 --- a/src/plugins/dpdk/device/init.c +++ b/src/plugins/dpdk/device/init.c @@ -810,6 +810,7 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input) dpdk_device_config_t *devconf; vlib_pci_addr_t pci_addr; unformat_input_t sub_input; + uword x; u8 *s, *tmp = 0; u8 *rte_cmd = 0, *ethname = 0; u32 log_level; @@ -822,6 +823,7 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input) u8 *socket_mem = 0; conf->device_config_index_by_pci_addr = hash_create (0, sizeof (uword)); + log_level = RTE_LOG_NOTICE; while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) { @@ -838,6 +840,9 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input) else if (unformat (input, "decimal-interface-names")) conf->interface_name_format_decimal = 1; + else if (unformat (input, "log-level %U", unformat_dpdk_log_level, &x)) + log_level = x; + else if (unformat (input, "no-multi-seg")) conf->no_multi_seg = 1; @@ -1175,8 +1180,6 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input) /* Set up DPDK eal and packet mbuf pool early. */ - log_level = (CLIB_DEBUG > 0) ? RTE_LOG_DEBUG : RTE_LOG_NOTICE; - #if RTE_VERSION >= RTE_VERSION_NUM(17, 5, 0, 0) rte_log_set_global_level (log_level); #else -- cgit 1.2.3-korg