plan9front/sys
cinap_lenrek 3459c8cb8e allocb: implement buffer pools for ethernet drivers
Some ethernet drivers implemented their own buffer pools
using Block.free() callbacks.

Usually, these implementations have the defect that the
driver only allocates a fixed number of buffers total.

This upper bound is impossible to predict (depends
on protocol queue limits).

Also, allocation is not space efficient when large
alignments are needed.

This change removes the Block.free() callback and
replaces it with a common buffer pool implementation:

A Bpool struct, containing the block size and
alignment needed for the blocks. Block.pool
is non-nil when the block is from a pool.

growbp(Bpool*,int) supplies new blocks to a pool.

Allocation is done such that the data area and
Block headers are in separate allocations.

All the blocks share the same allocation for
data avoiding waste as not every block needs
to add alignment slack individually.

Block *iallocbp(Bpool*) allocates a block,
growing the pool if neccessary.

freeb(): returns the block back to the pool.

We also tweak the input queue sizes for devether,
making it twice as large as the transmit queue.
2025-01-10 14:32:50 +00:00
..
doc /sys/doc/fs: don't make fs.html by default 2025-01-05 17:49:10 +00:00
games/lib
include libmemdraw: change openmemsubfont() to accept rune minimum as argument 2025-01-03 00:51:43 +00:00
lib
man gefs(8): fix indent of empty snapshot paragraph 2025-01-08 19:36:17 +00:00
src allocb: implement buffer pools for ethernet drivers 2025-01-10 14:32:50 +00:00