From b1586ee26b61fedd74e3bc076f7ff58d7a72f615 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Fri, 14 Jan 2022 14:13:19 +0000 Subject: 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 --- host/lib/transport/udp_dpdk_link.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'host/lib/transport/udp_dpdk_link.cpp') 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, -- cgit v1.2.3