dpdk: pass log-level configuration to EAL 17/18217/2
authorStephen Hemminger <stephen@networkplumber.org>
Tue, 12 Mar 2019 16:47:16 +0000 (09:47 -0700)
committerDamjan Marion <dmarion@me.com>
Tue, 12 Mar 2019 19:10:30 +0000 (19:10 +0000)
The log-level dpdk config value should be transparently
forwarded to DPDK via EAL argument.  Since DPDK now supports
naming log-levels, VPP no longer needs to parse and call
rte_set_loglevel().

This was the other part of the DPDK log-level change.
It must have got missed during my initial checkin.
Without it passing dynamic log-level values like are silently
ignored.

Fixes: 6ca6ac6c887e ("dpdk: support passing log-level")
Change-Id: I732cec5f638c9924e3ffb04c4753f957e3633d64
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
src/plugins/dpdk/device/dpdk.h
src/plugins/dpdk/device/format.c
src/plugins/dpdk/device/init.c

index 5d8368b..161dade 100644 (file)
@@ -503,7 +503,6 @@ format_function_t format_dpdk_flow;
 format_function_t format_dpdk_rss_hf_name;
 format_function_t format_dpdk_rx_offload_caps;
 format_function_t format_dpdk_tx_offload_caps;
-unformat_function_t unformat_dpdk_log_level;
 vnet_flow_dev_ops_function_t dpdk_flow_ops_fn;
 
 clib_error_t *unformat_rss_fn (unformat_input_t * input, uword * rss_fn);
index 3b18387..9dbaaba 100644 (file)
   foreach_dpdk_pkt_rx_offload_flag              \
   foreach_dpdk_pkt_tx_offload_flag
 
-#define foreach_dpdk_log_level \
-  _ (EMERG, "emergency")       \
-  _ (ALERT, "alert")           \
-  _ (CRIT, "critical")         \
-  _ (ERR, "error")             \
-  _ (WARNING, "warning")       \
-  _ (NOTICE, "notice")         \
-  _ (INFO, "info")             \
-  _ (DEBUG, "debug")
-
 u8 *
 format_dpdk_device_name (u8 * s, va_list * args)
 {
@@ -921,20 +911,6 @@ unformat_rss_fn (unformat_input_t * input, uword * rss_fn)
   return 0;
 }
 
-uword
-unformat_dpdk_log_level (unformat_input_t * input, va_list * args)
-{
-  u32 *r = va_arg (*args, u32 *);
-
-  if (0);
-#define _(v,s) else if (unformat (input, s)) *r = RTE_LOG_##v;
-  foreach_dpdk_log_level
-#undef _
-    else
-    return 0;
-  return 1;
-}
-
 clib_error_t *
 unformat_hqos (unformat_input_t * input, dpdk_device_config_hqos_t * hqos)
 {
index ef16f46..48869fc 100644 (file)
@@ -1061,7 +1061,6 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input)
   unformat_input_t sub_input;
   uword default_hugepage_sz, x;
   u8 *s, *tmp = 0;
-  u32 log_level;
   int ret, i;
   int num_whitelisted = 0;
   u8 no_pci = 0;
@@ -1075,7 +1074,6 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input)
     format (0, "%s/hugepages%c", vlib_unix_get_runtime_dir (), 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)
     {
@@ -1094,9 +1092,6 @@ 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;
 
@@ -1335,7 +1330,6 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input)
 
   /* Set up DPDK eal and packet mbuf pool early. */
 
-  rte_log_set_global_level (log_level);
   int log_fds[2] = { 0 };
   if (pipe (log_fds) == 0)
     {