X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdpdkevents.c;h=4cdf01dfb778a83626b99e07d67403c865906835;hb=d4f53887527777296b0982af60f4c0fecdb2f0d9;hp=9970be0c055e04be875a1d7f704d0c23855081e5;hpb=6eb269f494c039f1ff94f4771ac7ebf9f2783cba;p=collectd.git diff --git a/src/dpdkevents.c b/src/dpdkevents.c index 9970be0c..4cdf01df 100644 --- a/src/dpdkevents.c +++ b/src/dpdkevents.c @@ -32,12 +32,12 @@ #include "collectd.h" -#include "common.h" #include "plugin.h" +#include "utils/common/common.h" #include "semaphore.h" #include "sys/mman.h" -#include "utils_dpdk.h" +#include "utils/dpdk/dpdk.h" #include "utils_time.h" #include @@ -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");