Skip to content

Commit

Permalink
issue: 3898109 DOCA RX Task batching
Browse files Browse the repository at this point in the history
RX task batching is implemented as per poll loop.
After poll iteration, missing RX tasks are posted to RXQ, last post triggers doorbell.
This provides same batching performance comparing to raw XLIO.
No need for cross poll loops tasks aggregation in array wich introduces uncessary cache misses.

Signed-off-by: Alexander Grissik <[email protected]>
  • Loading branch information
AlexanderGrissik committed Sep 8, 2024
1 parent f1e364a commit bcebfc1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 10 additions & 5 deletions src/core/dev/hw_queue_rx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,19 @@ void hw_queue_rx::submit_rxq_tasks()
{
fill_buffers_from_global_pool();

while (m_rxq_task_debt > 0 && m_rx_pool.size()) {
if (unlikely(!submit_rxq_task())) {
break;
size_t batch_size = std::min(static_cast<size_t>(m_rxq_task_debt), m_rx_pool.size());
if (batch_size > 0) {
while (--batch_size > 0) {
if (unlikely(!submit_rxq_task(DOCA_TASK_SUBMIT_FLAG_NONE))) {
break;
}
}

submit_rxq_task(DOCA_TASK_SUBMIT_FLAG_FLUSH);
}
}

bool hw_queue_rx::submit_rxq_task()
bool hw_queue_rx::submit_rxq_task(uint32_t task_flag)
{
doca_eth_rxq_task_recv *rx_doca_task = nullptr;
doca_buf *rx_doca_buf = nullptr;
Expand All @@ -271,7 +276,7 @@ bool hw_queue_rx::submit_rxq_task()
}

--m_rxq_task_debt; // Must be set before return_doca_task()
rc = doca_task_submit(doca_eth_rxq_task_recv_as_doca_task(rx_doca_task));
rc = doca_task_submit_ex(doca_eth_rxq_task_recv_as_doca_task(rx_doca_task), task_flag);
if (DOCA_IS_ERROR(rc)) {
return_doca_task(rx_doca_task);
PRINT_DOCA_ERR(hwqrx_logerr, rc, "doca_eth_rxq_task_recv_as_doca_task");
Expand Down
2 changes: 1 addition & 1 deletion src/core/dev/hw_queue_rx.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class hw_queue_rx : public xlio_ti_owner {

bool prepare_doca_rxq();
void submit_rxq_tasks();
bool submit_rxq_task();
bool submit_rxq_task(uint32_t task_flag);
bool fill_buffers_from_global_pool();
void return_doca_buf(doca_buf *buf);
void start_doca_rxq();
Expand Down

0 comments on commit bcebfc1

Please sign in to comment.