From f44abf1fe71c09a753d59426f263bd94a422da7e Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Sun, 11 Sep 2016 20:15:41 +0000 Subject: [PATCH] ioat(4): Start poll timer when descriptors are released to HW Rather than when the software creates the descriptors. Sponsored by: Dell EMC Isilon --- sys/dev/ioat/ioat.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/dev/ioat/ioat.c b/sys/dev/ioat/ioat.c index c5ab03b0dd40..ccf9166f8abb 100644 --- a/sys/dev/ioat/ioat.c +++ b/sys/dev/ioat/ioat.c @@ -949,6 +949,13 @@ ioat_release(bus_dmaengine_t dmaengine) ioat = to_ioat_softc(dmaengine); CTR2(KTR_IOAT, "%s channel=%u", __func__, ioat->chan_idx); ioat_write_2(ioat, IOAT_DMACOUNT_OFFSET, (uint16_t)ioat->hw_head); + + if (!ioat->is_completion_pending) { + ioat->is_completion_pending = TRUE; + callout_reset(&ioat->poll_timer, 1, ioat_poll_timer_callback, + ioat); + callout_stop(&ioat->shrink_timer); + } mtx_unlock(&ioat->submit_lock); } @@ -1788,13 +1795,6 @@ ioat_submit_single(struct ioat_softc *ioat) atomic_add_rel_int(&ioat->head, 1); atomic_add_rel_int(&ioat->hw_head, 1); - if (!ioat->is_completion_pending) { - ioat->is_completion_pending = TRUE; - callout_reset(&ioat->poll_timer, 1, ioat_poll_timer_callback, - ioat); - callout_stop(&ioat->shrink_timer); - } - ioat->stats.descriptors_submitted++; }