mirror of
git://git.9front.org/plan9front/plan9front
synced 2025-01-12 11:10:06 +00:00
[Mirror] Some kind of OS: git://git.9front.org/plan9front/plan9front
3459c8cb8e
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. |
||
---|---|---|
386 | ||
68000 | ||
68020 | ||
acme | ||
adm/timezone | ||
amd64 | ||
arm | ||
arm64 | ||
lib | ||
mips | ||
power | ||
power64 | ||
rc | ||
sparc | ||
sparc64 | ||
spim | ||
sys |