[dpdk-dev] [PATCH RFCv2 0/4] generalise rte_ring to allow different datatypes

Bruce Richardson bruce.richardson at intel.com
Tue Jan 24 11:39:33 CET 2017

Following on from the previous RFC, this generalises the rte_ring 
structure using C constructs rather than using macros. The idea
here is to have the size of the data objects passed in to all common
functions and then switching the code paths, where necessary, based on
those size parameters. For the standard rte_ring APIs, these work on
void pointers, so the extra parameter is always specified as 
sizeof(void *). A new event_ring type is also added as a patch to test
out creating and using rings with different size objects.

Comments welcome on this RFC, though I still hope to try out some
other options, as I think there may be still better ways to achieve
the same end.

Bruce Richardson (4):
  ring: create common ring files
  ring: separate common and rte_ring specific functions
  ring: allow common ring to use 8 or 16 byte values
  ring: add new event ring class

 app/test/Makefile                 |   1 +
 app/test/test_event_ring.c        |  83 ++++
 lib/librte_ring/Makefile          |   8 +-
 lib/librte_ring/rte_common_ring.c | 386 ++++++++++++++++
 lib/librte_ring/rte_common_ring.h | 925 ++++++++++++++++++++++++++++++++++++++
 lib/librte_ring/rte_event_ring.c  |  87 ++++
 lib/librte_ring/rte_event_ring.h  | 696 ++++++++++++++++++++++++++++
 lib/librte_ring/rte_ring.c        | 320 +------------
 lib/librte_ring/rte_ring.h        | 606 +------------------------
 9 files changed, 2210 insertions(+), 902 deletions(-)
 create mode 100644 app/test/test_event_ring.c
 create mode 100644 lib/librte_ring/rte_common_ring.c
 create mode 100644 lib/librte_ring/rte_common_ring.h
 create mode 100644 lib/librte_ring/rte_event_ring.c
 create mode 100644 lib/librte_ring/rte_event_ring.h


More information about the dev mailing list