aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/include
diff options
context:
space:
mode:
authormattprost <matt.prost@ni.com>2022-03-29 17:31:27 -0500
committerAaron Rossetto <aaron.rossetto@ni.com>2022-04-01 13:26:09 -0700
commit9cd80e13c52daf24752b609b4ce9e437f22a33f6 (patch)
tree9f192030cd63bc9ffcbc8f33777399be4efe17d3 /host/lib/include
parentf8c39eb07569ff4dbd34eb974e959ea7f768c206 (diff)
downloaduhd-9cd80e13c52daf24752b609b4ce9e437f22a33f6.tar.gz
uhd-9cd80e13c52daf24752b609b4ce9e437f22a33f6.tar.bz2
uhd-9cd80e13c52daf24752b609b4ce9e437f22a33f6.zip
dpdk: Add support for DPDK 18.11 API
Substituting old values to restore API breakage from DPDK 18.11 to DPDK 19. It is recommended at this point that users upgrade to more recent DPDK LTS versions, but the DPDK 18.11 API is functional with UHD. Signed-off-by: mattprost <matt.prost@ni.com>
Diffstat (limited to 'host/lib/include')
-rw-r--r--host/lib/include/uhdlib/transport/dpdk/common.hpp32
1 files changed, 32 insertions, 0 deletions
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 {