Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Feb 2006 12:30:43 -0800
From:      Luigi Rizzo <rizzo@icir.org>
To:        Andre Oppermann <andre@freebsd.org>
Cc:        Marcos Bedinelli <bedinelli@madhaus.cns.utoronto.ca>, Max Laier <max@love2party.net>, Julian Elischer <julian@elischer.org>, freebsd-net@freebsd.org
Subject:   Re: Network performance in a dual CPU system
Message-ID:  <20060215123043.A29559@xorpc.icir.org>
In-Reply-To: <43F38CF5.71C326C1@freebsd.org>; from andre@freebsd.org on Wed, Feb 15, 2006 at 09:20:05PM %2B0100
References:  <7bb8f24157080b6aaacb897a99259df9@madhaus.cns.utoronto.ca> <711b7ec873f31bc5be50ce477313fac3@madhaus.cns.utoronto.ca> <200602110002.21275.max@love2party.net> <43F38CF5.71C326C1@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Feb 15, 2006 at 09:20:05PM +0100, Andre Oppermann wrote:
...
> >From my profiling with the Agilent tester there seem to be two areas where
> the packet filters (ipfw in my test case) burn a lot of CPU per packet.
> That is a) setup of lots of packet variables unconditionally at the entry
> of ip_fw_chk() no matter whether they get looked at later or not, and b)
> the switch() going through all the packet inspection options is for some
> reason not optimized by the compiler and burns even more CPU.  Some sort
> of JIT (as in the new bpf code) which replaces the case testing and jumps
> directly to the proper place in the switch statement would go a long way
> of making it way more performant.

i was expecting some overhead in the initial setting of
variables but the cost of the switch() surprises me a bit.
did you look at the assembly code produced, or otherwise
could you explain a bit more how you think the switch
affects performance ?
Maybe one could make it cheaper through an indirect function call ?
(in the end, instructions are already indexes for a jump table).

	cheers
	luigi



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