From b01a3933828e334ea99bb9edc2c5fbfdda5dc77c Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Fri, 15 Feb 2019 16:38:23 -0700 Subject: [PATCH] ioat: reduce completion writebacks Do not set the completion_update bit except on the last descriptor built before the dmacount doorbell is written. This allows much better batching of completions (to match batching of the submissions). Signed-off-by: Jim Harris Change-Id: Idd0281fb2e9e1ad2eb0f65f097c54fc051dfd935 Reviewed-on: https://review.gerrithub.io/c/444974 Tested-by: SPDK CI Jenkins Reviewed-by: Darek Stojaczyk Reviewed-by: Shuhei Matsumoto Reviewed-by: Changpeng Liu --- lib/ioat/ioat.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/ioat/ioat.c b/lib/ioat/ioat.c index b987250db8..6d73d61bc7 100644 --- a/lib/ioat/ioat.c +++ b/lib/ioat/ioat.c @@ -161,6 +161,11 @@ ioat_submit_single(struct spdk_ioat_chan *ioat) void spdk_ioat_flush(struct spdk_ioat_chan *ioat) { + uint32_t index = ioat_get_ring_index(ioat, ioat->head - 1); + union spdk_ioat_hw_desc *hw_desc; + + hw_desc = &ioat->hw_ring[index]; + hw_desc->dma.u.control.completion_update = 1; ioat->regs->dmacount = (uint16_t)ioat->head; } @@ -179,7 +184,6 @@ ioat_prep_null(struct spdk_ioat_chan *ioat) hw_desc->dma.u.control_raw = 0; hw_desc->dma.u.control.op = SPDK_IOAT_OP_COPY; hw_desc->dma.u.control.null = 1; - hw_desc->dma.u.control.completion_update = 1; hw_desc->dma.size = 8; hw_desc->dma.src_addr = 0; @@ -210,7 +214,6 @@ ioat_prep_copy(struct spdk_ioat_chan *ioat, uint64_t dst, hw_desc->dma.u.control_raw = 0; hw_desc->dma.u.control.op = SPDK_IOAT_OP_COPY; - hw_desc->dma.u.control.completion_update = 1; hw_desc->dma.size = len; hw_desc->dma.src_addr = src; @@ -241,7 +244,6 @@ ioat_prep_fill(struct spdk_ioat_chan *ioat, uint64_t dst, hw_desc->fill.u.control_raw = 0; hw_desc->fill.u.control.op = SPDK_IOAT_OP_FILL; - hw_desc->fill.u.control.completion_update = 1; hw_desc->fill.size = len; hw_desc->fill.src_data = fill_pattern;