From 1af951abb88485eb41f7f89a9413c6dee177f400 Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Wed, 19 Nov 2008 13:57:49 +0000 Subject: [PATCH] Don't use "timeout" mode for RX HC. The "collect" mode gives much simpler RX HC formula: if (packets > rx_bds || time since 1st packet > rx_ticks) generate interrupt Adjust RX BDs to 128, and RX ticks to 125. This gives 12000~14000/s interrupt rate across all ranges of packet size; this also gives good RX performance: - 1GB line rate for bulk data (TCP/UDP) - Peak packet per second rate of the hardware Thank Brad very much! --- sys/dev/netif/bce/if_bce.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/sys/dev/netif/bce/if_bce.c b/sys/dev/netif/bce/if_bce.c index f914e6ea0a..d5d47b2b69 100644 --- a/sys/dev/netif/bce/if_bce.c +++ b/sys/dev/netif/bce/if_bce.c @@ -28,7 +28,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/bce/if_bce.c,v 1.31 2007/05/16 23:34:11 davidch Exp $ - * $DragonFly: src/sys/dev/netif/bce/if_bce.c,v 1.20 2008/11/10 14:05:03 sephe Exp $ + * $DragonFly: src/sys/dev/netif/bce/if_bce.c,v 1.21 2008/11/19 13:57:49 sephe Exp $ */ /* @@ -395,20 +395,15 @@ static int bce_sysctl_coal_change(SYSCTL_HANDLER_ARGS, * takes 1023 as the TX ticks limit. However, using 1023 will * cause 5708(B2) to generate extra interrupts (~2000/s) even when * there is _no_ network activity on the NIC. - * - * NOTE: - * On 5706/5708 setting bce_rx_ticks/bce_rx_ticks_int to any value - * above 13 will let RX bds take over RX HC completely, i.e. RX ticks - * will _not_ have any effect at all. */ static uint32_t bce_tx_bds_int = 255; /* bcm: 20 */ static uint32_t bce_tx_bds = 255; /* bcm: 20 */ static uint32_t bce_tx_ticks_int = 1022; /* bcm: 80 */ static uint32_t bce_tx_ticks = 1022; /* bcm: 80 */ -static uint32_t bce_rx_bds_int = 12; /* bcm: 6 */ -static uint32_t bce_rx_bds = 12; /* bcm: 6 */ -static uint32_t bce_rx_ticks_int = 18; /* bcm: 18 */ -static uint32_t bce_rx_ticks = 18; /* bcm: 18 */ +static uint32_t bce_rx_bds_int = 128; /* bcm: 6 */ +static uint32_t bce_rx_bds = 128; /* bcm: 6 */ +static uint32_t bce_rx_ticks_int = 125; /* bcm: 18 */ +static uint32_t bce_rx_ticks = 125; /* bcm: 18 */ TUNABLE_INT("hw.bce.tx_bds_int", &bce_tx_bds_int); TUNABLE_INT("hw.bce.tx_bds", &bce_tx_bds); @@ -3203,7 +3198,6 @@ bce_blockinit(struct bce_softc *sc) REG_WR(sc, BCE_HC_STATS_TICKS, (sc->bce_stats_ticks & 0xffff00)); REG_WR(sc, BCE_HC_STAT_COLLECT_TICKS, 0xbb8); /* 3ms */ REG_WR(sc, BCE_HC_CONFIG, - BCE_HC_CONFIG_RX_TMR_MODE | BCE_HC_CONFIG_TX_TMR_MODE | BCE_HC_CONFIG_COLLECT_STATS); -- 2.41.0