From: Kefu Chai Date: Thu, 1 Mar 2018 07:19:36 +0000 (+0800) Subject: msg/async: execute on core specified by core_id not its index X-Git-Tag: v13.0.2~85^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=494bf4b407f93c0f40ad92387eacccf7020ab7ca;p=ceph.git msg/async: execute on core specified by core_id not its index Reported-by: shangfufei Signed-off-by: Kefu Chai --- diff --git a/src/msg/async/dpdk/DPDKStack.cc b/src/msg/async/dpdk/DPDKStack.cc index fce05098007f..9772d0f08b94 100644 --- a/src/msg/async/dpdk/DPDKStack.cc +++ b/src/msg/async/dpdk/DPDKStack.cc @@ -250,8 +250,14 @@ void DPDKStack::spawn_worker(unsigned i, std::function &&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(&funcs[i]), i+1); + r = rte_eal_remote_launch(dpdk_thread_adaptor, static_cast(&funcs[i]), core_id); if (r < 0) { lderr(cct) << __func__ << " remote launch failed, r=" << r << dendl; ceph_abort();