diff --git a/include/spdk/ioat.h b/include/spdk/ioat.h index c323a0b46..99a670a2d 100644 --- a/include/spdk/ioat.h +++ b/include/spdk/ioat.h @@ -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. * diff --git a/lib/ioat/ioat.c b/lib/ioat/ioat.c index 29f2d7ef2..7ff1d1271 100644 --- a/lib/ioat/ioat.c +++ b/lib/ioat/ioat.c @@ -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; }