From owner-freebsd-net@FreeBSD.ORG Thu Oct 15 08:13:32 2009 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 CA6D41065672 for ; Thu, 15 Oct 2009 08:13:32 +0000 (UTC) (envelope-from rihad@mail.ru) Received: from mx39.mail.ru (mx39.mail.ru [94.100.176.53]) by mx1.freebsd.org (Postfix) with ESMTP id 8A6438FC0C for ; Thu, 15 Oct 2009 08:13:32 +0000 (UTC) Received: from [217.25.27.27] (port=4198 helo=[217.25.27.27]) by mx39.mail.ru with asmtp id 1MyLSe-000I7I-00 for freebsd-net@freebsd.org; Thu, 15 Oct 2009 12:13:24 +0400 Message-ID: <4AD6D99E.10805@mail.ru> Date: Thu, 15 Oct 2009 13:13:18 +0500 From: rihad User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706) MIME-Version: 1.0 To: freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: Not detected X-Mras: Ok Subject: Re: dummynet dropping too many packets X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: rihad List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2009 08:13:32 -0000 For now we've mostly disabled dummynet and the drops have stopped, thanks to some extra unused bandwidth we have. But this isn't a real solution, of course, so this weekend I'm going to try the suggestion made by Robert Watson: > In the driver init code in if_bce, the following code appears: > > ifp->if_snd.ifq_drv_maxlen = USABLE_TX_BD; > IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); > IFQ_SET_READY(&ifp->if_snd); > > Which evaluates to a architecture-specific value due to varying pagesize. You might just try forcing it to 1024. But I've looked in /sys/dev/bce/if_bcereg.h of our FreeBSD 7.1 source code and found this: #define TX_PAGES 2 #define TOTAL_TX_BD_PER_PAGE (BCM_PAGE_SIZE / sizeof(struct tx_bd)) #define USABLE_TX_BD_PER_PAGE (TOTAL_TX_BD_PER_PAGE - 1) #define TOTAL_TX_BD (TOTAL_TX_BD_PER_PAGE * TX_PAGES) #define USABLE_TX_BD (USABLE_TX_BD_PER_PAGE * TX_PAGES) #define MAX_TX_BD (TOTAL_TX_BD - 1) meaning that USABLE_TX_BD is expected to be smaller than MAX_TX_BD. What if MAX_TX_BD is itself way smaller than 1024, which I'll eventually set ifq_drv_maxlen to? Can a driver guru please comment on this? In a few days I'm going to try it anyway, and if the system locks up I'll just revert back to the original code, and order a darn expensive Intel 10 Gige card, but it won't hurt to ask beforehand. TIA