mirror of https://github.com/F-Stack/f-stack.git
alows user to set dpdk log level from config.ini file.
Signed-off-by: Muhammad Jawad Hussain <jawad.hussain@emumba.com>
This commit is contained in:
parent
4f02579eda
commit
b497d0d7ac
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue