Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Feb 2012 04:03:42 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r231735 - stable/8/sys/dev/bge
Message-ID:  <201202150403.q1F43gID034907@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202150403.q1F43gID034907>