From owner-svn-src-all@freebsd.org Sat Oct 24 23:45:00 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E950A1EBD9; Sat, 24 Oct 2015 23:45:00 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2B69BEF; Sat, 24 Oct 2015 23:44:59 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9ONixLo011753; Sat, 24 Oct 2015 23:44:59 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9ONixdx011752; Sat, 24 Oct 2015 23:44:59 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201510242344.t9ONixdx011752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sat, 24 Oct 2015 23:44:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289904 - head/sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2015 23:45:00 -0000 Author: cem Date: Sat Oct 24 23:44:58 2015 New Revision: 289904 URL: https://svnweb.freebsd.org/changeset/base/289904 Log: ioat: Pull out timer callout delay into a constant Pull out the timer callout delay into IOAT_INTR_TIMO and shorten it considerably (5s -> 100ms). Single operations do not take 5-10 seconds and when interrupts aren't working, waiting 100ms sucks a lot less than 5s. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ioat/ioat.c Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Sat Oct 24 23:25:43 2015 (r289903) +++ head/sys/dev/ioat/ioat.c Sat Oct 24 23:44:58 2015 (r289904) @@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$"); #include "ioat_hw.h" #include "ioat_internal.h" +#define IOAT_INTR_TIMO (hz / 10) + static int ioat_probe(device_t device); static int ioat_attach(device_t device); static int ioat_detach(device_t device); @@ -271,6 +273,8 @@ ioat_detach(device_t device) ioat = DEVICE2SOFTC(device); ioat_test_detach(); + + ioat_teardown_intr(ioat); callout_drain(&ioat->timer); pci_disable_busmaster(device); @@ -294,8 +298,6 @@ ioat_detach(device_t device) bus_dma_tag_destroy(ioat->hw_desc_tag); - ioat_teardown_intr(ioat); - return (0); } @@ -586,7 +588,8 @@ ioat_process_events(struct ioat_softc *i if (ioat->head == ioat->tail) { ioat->is_completion_pending = FALSE; - callout_reset(&ioat->timer, 5 * hz, ioat_timer_callback, ioat); + callout_reset(&ioat->timer, IOAT_INTR_TIMO, + ioat_timer_callback, ioat); } ioat_write_chanctrl(ioat, IOAT_CHANCTRL_RUN); @@ -902,7 +905,7 @@ ioat_timer_callback(void *arg) uint32_t chanerr; ioat = arg; - ioat_log_message(2, "%s\n", __func__); + ioat_log_message(1, "%s\n", __func__); if (ioat->is_completion_pending) { status = ioat_get_chansts(ioat); @@ -934,7 +937,7 @@ ioat_timer_callback(void *arg) mtx_unlock(&ioat->submit_lock); if (ioat->ring_size_order > IOAT_MIN_ORDER) - callout_reset(&ioat->timer, 5 * hz, + callout_reset(&ioat->timer, IOAT_INTR_TIMO, ioat_timer_callback, ioat); } } @@ -950,8 +953,8 @@ ioat_submit_single(struct ioat_softc *io if (!ioat->is_completion_pending) { ioat->is_completion_pending = TRUE; - callout_reset(&ioat->timer, 10 * hz, ioat_timer_callback, - ioat); + callout_reset(&ioat->timer, IOAT_INTR_TIMO, + ioat_timer_callback, ioat); } }