From owner-svn-src-stable-8@FreeBSD.ORG Wed Feb 15 04:03:42 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B7BF10656D2; Wed, 15 Feb 2012 04:03:42 +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 5B5C08FC15; Wed, 15 Feb 2012 04:03:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1F43ghq034910; Wed, 15 Feb 2012 04:03:42 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1F43gID034907; Wed, 15 Feb 2012 04:03:42 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201202150403.q1F43gID034907@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 15 Feb 2012 04:03:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231735 - stable/8/sys/dev/bge X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2012 04:03:42 -0000 Author: yongari Date: Wed Feb 15 04:03:41 2012 New Revision: 231735 URL: http://svn.freebsd.org/changeset/base/231735 Log: MFC r230286,230337-230338,231159: r230286: Introduce a tunable that disables use of MSI. Non-zero value will use INTx. r230337-230338: Rename dev.bge.%d.msi_disable to dev.bge.%d.msi which matches enable/disable and default it to on. r231159: Call bge_add_sysctls() early and especially before bge_can_use_msi() so r230337 actually has a chance of working and doesn't always unconditionally disable the use of MSIs. Modified: stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/bge/if_bgereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Wed Feb 15 04:02:41 2012 (r231734) +++ stable/8/sys/dev/bge/if_bge.c Wed Feb 15 04:03:41 2012 (r231735) @@ -2745,6 +2745,9 @@ bge_can_use_msi(struct bge_softc *sc) { int can_use_msi = 0; + if (sc->bge_msi == 0) + return (0); + /* Disable MSI for polling(4). */ #ifdef DEVICE_POLLING return (0); @@ -2783,6 +2786,8 @@ bge_attach(device_t dev) sc = device_get_softc(dev); sc->bge_dev = dev; + bge_add_sysctls(sc); + TASK_INIT(&sc->bge_intr_task, 0, bge_intr_task, sc); /* @@ -3195,8 +3200,6 @@ bge_attach(device_t dev) goto fail; } - bge_add_sysctls(sc); - /* Set default tuneable values. */ sc->bge_stat_ticks = BGE_TICKS_PER_SEC; sc->bge_rx_coal_ticks = 150; @@ -5627,6 +5630,12 @@ bge_add_sysctls(struct bge_softc *sc) "Number of fragmented TX buffers of a frame allowed before " "forced collapsing"); + sc->bge_msi = 1; + snprintf(tn, sizeof(tn), "dev.bge.%d.msi", unit); + TUNABLE_INT_FETCH(tn, &sc->bge_msi); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "msi", + CTLFLAG_RD, &sc->bge_msi, 0, "Enable MSI"); + /* * It seems all Broadcom controllers have a bug that can generate UDP * datagrams with checksum value 0 when TX UDP checksum offloading is Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Wed Feb 15 04:02:41 2012 (r231734) +++ stable/8/sys/dev/bge/if_bgereg.h Wed Feb 15 04:03:41 2012 (r231735) @@ -2864,6 +2864,7 @@ struct bge_softc { int bge_timer; int bge_forced_collapse; int bge_forced_udpcsum; + int bge_msi; int bge_csum_features; struct callout bge_stat_ch; uint32_t bge_rx_discards;