aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/CMakeLists.txt2
-rw-r--r--host/lib/include/uhdlib/transport/dpdk/common.hpp32
-rw-r--r--host/lib/transport/uhd-dpdk/dpdk_common.cpp8
3 files changed, 41 insertions, 1 deletions
diff --git a/host/lib/CMakeLists.txt b/host/lib/CMakeLists.txt
index 094827d2a..5aee65d38 100644
--- a/host/lib/CMakeLists.txt
+++ b/host/lib/CMakeLists.txt
@@ -60,7 +60,7 @@ endmacro(INCLUDE_SUBDIRECTORY)
message(STATUS "")
# Dependencies
find_package(LIBUSB)
-find_package(DPDK 19.11...21.11)
+find_package(DPDK 18.11...21.11)
LIBUHD_REGISTER_COMPONENT("USB" ENABLE_USB ON "ENABLE_LIBUHD;LIBUSB_FOUND" OFF OFF)
# Devices
LIBUHD_REGISTER_COMPONENT("B100" ENABLE_B100 ON "ENABLE_LIBUHD;ENABLE_USB" OFF OFF)
diff --git a/host/lib/include/uhdlib/transport/dpdk/common.hpp b/host/lib/include/uhdlib/transport/dpdk/common.hpp
index c1302335a..4c5ba02e9 100644
--- a/host/lib/include/uhdlib/transport/dpdk/common.hpp
+++ b/host/lib/include/uhdlib/transport/dpdk/common.hpp
@@ -26,6 +26,38 @@
/* NOTE: There are changes to all the network standard fields in 19.x */
+/*
+ * Substituting old values to support DPDK 18.11 with the API changes in DPDK 19.
+ * There were no functional changes in the DPDK calls utilized by UHD between
+ * these two API versions.
+ */
+#if RTE_VER_YEAR < 19 || (RTE_VER_YEAR == 19 && RTE_VER_MONTH < 8)
+// 18.11 data types
+#define rte_ether_addr ether_addr
+#define rte_ether_hdr ether_hdr
+#define rte_arp_hdr arp_hdr
+#define arp_hardware arp_hrd
+#define arp_protocol arp_pro
+#define arp_hlen arp_hln
+#define arp_plen arp_pln
+#define arp_opcode arp_op
+#define rte_ipv4_hdr ipv4_hdr
+#define rte_udp_hdr udp_hdr
+// 18.11 constants
+#define RTE_ETHER_TYPE_IPV4 ETHER_TYPE_IPv4
+#define RTE_ETHER_TYPE_ARP ETHER_TYPE_ARP
+#define RTE_ETHER_ADDR_LEN ETHER_ADDR_LEN
+#define RTE_ETHER_CRC_LEN ETHER_CRC_LEN
+#define RTE_ETHER_HDR_LEN ETHER_HDR_LEN
+#define RTE_IPV4_HDR_DF_FLAG IPV4_HDR_DF_FLAG
+#define RTE_ARP_HRD_ETHER ARP_HRD_ETHER
+#define RTE_ARP_OP_REPLY ARP_OP_REPLY
+#define RTE_ARP_OP_REQUEST ARP_OP_REQUEST
+// 18.11 functions
+#define rte_ether_addr_copy ether_addr_copy
+#define rte_ether_format_addr ether_format_addr
+#define rte_is_zero_ether_addr is_zero_ether_addr
+#endif
namespace uhd { namespace transport {
diff --git a/host/lib/transport/uhd-dpdk/dpdk_common.cpp b/host/lib/transport/uhd-dpdk/dpdk_common.cpp
index 55bf57cdc..0f0a00e51 100644
--- a/host/lib/transport/uhd-dpdk/dpdk_common.cpp
+++ b/host/lib/transport/uhd-dpdk/dpdk_common.cpp
@@ -413,6 +413,14 @@ void dpdk_ctx::init(const device_addr_t& user_args)
unsigned int i;
std::lock_guard<std::mutex> lock(_init_mutex);
if (!_init_done) {
+#if RTE_VER_YEAR < 19 || (RTE_VER_YEAR == 19 && RTE_VER_MONTH < 11)
+ UHD_LOG_WARNING("DPDK",
+ "Deprecated DPDK version "
+ << RTE_VER_YEAR << "." << RTE_VER_MONTH
+ << " detected. Consider upgrading DPDK. Recommended versions are 19.11, "
+ "20.11, and 21.11.");
+#endif
+
/* Gather global config, build args for EAL, and init UHD-DPDK */
const device_addr_t dpdk_args = uhd::prefs::get_dpdk_args(user_args);
UHD_LOG_TRACE("DPDK", "Configuration:" << std::endl << dpdk_args.to_pp_string());