aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/transport/udp_dpdk_link.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/transport/udp_dpdk_link.cpp')
-rw-r--r--host/lib/transport/udp_dpdk_link.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/host/lib/transport/udp_dpdk_link.cpp b/host/lib/transport/udp_dpdk_link.cpp
index dc56de43c..b2fe55e24 100644
--- a/host/lib/transport/udp_dpdk_link.cpp
+++ b/host/lib/transport/udp_dpdk_link.cpp
@@ -101,13 +101,13 @@ udp_dpdk_link::sptr udp_dpdk_link::make(const dpdk::port_id_t port_id,
void udp_dpdk_link::enqueue_recv_mbuf(struct rte_mbuf* mbuf)
{
// Get packet size
- struct udp_hdr* hdr = rte_pktmbuf_mtod_offset(
- mbuf, struct udp_hdr*, sizeof(struct ether_hdr) + sizeof(struct ipv4_hdr));
- size_t packet_size = rte_be_to_cpu_16(hdr->dgram_len) - sizeof(struct udp_hdr);
+ struct rte_udp_hdr* hdr = rte_pktmbuf_mtod_offset(
+ mbuf, struct rte_udp_hdr*, sizeof(struct rte_ether_hdr) + sizeof(struct rte_ipv4_hdr));
+ size_t packet_size = rte_be_to_cpu_16(hdr->dgram_len) - sizeof(struct rte_udp_hdr);
// Prepare the dpdk_frame_buff
auto buff = new (rte_mbuf_to_priv(mbuf)) dpdk_frame_buff(mbuf);
buff->header_jump(
- sizeof(struct ether_hdr) + sizeof(struct ipv4_hdr) + sizeof(struct udp_hdr));
+ sizeof(struct rte_ether_hdr) + sizeof(struct rte_ipv4_hdr) + sizeof(struct rte_udp_hdr));
buff->set_packet_size(packet_size);
// Add the dpdk_frame_buff to the list
if (_recv_buff_head) {
@@ -155,7 +155,7 @@ frame_buff::uptr udp_dpdk_link::get_send_buff(int32_t /*timeout_ms*/)
if (mbuf) {
auto buff = new (rte_mbuf_to_priv(mbuf)) dpdk_frame_buff(mbuf);
buff->header_jump(
- sizeof(struct ether_hdr) + sizeof(struct ipv4_hdr) + sizeof(struct udp_hdr));
+ sizeof(struct rte_ether_hdr) + sizeof(struct rte_ipv4_hdr) + sizeof(struct rte_udp_hdr));
return frame_buff::uptr(buff);
}
return frame_buff::uptr();
@@ -169,12 +169,12 @@ void udp_dpdk_link::release_send_buff(frame_buff::uptr buff)
if (buff_ptr->packet_size()) {
// Fill in L2 header
auto local_mac = _port->get_mac_addr();
- struct ether_hdr* l2_hdr = rte_pktmbuf_mtod(mbuf, struct ether_hdr*);
- ether_addr_copy(&_remote_mac, &l2_hdr->d_addr);
- ether_addr_copy(&local_mac, &l2_hdr->s_addr);
- l2_hdr->ether_type = rte_cpu_to_be_16(ETHER_TYPE_IPv4);
+ struct rte_ether_hdr* l2_hdr = rte_pktmbuf_mtod(mbuf, struct rte_ether_hdr*);
+ rte_ether_addr_copy(&_remote_mac, &l2_hdr->d_addr);
+ rte_ether_addr_copy(&local_mac, &l2_hdr->s_addr);
+ l2_hdr->ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);
// Fill in L3 and L4 headers
- dpdk::fill_udp_hdr(mbuf,
+ dpdk::fill_rte_udp_hdr(mbuf,
_port,
_remote_ipv4,
_local_port,