[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [UNIKRAFT PATCH,v2,00/15] Introduce Ring Buffer Implementation
This series introduces a port of FreeBSD's buf_ring.{h,c} implementation for use within Unikraft. This simple ring buffer can be used for message passing in queues, for example within a AF_UNIX socket implementation between two threads. The implementation is therefore thread safe and provides a generic data field which is initialized to the desired ring buffer length. The implementation is provided within ukmpi as a new option, LIBUKMPI_RING, which exposes the following new methods: - uk_ring_alloc - uk_ring_free - uk_ring_enqueue - uk_ring_dequeue - uk_ring_dequeue_single - uk_ring_advance_single - uk_ring_putback_single - uk_ring_peek - uk_ring_peek_clear_single - uk_ring_full - uk_ring_empty - uk_ring_count The port is currently limited, with no support for reading atomic values from ARM{32,64} CPU registers (described in the comments inline). As a result, use of the ring buffer implementation is untested on ARM. Alexander Jung (15): lib/ukring: Import simple ring buffer from FreeBSD lib/ukring: {ring.c, ring.h} Fix checkpatch errors and spacing. lib/ukring: Adapt {ring.c, ring.h} to Unikraft lib/ukring: Re-prefix methods and structs from buf_ to uk_ lib/ukring: Remove br_ prefix and rename br variable lib/ukring: Disable use of cpu_spinwait function lib/ukring: Rename single and multiple consumer functions. lib/ukring: Use Unikraft to enable ring buffer debugging lib/ukring: Remove unsupported cache line size lib/ukring: Disable use of CPU prefetching lib/ukring: Properly commment {ring.c, ring.h} lib/ukring: Provide KConfig menu option for microlibrary lib/ukring: Target files to build for the microlibrary lib/ukring: Register ukring with Unikraft lib/ukring: Fix unitialized variable lib/Makefile.uk | 1 + lib/ukring/Config.uk | 7 + lib/ukring/Makefile.uk | 6 + lib/ukring/exportsyms.uk | 12 + lib/ukring/include/uk/ring.h | 482 +++++++++++++++++++++++++++++++++++ lib/ukring/ring.c | 86 +++++++ 6 files changed, 594 insertions(+) create mode 100644 lib/ukring/Config.uk create mode 100644 lib/ukring/Makefile.uk create mode 100644 lib/ukring/exportsyms.uk create mode 100644 lib/ukring/include/uk/ring.h create mode 100644 lib/ukring/ring.c -- 2.20.1
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |