From 09b4978cfd8bfb3a42095b0ecdb1ac78cc448cc9 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 29 Dec 2016 13:59:30 +0800 Subject: [PATCH] msg/async: be compatible with dpdk v16.07 Signed-off-by: Kefu Chai --- src/msg/async/dpdk/DPDK.cc | 3 ++- src/msg/async/dpdk/DPDK.h | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/msg/async/dpdk/DPDK.cc b/src/msg/async/dpdk/DPDK.cc index cb907807ef6a9..8da12c3fd35ee 100644 --- a/src/msg/async/dpdk/DPDK.cc +++ b/src/msg/async/dpdk/DPDK.cc @@ -665,9 +665,10 @@ void DPDKQueuePair::handle_stats() return ; } +#if RTE_VERSION < RTE_VERSION_NUM(16,7,0,0) _dev->perf_logger->set(l_dpdk_dev_rx_mcast, rte_stats.imcasts); - _dev->perf_logger->set(l_dpdk_dev_rx_badcrc_errors, rte_stats.ibadcrc); +#endif _dev->perf_logger->set(l_dpdk_dev_rx_dropped_errors, rte_stats.imissed); _dev->perf_logger->set(l_dpdk_dev_rx_nombuf_errors, rte_stats.rx_nombuf); diff --git a/src/msg/async/dpdk/DPDK.h b/src/msg/async/dpdk/DPDK.h index 868f6fecdcda6..b0c7ec780767e 100644 --- a/src/msg/async/dpdk/DPDK.h +++ b/src/msg/async/dpdk/DPDK.h @@ -42,6 +42,7 @@ #include #include #include +#include #include "include/page.h" #include "common/Tub.h" @@ -834,10 +835,13 @@ class DPDKDevice { string name(std::string("port") + std::to_string(port_idx)); PerfCountersBuilder plb(cct, name, l_dpdk_dev_first, l_dpdk_dev_last); +#if RTE_VERSION < RTE_VERSION_NUM(16,7,0,0) plb.add_u64_counter(l_dpdk_dev_rx_mcast, "dpdk_device_receive_multicast_packets", "DPDK received multicast packets"); + plb.add_u64_counter(l_dpdk_dev_rx_badcrc_errors, "dpdk_device_receive_badcrc_errors", "DPDK received bad crc errors"); +#endif + plb.add_u64_counter(l_dpdk_dev_rx_total_errors, "dpdk_device_receive_total_errors", "DPDK received total_errors"); plb.add_u64_counter(l_dpdk_dev_tx_total_errors, "dpdk_device_send_total_errors", "DPDK sendd total_errors"); - plb.add_u64_counter(l_dpdk_dev_rx_badcrc_errors, "dpdk_device_receive_badcrc_errors", "DPDK received bad crc errors"); plb.add_u64_counter(l_dpdk_dev_rx_dropped_errors, "dpdk_device_receive_dropped_errors", "DPDK received dropped errors"); plb.add_u64_counter(l_dpdk_dev_rx_nombuf_errors, "dpdk_device_receive_nombuf_errors", "DPDK received RX mbuf allocation errors"); -- 2.39.5