Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 May 2002 13:45:15 +0200
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
To:        Luigi Rizzo <luigi@FreeBSD.org>
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 
Message-ID:  <13421.1021290315@critter.freebsd.dk>
In-Reply-To: Your message of "Mon, 13 May 2002 04:39:15 PDT." <20020513043915.B30792@iguana.icir.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?13421.1021290315>