From owner-svn-src-head@freebsd.org Thu Nov 24 21:32:05 2016 Return-Path: Delivered-To: svn-src-head@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 B64FFC5438E; Thu, 24 Nov 2016 21:32:05 +0000 (UTC) (envelope-from avg@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 860D78D4; Thu, 24 Nov 2016 21:32:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAOLW4ib044548; Thu, 24 Nov 2016 21:32:04 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAOLW4Pr044547; Thu, 24 Nov 2016 21:32:04 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201611242132.uAOLW4Pr044547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 24 Nov 2016 21:32:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309119 - head/sys/dev/virtio/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2016 21:32:05 -0000 Author: avg Date: Thu Nov 24 21:32:04 2016 New Revision: 309119 URL: https://svnweb.freebsd.org/changeset/base/309119 Log: virtio_pci: fix announcement of MSI-X interrupts for queues Queues that do not need interrupts - for instance, output queues - do not have a corresponding entry in vtpci_msix_vq_interrupts. So, it was wrong to increment a pointer into that array when iterating over such a queue. I ran into this bug while trying to use virtio_console(4) that allocates a lot of queues with every other being an output queue without an interrupt handler (if MultiplePorts feature is negotiated). MFC after: 2 weeks Modified: head/sys/dev/virtio/pci/virtio_pci.c Modified: head/sys/dev/virtio/pci/virtio_pci.c ============================================================================== --- head/sys/dev/virtio/pci/virtio_pci.c Thu Nov 24 21:14:22 2016 (r309118) +++ head/sys/dev/virtio/pci/virtio_pci.c Thu Nov 24 21:32:04 2016 (r309119) @@ -1087,7 +1087,8 @@ vtpci_set_host_msix_vectors(struct vtpci * For shared MSIX, all the virtqueues share the first * interrupt. */ - if ((sc->vtpci_flags & VTPCI_FLAG_SHARED_MSIX) == 0) + if (!sc->vtpci_vqs[idx].vtv_no_intr && + (sc->vtpci_flags & VTPCI_FLAG_SHARED_MSIX) == 0) intr++; }