Skip to content

Commit

Permalink
Merge pull request #20659 from tchaikov/wip-msg/async/dpdk/launch-on-…
Browse files Browse the repository at this point in the history
…coreid

msg/async: execute on core specified by core_id not its index

Reviewed-by: shangfufei <shangfufei@inspur.com>
Reviewed-by: Haomai Wang <haomai@xsky.com>
  • Loading branch information
tchaikov committed Mar 6, 2018
2 parents 017c846 + 494bf4b commit 2e4f06e
Show file tree
Hide file tree
Showing 3 changed files with 263 additions and 133 deletions.
8 changes: 7 additions & 1 deletion src/msg/async/dpdk/DPDKStack.cc
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,14 @@ void DPDKStack::spawn_worker(unsigned i, std::function<void ()> &&func)
// if dpdk::eal::init already called by NVMEDevice, we will select 1..n
// cores
assert(rte_lcore_count() >= i + 1);
unsigned core_id;
RTE_LCORE_FOREACH_SLAVE(core_id) {
if (i-- == 0) {
break;
}
}
dpdk::eal::execute_on_master([&]() {
r = rte_eal_remote_launch(dpdk_thread_adaptor, static_cast<void*>(&funcs[i]), i+1);
r = rte_eal_remote_launch(dpdk_thread_adaptor, static_cast<void*>(&funcs[i]), core_id);
if (r < 0) {
lderr(cct) << __func__ << " remote launch failed, r=" << r << dendl;
ceph_abort();
Expand Down
1 change: 0 additions & 1 deletion src/msg/async/dpdk/IP.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@

#include "capture.h"
#include "IP.h"
#include "shared_ptr.h"
#include "toeplitz.h"

#include "common/dout.h"
Expand Down

0 comments on commit 2e4f06e

Please sign in to comment.