svn commit: r231736 - stable/7/sys/dev/bge
Pyun YongHyeon
yongari at FreeBSD.org
Wed Feb 15 04:04:37 UTC 2012
Author: yongari
Date: Wed Feb 15 04:04:36 2012
New Revision: 231736
URL: http://svn.freebsd.org/changeset/base/231736
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/7/sys/dev/bge/if_bge.c
stable/7/sys/dev/bge/if_bgereg.h
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/bge/if_bge.c
==============================================================================
--- stable/7/sys/dev/bge/if_bge.c Wed Feb 15 04:03:41 2012 (r231735)
+++ stable/7/sys/dev/bge/if_bge.c Wed Feb 15 04:04:36 2012 (r231736)
@@ -2749,6 +2749,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);
@@ -2787,6 +2790,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);
/*
@@ -3199,8 +3204,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/7/sys/dev/bge/if_bgereg.h
==============================================================================
--- stable/7/sys/dev/bge/if_bgereg.h Wed Feb 15 04:03:41 2012 (r231735)
+++ stable/7/sys/dev/bge/if_bgereg.h Wed Feb 15 04:04:36 2012 (r231736)
@@ -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;
More information about the svn-src-stable
mailing list