From owner-freebsd-net@FreeBSD.ORG Sun Nov 27 20:00:16 2005 Return-Path: X-Original-To: net@freebsd.org Delivered-To: freebsd-net@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4B45B16A41F for ; Sun, 27 Nov 2005 20:00:16 +0000 (GMT) (envelope-from misho@interbgc.com) Received: from mail.interbgc.com (mx02.interbgc.com [217.9.224.227]) by mx1.FreeBSD.org (Postfix) with SMTP id 250FC43D6A for ; Sun, 27 Nov 2005 20:00:10 +0000 (GMT) (envelope-from misho@interbgc.com) Received: (qmail 18744 invoked from network); 27 Nov 2005 20:00:07 -0000 Received: from misho@interbgc.com by keeper.interbgc.com by uid 1002 with qmail-scanner-1.14 (uvscan: v4.2.40/v4374. spamassassin: 2.63. Clear:SA:0(-2.6/8.0):. Processed in 2.735015 secs); 27 Nov 2005 20:00:07 -0000 X-Spam-Status: No, hits=-2.6 required=8.0 Received: from topilapi-wlan.ddns.cablebg.net (HELO misho) (213.240.221.12) by mx02.interbgc.com with SMTP; 27 Nov 2005 20:00:04 -0000 Message-ID: <002801c5f38d$2885c1c0$0cddf0d5@misho> From: "Mihail Balikov" To: References: <20051127005943.GR25711@cell.sick.ru><20051127135529.GF25711@cell.sick.ru> <20051127194545.GA76200@ip.net.ua> Date: Sun, 27 Nov 2005 22:00:01 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1506 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 Cc: Subject: Re: parallelizing ipfw table X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Mihail Balikov List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2005 20:00:16 -0000 I have made small patch to cache results per "table" and this caching gives me about 92% hit ratio with a lot of session. ----- Original Message ----- From: "Ruslan Ermilov" To: "Gleb Smirnoff" Cc: "Vsevolod Lobko" ; ; Sent: Sunday, November 27, 2005 9:45 PM Subject: Re: parallelizing ipfw table > On Sun, Nov 27, 2005 at 04:55:29PM +0300, Gleb Smirnoff wrote: > > On Sun, Nov 27, 2005 at 03:59:43AM +0300, Gleb Smirnoff wrote: > > T> A patch displaying the idea is attached. Not tested yet, read > > T> below. The patch moves the tables array into the ip_fw_chain > > T> structure. This is not necessary now, but in future we can > > T> have multiple independent chains in ipfw, that's why I try > > T> to avoid usage of &layer3_chain in the functions that are > > T> deeper in the call graph. I try to supply chain pointer > > T> from the caller. > > T> > > T> The only problem is the caching in table lookup. This "hack" > > T> makes the lookup function modify the table structure. We need > > T> to remove caching to make the lookup_table() function fully > > T> lockless and reenterable at the same time. The attached patch > > T> doesn't removes caching, since it only displays the original > > T> idea. > > > > Okay, I have made a working patch, that is now undergoing testing > > on SMP. I have axed all the caching from ipfw tables, to make > > lookup_table() lockless and reenterable. This axing simplified > > things much. I believe that the caching gives a benefit only > > when we serve a small number of clients, and is only additional > > workload when we are routing hundreds and thousands of simultaneous > > IP flows. > > > > The patch attached. I'm going to put it into production testing as > > soon as I can reboot the prod box. > > > Nope, I need this caching. It's for looking up the same table > several times in a row but with various values. For example, > we use ipfw tables to route the traffic to the correct dummynet > pipe, where value is the bandwidth, and this caching helps a lot. > > > Cheers, > -- > Ruslan Ermilov > ru@FreeBSD.org > FreeBSD committer > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" >