]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async: do not include dpdk headers in public header
authorKefu Chai <kchai@redhat.com>
Tue, 21 Aug 2018 04:12:46 +0000 (12:12 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 5 Sep 2018 05:53:57 +0000 (13:53 +0800)
before this change, async/Stack.cc includes DPDKStack.h, which in
turn includes dpdk headers. this practically renders the dpdk::dpdk an
PUBLIC library of common_async_dpdk. as dpdk needs to be compiled
with -march=core2, we should constrain the scope of this compiler
option. hence this change.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/msg/async/dpdk/DPDKStack.cc
src/msg/async/dpdk/DPDKStack.h

index fabfb024129fc0a2c479f181f823795a4ba84f8f..b5550f3537c37d8d97e6898c54402e365d73ae42 100644 (file)
@@ -41,6 +41,7 @@
 #include <tuple>
 
 #include "common/ceph_argparse.h"
+#include "dpdk_rte.h"
 #include "DPDKStack.h"
 #include "DPDK.h"
 #include "IP.h"
@@ -197,6 +198,11 @@ DPDKWorker::Impl::Impl(CephContext *cct, unsigned i, EventCenter *c, std::shared
   _inet.set_netmask_address(ipv4_address(std::get<2>(tuples[0])));
 }
 
+DPDKWorker::Impl::~Impl()
+{
+  _dev->unset_local_queue(id);
+}
+
 int DPDKWorker::listen(entity_addr_t &sa, const SocketOptions &opt,
                        ServerSocket *sock)
 {
@@ -265,3 +271,10 @@ void DPDKStack::spawn_worker(unsigned i, std::function<void ()> &&func)
     }
   });
 }
+
+void DPDKStack::join_worker(unsigned i)
+{
+  dpdk::eal::execute_on_master([&]() {
+    rte_eal_wait_lcore(i+1);
+  });
+}
index 3ccf2a22e591b3ae4268e923b6f584efadcd217e..cc374af9384795cdff8e0ac8ae055b0e689a2fd7 100644 (file)
@@ -21,8 +21,6 @@
 #include "common/Tub.h"
 
 #include "msg/async/Stack.h"
-#include "dpdk_rte.h"
-#include "DPDK.h"
 #include "net.h"
 #include "const.h"
 #include "IP.h"
@@ -215,9 +213,7 @@ class DPDKWorker : public Worker {
     std::shared_ptr<DPDKDevice> _dev;
     ipv4 _inet;
     Impl(CephContext *cct, unsigned i, EventCenter *c, std::shared_ptr<DPDKDevice> dev);
-    ~Impl() {
-      _dev->unset_local_queue(id);
-    }
+    ~Impl();
   };
   std::unique_ptr<Impl> _impl;
 
@@ -251,11 +247,7 @@ class DPDKStack : public NetworkStack {
   virtual bool support_local_listen_table() const override { return true; }
 
   virtual void spawn_worker(unsigned i, std::function<void ()> &&func) override;
-  virtual void join_worker(unsigned i) override {
-    dpdk::eal::execute_on_master([&]() {
-      rte_eal_wait_lcore(i+1);
-    });
-  }
+  virtual void join_worker(unsigned i) override;
 };
 
 #endif