From owner-freebsd-net@FreeBSD.ORG Sat Apr 5 16:52:59 2008 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 5D946106566C for ; Sat, 5 Apr 2008 16:52:59 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.171]) by mx1.freebsd.org (Postfix) with ESMTP id C96598FC15 for ; Sat, 5 Apr 2008 16:52:58 +0000 (UTC) (envelope-from max@love2party.net) Received: from vampire.homelinux.org (dslb-088-064-181-110.pools.arcor-ip.net [88.64.181.110]) by mrelayeu.kundenserver.de (node=mrelayeu8) with ESMTP (Nemesis) id 0ML31I-1JiBdR3txn-0003py; Sat, 05 Apr 2008 18:52:58 +0200 Received: (qmail 6594 invoked from network); 5 Apr 2008 16:51:58 -0000 Received: from myhost.laiers.local (192.168.4.151) by mx.laiers.local with SMTP; 5 Apr 2008 16:51:58 -0000 From: Max Laier Organization: FreeBSD To: freebsd-net@freebsd.org Date: Sat, 5 Apr 2008 18:50:34 +0200 User-Agent: KMail/1.9.9 References: <47F78E90.1000706@incunabulum.net> In-Reply-To: <47F78E90.1000706@incunabulum.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200804051850.34371.max@love2party.net> X-Provags-ID: V01U2FsdGVkX1+ehwkze/ApFOw4xyfb8hRJmr7EXTHGFGUDUBo Q9Qbj8DCmxvOS7lqpfUJfaq1pVZO8bX8ryoyhT6eBUWVM7Rc/X FYEUX8H0tjtN8gSNQvHNg== Cc: Bruce M Simpson Subject: Re: getifaddrs() scalability 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, 05 Apr 2008 16:52:59 -0000 On Saturday 05 April 2008 16:37:04 Bruce M Simpson wrote: > Just off the top of my head... > ...has anyone run into problems with the scalability of this call? > > One of the XORP users needs to create =BB1000 interfaces in Linux, and > I'm wondering if any FreeBSD users need to create that amount of > network interfaces. > > As such the getifaddrs() call is likely to get slow in that scenario, > as it uses a linked list. I'm not sure what you are trying to achieve. getifaddrs is the API to get= =20 a complete and consistent snapshot of all currently configured addresses=20 and I don't think there is a better way to represent that then a linked=20 list. If you need to do lookups in userland you should build your own=20 data structure off of that list. You can use a PF_ROUTE socket to watch=20 for changes and modify your view accordingly. =2D-=20 /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News