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

Only sleep after checking all queues #98

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/detail/IfaceWrapper.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ IfaceWrapper::rx_runner(void *arg __rte_unused) {
while(!this->m_lcore_quit_signal.load()) {

// Loop over assigned queues to process
uint8_t fb_count(0);
for (auto q : queues) {
uint8_t fb_count(0);
auto src_rx_q = q.first;
auto* q_bufs = m_bufs[src_rx_q];

Expand Down Expand Up @@ -99,15 +99,14 @@ IfaceWrapper::rx_runner(void *arg __rte_unused) {
if (nb_rx == m_burst_size) {
++fb_count;
}

// If no packets in burst...
if (!fb_count) {
// Sleep n nanoseconds... (value from config, timespec initialized in lcore first lines)
/*int response =*/ nanosleep(&sleep_request, nullptr);
}

} // per queue

// If no full buffers in burst...
if (!fb_count) {
// Sleep n nanoseconds... (value from config, timespec initialized in lcore first lines)
/*int response =*/ nanosleep(&sleep_request, nullptr);
}

} // main while(quit) loop

TLOG() << "LCore RX runner on CPU[" << lid << "] returned.";
Expand Down