From 3222bbd81a0e13309b783d13151d6f324d2f7879 Mon Sep 17 00:00:00 2001 From: Chunsong Feng Date: Thu, 14 Nov 2019 09:54:21 +0800 Subject: [PATCH] msg/async/dpdk: fix icmp_hdr build error MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ‘struct icmp_hdr’ is defined in both IP.h and rte_icmp.h. DPDK.cc include rte_ethdev.h that references rte_icmp.h, and include IP.h. It cause redefinition of ‘struct icmp_hdr’ error. So move the definition of ‘struct icmp_hdr’ from IP.h to IP.cc. Signed-off-by: Chunsong Feng --- src/msg/async/dpdk/IP.cc | 11 +++++++++++ src/msg/async/dpdk/IP.h | 11 ----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/msg/async/dpdk/IP.cc b/src/msg/async/dpdk/IP.cc index f730cded9e1..fab534bb25b 100644 --- a/src/msg/async/dpdk/IP.cc +++ b/src/msg/async/dpdk/IP.cc @@ -73,6 +73,17 @@ enum { l_dpdk_qp_last }; +struct icmp_hdr { + enum class msg_type : uint8_t { + echo_reply = 0, + echo_request = 8, + }; + msg_type type; + uint8_t code; + uint16_t csum; + uint32_t rest; +} __attribute__((packed)); + ipv4::ipv4(CephContext *c, EventCenter *cen, interface* netif) : cct(c), center(cen), _netif(netif), _global_arp(netif), _arp(c, _global_arp, cen), diff --git a/src/msg/async/dpdk/IP.h b/src/msg/async/dpdk/IP.h index 480b4b95b32..1fc60658235 100644 --- a/src/msg/async/dpdk/IP.h +++ b/src/msg/async/dpdk/IP.h @@ -123,17 +123,6 @@ class ipv4_tcp final : public ip_protocol { friend class ipv4; }; -struct icmp_hdr { - enum class msg_type : uint8_t { - echo_reply = 0, - echo_request = 8, - }; - msg_type type; - uint8_t code; - uint16_t csum; - uint32_t rest; -} __attribute__((packed)); - class icmp { public: -- 2.39.5