Skip to content

Commit da4e864

Browse files
longlimsftkuba-moo
authored andcommitted
net: 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 during a callback from napi_poll(). With this change, tests showed an improvement from 120G/s to 160G/s on a 200G physical link, with 16 or 32 hardware queues. Tests showed no regression in network latency benchmarks on single connection. Reviewed-by: Haiyang Zhang <[email protected]> Reviewed-by: Dexuan Cui <[email protected]> Signed-off-by: Long Li <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent f8e3433 commit da4e864

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

drivers/net/ethernet/microsoft/mana/mana_en.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,8 +1386,8 @@ static void mana_post_pkt_rxq(struct mana_rxq *rxq)
13861386

13871387
recv_buf_oob = &rxq->rx_oobs[curr_index];
13881388

1389-
err = mana_gd_post_and_ring(rxq->gdma_rq, &recv_buf_oob->wqe_req,
1390-
&recv_buf_oob->wqe_inf);
1389+
err = mana_gd_post_work_request(rxq->gdma_rq, &recv_buf_oob->wqe_req,
1390+
&recv_buf_oob->wqe_inf);
13911391
if (WARN_ON_ONCE(err))
13921392
return;
13931393

@@ -1657,6 +1657,12 @@ static void mana_poll_rx_cq(struct mana_cq *cq)
16571657
mana_process_rx_cqe(rxq, cq, &comp[i]);
16581658
}
16591659

1660+
if (comp_read > 0) {
1661+
struct gdma_context *gc = rxq->gdma_rq->gdma_dev->gdma_context;
1662+
1663+
mana_gd_wq_ring_doorbell(gc, rxq->gdma_rq);
1664+
}
1665+
16601666
if (rxq->xdp_flush)
16611667
xdp_do_flush();
16621668
}

0 commit comments

Comments
 (0)