FreeBSD Patches for Slow CPU Routers

I'm working on squeezing as much network performance as possible out of net45xx and net48xx Soekris single board systems. Following are a bunch of FreeBSD patches for slow CPU routers, embedded systems and the like. Hopefully they can eventually be merged into FreeBSD (any committers want to mentor this?).

I'll add and update patches as they're developed.

Polling Patches

Machines like the Soekris and WRAP PC often experience livelock under load. This occurs when interupts are generated by the hardware at a rate faster than the CPU can handle them. This not only applies to network cards, but to crypto accelerator cards and other hardware.

Polling sort of solves this problem by disabling interrupts and processing the packets in a scheduled kernel process. As explained elsewhere polling adds packet latency. Follow the instructions on the polling man page.

Polling for Other Devices

Currently in FreeBSD the polling code is specific to interfaces. The following patch makes a few changes to allow other devices to participate:

device-polling-6.0.patch

device-polling-HEAD.patch

Polling for HIFN crypto accelerator cards

The following patch adds polling support for the hifn driver. HIFN cards otherwise generate an interrupt for each packet. To turn on polling:

sysctl dev.hifn.0.polling=1

Note that polling on the hifn driver will only speed things up if interrupt handling is CPU bound on your box (common on a Soekris type system) and if your packet processing is done in parallel (common for IPSec network encryption). In particular the cryptotest utility may show drastically slower results with polling enabled, as it is serial in nature.

hifn-polling-6.0.patch

Dumping Kernel Panic to a USB Stick

Certain single board systems have a USB socket (or pins). This can be used to get a kernel dump from a deployed box when things go awry. The following FreeBSD 6.x patch enables this functionality. Use something like:

dumpon -v /dev/da0

umass-ohci-dump-6.x.patch

   [ home page ]