projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dpdk: fix deprecation warning
[collectd.git]
/
src
/
dpdkevents.c
diff --git
a/src/dpdkevents.c
b/src/dpdkevents.c
index
064dce1
..
9fc42b3
100644
(file)
--- a/
src/dpdkevents.c
+++ b/
src/dpdkevents.c
@@
-420,7
+420,11
@@
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 */
dpdk_events_ctx_t *ec = DPDK_EVENTS_CTX_GET(phc);
/* get Link Status values from DPDK */
+#if RTE_VERSION < RTE_VERSION_NUM(18, 05, 0, 0)
uint8_t nb_ports = rte_eth_dev_count();
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");
if (nb_ports == 0) {
DPDK_CHILD_LOG("dpdkevent-helper: No DPDK ports available. "
"Check bound devices to DPDK driver.\n");