aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/transport/udp_dpdk_link.cpp
diff options
context:
space:
mode:
authorLuca Boccassi <bluca@debian.org>2022-01-14 14:13:19 +0000
committerAaron Rossetto <aaron.rossetto@ni.com>2022-01-20 13:58:51 -0600
commitb1586ee26b61fedd74e3bc076f7ff58d7a72f615 (patch)
tree1ab09a06308acee12f2136e13e91246111fb9d87 /host/lib/transport/udp_dpdk_link.cpp
parent4e391500b54a22dbaae8692750ec25ae8a97ee6d (diff)
downloaduhd-b1586ee26b61fedd74e3bc076f7ff58d7a72f615.tar.gz
uhd-b1586ee26b61fedd74e3bc076f7ff58d7a72f615.tar.bz2
uhd-b1586ee26b61fedd74e3bc076f7ff58d7a72f615.zip
host: fix build with DPDK v21.11 LTS
Some APIs were changed with the latest DPDK LTS release, add some ifdefs to fix the build. Fixes https://github.com/EttusResearch/uhd/issues/547 Updated CMake file to reflect updated DPDK version. Fixed mbuf size to take ethernet headers into account. Updated documentation. Co-authored-by: Martin Anderseck <martin.anderseck@ni.com>
Diffstat (limited to 'host/lib/transport/udp_dpdk_link.cpp')
-rw-r--r--host/lib/transport/udp_dpdk_link.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/host/lib/transport/udp_dpdk_link.cpp b/host/lib/transport/udp_dpdk_link.cpp
index 194b0536c..4249d4bb8 100644
--- a/host/lib/transport/udp_dpdk_link.cpp
+++ b/host/lib/transport/udp_dpdk_link.cpp
@@ -175,8 +175,13 @@ void udp_dpdk_link::release_send_buff(frame_buff::uptr buff)
// Fill in L2 header
auto local_mac = _port->get_mac_addr();
struct rte_ether_hdr* l2_hdr = rte_pktmbuf_mtod(mbuf, struct rte_ether_hdr*);
+#if RTE_VER_YEAR > 21 || (RTE_VER_YEAR == 21 && RTE_VER_MONTH == 11)
+ rte_ether_addr_copy(&_remote_mac, &l2_hdr->dst_addr);
+ rte_ether_addr_copy(&local_mac, &l2_hdr->src_addr);
+#else
rte_ether_addr_copy(&_remote_mac, &l2_hdr->d_addr);
rte_ether_addr_copy(&local_mac, &l2_hdr->s_addr);
+#endif
l2_hdr->ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);
// Fill in L3 and L4 headers
dpdk::fill_rte_udp_hdr(mbuf,