projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Treewide: replace ssnprintf with snprintf
[collectd.git]
/
src
/
dpdkstat.c
diff --git
a/src/dpdkstat.c
b/src/dpdkstat.c
index
6b057f2
..
debcfef
100644
(file)
--- a/
src/dpdkstat.c
+++ b/
src/dpdkstat.c
@@
-103,6
+103,8
@@
static void dpdk_stats_default_config(void) {
for (int i = 0; i < RTE_MAX_ETHPORTS; i++) {
ec->config.port_name[i][0] = 0;
}
for (int i = 0; i < RTE_MAX_ETHPORTS; i++) {
ec->config.port_name[i][0] = 0;
}
+ /* Enable all ports by default */
+ ec->config.enabled_port_mask = ~0;
}
static int dpdk_stats_preinit(void) {
}
static int dpdk_stats_preinit(void) {
@@
-251,7
+253,7
@@
static int dpdk_helper_stats_count_get(dpdk_helper_ctx_t *phc) {
}
static int dpdk_stats_get_size(dpdk_helper_ctx_t *phc) {
}
static int dpdk_stats_get_size(dpdk_helper_ctx_t *phc) {
- return
(dpdk_helper_data_size_get(phc) - sizeof(dpdk_stats_ctx_t)
);
+ return
dpdk_helper_data_size_get(phc) - sizeof(dpdk_stats_ctx_t
);
}
int dpdk_helper_command_handler(dpdk_helper_ctx_t *phc, enum DPDK_CMD cmd) {
}
int dpdk_helper_command_handler(dpdk_helper_ctx_t *phc, enum DPDK_CMD cmd) {
@@
-374,9
+376,9
@@
static int dpdk_stats_counters_dispatch(dpdk_helper_ctx_t *phc) {
char dev_name[64];
if (ctx->config.port_name[i][0] != 0) {
char dev_name[64];
if (ctx->config.port_name[i][0] != 0) {
- s
s
nprintf(dev_name, sizeof(dev_name), "%s", ctx->config.port_name[i]);
+ snprintf(dev_name, sizeof(dev_name), "%s", ctx->config.port_name[i]);
} else {
} else {
- s
s
nprintf(dev_name, sizeof(dev_name), "port.%d", i);
+ snprintf(dev_name, sizeof(dev_name), "port.%d", i);
}
DEBUG(" === Dispatch stats for port %d (name=%s; stats_count=%d)", i,
}
DEBUG(" === Dispatch stats for port %d (name=%s; stats_count=%d)", i,