From owner-freebsd-net@FreeBSD.ORG Fri Nov 16 15:56:22 2007 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2169916A469 for ; Fri, 16 Nov 2007 15:56:22 +0000 (UTC) (envelope-from is@rambler-co.ru) Received: from relay0.rambler.ru (relay0.rambler.ru [81.19.66.187]) by mx1.freebsd.org (Postfix) with ESMTP id C515813C459 for ; Fri, 16 Nov 2007 15:56:21 +0000 (UTC) (envelope-from is@rambler-co.ru) Received: from relay0.rambler.ru (localhost [127.0.0.1]) by relay0.rambler.ru (Postfix) with ESMTP id C2EC97B4C for ; Fri, 16 Nov 2007 18:37:44 +0300 (MSK) Received: from localhost (is1.park.rambler.ru [81.19.64.121]) by relay0.rambler.ru (Postfix) with ESMTP id A21657C7E for ; Fri, 16 Nov 2007 18:37:44 +0300 (MSK) Date: Fri, 16 Nov 2007 18:40:19 +0300 From: Igor Sysoev To: freebsd-net@freebsd.org Message-ID: <20071116154019.GE93422@rambler-co.ru> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="i0/AhcQY5QxfSsSZ" Content-Disposition: inline User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: No virus found Subject: bge loader tunables X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2007 15:56:22 -0000 --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--