Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Mar 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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;
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the meaning?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the idea of #20638 would be better

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yuyuyu101 it's to get the core id from the its index. for example, if i is 0, the first non master core id is used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shangfufei, i'd be happy to learn the rationale behind your assertion.

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