]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async/dpdk: fix icmp_hdr build error
authorChunsong Feng <fengchunsong@huawei.com>
Thu, 14 Nov 2019 01:54:21 +0000 (09:54 +0800)
committerluo rixin <luorixin@huawei.com>
Fri, 22 Nov 2019 03:27:12 +0000 (11:27 +0800)
‘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 <fengchunsong@huawei.com>
src/msg/async/dpdk/IP.cc
src/msg/async/dpdk/IP.h

index f730cded9e12a13ecf87b26c20865a65088c584a..fab534bb25b5c00fde5d0bca551b0e794e7b59a5 100644 (file)
@@ -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),
index 480b4b95b3226fa7544129d2cc806659e4771878..1fc60658235fad78632a9f7da3b362de7af23c78 100644 (file)
@@ -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: