From owner-freebsd-net@FreeBSD.ORG Wed Nov 7 22:48:39 2012 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 91459DC9 for ; Wed, 7 Nov 2012 22:48:39 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mail.ipfw.ru (unknown [IPv6:2a01:4f8:120:6141::2]) by mx1.freebsd.org (Postfix) with ESMTP id 27B7A8FC08 for ; Wed, 7 Nov 2012 22:48:39 +0000 (UTC) Received: from v6.mpls.in ([2a02:978:2::5] helo=ws.su29.net) by mail.ipfw.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1TWETe-000HPz-Cl for freebsd-net@FreeBSD.org; Thu, 08 Nov 2012 02:52:06 +0400 Message-ID: <509AE539.5050102@FreeBSD.org> Date: Thu, 08 Nov 2012 02:48:25 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120121 Thunderbird/9.0 MIME-Version: 1.0 To: freebsd-net@FreeBSD.org Subject: arp/ndp default hash size Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 22:48:39 -0000 Hello list! Currently size of arp/ndp hash is the following: #define LLTBL_HASHTBL_SIZE 32 /* default 32 ? */ This may be OK for end hosts, but this is definitely not enough for router howadays. Especially given that IPv6 hosts generate 2 ndp records. Output from 2 random v4 / v6 routers from my $job: 2:23 [0] m@matisse arp -an | wc -l 1494 2:24 [0] m@singapore ndp -an | wc -l 3999 Given that LIST_HEAD is just a pointer, and we currently have single global (actually per-VNET) instance for every l3 proto, bumping hash to, say, at least 4096 should do no harm.