Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Nov 2007 18:40:19 +0300
From:      Igor Sysoev <is@rambler-co.ru>
To:        freebsd-net@freebsd.org
Subject:   bge loader tunables
Message-ID:  <20071116154019.GE93422@rambler-co.ru>

next in thread | raw e-mail | index | archive | help

--i0/AhcQY5QxfSsSZ
Content-Type: text/plain; charset=koi8-r
Content-Disposition: inline

The attached patch creates the following bge loader tunables:

hw.bge.rxd=512

Number of standard receive descriptors allocated by the driver.
The default value is 256. The maximum value is 512.

hw.bge.rx_int_delay=500

This value delays the generation of receive interrupts in microseconds.
The default value is 150 microseconds.

hw.bge.tx_int_delay=500

This value delays the generation of transmit interrupts in microseconds.
The default value is 150 microseconds.

hw.bge.rx_coal_desc=64

This value delays the generation of receive interrupts until specified
number of packets will be received. The default value is 10.

hw.bge.tx_coal_desc=128

This value delays the generation of transmit interrupts until specified
number of packets will be transmited. The default value is 10.


-- 
Igor Sysoev
http://sysoev.ru/en/

--i0/AhcQY5QxfSsSZ
Content-Type: text/x-diff; charset=koi8-r
Content-Disposition: attachment; filename="bge.7.patch"

--- sys/dev/bge/if_bge.c	2007-09-30 15:05:14.000000000 +0400
+++ sys/dev/bge/if_bge.c	2007-11-15 23:01:57.000000000 +0300
@@ -426,8 +426,18 @@
 DRIVER_MODULE(miibus, bge, miibus_driver, miibus_devclass, 0, 0);
 
 static int bge_allow_asf = 0;
+static int bge_rxd = BGE_SSLOTS;
+static int bge_rx_coal_ticks = 150;
+static int bge_tx_coal_ticks = 150;
+static int bge_rx_max_coal_bds = 10;
+static int bge_tx_max_coal_bds = 10;
 
 TUNABLE_INT("hw.bge.allow_asf", &bge_allow_asf);
+TUNABLE_INT("hw.bge.rxd", &bge_rxd);
+TUNABLE_INT("hw.bge.rx_int_delay", &bge_rx_coal_ticks);
+TUNABLE_INT("hw.bge.tx_int_delay", &bge_tx_coal_ticks);
+TUNABLE_INT("hw.bge.rx_coal_desc", &bge_rx_max_coal_bds);
+TUNABLE_INT("hw.bge.tx_coal_desc", &bge_tx_max_coal_bds);
 
 SYSCTL_NODE(_hw, OID_AUTO, bge, CTLFLAG_RD, 0, "BGE driver parameters");
 SYSCTL_INT(_hw_bge, OID_AUTO, allow_asf, CTLFLAG_RD, &bge_allow_asf, 0,
@@ -877,10 +887,10 @@
 {
 	int i;
 
-	for (i = 0; i < BGE_SSLOTS; i++) {
+	for (i = 0; i < bge_rxd; i++) {
 		if (bge_newbuf_std(sc, i, NULL) == ENOBUFS)
 			return (ENOBUFS);
-	};
+	}
 
 	bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag,
 	    sc->bge_cdata.bge_rx_std_ring_map,
@@ -2453,10 +2463,10 @@
 
 	/* Set default tuneable values. */
 	sc->bge_stat_ticks = BGE_TICKS_PER_SEC;
-	sc->bge_rx_coal_ticks = 150;
-	sc->bge_tx_coal_ticks = 150;
-	sc->bge_rx_max_coal_bds = 10;
-	sc->bge_tx_max_coal_bds = 10;
+	sc->bge_rx_coal_ticks = bge_rx_coal_ticks;
+	sc->bge_tx_coal_ticks = bge_tx_coal_ticks;
+	sc->bge_rx_max_coal_bds = bge_rx_max_coal_bds;
+	sc->bge_tx_max_coal_bds = bge_tx_max_coal_bds;
 
 	/* Set up ifnet structure */
 	ifp = sc->bge_ifp = if_alloc(IFT_ETHER);

--i0/AhcQY5QxfSsSZ--



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