ioat: make ioat_flush a public spdk_ioat_flush API

This will enable batching of doorbell writes in
future commits.  For now, just make the API public.

This is the first in a series of patches that
drastically improves performance for high queue
depth CB-DMA workloads.  Some basic tests on
my Xeon E5-v3 platform shows about 4x improvement
for 512B transfers.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia8d28a63f5020ae8644c1efdec7f68740bb6920c

Reviewed-on: https://review.gerrithub.io/c/444972
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
Jim Harris 2019-02-15 16:00:56 -07:00 committed by Darek Stojaczyk
parent d4875ed89e
commit ec95646a61
2 changed files with 16 additions and 5 deletions

View File

@ -141,6 +141,17 @@ int spdk_ioat_submit_fill(struct spdk_ioat_chan *chan,
void *cb_arg, spdk_ioat_req_cb cb_fn,
void *dst, uint64_t fill_pattern, uint64_t nbytes);
/**
* Flush previously built descriptors.
*
* Descriptors are flushed by writing the channel's dmacount doorbell
* register. This function enables batching multiple descriptors followed by
* a single doorbell write.
*
* \param chan I/OAT channel to flush.
*/
void spdk_ioat_flush(struct spdk_ioat_chan *chan);
/**
* Check for completed requests on an I/OAT channel.
*

View File

@ -158,8 +158,8 @@ ioat_submit_single(struct spdk_ioat_chan *ioat)
ioat->head++;
}
static void
ioat_flush(struct spdk_ioat_chan *ioat)
void
spdk_ioat_flush(struct spdk_ioat_chan *ioat)
{
ioat->regs->dmacount = (uint16_t)ioat->head;
}
@ -454,7 +454,7 @@ ioat_channel_start(struct spdk_ioat_chan *ioat)
ioat_write_chainaddr(ioat, ioat->ring[0].phys_addr);
ioat_prep_null(ioat);
ioat_flush(ioat);
spdk_ioat_flush(ioat);
i = 100;
while (i-- > 0) {
@ -652,7 +652,7 @@ spdk_ioat_submit_copy(struct spdk_ioat_chan *ioat, void *cb_arg, spdk_ioat_req_c
return -ENOMEM;
}
ioat_flush(ioat);
spdk_ioat_flush(ioat);
return 0;
}
@ -709,7 +709,7 @@ spdk_ioat_submit_fill(struct spdk_ioat_chan *ioat, void *cb_arg, spdk_ioat_req_c
return -ENOMEM;
}
ioat_flush(ioat);
spdk_ioat_flush(ioat);
return 0;
}