From 5df3a6aa72f98f69fa498e2249e71d7a14a0f16f Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Wed, 9 Sep 2009 09:10:58 -0700 Subject: [PATCH] NFE - Change default RX ring size from 128 -> 256, Adjust moderation timer. * NFE does not seem to be able to flow control the phy. TCP reception using window scaling and large socket bufs can blow out the receiver ring before the interrupt has a chance to drain it. This results in the receiver dropping a packet and the transmitter seeing bursts of duplicate TCP acks and having to go into recovery. * Shorten the moderation timer from 500uS to 250uS, increasing its frequency from 2000Hz to 4000Hz. Note that the moderation timer only kicks in when the discrete interrupt rate exceeds the frequency. * The problem still occurs with the larger RX ring and shorter moderation timer, but not nearly as often. --- sys/dev/netif/nfe/if_nfe.c | 7 ++++--- sys/dev/netif/nfe/if_nfereg.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/dev/netif/nfe/if_nfe.c b/sys/dev/netif/nfe/if_nfe.c index b6c2b22d5a..a4a8dda30c 100644 --- a/sys/dev/netif/nfe/if_nfe.c +++ b/sys/dev/netif/nfe/if_nfe.c @@ -161,13 +161,14 @@ static int nfe_debug = 0; static int nfe_rx_ring_count = NFE_RX_RING_DEF_COUNT; static int nfe_tx_ring_count = NFE_TX_RING_DEF_COUNT; /* - * hw timer simulated interrupt moderation @2000Hz. Negative values - * disable the timer when no traffic is present. + * hw timer simulated interrupt moderation @4000Hz. Negative values + * disable the timer when the discrete interrupt rate falls below + * the moderation rate. * * XXX 8000Hz might be better but if the interrupt is shared it can * blow out the cpu. */ -static int nfe_imtime = -500; /* uS */ +static int nfe_imtime = -250; /* uS */ TUNABLE_INT("hw.nfe.rx_ring_count", &nfe_rx_ring_count); TUNABLE_INT("hw.nfe.tx_ring_count", &nfe_tx_ring_count); diff --git a/sys/dev/netif/nfe/if_nfereg.h b/sys/dev/netif/nfe/if_nfereg.h index 4966792d09..faeadf566c 100644 --- a/sys/dev/netif/nfe/if_nfereg.h +++ b/sys/dev/netif/nfe/if_nfereg.h @@ -19,7 +19,7 @@ #define NFE_PCI_BA 0x10 -#define NFE_RX_RING_DEF_COUNT 128 +#define NFE_RX_RING_DEF_COUNT 256 #define NFE_TX_RING_DEF_COUNT 256 #define NFE_JUMBO_FRAMELEN 9018 -- 2.11.4.GIT