From 5af4545d64498b66b1ce6d57b163dde8a5dacda9 Mon Sep 17 00:00:00 2001 From: Jiri Prokes Date: Wed, 25 Oct 2017 05:51:18 -0700 Subject: [PATCH] Incorporation of review commnets Signed-off-by: Jiri Prokes --- src/collectd.conf.in | 2 ++ src/collectd.conf.pod | 16 ++++++++++++++++ src/utils_dpdk.c | 6 ++++-- src/utils_dpdk.h | 2 +- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/collectd.conf.in b/src/collectd.conf.in index 261abdfd..2051f389 100644 --- a/src/collectd.conf.in +++ b/src/collectd.conf.in @@ -561,6 +561,8 @@ # Coremask "0x2" # MemoryChannels "4" # FilePrefix "rte" +# LogLevel "7" +# RteDriverLibPath "/usr/lib/dpdk-pmd" # # SharedMemObj "dpdk_collectd_stats_0" # EnabledPortMask 0xffff diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod index cf76e639..97d184a1 100644 --- a/src/collectd.conf.pod +++ b/src/collectd.conf.pod @@ -2572,6 +2572,8 @@ B MemoryChannels "4" FilePrefix "rte" SocketMemory "1024" + LogLevel "7" + RteDriverLibPath "/usr/lib/dpdk-pmd" SharedMemObj "dpdk_collectd_stats_0" EnabledPortMask 0xffff @@ -2604,6 +2606,20 @@ The prefix text used for hugepage filenames. The filename will be set to A string containing amount of Memory to allocate from hugepages on specific sockets in MB. This is an optional value. +=item B I + +A string containing log level number. This parameter is optional. +If parameter is not present then default value "7" - (INFO) is used. +Value "8" - (DEBUG) can be set to enable debug traces. + +=item B I + +A string containing path to shared pmd driver lib or path to directory, +where shared pmd driver libs are available. This parameter is optional. +This parameter enable loading of shared pmd driver libs from defined path. +E.g.: "/usr/lib/dpdk-pmd/librte_pmd_i40e.so" +or "/usr/lib/dpdk-pmd" + =back =over 3 diff --git a/src/utils_dpdk.c b/src/utils_dpdk.c index 2f37818b..b6056466 100644 --- a/src/utils_dpdk.c +++ b/src/utils_dpdk.c @@ -45,7 +45,9 @@ #define DPDK_DEFAULT_RTE_CONFIG "/var/run/.rte_config" #define DPDK_EAL_ARGC 10 -// Complete trace should fit into 1024 chars +// Complete trace should fit into 1024 chars. Trace contain some headers +// and text together with traced data from pipe. This is the reason why +// we need to limit DPDK_MAX_BUFFER_SIZE value. #define DPDK_MAX_BUFFER_SIZE 896 #define DPDK_CDM_DEFAULT_TIMEOUT 10000 @@ -731,7 +733,7 @@ static void dpdk_helper_check_pipe(dpdk_helper_ctx_t *phc) { DEBUG("%s:dpdk_helper_check_pipe: read nbytes=%d", phc->shm_name, nbytes); if (nbytes <= 0) break; - buf[nbytes] = '\n'; + buf[nbytes] = '\0'; sstrncpy(out, buf, (nbytes + 1)); DEBUG("%s: helper process:\n%s", phc->shm_name, out); } diff --git a/src/utils_dpdk.h b/src/utils_dpdk.h index e8d85357..f3b7e7f7 100644 --- a/src/utils_dpdk.h +++ b/src/utils_dpdk.h @@ -52,7 +52,7 @@ struct dpdk_eal_config_s { char socket_memory[DATA_MAX_NAME_LEN]; char file_prefix[DATA_MAX_NAME_LEN]; char log_level[DATA_MAX_NAME_LEN]; - char rte_driver_lib_path[DATA_MAX_NAME_LEN]; + char rte_driver_lib_path[PATH_MAX]; }; typedef struct dpdk_eal_config_s dpdk_eal_config_t; -- 2.30.2