From owner-freebsd-net@FreeBSD.ORG Sat May 1 09:20:08 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 34ED6106564A; Sat, 1 May 2010 09:20:08 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3]) by mx1.freebsd.org (Postfix) with ESMTP id D86038FC0C; Sat, 1 May 2010 09:20:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 6268241C6A3; Sat, 1 May 2010 11:20:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id efeOcqrf7+pF; Sat, 1 May 2010 11:20:05 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id D3F8841C67B; Sat, 1 May 2010 11:20:05 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id F347D4448EC; Sat, 1 May 2010 09:17:05 +0000 (UTC) Date: Sat, 1 May 2010 09:17:04 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Maxim Sobolev In-Reply-To: <4BDB52F4.2010100@FreeBSD.org> Message-ID: <20100501091158.B23815@maildrop.int.zabbadoz.net> References: <4BDB3C31.4050709@sippysoft.com> <4BDB4CAE.20006@elischer.org> <4BDB52F4.2010100@FreeBSD.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-net@FreeBSD.org, Julian Elischer , "current@freebsd.org" Subject: Re: Making IFQ_MAXLEN tunable 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: Sat, 01 May 2010 09:20:08 -0000 On Fri, 30 Apr 2010, Maxim Sobolev wrote: Hi, > Julian Elischer wrote: >> On 4/30/10 1:23 PM, Maxim Sobolev wrote: >>> Hi, >>> >>> Many network drivers in the FreeBSD kernel use the IFQ_MAXLEN value to >>> set length of the outgoing packets queue. The default value for that >>> parameter is only 50, which is pretty low especially for the cases when >>> the system handles lot of small packets and can cause ENOBUFS in >>> applications under the load. The following patch makes IFQ_MAXLEN a >>> tunable. I am also tempted to bump the default value for IFQ_MAXLEN >>> 10-fold, but would like to hear what do people think about it first. >>> >>> http://sobomax.sippysoft.com/IFQ_MAXLEN.diff >> >> so just tunable? not a sysctl :-) > > The sysctl would require much bigger rewrite. As long as I understand the > value is now cached in many instances of the ifnet structure, and some > drivers even use their own queue length instead of IFQ_MAXLEN. Therefore, > even if I make this parameter a sysctl one would have to destroy interface > and create it again in order for the change to have an effect. Therefore, > keeping it tunable would be less confusing. > >> patch could be a lot smaller if you defined IFQ_MAXLEN to be V_ifqmaxlen >> (do different vimages want a different value?) > > I am not quite sure about that. AFAIK vimage is more high-level thing, while > this parameter controls queue length between kernel and hardware interface > driver. vimage lies above that. My leaning goes that it should be a global system boottime configuration and neither a sysctl nor a value per virtual network stack. If we'd want it to be anything else, like making a sysctl I'd prefer to have it global rather than having someone inside a virtual network stack as it basically restricts the usage of global resources (mbufs). If we can get it a sysctl and will have resources limits it will be easily converted into a per-vnet configuration. /bz -- Bjoern A. Zeeb See you when I see you.