From: Pavel Rochnyak Date: Thu, 5 Jul 2018 03:37:36 +0000 (+0700) Subject: Merge pull request #2845 from rpv-tomsk/tmpfix X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=8a9e349b729ca8aa3144340b5b0fe85183597e06;hp=85fd55f0c419cfd23aef9a408e8a0167aca9e4d5;p=collectd.git Merge pull request #2845 from rpv-tomsk/tmpfix redis plugin: Remove `operations_per_second` metric. --- diff --git a/src/dpdkevents.c b/src/dpdkevents.c index 9970be0c..2a44b2c1 100644 --- a/src/dpdkevents.c +++ b/src/dpdkevents.c @@ -419,8 +419,12 @@ static int dpdk_events_config(oconfig_item_t *ci) { static int dpdk_helper_link_status_get(dpdk_helper_ctx_t *phc) { dpdk_events_ctx_t *ec = DPDK_EVENTS_CTX_GET(phc); - /* get Link Status values from DPDK */ +/* get Link Status values from DPDK */ +#if RTE_VERSION < RTE_VERSION_NUM(18, 05, 0, 0) uint8_t nb_ports = rte_eth_dev_count(); +#else + uint8_t nb_ports = rte_eth_dev_count_avail(); +#endif if (nb_ports == 0) { DPDK_CHILD_LOG("dpdkevent-helper: No DPDK ports available. " "Check bound devices to DPDK driver.\n"); diff --git a/src/statsd.c b/src/statsd.c index 444e8ea1..6fbfd181 100644 --- a/src/statsd.c +++ b/src/statsd.c @@ -489,8 +489,8 @@ static int statsd_network_init(struct pollfd **ret_fds, /* {{{ */ int fd; struct pollfd *tmp; - char dbg_node[NI_MAXHOST]; - char dbg_service[NI_MAXSERV]; + char str_node[NI_MAXHOST]; + char str_service[NI_MAXSERV]; fd = socket(ai_ptr->ai_family, ai_ptr->ai_socktype, ai_ptr->ai_protocol); if (fd < 0) { @@ -498,15 +498,16 @@ static int statsd_network_init(struct pollfd **ret_fds, /* {{{ */ continue; } - getnameinfo(ai_ptr->ai_addr, ai_ptr->ai_addrlen, dbg_node, sizeof(dbg_node), - dbg_service, sizeof(dbg_service), + getnameinfo(ai_ptr->ai_addr, ai_ptr->ai_addrlen, str_node, sizeof(str_node), + str_service, sizeof(str_service), NI_DGRAM | NI_NUMERICHOST | NI_NUMERICSERV); - DEBUG("statsd plugin: Trying to bind to [%s]:%s ...", dbg_node, - dbg_service); + DEBUG("statsd plugin: Trying to bind to [%s]:%s ...", str_node, + str_service); status = bind(fd, ai_ptr->ai_addr, ai_ptr->ai_addrlen); if (status != 0) { - ERROR("statsd plugin: bind(2) failed: %s", STRERRNO); + ERROR("statsd plugin: bind(2) to [%s]:%s failed: %s", str_node, + str_service, STRERRNO); close(fd); continue; } diff --git a/src/utils_dpdk.c b/src/utils_dpdk.c index 1d4668f3..aee97917 100644 --- a/src/utils_dpdk.c +++ b/src/utils_dpdk.c @@ -853,7 +853,11 @@ uint128_t str_to_uint128(const char *str, int len) { } uint8_t dpdk_helper_eth_dev_count(void) { +#if RTE_VERSION < RTE_VERSION_NUM(18, 05, 0, 0) uint8_t ports = rte_eth_dev_count(); +#else + uint8_t ports = rte_eth_dev_count_avail(); +#endif if (ports == 0) { ERROR( "%s:%d: No DPDK ports available. Check bound devices to DPDK driver.\n",