From owner-svn-src-projects@FreeBSD.ORG Sun Feb 3 23:33:53 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 03F211DD; Sun, 3 Feb 2013 23:33:53 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BE583F16; Sun, 3 Feb 2013 23:33:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r13NXqbf087759; Sun, 3 Feb 2013 23:33:52 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r13NXq6l087757; Sun, 3 Feb 2013 23:33:52 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201302032333.r13NXq6l087757@svn.freebsd.org> From: Bryan Venteicher Date: Sun, 3 Feb 2013 23:33:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r246305 - in projects/virtio/sys/dev/virtio: . pci X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 23:33:53 -0000 Author: bryanv Date: Sun Feb 3 23:33:51 2013 New Revision: 246305 URL: http://svnweb.freebsd.org/changeset/base/246305 Log: virtio_pci: Move no interrupt check into the PCI interrupt handlers Approved by: grehan (implicit) Modified: projects/virtio/sys/dev/virtio/pci/virtio_pci.c projects/virtio/sys/dev/virtio/virtqueue.c Modified: projects/virtio/sys/dev/virtio/pci/virtio_pci.c ============================================================================== --- projects/virtio/sys/dev/virtio/pci/virtio_pci.c Sun Feb 3 23:32:56 2013 (r246304) +++ projects/virtio/sys/dev/virtio/pci/virtio_pci.c Sun Feb 3 23:33:51 2013 (r246305) @@ -1252,8 +1252,10 @@ vtpci_legacy_intr(void *xsc) vtpci_config_intr(sc); if (isr & VIRTIO_PCI_ISR_INTR) { - for (i = 0; i < sc->vtpci_nvqs; i++, vqx++) - virtqueue_intr(vqx->vtv_vq); + for (i = 0; i < sc->vtpci_nvqs; i++, vqx++) { + if (vqx->vtv_no_intr == 0) + virtqueue_intr(vqx->vtv_vq); + } } } @@ -1268,8 +1270,10 @@ vtpci_vq_shared_intr_filter(void *xsc) sc = xsc; vqx = &sc->vtpci_vqs[0]; - for (i = 0; i < sc->vtpci_nvqs; i++, vqx++) - rc |= virtqueue_intr_filter(vqx->vtv_vq); + for (i = 0; i < sc->vtpci_nvqs; i++, vqx++) { + if (vqx->vtv_no_intr == 0) + rc |= virtqueue_intr_filter(vqx->vtv_vq); + } return (rc ? FILTER_SCHEDULE_THREAD : FILTER_STRAY); } @@ -1284,8 +1288,10 @@ vtpci_vq_shared_intr(void *xsc) sc = xsc; vqx = &sc->vtpci_vqs[0]; - for (i = 0; i < sc->vtpci_nvqs; i++, vqx++) - virtqueue_intr(vqx->vtv_vq); + for (i = 0; i < sc->vtpci_nvqs; i++, vqx++) { + if (vqx->vtv_no_intr == 0) + virtqueue_intr(vqx->vtv_vq); + } } static int Modified: projects/virtio/sys/dev/virtio/virtqueue.c ============================================================================== --- projects/virtio/sys/dev/virtio/virtqueue.c Sun Feb 3 23:32:56 2013 (r246304) +++ projects/virtio/sys/dev/virtio/virtqueue.c Sun Feb 3 23:33:51 2013 (r246305) @@ -417,8 +417,6 @@ int virtqueue_intr_filter(struct virtqueue *vq) { - if (__predict_false(vq->vq_intrhand == NULL)) - return (0); if (vq->vq_used_cons_idx == vq->vq_ring.used->idx) return (0); @@ -431,8 +429,7 @@ void virtqueue_intr(struct virtqueue *vq) { - if (__predict_true(vq->vq_intrhand != NULL)) - vq->vq_intrhand(vq->vq_intrhand_arg); + vq->vq_intrhand(vq->vq_intrhand_arg); } int