demikernel icon indicating copy to clipboard operation
demikernel copied to clipboard

[runtime] Add Functionality to Conceptual Buffer Type

Open BrianZill opened this issue 2 years ago • 2 comments

The buffers we currently pass around everywhere can be created (either empty, or from a slice of an u8 array), adjusted (have an amount taken from the start), and trimmed (have an amount taken from the end). And that's it.

It would be nice if we could place these buffers on lists without having to allocate an extra wrapper for them (e.g. by having accessible next & previous link fields in the buffer structure).

It would also be nice if we could attach a small amount of data to the buffer for various purposes where we currently have to allocate a wrapping struct (e.g. the UnackedSegment type, which holds an "Instant" representing the transmission time).

All of the above could potentially apply to groups of buffers, so we could manipulate multiple memory allocations together as a unit (BSD stacks have mbuf chains, Windows NT has net buffer lists).

This would likely require integration with the memory allocator for peak efficiency.

BrianZill avatar Mar 29 '22 22:03 BrianZill

Related Issue #173 extends the desired functionality further.

BrianZill avatar Oct 04 '22 23:10 BrianZill

We also need to support splitting an existing buffer into two (preferably without copying any of the actual data).

BrianZill avatar Oct 04 '22 23:10 BrianZill