From owner-freebsd-ipfw@FreeBSD.ORG Fri Dec 7 12:27:50 2012 Return-Path: Delivered-To: freebsd-ipfw@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by hub.freebsd.org (Postfix) with ESMTP id B9FAB329; Fri, 7 Dec 2012 12:27:50 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id 7CCE33B4C04; Fri, 7 Dec 2012 12:27:39 +0000 (UTC) Message-ID: <50C1E09A.5050301@FreeBSD.org> Date: Fri, 07 Dec 2012 16:27:06 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: freebsd-net@freebsd.org, freebsd-ipfw Subject: [RFC] IPv6 ifaddr hash X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: melifaro@FreeBSD.org X-BeenThere: freebsd-ipfw@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: IPFW Technical Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Dec 2012 12:27:50 -0000 Hi All, We have discovered that ipfw(4) shows very low performance results with our rules. One of the biggest problems is rules with O_IP6_XXX_ME opcode. They checks match or not match packet's addresses with locally configured IPv6 addresses. For IPv4 we have an in_ifaddr hash for the quick search an address, but not for the IPv6. So, I have implemented the first patch based on the code for the IPv4, but there are several questions I want to discuss. The patch is here: http://people.freebsd.org/~ae/in6_ifaddrhash.diff 1. The hash size. I made it the same what IPv4 has. But I think 512 buckets is too many. 2. What hash function is better to use? 3. Using the whole 128 bit of address to hash seems like overkill. -- WBR, Andrey V. Elsukov