[Click] Kernel BufferQueue

Beyers Cronje bcronje at gmail.com
Thu Jun 22 22:58:48 EDT 2006


Hi Eddie, all,

I had a need to buffer incoming packets in Click kernel module for two
seconds on an interface with around 350+mbps traffic load with an average
packet count of 80,000pps. In other words I needed to buffer at least
160,000 packets at any given time in the kernel module. Any SimpleQueue
derived queue's maximum capacity is 32761, limited by kmalloc's maximum
bucket size of 131048 bytes.  Click-install will crash the kernel if you
specify any larger capacity.

The attached element is a linuxmodule only element that uses vmalloc instead
of kmalloc to allocate queue memory. It installs and seems to run fine on my
system with a queue capacity of 500,000. It is derived from NotifierQueue
and overrides methods used in SimpleQueue to allocate and free memory
(initialize, live_reconfigure & cleanup).

Feel free to use or include in Click. Also feel free to rename as I couldnt
come up with a better name than BufferQueue :)

One drawback of calling vmalloc directly is that click/meminfo will not
reflect this allocation. Maybe a Click newvm(size_t) function can help with
this.

Cheers

Beyers Cronje
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bufferqueue.tar.gz
Type: application/x-gzip
Size: 1735 bytes
Desc: not available
Url : https://amsterdam.lcs.mit.edu/pipermail/click/attachments/20060622/0c8e85cf/bufferqueue.tar.bin


More information about the click mailing list