From owner-svn-src-stable@FreeBSD.ORG Mon Nov 29 01:37:28 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 139DE1065670; Mon, 29 Nov 2010 01:37:28 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0077F8FC16; Mon, 29 Nov 2010 01:37:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAT1bR0S076519; Mon, 29 Nov 2010 01:37:27 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAT1bR9W076517; Mon, 29 Nov 2010 01:37:27 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011290137.oAT1bR9W076517@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 29 Nov 2010 01:37:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216028 - stable/7/sys/dev/jme X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 01:37:28 -0000 Author: yongari Date: Mon Nov 29 01:37:27 2010 New Revision: 216028 URL: http://svn.freebsd.org/changeset/base/216028 Log: MFC r215848: Allocate 1 MSI/MSI-X vector. Originally jme(4) was designed to support multi-queue but the hardware limitation made it hard to implement supporting multi-queue. Allocating more than necessary vectors is resource waste and it can be added back when we implement multi-queue support. Modified: stable/7/sys/dev/jme/if_jme.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/jme/if_jme.c ============================================================================== --- stable/7/sys/dev/jme/if_jme.c Mon Nov 29 01:36:15 2010 (r216027) +++ stable/7/sys/dev/jme/if_jme.c Mon Nov 29 01:37:27 2010 (r216028) @@ -201,13 +201,6 @@ static struct resource_spec jme_irq_spec static struct resource_spec jme_irq_spec_msi[] = { { SYS_RES_IRQ, 1, RF_ACTIVE }, - { SYS_RES_IRQ, 2, RF_ACTIVE }, - { SYS_RES_IRQ, 3, RF_ACTIVE }, - { SYS_RES_IRQ, 4, RF_ACTIVE }, - { SYS_RES_IRQ, 5, RF_ACTIVE }, - { SYS_RES_IRQ, 6, RF_ACTIVE }, - { SYS_RES_IRQ, 7, RF_ACTIVE }, - { SYS_RES_IRQ, 8, RF_ACTIVE }, { -1, 0, 0 } }; @@ -586,11 +579,16 @@ jme_attach(device_t dev) device_printf(dev, "MSI count : %d\n", msic); } + /* Use 1 MSI/MSI-X. */ + if (msixc > 1) + msixc = 1; + if (msic > 1) + msic = 1; /* Prefer MSIX over MSI. */ if (msix_disable == 0 || msi_disable == 0) { - if (msix_disable == 0 && msixc == JME_MSIX_MESSAGES && + if (msix_disable == 0 && msixc > 0 && pci_alloc_msix(dev, &msixc) == 0) { - if (msic == JME_MSIX_MESSAGES) { + if (msixc == 1) { device_printf(dev, "Using %d MSIX messages.\n", msixc); sc->jme_flags |= JME_FLAG_MSIX; @@ -599,9 +597,8 @@ jme_attach(device_t dev) pci_release_msi(dev); } if (msi_disable == 0 && (sc->jme_flags & JME_FLAG_MSIX) == 0 && - msic == JME_MSI_MESSAGES && - pci_alloc_msi(dev, &msic) == 0) { - if (msic == JME_MSI_MESSAGES) { + msic > 0 && pci_alloc_msi(dev, &msic) == 0) { + if (msic == 1) { device_printf(dev, "Using %d MSI messages.\n", msic); sc->jme_flags |= JME_FLAG_MSI; @@ -794,13 +791,7 @@ jme_attach(device_t dev) taskqueue_start_threads(&sc->jme_tq, 1, PI_NET, "%s taskq", device_get_nameunit(sc->jme_dev)); - if ((sc->jme_flags & JME_FLAG_MSIX) != 0) - msic = JME_MSIX_MESSAGES; - else if ((sc->jme_flags & JME_FLAG_MSI) != 0) - msic = JME_MSI_MESSAGES; - else - msic = 1; - for (i = 0; i < msic; i++) { + for (i = 0; i < 1; i++) { error = bus_setup_intr(dev, sc->jme_irq[i], INTR_TYPE_NET | INTR_MPSAFE, jme_intr, NULL, sc, &sc->jme_intrhand[i]); @@ -828,7 +819,7 @@ jme_detach(device_t dev) { struct jme_softc *sc; struct ifnet *ifp; - int i, msic; + int i; sc = device_get_softc(dev); @@ -863,14 +854,7 @@ jme_detach(device_t dev) sc->jme_ifp = NULL; } - msic = 1; - if ((sc->jme_flags & JME_FLAG_MSIX) != 0) - msic = JME_MSIX_MESSAGES; - else if ((sc->jme_flags & JME_FLAG_MSI) != 0) - msic = JME_MSI_MESSAGES; - else - msic = 1; - for (i = 0; i < msic; i++) { + for (i = 0; i < 1; i++) { if (sc->jme_intrhand[i] != NULL) { bus_teardown_intr(dev, sc->jme_irq[i], sc->jme_intrhand[i]);