mirror of
https://github.com/opnsense/src.git
synced 2026-06-05 06:42:56 -04:00
mana: batch ringing RX queue doorbell on receiving packets
It's inefficient to ring the doorbell page every time a WQE is posted to the received queue. Excessive MMIO writes result in CPU spending more time waiting on LOCK instructions (atomic operations), resulting in poor scaling performance. Move the code for ringing doorbell page to where after we have posted all WQEs to the receive queue in mana_poll_rx_cq(). In addition, use the correct WQE count for ringing RQ doorbell. The hardware specification specifies that WQE_COUNT should set to 0 for the Receive Queue. Although currently the hardware doesn't enforce the check, in the future releases it may check on this value. Tested by: whu MFC after: 1 week Sponsored by: Microsoft
This commit is contained in:
parent
315ee00fa9
commit
e4e11c1d07
2 changed files with 9 additions and 2 deletions
|
|
@ -471,7 +471,7 @@ void
|
|||
mana_gd_wq_ring_doorbell(struct gdma_context *gc, struct gdma_queue *queue)
|
||||
{
|
||||
mana_gd_ring_doorbell(gc, queue->gdma_dev->doorbell, queue->type,
|
||||
queue->id, queue->head * GDMA_WQE_BU_SIZE, 1);
|
||||
queue->id, queue->head * GDMA_WQE_BU_SIZE, 0);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -1524,7 +1524,7 @@ mana_post_pkt_rxq(struct mana_rxq *rxq)
|
|||
|
||||
recv_buf_oob = &rxq->rx_oobs[curr_index];
|
||||
|
||||
err = mana_gd_post_and_ring(rxq->gdma_rq, &recv_buf_oob->wqe_req,
|
||||
err = mana_gd_post_work_request(rxq->gdma_rq, &recv_buf_oob->wqe_req,
|
||||
&recv_buf_oob->wqe_inf);
|
||||
if (err) {
|
||||
mana_err(NULL, "WARNING: rxq %u post pkt err %d\n",
|
||||
|
|
@ -1757,6 +1757,13 @@ mana_poll_rx_cq(struct mana_cq *cq)
|
|||
mana_process_rx_cqe(cq->rxq, cq, &comp[i]);
|
||||
}
|
||||
|
||||
if (comp_read > 0) {
|
||||
struct gdma_context *gc =
|
||||
cq->rxq->gdma_rq->gdma_dev->gdma_context;
|
||||
|
||||
mana_gd_wq_ring_doorbell(gc, cq->rxq->gdma_rq);
|
||||
}
|
||||
|
||||
tcp_lro_flush_all(&cq->rxq->lro);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue