From 3fb4bb6c799099f6ad07905b39f90c532001dbaa Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Mon, 10 Nov 2008 14:05:03 +0000 Subject: [PATCH] Reconfigure default interrupt moderation parameters: - Adjust TX ticks and TX bds. Add a note in comment that setting TX ticks to 1023 will have _unexpected_ effect. With this TX ticks/bds setting: 1472bytes UDP payload will cause ~1200HZ interrupt (ticks controls TX HC) 1bytes UDP payload will cause ~5100HZ interrupt (bds controls TX HC) - Restore Broadcom's default RX ticks settings (18). Set RX bds to 12. This should be able to restore TCP stream RX performance. Add a note in comment that setting RX ticks to any value above 13 will make RX bds control RX HC. It is found out by using following method: Assume for bulk data RX, RX ticks should always control RX HC if RX bds is relative large. So RX bds is set to 128, which should be large enough but less than the limit (255). Other side of this test TXes 1472bytes payload UDP datagrams. The result: RX ticks Interrupt rate 12 livelock 13 47800 14 1270 15 1270 16 1270 17 1270 18 1270 19 1270 20 1270 30 1270 Linux bnx2 says the RX ticks unit is microsecond, while it looks incorrect. FreeBSD bce(4) does not have any comment about the RX ticks setting. We probably need to find a dynamic RX bds tuning mechanism to prevent system from being livelocked if full speed tiny packets are injected. --- sys/dev/netif/bce/if_bce.c | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/sys/dev/netif/bce/if_bce.c b/sys/dev/netif/bce/if_bce.c index 5c6c8105ae..f914e6ea0a 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.19 2008/09/17 08:51:29 sephe Exp $ + * $DragonFly: src/sys/dev/netif/bce/if_bce.c,v 1.20 2008/11/10 14:05:03 sephe Exp $ */ /* @@ -389,14 +389,26 @@ static int bce_sysctl_rx_ticks(SYSCTL_HANDLER_ARGS); static int bce_sysctl_coal_change(SYSCTL_HANDLER_ARGS, uint32_t *, uint32_t); -static uint32_t bce_tx_bds_int = 20; /* bcm: 20 */ -static uint32_t bce_tx_bds = 24; /* bcm: 20 */ -static uint32_t bce_tx_ticks_int = 80; /* bcm: 80 */ -static uint32_t bce_tx_ticks = 1000; /* bcm: 80 */ -static uint32_t bce_rx_bds_int = 6; /* bcm: 6 */ -static uint32_t bce_rx_bds = 24; /* bcm: 6 */ -static uint32_t bce_rx_ticks_int = 18; /* bcm: 18 */ -static uint32_t bce_rx_ticks = 100; /* bcm: 18 */ +/* + * NOTE: + * Don't set bce_tx_ticks_int/bce_tx_ticks to 1023. Linux's bnx2 + * 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 */ TUNABLE_INT("hw.bce.tx_bds_int", &bce_tx_bds_int); TUNABLE_INT("hw.bce.tx_bds", &bce_tx_bds); -- 2.41.0