[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[UNIKRAFT PATCH v3 0/5] Introduce Ring Buffer Implementation



This series introduces a port of FreeBSD's buf_ring.{h,c} implementation for use
within Unikraft.  This 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.

 - 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

Changes in v3:

 * This patch series relies on changes made available in the following patch
   series': #1474, #1475 and #1477.  These series' introduce primitives for
   cpu_spinwait across architecturs; pre-emptive scheduling, namely 
   `uk_preempt_enable` and uk_preempt_disable`; and, the global architecture 
cache line size, respectively.
 * Squahes some verbose commits on library registration.

Alexander Jung (5):
  lib/ukring: Import ring buffer from FreeBSD
  lib/ukring: Fix formatting issues {ring.c, ring.h}
  lib/ukring: Adapt {ring.c, ring.h} to Unikraft
  lib/ukring: Re-prefix methods and structs from buf_ to uk_
  lib/ukring: Register ukring with Unikraft

 lib/Makefile.uk              |   1 +
 lib/ukring/Config.uk         |  23 +++
 lib/ukring/Makefile.uk       |   6 +
 lib/ukring/exportsyms.uk     |  12 ++
 lib/ukring/include/uk/ring.h | 392 +++++++++++++++++++++++++++++++++++++++++++
 lib/ukring/ring.c            |  67 ++++++++
 6 files changed, 501 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.11.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.