From owner-cvs-all Mon May 13 4:46: 7 2002 Delivered-To: cvs-all@freebsd.org Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by hub.freebsd.org (Postfix) with ESMTP id 66FC837B408; Mon, 13 May 2002 04:45:54 -0700 (PDT) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.2/8.12.2) with ESMTP id g4DBjFHA013422; Mon, 13 May 2002 13:45:15 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: Luigi Rizzo Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/net if_ethersubr.c src/sys/netinet ip_dummynet.c ip_dummynet.h In-Reply-To: Your message of "Mon, 13 May 2002 04:39:15 PDT." <20020513043915.B30792@iguana.icir.org> Date: Mon, 13 May 2002 13:45:15 +0200 Message-ID: <13421.1021290315@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message <20020513043915.B30792@iguana.icir.org>, Luigi Rizzo writes: >On Mon, May 13, 2002 at 01:27:38PM +0200, Poul-Henning Kamp wrote: >... >> Even better yet: >> >> + Make the ipfw program a "ipfw rule to C compiler" and >> kldload the compiled C code. >> >> BillF has worked on this and the performance increase was fantastic. > >i am not a compiler guy. I hate writing compilers. >If there is code available that does this, and it is complete >(i.e. it supports all things our ipfw does) then it is welcome. It's not as much a compiler as a text-processing task. All the optimizations can be left to GCC. All you have to do is translate the ipfw rule to suitable C source and then run gcc on it. >This said... if the ipfw ruleset is properly written, I am not sure >that you can improve by more than a factor of 2..5, but I'll be glad to be >proven wrong. A factor 5 isn't a bad thing. I think you overlook that by compiling it to C we can leverage the GCC optimizer. For instance, a sequence like: ... allow tcp from any to any 25 allow tcp from any to any 113 allow tcp from foohost to any 23 ... The compile C code would likely only test for it being TCP once -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message