diff --git a/config.ini b/config.ini index 9ab33bb16..352b51da7 100644 --- a/config.ini +++ b/config.ini @@ -70,6 +70,9 @@ nb_vdev=0 # Number of bond. nb_bond=0 +# log level for dpdk, optional +# log_level=0 + # Each core write into own pcap file, which is open one time, close one time if enough. # Support dump the first snaplen bytes of each packet. # if pcap file is lager than savelen bytes, it will be closed and next file was dumped into. diff --git a/lib/ff_config.c b/lib/ff_config.c index 30b93f725..116d686c9 100644 --- a/lib/ff_config.c +++ b/lib/ff_config.c @@ -656,7 +656,9 @@ ini_parse_handler(void* user, const char* section, const char* name, printf("[%s]: %s=%s\n", section, name, value); #define MATCH(s, n) strcmp(section, s) == 0 && strcmp(name, n) == 0 - if (MATCH("dpdk", "channel")) { + if (MATCH("dpdk", "log_level")) { + pconfig->dpdk.log_level = atoi(value); + } else if (MATCH("dpdk", "channel")) { pconfig->dpdk.nb_channel = atoi(value); } else if (MATCH("dpdk", "memory")) { pconfig->dpdk.memory = atoi(value); @@ -760,6 +762,10 @@ dpdk_args_setup(struct ff_config *cfg) sprintf(temp, "-m%d", cfg->dpdk.memory); dpdk_argv[n++] = strdup(temp); } + if (cfg->dpdk.log_level) { + sprintf(temp, "--log-level=%d", cfg->dpdk.log_level); + dpdk_argv[n++] = strdup(temp); + } if (cfg->dpdk.proc_type) { sprintf(temp, "--proc-type=%s", cfg->dpdk.proc_type); dpdk_argv[n++] = strdup(temp); diff --git a/lib/ff_config.h b/lib/ff_config.h index 30d7d4052..a6fca3891 100644 --- a/lib/ff_config.h +++ b/lib/ff_config.h @@ -164,6 +164,9 @@ struct ff_config { int nb_ports; uint16_t max_portid; uint16_t *portid_list; + + // load dpdk log level + uint16_t log_level; // MAP(portid => struct ff_port_cfg*) struct ff_port_cfg *port_cfgs; struct ff_vdev_cfg *vdev_cfgs;