svn commit: r213107 - stable/8/sys/dev/bge

Pyun YongHyeon yongari at FreeBSD.org
Fri Sep 24 17:53:33 UTC 2010


Author: yongari
Date: Fri Sep 24 17:53:32 2010
New Revision: 213107
URL: http://svn.freebsd.org/changeset/base/213107

Log:
  MFC r211594:
    Load tunable from loader.conf(5) instead of device.hints(5).

Modified:
  stable/8/sys/dev/bge/if_bge.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (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/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/bge/if_bge.c
==============================================================================
--- stable/8/sys/dev/bge/if_bge.c	Fri Sep 24 17:26:57 2010	(r213106)
+++ stable/8/sys/dev/bge/if_bge.c	Fri Sep 24 17:53:32 2010	(r213107)
@@ -4898,6 +4898,8 @@ bge_add_sysctls(struct bge_softc *sc)
 	struct sysctl_ctx_list *ctx;
 	struct sysctl_oid_list *children, *schildren;
 	struct sysctl_oid *tree;
+	char tn[32];
+	int unit;
 
 	ctx = device_get_sysctl_ctx(sc->bge_dev);
 	children = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->bge_dev));
@@ -4917,6 +4919,7 @@ bge_add_sysctls(struct bge_softc *sc)
 
 #endif
 
+	unit = device_get_unit(sc->bge_dev);
 	/*
 	 * A common design characteristic for many Broadcom client controllers
 	 * is that they only support a single outstanding DMA read operation
@@ -4929,13 +4932,13 @@ bge_add_sysctls(struct bge_softc *sc)
 	 * performance is about 850Mbps. However forcing coalescing mbufs
 	 * consumes a lot of CPU cycles, so leave it off by default.
 	 */
+	sc->bge_forced_collapse = 0;
+	snprintf(tn, sizeof(tn), "dev.bge.%d.forced_collapse", unit);
+	TUNABLE_INT_FETCH(tn, &sc->bge_forced_collapse);
 	SYSCTL_ADD_INT(ctx, children, OID_AUTO, "forced_collapse",
 	    CTLFLAG_RW, &sc->bge_forced_collapse, 0,
 	    "Number of fragmented TX buffers of a frame allowed before "
 	    "forced collapsing");
-	resource_int_value(device_get_name(sc->bge_dev),
-	    device_get_unit(sc->bge_dev), "forced_collapse",
-	    &sc->bge_forced_collapse);
 
 	if (BGE_IS_5705_PLUS(sc))
 		return;


More information about the svn-src-stable-8 mailing list