Network performance in a dual CPU system

Luigi Rizzo rizzo at icir.org
Wed Feb 15 12:31:10 PST 2006


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


More information about the freebsd-net mailing list