diff mbox

[3/6] linux-generic: rename odph_ring.., to shm_ring...

Message ID 1441793199-30966-4-git-send-email-maxim.uvarov@linaro.org
State New
Headers show

Commit Message

Maxim Uvarov Sept. 9, 2015, 10:06 a.m. UTC
Drop odph_ prefix due to it's not helper anymore and do not
add odp_ prefix because it's not api.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 platform/linux-generic/include/odp_ring_internal.h | 64 +++++++-------
 platform/linux-generic/pktio/ring.c                | 98 +++++++++++-----------
 platform/linux-generic/test/ring/odp_ring_test.c   | 58 ++++++-------
 3 files changed, 110 insertions(+), 110 deletions(-)

Comments

Bill Fischofer Sept. 10, 2015, 3:18 a.m. UTC | #1
Why shm_ring_xxx rather than odp_ring_xxx (or _odp_ring_xxx if these are
internal APIs?)  That would seem to be consistent with other internal APIs.



On Wed, Sep 9, 2015 at 5:06 AM, Maxim Uvarov <maxim.uvarov@linaro.org>
wrote:

> Drop odph_ prefix due to it's not helper anymore and do not
> add odp_ prefix because it's not api.
>
> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
> ---
>  platform/linux-generic/include/odp_ring_internal.h | 64 +++++++-------
>  platform/linux-generic/pktio/ring.c                | 98
> +++++++++++-----------
>  platform/linux-generic/test/ring/odp_ring_test.c   | 58 ++++++-------
>  3 files changed, 110 insertions(+), 110 deletions(-)
>
> diff --git a/platform/linux-generic/include/odp_ring_internal.h
> b/platform/linux-generic/include/odp_ring_internal.h
> index 65c32ad..596bf9b 100644
> --- a/platform/linux-generic/include/odp_ring_internal.h
> +++ b/platform/linux-generic/include/odp_ring_internal.h
> @@ -103,7 +103,7 @@ extern "C" {
>  #include <errno.h>
>  #include <sys/queue.h>
>
> -enum odph_ring_queue_behavior {
> +enum shm_ring_queue_behavior {
>         ODPH_RING_QUEUE_FIXED = 0, /**< Enq/Deq a fixed number
>                                 of items from a ring */
>         ODPH_RING_QUEUE_VARIABLE   /**< Enq/Deq as many items
> @@ -123,9 +123,9 @@ enum odph_ring_queue_behavior {
>   * values in a modulo-32bit base: that's why the overflow of the indexes
> is not
>   * a problem.
>   */
> -typedef struct odph_ring {
> +typedef struct shm_ring {
>         /** @private Next in list. */
> -       TAILQ_ENTRY(odph_ring) next;
> +       TAILQ_ENTRY(shm_ring) next;
>
>         /** @private Name of the ring. */
>         char name[ODPH_RING_NAMESIZE];
> @@ -153,7 +153,7 @@ typedef struct odph_ring {
>
>         /** @private Memory space of ring starts here. */
>         void *ring[0] ODP_ALIGNED_CACHE;
> -} odph_ring_t;
> +} shm_ring_t;
>
>
>  #define ODPH_RING_F_SP_ENQ 0x0001 /* The default enqueue is
> "single-producer".*/
> @@ -191,7 +191,7 @@ typedef struct odph_ring {
>   *    - EEXIST - a memzone with the same name already exists
>   *    - ENOMEM - no appropriate memory area found in which to create
> memzone
>   */
> -odph_ring_t *odph_ring_create(const char *name, unsigned count,
> +shm_ring_t *shm_ring_create(const char *name, unsigned count,
>                             unsigned flags);
>
>
> @@ -210,14 +210,14 @@ odph_ring_t *odph_ring_create(const char *name,
> unsigned count,
>   * @return 0: Success; water mark changed.
>   *             -EINVAL: Invalid water mark value.
>   */
> -int odph_ring_set_water_mark(odph_ring_t *r, unsigned count);
> +int shm_ring_set_water_mark(shm_ring_t *r, unsigned count);
>
>  /**
>   * Dump the status of the ring to the console.
>   *
>   * @param r A pointer to the ring structure.
>   */
> -void odph_ring_dump(const odph_ring_t *r);
> +void shm_ring_dump(const shm_ring_t *r);
>
>  /**
>   * Enqueue several objects on the ring (multi-producers safe).
> @@ -244,9 +244,9 @@ void odph_ring_dump(const odph_ring_t *r);
>   *   if behavior = ODP_RING_QUEUE_VARIABLE
>   *   - n: Actual number of objects enqueued.
>   */
> -int __odph_ring_mp_do_enqueue(odph_ring_t *r, void * const *obj_table,
> +int __shm_ring_mp_do_enqueue(shm_ring_t *r, void * const *obj_table,
>                               unsigned n,
> -                             enum odph_ring_queue_behavior behavior);
> +                             enum shm_ring_queue_behavior behavior);
>
>  /**
>   * Enqueue several objects on a ring (NOT multi-producers safe).
> @@ -270,9 +270,9 @@ int __odph_ring_mp_do_enqueue(odph_ring_t *r, void *
> const *obj_table,
>   *   if behavior = ODP_RING_QUEUE_VARIABLE
>   *   - n: Actual number of objects enqueued.
>   */
> -int __odph_ring_sp_do_enqueue(odph_ring_t *r, void * const *obj_table,
> +int __shm_ring_sp_do_enqueue(shm_ring_t *r, void * const *obj_table,
>                               unsigned n,
> -                             enum odph_ring_queue_behavior behavior);
> +                             enum shm_ring_queue_behavior behavior);
>
>  /**
>   * Dequeue several objects from a ring (multi-consumers safe). When
> @@ -301,9 +301,9 @@ int __odph_ring_sp_do_enqueue(odph_ring_t *r, void *
> const *obj_table,
>   *   - n: Actual number of objects dequeued.
>   */
>
> -int __odph_ring_mc_do_dequeue(odph_ring_t *r, void **obj_table,
> +int __shm_ring_mc_do_dequeue(shm_ring_t *r, void **obj_table,
>                               unsigned n,
> -                             enum odph_ring_queue_behavior behavior);
> +                             enum shm_ring_queue_behavior behavior);
>
>  /**
>   * Dequeue several objects from a ring (NOT multi-consumers safe).
> @@ -328,9 +328,9 @@ int __odph_ring_mc_do_dequeue(odph_ring_t *r, void
> **obj_table,
>   *   if behavior = ODP_RING_QUEUE_VARIABLE
>   *   - n: Actual number of objects dequeued.
>   */
> -int __odph_ring_sc_do_dequeue(odph_ring_t *r, void **obj_table,
> +int __shm_ring_sc_do_dequeue(shm_ring_t *r, void **obj_table,
>                               unsigned n,
> -                             enum odph_ring_queue_behavior behavior);
> +                             enum shm_ring_queue_behavior behavior);
>
>  /**
>   * Enqueue several objects on the ring (multi-producers safe).
> @@ -350,7 +350,7 @@ int __odph_ring_sc_do_dequeue(odph_ring_t *r, void
> **obj_table,
>   *     high water mark is exceeded.
>   *   - -ENOBUFS: Not enough room in the ring to enqueue, no object is
> enqueued.
>   */
> -int odph_ring_mp_enqueue_bulk(odph_ring_t *r, void * const *obj_table,
> +int shm_ring_mp_enqueue_bulk(shm_ring_t *r, void * const *obj_table,
>                               unsigned n);
>
>  /**
> @@ -368,7 +368,7 @@ int odph_ring_mp_enqueue_bulk(odph_ring_t *r, void *
> const *obj_table,
>   *     high water mark is exceeded.
>   *   - -ENOBUFS: Not enough room in the ring to enqueue; no object is
> enqueued.
>   */
> -int odph_ring_sp_enqueue_bulk(odph_ring_t *r, void * const *obj_table,
> +int shm_ring_sp_enqueue_bulk(shm_ring_t *r, void * const *obj_table,
>                               unsigned n);
>
>  /**
> @@ -388,7 +388,7 @@ int odph_ring_sp_enqueue_bulk(odph_ring_t *r, void *
> const *obj_table,
>   *   - -ENOENT: Not enough entries in the ring to dequeue; no object is
>   *     dequeued.
>   */
> -int odph_ring_mc_dequeue_bulk(odph_ring_t *r, void **obj_table, unsigned
> n);
> +int shm_ring_mc_dequeue_bulk(shm_ring_t *r, void **obj_table, unsigned n);
>
>  /**
>   * Dequeue several objects from a ring (NOT multi-consumers safe).
> @@ -405,7 +405,7 @@ int odph_ring_mc_dequeue_bulk(odph_ring_t *r, void
> **obj_table, unsigned n);
>   *   - -ENOENT: Not enough entries in the ring to dequeue; no object is
>   *     dequeued.
>   */
> -int odph_ring_sc_dequeue_bulk(odph_ring_t *r, void **obj_table, unsigned
> n);
> +int shm_ring_sc_dequeue_bulk(shm_ring_t *r, void **obj_table, unsigned n);
>
>  /**
>   * Test if a ring is full.
> @@ -416,7 +416,7 @@ int odph_ring_sc_dequeue_bulk(odph_ring_t *r, void
> **obj_table, unsigned n);
>   *   - 1: The ring is full.
>   *   - 0: The ring is not full.
>   */
> -int odph_ring_full(const odph_ring_t *r);
> +int shm_ring_full(const shm_ring_t *r);
>
>  /**
>   * Test if a ring is empty.
> @@ -427,7 +427,7 @@ int odph_ring_full(const odph_ring_t *r);
>   *   - 1: The ring is empty.
>   *   - 0: The ring is not empty.
>   */
> -int odph_ring_empty(const odph_ring_t *r);
> +int shm_ring_empty(const shm_ring_t *r);
>
>  /**
>   * Return the number of entries in a ring.
> @@ -437,7 +437,7 @@ int odph_ring_empty(const odph_ring_t *r);
>   * @return
>   *   The number of entries in the ring.
>   */
> -unsigned odph_ring_count(const odph_ring_t *r);
> +unsigned shm_ring_count(const shm_ring_t *r);
>
>  /**
>   * Return the number of free entries in a ring.
> @@ -447,14 +447,14 @@ unsigned odph_ring_count(const odph_ring_t *r);
>   * @return
>   *   The number of free entries in the ring.
>   */
> -unsigned odph_ring_free_count(const odph_ring_t *r);
> +unsigned shm_ring_free_count(const shm_ring_t *r);
>
>  /**
>   * search ring by name
>   * @param name ring name to search
>   * @return     pointer to ring otherwise NULL
>   */
> -odph_ring_t *odph_ring_lookup(const char *name);
> +shm_ring_t *shm_ring_lookup(const char *name);
>
>  /**
>   * Enqueue several objects on the ring (multi-producers safe).
> @@ -471,7 +471,7 @@ odph_ring_t *odph_ring_lookup(const char *name);
>   * @return
>   *   - n: Actual number of objects enqueued.
>   */
> -int odph_ring_mp_enqueue_burst(odph_ring_t *r, void * const *obj_table,
> +int shm_ring_mp_enqueue_burst(shm_ring_t *r, void * const *obj_table,
>                                unsigned n);
>
>  /**
> @@ -486,7 +486,7 @@ int odph_ring_mp_enqueue_burst(odph_ring_t *r, void *
> const *obj_table,
>   * @return
>   *   - n: Actual number of objects enqueued.
>   */
> -int odph_ring_sp_enqueue_burst(odph_ring_t *r, void * const *obj_table,
> +int shm_ring_sp_enqueue_burst(shm_ring_t *r, void * const *obj_table,
>                                unsigned n);
>  /**
>   * Enqueue several objects on a ring.
> @@ -504,7 +504,7 @@ int odph_ring_sp_enqueue_burst(odph_ring_t *r, void *
> const *obj_table,
>   * @return
>   *   - n: Actual number of objects enqueued.
>   */
> -int odph_ring_enqueue_burst(odph_ring_t *r, void * const *obj_table,
> +int shm_ring_enqueue_burst(shm_ring_t *r, void * const *obj_table,
>                             unsigned n);
>
>  /**
> @@ -524,7 +524,7 @@ int odph_ring_enqueue_burst(odph_ring_t *r, void *
> const *obj_table,
>   * @return
>   *   - n: Actual number of objects dequeued, 0 if ring is empty
>   */
> -int odph_ring_mc_dequeue_burst(odph_ring_t *r, void **obj_table, unsigned
> n);
> +int shm_ring_mc_dequeue_burst(shm_ring_t *r, void **obj_table, unsigned
> n);
>
>  /**
>   * Dequeue several objects from a ring (NOT multi-consumers safe).When the
> @@ -540,7 +540,7 @@ int odph_ring_mc_dequeue_burst(odph_ring_t *r, void
> **obj_table, unsigned n);
>   * @return
>   *   - n: Actual number of objects dequeued, 0 if ring is empty
>   */
> -int odph_ring_sc_dequeue_burst(odph_ring_t *r, void **obj_table, unsigned
> n);
> +int shm_ring_sc_dequeue_burst(shm_ring_t *r, void **obj_table, unsigned
> n);
>
>  /**
>   * Dequeue multiple objects from a ring up to a maximum number.
> @@ -558,17 +558,17 @@ int odph_ring_sc_dequeue_burst(odph_ring_t *r, void
> **obj_table, unsigned n);
>   * @return
>   *   - Number of objects dequeued, or a negative error code on error
>   */
> -int odph_ring_dequeue_burst(odph_ring_t *r, void **obj_table, unsigned n);
> +int shm_ring_dequeue_burst(shm_ring_t *r, void **obj_table, unsigned n);
>
>  /**
>   * dump the status of all rings on the console
>   */
> -void odph_ring_list_dump(void);
> +void shm_ring_list_dump(void);
>
>  /**
>   * initialise ring tailq
>   */
> -void odph_ring_tailq_init(void);
> +void shm_ring_tailq_init(void);
>
>  #ifdef __cplusplus
>  }
> diff --git a/platform/linux-generic/pktio/ring.c
> b/platform/linux-generic/pktio/ring.c
> index 4bb6b4e..9ff457f 100644
> --- a/platform/linux-generic/pktio/ring.c
> +++ b/platform/linux-generic/pktio/ring.c
> @@ -80,7 +80,7 @@
>  #include <odp_ring_internal.h>
>  #include <odph_debug.h>
>
> -static TAILQ_HEAD(, odph_ring) odp_ring_list;
> +static TAILQ_HEAD(, shm_ring) odp_ring_list;
>
>  #define RING_VAL_IS_POWER_2(x) ((((x) - 1) & (x)) == 0)
>
> @@ -145,18 +145,18 @@ static TAILQ_HEAD(, odph_ring) odp_ring_list;
>  static odp_rwlock_t    qlock;  /* rings tailq lock */
>
>  /* init tailq_ring */
> -void odph_ring_tailq_init(void)
> +void shm_ring_tailq_init(void)
>  {
>         TAILQ_INIT(&odp_ring_list);
>         odp_rwlock_init(&qlock);
>  }
>
>  /* create the ring */
> -odph_ring_t *
> -odph_ring_create(const char *name, unsigned count, unsigned flags)
> +shm_ring_t *
> +shm_ring_create(const char *name, unsigned count, unsigned flags)
>  {
>         char ring_name[ODPH_RING_NAMESIZE];
> -       odph_ring_t *r;
> +       shm_ring_t *r;
>         size_t ring_size;
>         odp_shm_t shm;
>
> @@ -168,7 +168,7 @@ odph_ring_create(const char *name, unsigned count,
> unsigned flags)
>         }
>
>         snprintf(ring_name, sizeof(ring_name), "%s", name);
> -       ring_size = count*sizeof(void *)+sizeof(odph_ring_t);
> +       ring_size = count*sizeof(void *)+sizeof(shm_ring_t);
>
>         odp_rwlock_write_lock(&qlock);
>         /* reserve a memory zone for this ring.*/
> @@ -205,7 +205,7 @@ odph_ring_create(const char *name, unsigned count,
> unsigned flags)
>   * change the high water mark. If *count* is 0, water marking is
>   * disabled
>   */
> -int odph_ring_set_water_mark(odph_ring_t *r, unsigned count)
> +int shm_ring_set_water_mark(shm_ring_t *r, unsigned count)
>  {
>         if (count >= r->prod.size)
>                 return -EINVAL;
> @@ -221,8 +221,8 @@ int odph_ring_set_water_mark(odph_ring_t *r, unsigned
> count)
>  /**
>   * Enqueue several objects on the ring (multi-producers safe).
>   */
> -int __odph_ring_mp_do_enqueue(odph_ring_t *r, void * const *obj_table,
> -                        unsigned n, enum odph_ring_queue_behavior
> behavior)
> +int __shm_ring_mp_do_enqueue(shm_ring_t *r, void * const *obj_table,
> +                        unsigned n, enum shm_ring_queue_behavior behavior)
>  {
>         uint32_t prod_head, prod_next;
>         uint32_t cons_tail, free_entries;
> @@ -294,8 +294,8 @@ int __odph_ring_mp_do_enqueue(odph_ring_t *r, void *
> const *obj_table,
>  /**
>   * Enqueue several objects on a ring (NOT multi-producers safe).
>   */
> -int __odph_ring_sp_do_enqueue(odph_ring_t *r, void * const *obj_table,
> -                            unsigned n, enum odph_ring_queue_behavior
> behavior)
> +int __shm_ring_sp_do_enqueue(shm_ring_t *r, void * const *obj_table,
> +                            unsigned n, enum shm_ring_queue_behavior
> behavior)
>  {
>         uint32_t prod_head, cons_tail;
>         uint32_t prod_next, free_entries;
> @@ -348,8 +348,8 @@ int __odph_ring_sp_do_enqueue(odph_ring_t *r, void *
> const *obj_table,
>   * Dequeue several objects from a ring (multi-consumers safe).
>   */
>
> -int __odph_ring_mc_do_dequeue(odph_ring_t *r, void **obj_table,
> -                        unsigned n, enum odph_ring_queue_behavior
> behavior)
> +int __shm_ring_mc_do_dequeue(shm_ring_t *r, void **obj_table,
> +                        unsigned n, enum shm_ring_queue_behavior behavior)
>  {
>         uint32_t cons_head, prod_tail;
>         uint32_t cons_next, entries;
> @@ -412,8 +412,8 @@ int __odph_ring_mc_do_dequeue(odph_ring_t *r, void
> **obj_table,
>  /**
>   * Dequeue several objects from a ring (NOT multi-consumers safe).
>   */
> -int __odph_ring_sc_do_dequeue(odph_ring_t *r, void **obj_table,
> -                            unsigned n, enum odph_ring_queue_behavior
> behavior)
> +int __shm_ring_sc_do_dequeue(shm_ring_t *r, void **obj_table,
> +                            unsigned n, enum shm_ring_queue_behavior
> behavior)
>  {
>         uint32_t cons_head, prod_tail;
>         uint32_t cons_next, entries;
> @@ -454,45 +454,45 @@ int __odph_ring_sc_do_dequeue(odph_ring_t *r, void
> **obj_table,
>  /**
>   * Enqueue several objects on the ring (multi-producers safe).
>   */
> -int odph_ring_mp_enqueue_bulk(odph_ring_t *r, void * const *obj_table,
> +int shm_ring_mp_enqueue_bulk(shm_ring_t *r, void * const *obj_table,
>                                 unsigned n)
>  {
> -       return __odph_ring_mp_do_enqueue(r, obj_table, n,
> +       return __shm_ring_mp_do_enqueue(r, obj_table, n,
>                                          ODPH_RING_QUEUE_FIXED);
>  }
>
>  /**
>   * Enqueue several objects on a ring (NOT multi-producers safe).
>   */
> -int odph_ring_sp_enqueue_bulk(odph_ring_t *r, void * const *obj_table,
> +int shm_ring_sp_enqueue_bulk(shm_ring_t *r, void * const *obj_table,
>                              unsigned n)
>  {
> -       return __odph_ring_sp_do_enqueue(r, obj_table, n,
> +       return __shm_ring_sp_do_enqueue(r, obj_table, n,
>                                          ODPH_RING_QUEUE_FIXED);
>  }
>
>  /**
>   * Dequeue several objects from a ring (multi-consumers safe).
>   */
> -int odph_ring_mc_dequeue_bulk(odph_ring_t *r, void **obj_table, unsigned
> n)
> +int shm_ring_mc_dequeue_bulk(shm_ring_t *r, void **obj_table, unsigned n)
>  {
> -       return __odph_ring_mc_do_dequeue(r, obj_table, n,
> +       return __shm_ring_mc_do_dequeue(r, obj_table, n,
>                                          ODPH_RING_QUEUE_FIXED);
>  }
>
>  /**
>   * Dequeue several objects from a ring (NOT multi-consumers safe).
>   */
> -int odph_ring_sc_dequeue_bulk(odph_ring_t *r, void **obj_table, unsigned
> n)
> +int shm_ring_sc_dequeue_bulk(shm_ring_t *r, void **obj_table, unsigned n)
>  {
> -       return __odph_ring_sc_do_dequeue(r, obj_table, n,
> +       return __shm_ring_sc_do_dequeue(r, obj_table, n,
>                                          ODPH_RING_QUEUE_FIXED);
>  }
>
>  /**
>   * Test if a ring is full.
>   */
> -int odph_ring_full(const odph_ring_t *r)
> +int shm_ring_full(const shm_ring_t *r)
>  {
>         uint32_t prod_tail = r->prod.tail;
>         uint32_t cons_tail = r->cons.tail;
> @@ -502,7 +502,7 @@ int odph_ring_full(const odph_ring_t *r)
>  /**
>   * Test if a ring is empty.
>   */
> -int odph_ring_empty(const odph_ring_t *r)
> +int shm_ring_empty(const shm_ring_t *r)
>  {
>         uint32_t prod_tail = r->prod.tail;
>         uint32_t cons_tail = r->cons.tail;
> @@ -512,7 +512,7 @@ int odph_ring_empty(const odph_ring_t *r)
>  /**
>   * Return the number of entries in a ring.
>   */
> -unsigned odph_ring_count(const odph_ring_t *r)
> +unsigned shm_ring_count(const shm_ring_t *r)
>  {
>         uint32_t prod_tail = r->prod.tail;
>         uint32_t cons_tail = r->cons.tail;
> @@ -522,7 +522,7 @@ unsigned odph_ring_count(const odph_ring_t *r)
>  /**
>   * Return the number of free entries in a ring.
>   */
> -unsigned odph_ring_free_count(const odph_ring_t *r)
> +unsigned shm_ring_free_count(const shm_ring_t *r)
>  {
>         uint32_t prod_tail = r->prod.tail;
>         uint32_t cons_tail = r->cons.tail;
> @@ -530,7 +530,7 @@ unsigned odph_ring_free_count(const odph_ring_t *r)
>  }
>
>  /* dump the status of the ring on the console */
> -void odph_ring_dump(const odph_ring_t *r)
> +void shm_ring_dump(const shm_ring_t *r)
>  {
>         ODPH_DBG("ring <%s>@%p\n", r->name, r);
>         ODPH_DBG("  flags=%x\n", r->flags);
> @@ -539,8 +539,8 @@ void odph_ring_dump(const odph_ring_t *r)
>         ODPH_DBG("  ch=%" PRIu32 "\n", r->cons.head);
>         ODPH_DBG("  pt=%" PRIu32 "\n", r->prod.tail);
>         ODPH_DBG("  ph=%" PRIu32 "\n", r->prod.head);
> -       ODPH_DBG("  used=%u\n", odph_ring_count(r));
> -       ODPH_DBG("  avail=%u\n", odph_ring_free_count(r));
> +       ODPH_DBG("  used=%u\n", shm_ring_count(r));
> +       ODPH_DBG("  avail=%u\n", shm_ring_free_count(r));
>         if (r->prod.watermark == r->prod.size)
>                 ODPH_DBG("  watermark=0\n");
>         else
> @@ -548,23 +548,23 @@ void odph_ring_dump(const odph_ring_t *r)
>  }
>
>  /* dump the status of all rings on the console */
> -void odph_ring_list_dump(void)
> +void shm_ring_list_dump(void)
>  {
> -       const odph_ring_t *mp = NULL;
> +       const shm_ring_t *mp = NULL;
>
>         odp_rwlock_read_lock(&qlock);
>
>         TAILQ_FOREACH(mp, &odp_ring_list, next) {
> -               odph_ring_dump(mp);
> +               shm_ring_dump(mp);
>         }
>
>         odp_rwlock_read_unlock(&qlock);
>  }
>
>  /* search a ring from its name */
> -odph_ring_t *odph_ring_lookup(const char *name)
> +shm_ring_t *shm_ring_lookup(const char *name)
>  {
> -       odph_ring_t *r;
> +       shm_ring_t *r;
>
>         odp_rwlock_read_lock(&qlock);
>         TAILQ_FOREACH(r, &odp_ring_list, next) {
> @@ -579,60 +579,60 @@ odph_ring_t *odph_ring_lookup(const char *name)
>  /**
>   * Enqueue several objects on the ring (multi-producers safe).
>   */
> -int odph_ring_mp_enqueue_burst(odph_ring_t *r, void * const *obj_table,
> +int shm_ring_mp_enqueue_burst(shm_ring_t *r, void * const *obj_table,
>                               unsigned n)
>  {
> -       return __odph_ring_mp_do_enqueue(r, obj_table, n,
> +       return __shm_ring_mp_do_enqueue(r, obj_table, n,
>                                          ODPH_RING_QUEUE_VARIABLE);
>  }
>
>  /**
>   * Enqueue several objects on a ring (NOT multi-producers safe).
>   */
> -int odph_ring_sp_enqueue_burst(odph_ring_t *r, void * const *obj_table,
> +int shm_ring_sp_enqueue_burst(shm_ring_t *r, void * const *obj_table,
>                               unsigned n)
>  {
> -       return __odph_ring_sp_do_enqueue(r, obj_table, n,
> +       return __shm_ring_sp_do_enqueue(r, obj_table, n,
>                                         ODPH_RING_QUEUE_VARIABLE);
>  }
>
>  /**
>   * Enqueue several objects on a ring.
>   */
> -int odph_ring_enqueue_burst(odph_ring_t *r, void * const *obj_table,
> +int shm_ring_enqueue_burst(shm_ring_t *r, void * const *obj_table,
>                            unsigned n)
>  {
>         if (r->prod.sp_enqueue)
> -               return odph_ring_sp_enqueue_burst(r, obj_table, n);
> +               return shm_ring_sp_enqueue_burst(r, obj_table, n);
>         else
> -               return odph_ring_mp_enqueue_burst(r, obj_table, n);
> +               return shm_ring_mp_enqueue_burst(r, obj_table, n);
>  }
>
>  /**
>   * Dequeue several objects from a ring (multi-consumers safe).
>   */
> -int odph_ring_mc_dequeue_burst(odph_ring_t *r, void **obj_table, unsigned
> n)
> +int shm_ring_mc_dequeue_burst(shm_ring_t *r, void **obj_table, unsigned n)
>  {
> -       return __odph_ring_mc_do_dequeue(r, obj_table, n,
> +       return __shm_ring_mc_do_dequeue(r, obj_table, n,
>                                         ODPH_RING_QUEUE_VARIABLE);
>  }
>
>  /**
>   * Dequeue several objects from a ring (NOT multi-consumers safe).
>   */
> -int odph_ring_sc_dequeue_burst(odph_ring_t *r, void **obj_table, unsigned
> n)
> +int shm_ring_sc_dequeue_burst(shm_ring_t *r, void **obj_table, unsigned n)
>  {
> -       return __odph_ring_sc_do_dequeue(r, obj_table, n,
> +       return __shm_ring_sc_do_dequeue(r, obj_table, n,
>                                          ODPH_RING_QUEUE_VARIABLE);
>  }
>
>  /**
>   * Dequeue multiple objects from a ring up to a maximum number.
>   */
> -int odph_ring_dequeue_burst(odph_ring_t *r, void **obj_table, unsigned n)
> +int shm_ring_dequeue_burst(shm_ring_t *r, void **obj_table, unsigned n)
>  {
>         if (r->cons.sc_dequeue)
> -               return odph_ring_sc_dequeue_burst(r, obj_table, n);
> +               return shm_ring_sc_dequeue_burst(r, obj_table, n);
>         else
> -               return odph_ring_mc_dequeue_burst(r, obj_table, n);
> +               return shm_ring_mc_dequeue_burst(r, obj_table, n);
>  }
> diff --git a/platform/linux-generic/test/ring/odp_ring_test.c
> b/platform/linux-generic/test/ring/odp_ring_test.c
> index cec8221..799f5c6 100644
> --- a/platform/linux-generic/test/ring/odp_ring_test.c
> +++ b/platform/linux-generic/test/ring/odp_ring_test.c
> @@ -57,7 +57,7 @@
>
>  #define RING_TEST_BASIC
>
> -static int test_ring_basic(odph_ring_t *r)
> +static int test_ring_basic(shm_ring_t *r)
>  {
>         void **src = NULL, **cur_src = NULL, **dst = NULL, **cur_dst =
> NULL;
>         int ret;
> @@ -86,7 +86,7 @@ static int test_ring_basic(odph_ring_t *r)
>
>         printf("Test SP & SC basic functions\n");
>         printf("enqueue 1 obj\n");
> -       ret = odph_ring_sp_enqueue_burst(r, cur_src, 1);
> +       ret = shm_ring_sp_enqueue_burst(r, cur_src, 1);
>         cur_src += 1;
>         if ((ret & ODPH_RING_SZ_MASK) != 1) {
>                 LOG_ERR("sp_enq for 1 obj failed\n");
> @@ -94,7 +94,7 @@ static int test_ring_basic(odph_ring_t *r)
>         }
>
>         printf("enqueue 2 objs\n");
> -       ret = odph_ring_sp_enqueue_burst(r, cur_src, 2);
> +       ret = shm_ring_sp_enqueue_burst(r, cur_src, 2);
>         cur_src += 2;
>         if ((ret & ODPH_RING_SZ_MASK) != 2) {
>                 LOG_ERR("sp_enq for 2 obj failed\n");
> @@ -102,14 +102,14 @@ static int test_ring_basic(odph_ring_t *r)
>         }
>
>         printf("enqueue MAX_BULK objs\n");
> -       ret = odph_ring_sp_enqueue_burst(r, cur_src, MAX_BULK);
> +       ret = shm_ring_sp_enqueue_burst(r, cur_src, MAX_BULK);
>         if ((ret & ODPH_RING_SZ_MASK) != MAX_BULK) {
>                 LOG_ERR("sp_enq for %d obj failed\n", MAX_BULK);
>                 goto fail;
>         }
>
>         printf("dequeue 1 obj\n");
> -       ret = odph_ring_sc_dequeue_burst(r, cur_dst, 1);
> +       ret = shm_ring_sc_dequeue_burst(r, cur_dst, 1);
>         cur_dst += 1;
>         if ((ret & ODPH_RING_SZ_MASK) != 1) {
>                 LOG_ERR("sc_deq for 1 obj failed\n");
> @@ -117,7 +117,7 @@ static int test_ring_basic(odph_ring_t *r)
>         }
>
>         printf("dequeue 2 objs\n");
> -       ret = odph_ring_sc_dequeue_burst(r, cur_dst, 2);
> +       ret = shm_ring_sc_dequeue_burst(r, cur_dst, 2);
>         cur_dst += 2;
>         if ((ret & ODPH_RING_SZ_MASK) != 2) {
>                 LOG_ERR("sc_deq for 2 obj failed\n");
> @@ -125,7 +125,7 @@ static int test_ring_basic(odph_ring_t *r)
>         }
>
>         printf("dequeue MAX_BULK objs\n");
> -       ret = odph_ring_sc_dequeue_burst(r, cur_dst, MAX_BULK);
> +       ret = shm_ring_sc_dequeue_burst(r, cur_dst, MAX_BULK);
>         cur_dst += MAX_BULK;
>         if ((ret & ODPH_RING_SZ_MASK) != MAX_BULK) {
>                 LOG_ERR("sc_deq for %d obj failed\n", MAX_BULK);
> @@ -144,41 +144,41 @@ static int test_ring_basic(odph_ring_t *r)
>         printf("Test MP & MC basic functions\n");
>
>         printf("enqueue 1 obj\n");
> -       ret = odph_ring_mp_enqueue_bulk(r, cur_src, 1);
> +       ret = shm_ring_mp_enqueue_bulk(r, cur_src, 1);
>         cur_src += 1;
>         if (ret != 0) {
>                 LOG_ERR("mp_enq for 1 obj failed\n");
>                 goto fail;
>         }
>         printf("enqueue 2 objs\n");
> -       ret = odph_ring_mp_enqueue_bulk(r, cur_src, 2);
> +       ret = shm_ring_mp_enqueue_bulk(r, cur_src, 2);
>         cur_src += 2;
>         if (ret != 0) {
>                 LOG_ERR("mp_enq for 2 obj failed\n");
>                 goto fail;
>         }
>         printf("enqueue MAX_BULK objs\n");
> -       ret = odph_ring_mp_enqueue_bulk(r, cur_src, MAX_BULK);
> +       ret = shm_ring_mp_enqueue_bulk(r, cur_src, MAX_BULK);
>         if (ret != 0) {
>                 LOG_ERR("mp_enq for %d obj failed\n", MAX_BULK);
>                 goto fail;
>         }
>         printf("dequeue 1 obj\n");
> -       ret = odph_ring_mc_dequeue_bulk(r, cur_dst, 1);
> +       ret = shm_ring_mc_dequeue_bulk(r, cur_dst, 1);
>         cur_dst += 1;
>         if (ret != 0) {
>                 LOG_ERR("mc_deq for 1 obj failed\n");
>                 goto fail;
>         }
>         printf("dequeue 2 objs\n");
> -       ret = odph_ring_mc_dequeue_bulk(r, cur_dst, 2);
> +       ret = shm_ring_mc_dequeue_bulk(r, cur_dst, 2);
>         cur_dst += 2;
>         if (ret != 0) {
>                 LOG_ERR("mc_deq for 2 obj failed\n");
>                 goto fail;
>         }
>         printf("dequeue MAX_BULK objs\n");
> -       ret = odph_ring_mc_dequeue_bulk(r, cur_dst, MAX_BULK);
> +       ret = shm_ring_mc_dequeue_bulk(r, cur_dst, MAX_BULK);
>         cur_dst += MAX_BULK;
>         if (ret != 0) {
>                 LOG_ERR("mc_deq for %d obj failed\n", MAX_BULK);
> @@ -191,30 +191,30 @@ static int test_ring_basic(odph_ring_t *r)
>         }
>
>         printf("test watermark and default bulk enqueue / dequeue\n");
> -       odph_ring_set_water_mark(r, 20);
> +       shm_ring_set_water_mark(r, 20);
>         num_elems = 16;
>
>         cur_src = src;
>         cur_dst = dst;
>
> -       ret = odph_ring_mp_enqueue_bulk(r, cur_src, num_elems);
> +       ret = shm_ring_mp_enqueue_bulk(r, cur_src, num_elems);
>         cur_src += num_elems;
>         if (ret != 0) {
>                 LOG_ERR("Cannot enqueue\n");
>                 goto fail;
>         }
> -       ret = odph_ring_mp_enqueue_bulk(r, cur_src, num_elems);
> +       ret = shm_ring_mp_enqueue_bulk(r, cur_src, num_elems);
>         if (ret != -EDQUOT) {
>                 LOG_ERR("Watermark not exceeded\n");
>                 goto fail;
>         }
> -       ret = odph_ring_mc_dequeue_bulk(r, cur_dst, num_elems);
> +       ret = shm_ring_mc_dequeue_bulk(r, cur_dst, num_elems);
>         cur_dst += num_elems;
>         if (ret != 0) {
>                 LOG_ERR("Cannot dequeue\n");
>                 goto fail;
>         }
> -       ret = odph_ring_mc_dequeue_bulk(r, cur_dst, num_elems);
> +       ret = shm_ring_mc_dequeue_bulk(r, cur_dst, num_elems);
>         cur_dst += num_elems;
>         if (ret != 0) {
>                 LOG_ERR("Cannot dequeue2\n");
> @@ -241,7 +241,7 @@ fail:
>  }
>
>  /* global shared ring used for stress testing */
> -static odph_ring_t *r_stress;
> +static shm_ring_t *r_stress;
>
>  /* Stress func for Multi producer only */
>  static int producer_fn(void)
> @@ -260,7 +260,7 @@ static int producer_fn(void)
>                 src[i] = (void *)(unsigned long)i;
>
>         do {
> -               i = odph_ring_mp_enqueue_bulk(r_stress, src, MAX_BULK);
> +               i = shm_ring_mp_enqueue_bulk(r_stress, src, MAX_BULK);
>                 if (i == 0) {
>                         free(src);
>                         return 0;
> @@ -282,7 +282,7 @@ static int consumer_fn(void)
>         }
>
>         do {
> -               i = odph_ring_mc_dequeue_bulk(r_stress, src, MAX_BULK);
> +               i = shm_ring_mc_dequeue_bulk(r_stress, src, MAX_BULK);
>                 if (i == 0) {
>                         for (i = 0; i < MAX_BULK; i++) {
>                                 if (src[i] != (void *)(unsigned long)i) {
> @@ -356,7 +356,7 @@ static void *test_ring(void *arg)
>         ring_arg_t *parg = (ring_arg_t *)arg;
>         int thr;
>         char ring_name[ODPH_RING_NAMESIZE];
> -       odph_ring_t *r;
> +       shm_ring_t *r;
>         int result = 0;
>
>         thr = odp_thread_id();
> @@ -367,7 +367,7 @@ static void *test_ring(void *arg)
>         case ODP_RING_TEST_BASIC:
>                 snprintf(ring_name, sizeof(ring_name), "test_ring_%i",
> thr);
>
> -               r = odph_ring_create(ring_name, RING_SIZE,
> +               r = shm_ring_create(ring_name, RING_SIZE,
>                                     0 /* not used, alignement
>                                          taken care inside func : todo */);
>                 if (r == NULL) {
> @@ -376,7 +376,7 @@ static void *test_ring(void *arg)
>                         break;
>                 }
>                 /* lookup ring from its name */
> -               if (odph_ring_lookup(ring_name) != r) {
> +               if (shm_ring_lookup(ring_name) != r) {
>                         LOG_ERR("ring lookup failed\n");
>                         result = -1;
>                         break;
> @@ -389,7 +389,7 @@ static void *test_ring(void *arg)
>                 }
>
>                 /* dump ring stats */
> -               odph_ring_list_dump();
> +               shm_ring_list_dump();
>
>                 break;
>
> @@ -397,7 +397,7 @@ static void *test_ring(void *arg)
>                 test_ring_stress(parg->stress_type);
>
>                 /* dump ring stats */
> -               odph_ring_list_dump();
> +               shm_ring_list_dump();
>                 break;
>
>         default:
> @@ -428,7 +428,7 @@ int main(int argc __attribute__((__unused__)),
>
>         odp_print_system_info();
>
> -       odph_ring_tailq_init();
> +       shm_ring_tailq_init();
>
>         rarg.thrdarg.numthrds = odp_cpu_count();
>
> @@ -444,7 +444,7 @@ int main(int argc __attribute__((__unused__)),
>         /* create a ring */
>         snprintf(ring_name, sizeof(ring_name), "test_ring_stress");
>
> -       r_stress = odph_ring_create(ring_name, RING_SIZE,
> +       r_stress = shm_ring_create(ring_name, RING_SIZE,
>                                 0 /* not used, alignement
>                                  taken care inside func : todo */);
>         if (r_stress == NULL) {
> @@ -452,7 +452,7 @@ int main(int argc __attribute__((__unused__)),
>                 goto fail;
>         }
>         /* lookup ring from its name */
> -       if (odph_ring_lookup(ring_name) != r_stress) {
> +       if (shm_ring_lookup(ring_name) != r_stress) {
>                 LOG_ERR("ring lookup failed\n");
>                 goto fail;
>         }
> --
> 1.9.1
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
Mike Holmes Sept. 10, 2015, 11:59 a.m. UTC | #2
On 9 September 2015 at 23:18, Bill Fischofer <bill.fischofer@linaro.org>
wrote:

> Why shm_ring_xxx rather than odp_ring_xxx (or _odp_ring_xxx if these are
> internal APIs?)  That would seem to be consistent with other internal APIs.
>

I really like the prefix "_" for internal functions, its very clear and low
overhead in naming.


>
>
>
> On Wed, Sep 9, 2015 at 5:06 AM, Maxim Uvarov <maxim.uvarov@linaro.org>
> wrote:
>
>> Drop odph_ prefix due to it's not helper anymore and do not
>> add odp_ prefix because it's not api.
>>
>> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
>> ---
>>  platform/linux-generic/include/odp_ring_internal.h | 64 +++++++-------
>>  platform/linux-generic/pktio/ring.c                | 98
>> +++++++++++-----------
>>  platform/linux-generic/test/ring/odp_ring_test.c   | 58 ++++++-------
>>  3 files changed, 110 insertions(+), 110 deletions(-)
>>
>> diff --git a/platform/linux-generic/include/odp_ring_internal.h
>> b/platform/linux-generic/include/odp_ring_internal.h
>> index 65c32ad..596bf9b 100644
>> --- a/platform/linux-generic/include/odp_ring_internal.h
>> +++ b/platform/linux-generic/include/odp_ring_internal.h
>> @@ -103,7 +103,7 @@ extern "C" {
>>  #include <errno.h>
>>  #include <sys/queue.h>
>>
>> -enum odph_ring_queue_behavior {
>> +enum shm_ring_queue_behavior {
>>         ODPH_RING_QUEUE_FIXED = 0, /**< Enq/Deq a fixed number
>>                                 of items from a ring */
>>         ODPH_RING_QUEUE_VARIABLE   /**< Enq/Deq as many items
>> @@ -123,9 +123,9 @@ enum odph_ring_queue_behavior {
>>   * values in a modulo-32bit base: that's why the overflow of the indexes
>> is not
>>   * a problem.
>>   */
>> -typedef struct odph_ring {
>> +typedef struct shm_ring {
>>         /** @private Next in list. */
>> -       TAILQ_ENTRY(odph_ring) next;
>> +       TAILQ_ENTRY(shm_ring) next;
>>
>>         /** @private Name of the ring. */
>>         char name[ODPH_RING_NAMESIZE];
>> @@ -153,7 +153,7 @@ typedef struct odph_ring {
>>
>>         /** @private Memory space of ring starts here. */
>>         void *ring[0] ODP_ALIGNED_CACHE;
>> -} odph_ring_t;
>> +} shm_ring_t;
>>
>>
>>  #define ODPH_RING_F_SP_ENQ 0x0001 /* The default enqueue is
>> "single-producer".*/
>> @@ -191,7 +191,7 @@ typedef struct odph_ring {
>>   *    - EEXIST - a memzone with the same name already exists
>>   *    - ENOMEM - no appropriate memory area found in which to create
>> memzone
>>   */
>> -odph_ring_t *odph_ring_create(const char *name, unsigned count,
>> +shm_ring_t *shm_ring_create(const char *name, unsigned count,
>>                             unsigned flags);
>>
>>
>> @@ -210,14 +210,14 @@ odph_ring_t *odph_ring_create(const char *name,
>> unsigned count,
>>   * @return 0: Success; water mark changed.
>>   *             -EINVAL: Invalid water mark value.
>>   */
>> -int odph_ring_set_water_mark(odph_ring_t *r, unsigned count);
>> +int shm_ring_set_water_mark(shm_ring_t *r, unsigned count);
>>
>>  /**
>>   * Dump the status of the ring to the console.
>>   *
>>   * @param r A pointer to the ring structure.
>>   */
>> -void odph_ring_dump(const odph_ring_t *r);
>> +void shm_ring_dump(const shm_ring_t *r);
>>
>>  /**
>>   * Enqueue several objects on the ring (multi-producers safe).
>> @@ -244,9 +244,9 @@ void odph_ring_dump(const odph_ring_t *r);
>>   *   if behavior = ODP_RING_QUEUE_VARIABLE
>>   *   - n: Actual number of objects enqueued.
>>   */
>> -int __odph_ring_mp_do_enqueue(odph_ring_t *r, void * const *obj_table,
>> +int __shm_ring_mp_do_enqueue(shm_ring_t *r, void * const *obj_table,
>>                               unsigned n,
>> -                             enum odph_ring_queue_behavior behavior);
>> +                             enum shm_ring_queue_behavior behavior);
>>
>>  /**
>>   * Enqueue several objects on a ring (NOT multi-producers safe).
>> @@ -270,9 +270,9 @@ int __odph_ring_mp_do_enqueue(odph_ring_t *r, void *
>> const *obj_table,
>>   *   if behavior = ODP_RING_QUEUE_VARIABLE
>>   *   - n: Actual number of objects enqueued.
>>   */
>> -int __odph_ring_sp_do_enqueue(odph_ring_t *r, void * const *obj_table,
>> +int __shm_ring_sp_do_enqueue(shm_ring_t *r, void * const *obj_table,
>>                               unsigned n,
>> -                             enum odph_ring_queue_behavior behavior);
>> +                             enum shm_ring_queue_behavior behavior);
>>
>>  /**
>>   * Dequeue several objects from a ring (multi-consumers safe). When
>> @@ -301,9 +301,9 @@ int __odph_ring_sp_do_enqueue(odph_ring_t *r, void *
>> const *obj_table,
>>   *   - n: Actual number of objects dequeued.
>>   */
>>
>> -int __odph_ring_mc_do_dequeue(odph_ring_t *r, void **obj_table,
>> +int __shm_ring_mc_do_dequeue(shm_ring_t *r, void **obj_table,
>>                               unsigned n,
>> -                             enum odph_ring_queue_behavior behavior);
>> +                             enum shm_ring_queue_behavior behavior);
>>
>>  /**
>>   * Dequeue several objects from a ring (NOT multi-consumers safe).
>> @@ -328,9 +328,9 @@ int __odph_ring_mc_do_dequeue(odph_ring_t *r, void
>> **obj_table,
>>   *   if behavior = ODP_RING_QUEUE_VARIABLE
>>   *   - n: Actual number of objects dequeued.
>>   */
>> -int __odph_ring_sc_do_dequeue(odph_ring_t *r, void **obj_table,
>> +int __shm_ring_sc_do_dequeue(shm_ring_t *r, void **obj_table,
>>                               unsigned n,
>> -                             enum odph_ring_queue_behavior behavior);
>> +                             enum shm_ring_queue_behavior behavior);
>>
>>  /**
>>   * Enqueue several objects on the ring (multi-producers safe).
>> @@ -350,7 +350,7 @@ int __odph_ring_sc_do_dequeue(odph_ring_t *r, void
>> **obj_table,
>>   *     high water mark is exceeded.
>>   *   - -ENOBUFS: Not enough room in the ring to enqueue, no object is
>> enqueued.
>>   */
>> -int odph_ring_mp_enqueue_bulk(odph_ring_t *r, void * const *obj_table,
>> +int shm_ring_mp_enqueue_bulk(shm_ring_t *r, void * const *obj_table,
>>                               unsigned n);
>>
>>  /**
>> @@ -368,7 +368,7 @@ int odph_ring_mp_enqueue_bulk(odph_ring_t *r, void *
>> const *obj_table,
>>   *     high water mark is exceeded.
>>   *   - -ENOBUFS: Not enough room in the ring to enqueue; no object is
>> enqueued.
>>   */
>> -int odph_ring_sp_enqueue_bulk(odph_ring_t *r, void * const *obj_table,
>> +int shm_ring_sp_enqueue_bulk(shm_ring_t *r, void * const *obj_table,
>>                               unsigned n);
>>
>>  /**
>> @@ -388,7 +388,7 @@ int odph_ring_sp_enqueue_bulk(odph_ring_t *r, void *
>> const *obj_table,
>>   *   - -ENOENT: Not enough entries in the ring to dequeue; no object is
>>   *     dequeued.
>>   */
>> -int odph_ring_mc_dequeue_bulk(odph_ring_t *r, void **obj_table, unsigned
>> n);
>> +int shm_ring_mc_dequeue_bulk(shm_ring_t *r, void **obj_table, unsigned
>> n);
>>
>>  /**
>>   * Dequeue several objects from a ring (NOT multi-consumers safe).
>> @@ -405,7 +405,7 @@ int odph_ring_mc_dequeue_bulk(odph_ring_t *r, void
>> **obj_table, unsigned n);
>>   *   - -ENOENT: Not enough entries in the ring to dequeue; no object is
>>   *     dequeued.
>>   */
>> -int odph_ring_sc_dequeue_bulk(odph_ring_t *r, void **obj_table, unsigned
>> n);
>> +int shm_ring_sc_dequeue_bulk(shm_ring_t *r, void **obj_table, unsigned
>> n);
>>
>>  /**
>>   * Test if a ring is full.
>> @@ -416,7 +416,7 @@ int odph_ring_sc_dequeue_bulk(odph_ring_t *r, void
>> **obj_table, unsigned n);
>>   *   - 1: The ring is full.
>>   *   - 0: The ring is not full.
>>   */
>> -int odph_ring_full(const odph_ring_t *r);
>> +int shm_ring_full(const shm_ring_t *r);
>>
>>  /**
>>   * Test if a ring is empty.
>> @@ -427,7 +427,7 @@ int odph_ring_full(const odph_ring_t *r);
>>   *   - 1: The ring is empty.
>>   *   - 0: The ring is not empty.
>>   */
>> -int odph_ring_empty(const odph_ring_t *r);
>> +int shm_ring_empty(const shm_ring_t *r);
>>
>>  /**
>>   * Return the number of entries in a ring.
>> @@ -437,7 +437,7 @@ int odph_ring_empty(const odph_ring_t *r);
>>   * @return
>>   *   The number of entries in the ring.
>>   */
>> -unsigned odph_ring_count(const odph_ring_t *r);
>> +unsigned shm_ring_count(const shm_ring_t *r);
>>
>>  /**
>>   * Return the number of free entries in a ring.
>> @@ -447,14 +447,14 @@ unsigned odph_ring_count(const odph_ring_t *r);
>>   * @return
>>   *   The number of free entries in the ring.
>>   */
>> -unsigned odph_ring_free_count(const odph_ring_t *r);
>> +unsigned shm_ring_free_count(const shm_ring_t *r);
>>
>>  /**
>>   * search ring by name
>>   * @param name ring name to search
>>   * @return     pointer to ring otherwise NULL
>>   */
>> -odph_ring_t *odph_ring_lookup(const char *name);
>> +shm_ring_t *shm_ring_lookup(const char *name);
>>
>>  /**
>>   * Enqueue several objects on the ring (multi-producers safe).
>> @@ -471,7 +471,7 @@ odph_ring_t *odph_ring_lookup(const char *name);
>>   * @return
>>   *   - n: Actual number of objects enqueued.
>>   */
>> -int odph_ring_mp_enqueue_burst(odph_ring_t *r, void * const *obj_table,
>> +int shm_ring_mp_enqueue_burst(shm_ring_t *r, void * const *obj_table,
>>                                unsigned n);
>>
>>  /**
>> @@ -486,7 +486,7 @@ int odph_ring_mp_enqueue_burst(odph_ring_t *r, void *
>> const *obj_table,
>>   * @return
>>   *   - n: Actual number of objects enqueued.
>>   */
>> -int odph_ring_sp_enqueue_burst(odph_ring_t *r, void * const *obj_table,
>> +int shm_ring_sp_enqueue_burst(shm_ring_t *r, void * const *obj_table,
>>                                unsigned n);
>>  /**
>>   * Enqueue several objects on a ring.
>> @@ -504,7 +504,7 @@ int odph_ring_sp_enqueue_burst(odph_ring_t *r, void *
>> const *obj_table,
>>   * @return
>>   *   - n: Actual number of objects enqueued.
>>   */
>> -int odph_ring_enqueue_burst(odph_ring_t *r, void * const *obj_table,
>> +int shm_ring_enqueue_burst(shm_ring_t *r, void * const *obj_table,
>>                             unsigned n);
>>
>>  /**
>> @@ -524,7 +524,7 @@ int odph_ring_enqueue_burst(odph_ring_t *r, void *
>> const *obj_table,
>>   * @return
>>   *   - n: Actual number of objects dequeued, 0 if ring is empty
>>   */
>> -int odph_ring_mc_dequeue_burst(odph_ring_t *r, void **obj_table,
>> unsigned n);
>> +int shm_ring_mc_dequeue_burst(shm_ring_t *r, void **obj_table, unsigned
>> n);
>>
>>  /**
>>   * Dequeue several objects from a ring (NOT multi-consumers safe).When
>> the
>> @@ -540,7 +540,7 @@ int odph_ring_mc_dequeue_burst(odph_ring_t *r, void
>> **obj_table, unsigned n);
>>   * @return
>>   *   - n: Actual number of objects dequeued, 0 if ring is empty
>>   */
>> -int odph_ring_sc_dequeue_burst(odph_ring_t *r, void **obj_table,
>> unsigned n);
>> +int shm_ring_sc_dequeue_burst(shm_ring_t *r, void **obj_table, unsigned
>> n);
>>
>>  /**
>>   * Dequeue multiple objects from a ring up to a maximum number.
>> @@ -558,17 +558,17 @@ int odph_ring_sc_dequeue_burst(odph_ring_t *r, void
>> **obj_table, unsigned n);
>>   * @return
>>   *   - Number of objects dequeued, or a negative error code on error
>>   */
>> -int odph_ring_dequeue_burst(odph_ring_t *r, void **obj_table, unsigned
>> n);
>> +int shm_ring_dequeue_burst(shm_ring_t *r, void **obj_table, unsigned n);
>>
>>  /**
>>   * dump the status of all rings on the console
>>   */
>> -void odph_ring_list_dump(void);
>> +void shm_ring_list_dump(void);
>>
>>  /**
>>   * initialise ring tailq
>>   */
>> -void odph_ring_tailq_init(void);
>> +void shm_ring_tailq_init(void);
>>
>>  #ifdef __cplusplus
>>  }
>> diff --git a/platform/linux-generic/pktio/ring.c
>> b/platform/linux-generic/pktio/ring.c
>> index 4bb6b4e..9ff457f 100644
>> --- a/platform/linux-generic/pktio/ring.c
>> +++ b/platform/linux-generic/pktio/ring.c
>> @@ -80,7 +80,7 @@
>>  #include <odp_ring_internal.h>
>>  #include <odph_debug.h>
>>
>> -static TAILQ_HEAD(, odph_ring) odp_ring_list;
>> +static TAILQ_HEAD(, shm_ring) odp_ring_list;
>>
>>  #define RING_VAL_IS_POWER_2(x) ((((x) - 1) & (x)) == 0)
>>
>> @@ -145,18 +145,18 @@ static TAILQ_HEAD(, odph_ring) odp_ring_list;
>>  static odp_rwlock_t    qlock;  /* rings tailq lock */
>>
>>  /* init tailq_ring */
>> -void odph_ring_tailq_init(void)
>> +void shm_ring_tailq_init(void)
>>  {
>>         TAILQ_INIT(&odp_ring_list);
>>         odp_rwlock_init(&qlock);
>>  }
>>
>>  /* create the ring */
>> -odph_ring_t *
>> -odph_ring_create(const char *name, unsigned count, unsigned flags)
>> +shm_ring_t *
>> +shm_ring_create(const char *name, unsigned count, unsigned flags)
>>  {
>>         char ring_name[ODPH_RING_NAMESIZE];
>> -       odph_ring_t *r;
>> +       shm_ring_t *r;
>>         size_t ring_size;
>>         odp_shm_t shm;
>>
>> @@ -168,7 +168,7 @@ odph_ring_create(const char *name, unsigned count,
>> unsigned flags)
>>         }
>>
>>         snprintf(ring_name, sizeof(ring_name), "%s", name);
>> -       ring_size = count*sizeof(void *)+sizeof(odph_ring_t);
>> +       ring_size = count*sizeof(void *)+sizeof(shm_ring_t);
>>
>>         odp_rwlock_write_lock(&qlock);
>>         /* reserve a memory zone for this ring.*/
>> @@ -205,7 +205,7 @@ odph_ring_create(const char *name, unsigned count,
>> unsigned flags)
>>   * change the high water mark. If *count* is 0, water marking is
>>   * disabled
>>   */
>> -int odph_ring_set_water_mark(odph_ring_t *r, unsigned count)
>> +int shm_ring_set_water_mark(shm_ring_t *r, unsigned count)
>>  {
>>         if (count >= r->prod.size)
>>                 return -EINVAL;
>> @@ -221,8 +221,8 @@ int odph_ring_set_water_mark(odph_ring_t *r, unsigned
>> count)
>>  /**
>>   * Enqueue several objects on the ring (multi-producers safe).
>>   */
>> -int __odph_ring_mp_do_enqueue(odph_ring_t *r, void * const *obj_table,
>> -                        unsigned n, enum odph_ring_queue_behavior
>> behavior)
>> +int __shm_ring_mp_do_enqueue(shm_ring_t *r, void * const *obj_table,
>> +                        unsigned n, enum shm_ring_queue_behavior
>> behavior)
>>  {
>>         uint32_t prod_head, prod_next;
>>         uint32_t cons_tail, free_entries;
>> @@ -294,8 +294,8 @@ int __odph_ring_mp_do_enqueue(odph_ring_t *r, void *
>> const *obj_table,
>>  /**
>>   * Enqueue several objects on a ring (NOT multi-producers safe).
>>   */
>> -int __odph_ring_sp_do_enqueue(odph_ring_t *r, void * const *obj_table,
>> -                            unsigned n, enum odph_ring_queue_behavior
>> behavior)
>> +int __shm_ring_sp_do_enqueue(shm_ring_t *r, void * const *obj_table,
>> +                            unsigned n, enum shm_ring_queue_behavior
>> behavior)
>>  {
>>         uint32_t prod_head, cons_tail;
>>         uint32_t prod_next, free_entries;
>> @@ -348,8 +348,8 @@ int __odph_ring_sp_do_enqueue(odph_ring_t *r, void *
>> const *obj_table,
>>   * Dequeue several objects from a ring (multi-consumers safe).
>>   */
>>
>> -int __odph_ring_mc_do_dequeue(odph_ring_t *r, void **obj_table,
>> -                        unsigned n, enum odph_ring_queue_behavior
>> behavior)
>> +int __shm_ring_mc_do_dequeue(shm_ring_t *r, void **obj_table,
>> +                        unsigned n, enum shm_ring_queue_behavior
>> behavior)
>>  {
>>         uint32_t cons_head, prod_tail;
>>         uint32_t cons_next, entries;
>> @@ -412,8 +412,8 @@ int __odph_ring_mc_do_dequeue(odph_ring_t *r, void
>> **obj_table,
>>  /**
>>   * Dequeue several objects from a ring (NOT multi-consumers safe).
>>   */
>> -int __odph_ring_sc_do_dequeue(odph_ring_t *r, void **obj_table,
>> -                            unsigned n, enum odph_ring_queue_behavior
>> behavior)
>> +int __shm_ring_sc_do_dequeue(shm_ring_t *r, void **obj_table,
>> +                            unsigned n, enum shm_ring_queue_behavior
>> behavior)
>>  {
>>         uint32_t cons_head, prod_tail;
>>         uint32_t cons_next, entries;
>> @@ -454,45 +454,45 @@ int __odph_ring_sc_do_dequeue(odph_ring_t *r, void
>> **obj_table,
>>  /**
>>   * Enqueue several objects on the ring (multi-producers safe).
>>   */
>> -int odph_ring_mp_enqueue_bulk(odph_ring_t *r, void * const *obj_table,
>> +int shm_ring_mp_enqueue_bulk(shm_ring_t *r, void * const *obj_table,
>>                                 unsigned n)
>>  {
>> -       return __odph_ring_mp_do_enqueue(r, obj_table, n,
>> +       return __shm_ring_mp_do_enqueue(r, obj_table, n,
>>                                          ODPH_RING_QUEUE_FIXED);
>>  }
>>
>>  /**
>>   * Enqueue several objects on a ring (NOT multi-producers safe).
>>   */
>> -int odph_ring_sp_enqueue_bulk(odph_ring_t *r, void * const *obj_table,
>> +int shm_ring_sp_enqueue_bulk(shm_ring_t *r, void * const *obj_table,
>>                              unsigned n)
>>  {
>> -       return __odph_ring_sp_do_enqueue(r, obj_table, n,
>> +       return __shm_ring_sp_do_enqueue(r, obj_table, n,
>>                                          ODPH_RING_QUEUE_FIXED);
>>  }
>>
>>  /**
>>   * Dequeue several objects from a ring (multi-consumers safe).
>>   */
>> -int odph_ring_mc_dequeue_bulk(odph_ring_t *r, void **obj_table, unsigned
>> n)
>> +int shm_ring_mc_dequeue_bulk(shm_ring_t *r, void **obj_table, unsigned n)
>>  {
>> -       return __odph_ring_mc_do_dequeue(r, obj_table, n,
>> +       return __shm_ring_mc_do_dequeue(r, obj_table, n,
>>                                          ODPH_RING_QUEUE_FIXED);
>>  }
>>
>>  /**
>>   * Dequeue several objects from a ring (NOT multi-consumers safe).
>>   */
>> -int odph_ring_sc_dequeue_bulk(odph_ring_t *r, void **obj_table, unsigned
>> n)
>> +int shm_ring_sc_dequeue_bulk(shm_ring_t *r, void **obj_table, unsigned n)
>>  {
>> -       return __odph_ring_sc_do_dequeue(r, obj_table, n,
>> +       return __shm_ring_sc_do_dequeue(r, obj_table, n,
>>                                          ODPH_RING_QUEUE_FIXED);
>>  }
>>
>>  /**
>>   * Test if a ring is full.
>>   */
>> -int odph_ring_full(const odph_ring_t *r)
>> +int shm_ring_full(const shm_ring_t *r)
>>  {
>>         uint32_t prod_tail = r->prod.tail;
>>         uint32_t cons_tail = r->cons.tail;
>> @@ -502,7 +502,7 @@ int odph_ring_full(const odph_ring_t *r)
>>  /**
>>   * Test if a ring is empty.
>>   */
>> -int odph_ring_empty(const odph_ring_t *r)
>> +int shm_ring_empty(const shm_ring_t *r)
>>  {
>>         uint32_t prod_tail = r->prod.tail;
>>         uint32_t cons_tail = r->cons.tail;
>> @@ -512,7 +512,7 @@ int odph_ring_empty(const odph_ring_t *r)
>>  /**
>>   * Return the number of entries in a ring.
>>   */
>> -unsigned odph_ring_count(const odph_ring_t *r)
>> +unsigned shm_ring_count(const shm_ring_t *r)
>>  {
>>         uint32_t prod_tail = r->prod.tail;
>>         uint32_t cons_tail = r->cons.tail;
>> @@ -522,7 +522,7 @@ unsigned odph_ring_count(const odph_ring_t *r)
>>  /**
>>   * Return the number of free entries in a ring.
>>   */
>> -unsigned odph_ring_free_count(const odph_ring_t *r)
>> +unsigned shm_ring_free_count(const shm_ring_t *r)
>>  {
>>         uint32_t prod_tail = r->prod.tail;
>>         uint32_t cons_tail = r->cons.tail;
>> @@ -530,7 +530,7 @@ unsigned odph_ring_free_count(const odph_ring_t *r)
>>  }
>>
>>  /* dump the status of the ring on the console */
>> -void odph_ring_dump(const odph_ring_t *r)
>> +void shm_ring_dump(const shm_ring_t *r)
>>  {
>>         ODPH_DBG("ring <%s>@%p\n", r->name, r);
>>         ODPH_DBG("  flags=%x\n", r->flags);
>> @@ -539,8 +539,8 @@ void odph_ring_dump(const odph_ring_t *r)
>>         ODPH_DBG("  ch=%" PRIu32 "\n", r->cons.head);
>>         ODPH_DBG("  pt=%" PRIu32 "\n", r->prod.tail);
>>         ODPH_DBG("  ph=%" PRIu32 "\n", r->prod.head);
>> -       ODPH_DBG("  used=%u\n", odph_ring_count(r));
>> -       ODPH_DBG("  avail=%u\n", odph_ring_free_count(r));
>> +       ODPH_DBG("  used=%u\n", shm_ring_count(r));
>> +       ODPH_DBG("  avail=%u\n", shm_ring_free_count(r));
>>         if (r->prod.watermark == r->prod.size)
>>                 ODPH_DBG("  watermark=0\n");
>>         else
>> @@ -548,23 +548,23 @@ void odph_ring_dump(const odph_ring_t *r)
>>  }
>>
>>  /* dump the status of all rings on the console */
>> -void odph_ring_list_dump(void)
>> +void shm_ring_list_dump(void)
>>  {
>> -       const odph_ring_t *mp = NULL;
>> +       const shm_ring_t *mp = NULL;
>>
>>         odp_rwlock_read_lock(&qlock);
>>
>>         TAILQ_FOREACH(mp, &odp_ring_list, next) {
>> -               odph_ring_dump(mp);
>> +               shm_ring_dump(mp);
>>         }
>>
>>         odp_rwlock_read_unlock(&qlock);
>>  }
>>
>>  /* search a ring from its name */
>> -odph_ring_t *odph_ring_lookup(const char *name)
>> +shm_ring_t *shm_ring_lookup(const char *name)
>>  {
>> -       odph_ring_t *r;
>> +       shm_ring_t *r;
>>
>>         odp_rwlock_read_lock(&qlock);
>>         TAILQ_FOREACH(r, &odp_ring_list, next) {
>> @@ -579,60 +579,60 @@ odph_ring_t *odph_ring_lookup(const char *name)
>>  /**
>>   * Enqueue several objects on the ring (multi-producers safe).
>>   */
>> -int odph_ring_mp_enqueue_burst(odph_ring_t *r, void * const *obj_table,
>> +int shm_ring_mp_enqueue_burst(shm_ring_t *r, void * const *obj_table,
>>                               unsigned n)
>>  {
>> -       return __odph_ring_mp_do_enqueue(r, obj_table, n,
>> +       return __shm_ring_mp_do_enqueue(r, obj_table, n,
>>                                          ODPH_RING_QUEUE_VARIABLE);
>>  }
>>
>>  /**
>>   * Enqueue several objects on a ring (NOT multi-producers safe).
>>   */
>> -int odph_ring_sp_enqueue_burst(odph_ring_t *r, void * const *obj_table,
>> +int shm_ring_sp_enqueue_burst(shm_ring_t *r, void * const *obj_table,
>>                               unsigned n)
>>  {
>> -       return __odph_ring_sp_do_enqueue(r, obj_table, n,
>> +       return __shm_ring_sp_do_enqueue(r, obj_table, n,
>>                                         ODPH_RING_QUEUE_VARIABLE);
>>  }
>>
>>  /**
>>   * Enqueue several objects on a ring.
>>   */
>> -int odph_ring_enqueue_burst(odph_ring_t *r, void * const *obj_table,
>> +int shm_ring_enqueue_burst(shm_ring_t *r, void * const *obj_table,
>>                            unsigned n)
>>  {
>>         if (r->prod.sp_enqueue)
>> -               return odph_ring_sp_enqueue_burst(r, obj_table, n);
>> +               return shm_ring_sp_enqueue_burst(r, obj_table, n);
>>         else
>> -               return odph_ring_mp_enqueue_burst(r, obj_table, n);
>> +               return shm_ring_mp_enqueue_burst(r, obj_table, n);
>>  }
>>
>>  /**
>>   * Dequeue several objects from a ring (multi-consumers safe).
>>   */
>> -int odph_ring_mc_dequeue_burst(odph_ring_t *r, void **obj_table,
>> unsigned n)
>> +int shm_ring_mc_dequeue_burst(shm_ring_t *r, void **obj_table, unsigned
>> n)
>>  {
>> -       return __odph_ring_mc_do_dequeue(r, obj_table, n,
>> +       return __shm_ring_mc_do_dequeue(r, obj_table, n,
>>                                         ODPH_RING_QUEUE_VARIABLE);
>>  }
>>
>>  /**
>>   * Dequeue several objects from a ring (NOT multi-consumers safe).
>>   */
>> -int odph_ring_sc_dequeue_burst(odph_ring_t *r, void **obj_table,
>> unsigned n)
>> +int shm_ring_sc_dequeue_burst(shm_ring_t *r, void **obj_table, unsigned
>> n)
>>  {
>> -       return __odph_ring_sc_do_dequeue(r, obj_table, n,
>> +       return __shm_ring_sc_do_dequeue(r, obj_table, n,
>>                                          ODPH_RING_QUEUE_VARIABLE);
>>  }
>>
>>  /**
>>   * Dequeue multiple objects from a ring up to a maximum number.
>>   */
>> -int odph_ring_dequeue_burst(odph_ring_t *r, void **obj_table, unsigned n)
>> +int shm_ring_dequeue_burst(shm_ring_t *r, void **obj_table, unsigned n)
>>  {
>>         if (r->cons.sc_dequeue)
>> -               return odph_ring_sc_dequeue_burst(r, obj_table, n);
>> +               return shm_ring_sc_dequeue_burst(r, obj_table, n);
>>         else
>> -               return odph_ring_mc_dequeue_burst(r, obj_table, n);
>> +               return shm_ring_mc_dequeue_burst(r, obj_table, n);
>>  }
>> diff --git a/platform/linux-generic/test/ring/odp_ring_test.c
>> b/platform/linux-generic/test/ring/odp_ring_test.c
>> index cec8221..799f5c6 100644
>> --- a/platform/linux-generic/test/ring/odp_ring_test.c
>> +++ b/platform/linux-generic/test/ring/odp_ring_test.c
>> @@ -57,7 +57,7 @@
>>
>>  #define RING_TEST_BASIC
>>
>> -static int test_ring_basic(odph_ring_t *r)
>> +static int test_ring_basic(shm_ring_t *r)
>>  {
>>         void **src = NULL, **cur_src = NULL, **dst = NULL, **cur_dst =
>> NULL;
>>         int ret;
>> @@ -86,7 +86,7 @@ static int test_ring_basic(odph_ring_t *r)
>>
>>         printf("Test SP & SC basic functions\n");
>>         printf("enqueue 1 obj\n");
>> -       ret = odph_ring_sp_enqueue_burst(r, cur_src, 1);
>> +       ret = shm_ring_sp_enqueue_burst(r, cur_src, 1);
>>         cur_src += 1;
>>         if ((ret & ODPH_RING_SZ_MASK) != 1) {
>>                 LOG_ERR("sp_enq for 1 obj failed\n");
>> @@ -94,7 +94,7 @@ static int test_ring_basic(odph_ring_t *r)
>>         }
>>
>>         printf("enqueue 2 objs\n");
>> -       ret = odph_ring_sp_enqueue_burst(r, cur_src, 2);
>> +       ret = shm_ring_sp_enqueue_burst(r, cur_src, 2);
>>         cur_src += 2;
>>         if ((ret & ODPH_RING_SZ_MASK) != 2) {
>>                 LOG_ERR("sp_enq for 2 obj failed\n");
>> @@ -102,14 +102,14 @@ static int test_ring_basic(odph_ring_t *r)
>>         }
>>
>>         printf("enqueue MAX_BULK objs\n");
>> -       ret = odph_ring_sp_enqueue_burst(r, cur_src, MAX_BULK);
>> +       ret = shm_ring_sp_enqueue_burst(r, cur_src, MAX_BULK);
>>         if ((ret & ODPH_RING_SZ_MASK) != MAX_BULK) {
>>                 LOG_ERR("sp_enq for %d obj failed\n", MAX_BULK);
>>                 goto fail;
>>         }
>>
>>         printf("dequeue 1 obj\n");
>> -       ret = odph_ring_sc_dequeue_burst(r, cur_dst, 1);
>> +       ret = shm_ring_sc_dequeue_burst(r, cur_dst, 1);
>>         cur_dst += 1;
>>         if ((ret & ODPH_RING_SZ_MASK) != 1) {
>>                 LOG_ERR("sc_deq for 1 obj failed\n");
>> @@ -117,7 +117,7 @@ static int test_ring_basic(odph_ring_t *r)
>>         }
>>
>>         printf("dequeue 2 objs\n");
>> -       ret = odph_ring_sc_dequeue_burst(r, cur_dst, 2);
>> +       ret = shm_ring_sc_dequeue_burst(r, cur_dst, 2);
>>         cur_dst += 2;
>>         if ((ret & ODPH_RING_SZ_MASK) != 2) {
>>                 LOG_ERR("sc_deq for 2 obj failed\n");
>> @@ -125,7 +125,7 @@ static int test_ring_basic(odph_ring_t *r)
>>         }
>>
>>         printf("dequeue MAX_BULK objs\n");
>> -       ret = odph_ring_sc_dequeue_burst(r, cur_dst, MAX_BULK);
>> +       ret = shm_ring_sc_dequeue_burst(r, cur_dst, MAX_BULK);
>>         cur_dst += MAX_BULK;
>>         if ((ret & ODPH_RING_SZ_MASK) != MAX_BULK) {
>>                 LOG_ERR("sc_deq for %d obj failed\n", MAX_BULK);
>> @@ -144,41 +144,41 @@ static int test_ring_basic(odph_ring_t *r)
>>         printf("Test MP & MC basic functions\n");
>>
>>         printf("enqueue 1 obj\n");
>> -       ret = odph_ring_mp_enqueue_bulk(r, cur_src, 1);
>> +       ret = shm_ring_mp_enqueue_bulk(r, cur_src, 1);
>>         cur_src += 1;
>>         if (ret != 0) {
>>                 LOG_ERR("mp_enq for 1 obj failed\n");
>>                 goto fail;
>>         }
>>         printf("enqueue 2 objs\n");
>> -       ret = odph_ring_mp_enqueue_bulk(r, cur_src, 2);
>> +       ret = shm_ring_mp_enqueue_bulk(r, cur_src, 2);
>>         cur_src += 2;
>>         if (ret != 0) {
>>                 LOG_ERR("mp_enq for 2 obj failed\n");
>>                 goto fail;
>>         }
>>         printf("enqueue MAX_BULK objs\n");
>> -       ret = odph_ring_mp_enqueue_bulk(r, cur_src, MAX_BULK);
>> +       ret = shm_ring_mp_enqueue_bulk(r, cur_src, MAX_BULK);
>>         if (ret != 0) {
>>                 LOG_ERR("mp_enq for %d obj failed\n", MAX_BULK);
>>                 goto fail;
>>         }
>>         printf("dequeue 1 obj\n");
>> -       ret = odph_ring_mc_dequeue_bulk(r, cur_dst, 1);
>> +       ret = shm_ring_mc_dequeue_bulk(r, cur_dst, 1);
>>         cur_dst += 1;
>>         if (ret != 0) {
>>                 LOG_ERR("mc_deq for 1 obj failed\n");
>>                 goto fail;
>>         }
>>         printf("dequeue 2 objs\n");
>> -       ret = odph_ring_mc_dequeue_bulk(r, cur_dst, 2);
>> +       ret = shm_ring_mc_dequeue_bulk(r, cur_dst, 2);
>>         cur_dst += 2;
>>         if (ret != 0) {
>>                 LOG_ERR("mc_deq for 2 obj failed\n");
>>                 goto fail;
>>         }
>>         printf("dequeue MAX_BULK objs\n");
>> -       ret = odph_ring_mc_dequeue_bulk(r, cur_dst, MAX_BULK);
>> +       ret = shm_ring_mc_dequeue_bulk(r, cur_dst, MAX_BULK);
>>         cur_dst += MAX_BULK;
>>         if (ret != 0) {
>>                 LOG_ERR("mc_deq for %d obj failed\n", MAX_BULK);
>> @@ -191,30 +191,30 @@ static int test_ring_basic(odph_ring_t *r)
>>         }
>>
>>         printf("test watermark and default bulk enqueue / dequeue\n");
>> -       odph_ring_set_water_mark(r, 20);
>> +       shm_ring_set_water_mark(r, 20);
>>         num_elems = 16;
>>
>>         cur_src = src;
>>         cur_dst = dst;
>>
>> -       ret = odph_ring_mp_enqueue_bulk(r, cur_src, num_elems);
>> +       ret = shm_ring_mp_enqueue_bulk(r, cur_src, num_elems);
>>         cur_src += num_elems;
>>         if (ret != 0) {
>>                 LOG_ERR("Cannot enqueue\n");
>>                 goto fail;
>>         }
>> -       ret = odph_ring_mp_enqueue_bulk(r, cur_src, num_elems);
>> +       ret = shm_ring_mp_enqueue_bulk(r, cur_src, num_elems);
>>         if (ret != -EDQUOT) {
>>                 LOG_ERR("Watermark not exceeded\n");
>>                 goto fail;
>>         }
>> -       ret = odph_ring_mc_dequeue_bulk(r, cur_dst, num_elems);
>> +       ret = shm_ring_mc_dequeue_bulk(r, cur_dst, num_elems);
>>         cur_dst += num_elems;
>>         if (ret != 0) {
>>                 LOG_ERR("Cannot dequeue\n");
>>                 goto fail;
>>         }
>> -       ret = odph_ring_mc_dequeue_bulk(r, cur_dst, num_elems);
>> +       ret = shm_ring_mc_dequeue_bulk(r, cur_dst, num_elems);
>>         cur_dst += num_elems;
>>         if (ret != 0) {
>>                 LOG_ERR("Cannot dequeue2\n");
>> @@ -241,7 +241,7 @@ fail:
>>  }
>>
>>  /* global shared ring used for stress testing */
>> -static odph_ring_t *r_stress;
>> +static shm_ring_t *r_stress;
>>
>>  /* Stress func for Multi producer only */
>>  static int producer_fn(void)
>> @@ -260,7 +260,7 @@ static int producer_fn(void)
>>                 src[i] = (void *)(unsigned long)i;
>>
>>         do {
>> -               i = odph_ring_mp_enqueue_bulk(r_stress, src, MAX_BULK);
>> +               i = shm_ring_mp_enqueue_bulk(r_stress, src, MAX_BULK);
>>                 if (i == 0) {
>>                         free(src);
>>                         return 0;
>> @@ -282,7 +282,7 @@ static int consumer_fn(void)
>>         }
>>
>>         do {
>> -               i = odph_ring_mc_dequeue_bulk(r_stress, src, MAX_BULK);
>> +               i = shm_ring_mc_dequeue_bulk(r_stress, src, MAX_BULK);
>>                 if (i == 0) {
>>                         for (i = 0; i < MAX_BULK; i++) {
>>                                 if (src[i] != (void *)(unsigned long)i) {
>> @@ -356,7 +356,7 @@ static void *test_ring(void *arg)
>>         ring_arg_t *parg = (ring_arg_t *)arg;
>>         int thr;
>>         char ring_name[ODPH_RING_NAMESIZE];
>> -       odph_ring_t *r;
>> +       shm_ring_t *r;
>>         int result = 0;
>>
>>         thr = odp_thread_id();
>> @@ -367,7 +367,7 @@ static void *test_ring(void *arg)
>>         case ODP_RING_TEST_BASIC:
>>                 snprintf(ring_name, sizeof(ring_name), "test_ring_%i",
>> thr);
>>
>> -               r = odph_ring_create(ring_name, RING_SIZE,
>> +               r = shm_ring_create(ring_name, RING_SIZE,
>>                                     0 /* not used, alignement
>>                                          taken care inside func : todo
>> */);
>>                 if (r == NULL) {
>> @@ -376,7 +376,7 @@ static void *test_ring(void *arg)
>>                         break;
>>                 }
>>                 /* lookup ring from its name */
>> -               if (odph_ring_lookup(ring_name) != r) {
>> +               if (shm_ring_lookup(ring_name) != r) {
>>                         LOG_ERR("ring lookup failed\n");
>>                         result = -1;
>>                         break;
>> @@ -389,7 +389,7 @@ static void *test_ring(void *arg)
>>                 }
>>
>>                 /* dump ring stats */
>> -               odph_ring_list_dump();
>> +               shm_ring_list_dump();
>>
>>                 break;
>>
>> @@ -397,7 +397,7 @@ static void *test_ring(void *arg)
>>                 test_ring_stress(parg->stress_type);
>>
>>                 /* dump ring stats */
>> -               odph_ring_list_dump();
>> +               shm_ring_list_dump();
>>                 break;
>>
>>         default:
>> @@ -428,7 +428,7 @@ int main(int argc __attribute__((__unused__)),
>>
>>         odp_print_system_info();
>>
>> -       odph_ring_tailq_init();
>> +       shm_ring_tailq_init();
>>
>>         rarg.thrdarg.numthrds = odp_cpu_count();
>>
>> @@ -444,7 +444,7 @@ int main(int argc __attribute__((__unused__)),
>>         /* create a ring */
>>         snprintf(ring_name, sizeof(ring_name), "test_ring_stress");
>>
>> -       r_stress = odph_ring_create(ring_name, RING_SIZE,
>> +       r_stress = shm_ring_create(ring_name, RING_SIZE,
>>                                 0 /* not used, alignement
>>                                  taken care inside func : todo */);
>>         if (r_stress == NULL) {
>> @@ -452,7 +452,7 @@ int main(int argc __attribute__((__unused__)),
>>                 goto fail;
>>         }
>>         /* lookup ring from its name */
>> -       if (odph_ring_lookup(ring_name) != r_stress) {
>> +       if (shm_ring_lookup(ring_name) != r_stress) {
>>                 LOG_ERR("ring lookup failed\n");
>>                 goto fail;
>>         }
>> --
>> 1.9.1
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> https://lists.linaro.org/mailman/listinfo/lng-odp
>>
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
Maxim Uvarov Sept. 10, 2015, 12:13 p.m. UTC | #3
On 09/10/15 14:59, Mike Holmes wrote:
>
>
> On 9 September 2015 at 23:18, Bill Fischofer 
> <bill.fischofer@linaro.org <mailto:bill.fischofer@linaro.org>> wrote:
>
>     Why shm_ring_xxx rather than odp_ring_xxx (or _odp_ring_xxx if
>     these are internal APIs?)  That would seem to be consistent with
>     other internal APIs.
>
>
> I really like the prefix "_" for internal functions, its very clear 
> and low overhead in naming.

I planned to use ring for pktio. In general it's good to have even api 
for ring support as we plan to add some algorithms. So I'm not really 
sure what is better - put it to common layer or keep it in pktio until 
somebody will try to reuse it. I specially remove odp_ prefix to be 
understandable that it's some internal function. But I'm ok to rename it 
to any.

Maxim.

>
>
>
>     On Wed, Sep 9, 2015 at 5:06 AM, Maxim Uvarov
>     <maxim.uvarov@linaro.org <mailto:maxim.uvarov@linaro.org>> wrote:
>
>         Drop odph_ prefix due to it's not helper anymore and do not
>         add odp_ prefix because it's not api.
>
>         Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org
>         <mailto:maxim.uvarov@linaro.org>>
>         ---
>          platform/linux-generic/include/odp_ring_internal.h | 64
>         +++++++-------
>          platform/linux-generic/pktio/ring.c     | 98
>         +++++++++++-----------
>          platform/linux-generic/test/ring/odp_ring_test.c  | 58
>         ++++++-------
>          3 files changed, 110 insertions(+), 110 deletions(-)
>
>         diff --git
>         a/platform/linux-generic/include/odp_ring_internal.h
>         b/platform/linux-generic/include/odp_ring_internal.h
>         index 65c32ad..596bf9b 100644
>         --- a/platform/linux-generic/include/odp_ring_internal.h
>         +++ b/platform/linux-generic/include/odp_ring_internal.h
>         @@ -103,7 +103,7 @@ extern "C" {
>          #include <errno.h>
>          #include <sys/queue.h>
>
>         -enum odph_ring_queue_behavior {
>         +enum shm_ring_queue_behavior {
>                 ODPH_RING_QUEUE_FIXED = 0, /**< Enq/Deq a fixed number
>                                         of items from a ring */
>                 ODPH_RING_QUEUE_VARIABLE   /**< Enq/Deq as many items
>         @@ -123,9 +123,9 @@ enum odph_ring_queue_behavior {
>           * values in a modulo-32bit base: that's why the overflow of
>         the indexes is not
>           * a problem.
>           */
>         -typedef struct odph_ring {
>         +typedef struct shm_ring {
>                 /** @private Next in list. */
>         -       TAILQ_ENTRY(odph_ring) next;
>         +       TAILQ_ENTRY(shm_ring) next;
>
>                 /** @private Name of the ring. */
>                 char name[ODPH_RING_NAMESIZE];
>         @@ -153,7 +153,7 @@ typedef struct odph_ring {
>
>                 /** @private Memory space of ring starts here. */
>                 void *ring[0] ODP_ALIGNED_CACHE;
>         -} odph_ring_t;
>         +} shm_ring_t;
>
>
>          #define ODPH_RING_F_SP_ENQ 0x0001 /* The default enqueue is
>         "single-producer".*/
>         @@ -191,7 +191,7 @@ typedef struct odph_ring {
>           *    - EEXIST - a memzone with the same name already exists
>           *    - ENOMEM - no appropriate memory area found in which to
>         create memzone
>           */
>         -odph_ring_t *odph_ring_create(const char *name, unsigned count,
>         +shm_ring_t *shm_ring_create(const char *name, unsigned count,
>                                     unsigned flags);
>
>
>         @@ -210,14 +210,14 @@ odph_ring_t *odph_ring_create(const char
>         *name, unsigned count,
>           * @return 0: Success; water mark changed.
>           *             -EINVAL: Invalid water mark value.
>           */
>         -int odph_ring_set_water_mark(odph_ring_t *r, unsigned count);
>         +int shm_ring_set_water_mark(shm_ring_t *r, unsigned count);
>
>          /**
>           * Dump the status of the ring to the console.
>           *
>           * @param r A pointer to the ring structure.
>           */
>         -void odph_ring_dump(const odph_ring_t *r);
>         +void shm_ring_dump(const shm_ring_t *r);
>
>          /**
>           * Enqueue several objects on the ring (multi-producers safe).
>         @@ -244,9 +244,9 @@ void odph_ring_dump(const odph_ring_t *r);
>           *   if behavior = ODP_RING_QUEUE_VARIABLE
>           *   - n: Actual number of objects enqueued.
>           */
>         -int __odph_ring_mp_do_enqueue(odph_ring_t *r, void * const
>         *obj_table,
>         +int __shm_ring_mp_do_enqueue(shm_ring_t *r, void * const
>         *obj_table,
>                                       unsigned n,
>         -                             enum odph_ring_queue_behavior
>         behavior);
>         +                             enum shm_ring_queue_behavior
>         behavior);
>
>          /**
>           * Enqueue several objects on a ring (NOT multi-producers safe).
>         @@ -270,9 +270,9 @@ int __odph_ring_mp_do_enqueue(odph_ring_t
>         *r, void * const *obj_table,
>           *   if behavior = ODP_RING_QUEUE_VARIABLE
>           *   - n: Actual number of objects enqueued.
>           */
>         -int __odph_ring_sp_do_enqueue(odph_ring_t *r, void * const
>         *obj_table,
>         +int __shm_ring_sp_do_enqueue(shm_ring_t *r, void * const
>         *obj_table,
>                                       unsigned n,
>         -                             enum odph_ring_queue_behavior
>         behavior);
>         +                             enum shm_ring_queue_behavior
>         behavior);
>
>          /**
>           * Dequeue several objects from a ring (multi-consumers
>         safe). When
>         @@ -301,9 +301,9 @@ int __odph_ring_sp_do_enqueue(odph_ring_t
>         *r, void * const *obj_table,
>           *   - n: Actual number of objects dequeued.
>           */
>
>         -int __odph_ring_mc_do_dequeue(odph_ring_t *r, void **obj_table,
>         +int __shm_ring_mc_do_dequeue(shm_ring_t *r, void **obj_table,
>                                       unsigned n,
>         -                             enum odph_ring_queue_behavior
>         behavior);
>         +                             enum shm_ring_queue_behavior
>         behavior);
>
>          /**
>           * Dequeue several objects from a ring (NOT multi-consumers
>         safe).
>         @@ -328,9 +328,9 @@ int __odph_ring_mc_do_dequeue(odph_ring_t
>         *r, void **obj_table,
>           *   if behavior = ODP_RING_QUEUE_VARIABLE
>           *   - n: Actual number of objects dequeued.
>           */
>         -int __odph_ring_sc_do_dequeue(odph_ring_t *r, void **obj_table,
>         +int __shm_ring_sc_do_dequeue(shm_ring_t *r, void **obj_table,
>                                       unsigned n,
>         -                             enum odph_ring_queue_behavior
>         behavior);
>         +                             enum shm_ring_queue_behavior
>         behavior);
>
>          /**
>           * Enqueue several objects on the ring (multi-producers safe).
>         @@ -350,7 +350,7 @@ int __odph_ring_sc_do_dequeue(odph_ring_t
>         *r, void **obj_table,
>           *     high water mark is exceeded.
>           *   - -ENOBUFS: Not enough room in the ring to enqueue, no
>         object is enqueued.
>           */
>         -int odph_ring_mp_enqueue_bulk(odph_ring_t *r, void * const
>         *obj_table,
>         +int shm_ring_mp_enqueue_bulk(shm_ring_t *r, void * const
>         *obj_table,
>                                       unsigned n);
>
>          /**
>         @@ -368,7 +368,7 @@ int odph_ring_mp_enqueue_bulk(odph_ring_t
>         *r, void * const *obj_table,
>           *     high water mark is exceeded.
>           *   - -ENOBUFS: Not enough room in the ring to enqueue; no
>         object is enqueued.
>           */
>         -int odph_ring_sp_enqueue_bulk(odph_ring_t *r, void * const
>         *obj_table,
>         +int shm_ring_sp_enqueue_bulk(shm_ring_t *r, void * const
>         *obj_table,
>                                       unsigned n);
>
>          /**
>         @@ -388,7 +388,7 @@ int odph_ring_sp_enqueue_bulk(odph_ring_t
>         *r, void * const *obj_table,
>           *   - -ENOENT: Not enough entries in the ring to dequeue; no
>         object is
>           *     dequeued.
>           */
>         -int odph_ring_mc_dequeue_bulk(odph_ring_t *r, void
>         **obj_table, unsigned n);
>         +int shm_ring_mc_dequeue_bulk(shm_ring_t *r, void **obj_table,
>         unsigned n);
>
>          /**
>           * Dequeue several objects from a ring (NOT multi-consumers
>         safe).
>         @@ -405,7 +405,7 @@ int odph_ring_mc_dequeue_bulk(odph_ring_t
>         *r, void **obj_table, unsigned n);
>           *   - -ENOENT: Not enough entries in the ring to dequeue; no
>         object is
>           *     dequeued.
>           */
>         -int odph_ring_sc_dequeue_bulk(odph_ring_t *r, void
>         **obj_table, unsigned n);
>         +int shm_ring_sc_dequeue_bulk(shm_ring_t *r, void **obj_table,
>         unsigned n);
>
>          /**
>           * Test if a ring is full.
>         @@ -416,7 +416,7 @@ int odph_ring_sc_dequeue_bulk(odph_ring_t
>         *r, void **obj_table, unsigned n);
>           *   - 1: The ring is full.
>           *   - 0: The ring is not full.
>           */
>         -int odph_ring_full(const odph_ring_t *r);
>         +int shm_ring_full(const shm_ring_t *r);
>
>          /**
>           * Test if a ring is empty.
>         @@ -427,7 +427,7 @@ int odph_ring_full(const odph_ring_t *r);
>           *   - 1: The ring is empty.
>           *   - 0: The ring is not empty.
>           */
>         -int odph_ring_empty(const odph_ring_t *r);
>         +int shm_ring_empty(const shm_ring_t *r);
>
>          /**
>           * Return the number of entries in a ring.
>         @@ -437,7 +437,7 @@ int odph_ring_empty(const odph_ring_t *r);
>           * @return
>           *   The number of entries in the ring.
>           */
>         -unsigned odph_ring_count(const odph_ring_t *r);
>         +unsigned shm_ring_count(const shm_ring_t *r);
>
>          /**
>           * Return the number of free entries in a ring.
>         @@ -447,14 +447,14 @@ unsigned odph_ring_count(const
>         odph_ring_t *r);
>           * @return
>           *   The number of free entries in the ring.
>           */
>         -unsigned odph_ring_free_count(const odph_ring_t *r);
>         +unsigned shm_ring_free_count(const shm_ring_t *r);
>
>          /**
>           * search ring by name
>           * @param name ring name to search
>           * @return     pointer to ring otherwise NULL
>           */
>         -odph_ring_t *odph_ring_lookup(const char *name);
>         +shm_ring_t *shm_ring_lookup(const char *name);
>
>          /**
>           * Enqueue several objects on the ring (multi-producers safe).
>         @@ -471,7 +471,7 @@ odph_ring_t *odph_ring_lookup(const char
>         *name);
>           * @return
>           *   - n: Actual number of objects enqueued.
>           */
>         -int odph_ring_mp_enqueue_burst(odph_ring_t *r, void * const
>         *obj_table,
>         +int shm_ring_mp_enqueue_burst(shm_ring_t *r, void * const
>         *obj_table,
>                                        unsigned n);
>
>          /**
>         @@ -486,7 +486,7 @@ int odph_ring_mp_enqueue_burst(odph_ring_t
>         *r, void * const *obj_table,
>           * @return
>           *   - n: Actual number of objects enqueued.
>           */
>         -int odph_ring_sp_enqueue_burst(odph_ring_t *r, void * const
>         *obj_table,
>         +int shm_ring_sp_enqueue_burst(shm_ring_t *r, void * const
>         *obj_table,
>                                        unsigned n);
>          /**
>           * Enqueue several objects on a ring.
>         @@ -504,7 +504,7 @@ int odph_ring_sp_enqueue_burst(odph_ring_t
>         *r, void * const *obj_table,
>           * @return
>           *   - n: Actual number of objects enqueued.
>           */
>         -int odph_ring_enqueue_burst(odph_ring_t *r, void * const
>         *obj_table,
>         +int shm_ring_enqueue_burst(shm_ring_t *r, void * const
>         *obj_table,
>                                     unsigned n);
>
>          /**
>         @@ -524,7 +524,7 @@ int odph_ring_enqueue_burst(odph_ring_t
>         *r, void * const *obj_table,
>           * @return
>           *   - n: Actual number of objects dequeued, 0 if ring is empty
>           */
>         -int odph_ring_mc_dequeue_burst(odph_ring_t *r, void
>         **obj_table, unsigned n);
>         +int shm_ring_mc_dequeue_burst(shm_ring_t *r, void
>         **obj_table, unsigned n);
>
>          /**
>           * Dequeue several objects from a ring (NOT multi-consumers
>         safe).When the
>         @@ -540,7 +540,7 @@ int odph_ring_mc_dequeue_burst(odph_ring_t
>         *r, void **obj_table, unsigned n);
>           * @return
>           *   - n: Actual number of objects dequeued, 0 if ring is empty
>           */
>         -int odph_ring_sc_dequeue_burst(odph_ring_t *r, void
>         **obj_table, unsigned n);
>         +int shm_ring_sc_dequeue_burst(shm_ring_t *r, void
>         **obj_table, unsigned n);
>
>          /**
>           * Dequeue multiple objects from a ring up to a maximum number.
>         @@ -558,17 +558,17 @@ int
>         odph_ring_sc_dequeue_burst(odph_ring_t *r, void **obj_table,
>         unsigned n);
>           * @return
>           *   - Number of objects dequeued, or a negative error code
>         on error
>           */
>         -int odph_ring_dequeue_burst(odph_ring_t *r, void **obj_table,
>         unsigned n);
>         +int shm_ring_dequeue_burst(shm_ring_t *r, void **obj_table,
>         unsigned n);
>
>          /**
>           * dump the status of all rings on the console
>           */
>         -void odph_ring_list_dump(void);
>         +void shm_ring_list_dump(void);
>
>          /**
>           * initialise ring tailq
>           */
>         -void odph_ring_tailq_init(void);
>         +void shm_ring_tailq_init(void);
>
>          #ifdef __cplusplus
>          }
>         diff --git a/platform/linux-generic/pktio/ring.c
>         b/platform/linux-generic/pktio/ring.c
>         index 4bb6b4e..9ff457f 100644
>         --- a/platform/linux-generic/pktio/ring.c
>         +++ b/platform/linux-generic/pktio/ring.c
>         @@ -80,7 +80,7 @@
>          #include <odp_ring_internal.h>
>          #include <odph_debug.h>
>
>         -static TAILQ_HEAD(, odph_ring) odp_ring_list;
>         +static TAILQ_HEAD(, shm_ring) odp_ring_list;
>
>          #define RING_VAL_IS_POWER_2(x) ((((x) - 1) & (x)) == 0)
>
>         @@ -145,18 +145,18 @@ static TAILQ_HEAD(, odph_ring)
>         odp_ring_list;
>          static odp_rwlock_t    qlock;  /* rings tailq lock */
>
>          /* init tailq_ring */
>         -void odph_ring_tailq_init(void)
>         +void shm_ring_tailq_init(void)
>          {
>                 TAILQ_INIT(&odp_ring_list);
>                 odp_rwlock_init(&qlock);
>          }
>
>          /* create the ring */
>         -odph_ring_t *
>         -odph_ring_create(const char *name, unsigned count, unsigned
>         flags)
>         +shm_ring_t *
>         +shm_ring_create(const char *name, unsigned count, unsigned flags)
>          {
>                 char ring_name[ODPH_RING_NAMESIZE];
>         -       odph_ring_t *r;
>         +       shm_ring_t *r;
>                 size_t ring_size;
>                 odp_shm_t shm;
>
>         @@ -168,7 +168,7 @@ odph_ring_create(const char *name,
>         unsigned count, unsigned flags)
>                 }
>
>                 snprintf(ring_name, sizeof(ring_name), "%s", name);
>         -       ring_size = count*sizeof(void *)+sizeof(odph_ring_t);
>         +       ring_size = count*sizeof(void *)+sizeof(shm_ring_t);
>
>                 odp_rwlock_write_lock(&qlock);
>                 /* reserve a memory zone for this ring.*/
>         @@ -205,7 +205,7 @@ odph_ring_create(const char *name,
>         unsigned count, unsigned flags)
>           * change the high water mark. If *count* is 0, water marking is
>           * disabled
>           */
>         -int odph_ring_set_water_mark(odph_ring_t *r, unsigned count)
>         +int shm_ring_set_water_mark(shm_ring_t *r, unsigned count)
>          {
>                 if (count >= r->prod.size)
>                         return -EINVAL;
>         @@ -221,8 +221,8 @@ int odph_ring_set_water_mark(odph_ring_t
>         *r, unsigned count)
>          /**
>           * Enqueue several objects on the ring (multi-producers safe).
>           */
>         -int __odph_ring_mp_do_enqueue(odph_ring_t *r, void * const
>         *obj_table,
>         -                        unsigned n, enum
>         odph_ring_queue_behavior behavior)
>         +int __shm_ring_mp_do_enqueue(shm_ring_t *r, void * const
>         *obj_table,
>         +                        unsigned n, enum
>         shm_ring_queue_behavior behavior)
>          {
>                 uint32_t prod_head, prod_next;
>                 uint32_t cons_tail, free_entries;
>         @@ -294,8 +294,8 @@ int __odph_ring_mp_do_enqueue(odph_ring_t
>         *r, void * const *obj_table,
>          /**
>           * Enqueue several objects on a ring (NOT multi-producers safe).
>           */
>         -int __odph_ring_sp_do_enqueue(odph_ring_t *r, void * const
>         *obj_table,
>         -                            unsigned n, enum
>         odph_ring_queue_behavior behavior)
>         +int __shm_ring_sp_do_enqueue(shm_ring_t *r, void * const
>         *obj_table,
>         +                            unsigned n, enum
>         shm_ring_queue_behavior behavior)
>          {
>                 uint32_t prod_head, cons_tail;
>                 uint32_t prod_next, free_entries;
>         @@ -348,8 +348,8 @@ int __odph_ring_sp_do_enqueue(odph_ring_t
>         *r, void * const *obj_table,
>           * Dequeue several objects from a ring (multi-consumers safe).
>           */
>
>         -int __odph_ring_mc_do_dequeue(odph_ring_t *r, void **obj_table,
>         -                        unsigned n, enum
>         odph_ring_queue_behavior behavior)
>         +int __shm_ring_mc_do_dequeue(shm_ring_t *r, void **obj_table,
>         +                        unsigned n, enum
>         shm_ring_queue_behavior behavior)
>          {
>                 uint32_t cons_head, prod_tail;
>                 uint32_t cons_next, entries;
>         @@ -412,8 +412,8 @@ int __odph_ring_mc_do_dequeue(odph_ring_t
>         *r, void **obj_table,
>          /**
>           * Dequeue several objects from a ring (NOT multi-consumers
>         safe).
>           */
>         -int __odph_ring_sc_do_dequeue(odph_ring_t *r, void **obj_table,
>         -                            unsigned n, enum
>         odph_ring_queue_behavior behavior)
>         +int __shm_ring_sc_do_dequeue(shm_ring_t *r, void **obj_table,
>         +                            unsigned n, enum
>         shm_ring_queue_behavior behavior)
>          {
>                 uint32_t cons_head, prod_tail;
>                 uint32_t cons_next, entries;
>         @@ -454,45 +454,45 @@ int
>         __odph_ring_sc_do_dequeue(odph_ring_t *r, void **obj_table,
>          /**
>           * Enqueue several objects on the ring (multi-producers safe).
>           */
>         -int odph_ring_mp_enqueue_bulk(odph_ring_t *r, void * const
>         *obj_table,
>         +int shm_ring_mp_enqueue_bulk(shm_ring_t *r, void * const
>         *obj_table,
>                                         unsigned n)
>          {
>         -       return __odph_ring_mp_do_enqueue(r, obj_table, n,
>         +       return __shm_ring_mp_do_enqueue(r, obj_table, n,
>          ODPH_RING_QUEUE_FIXED);
>          }
>
>          /**
>           * Enqueue several objects on a ring (NOT multi-producers safe).
>           */
>         -int odph_ring_sp_enqueue_bulk(odph_ring_t *r, void * const
>         *obj_table,
>         +int shm_ring_sp_enqueue_bulk(shm_ring_t *r, void * const
>         *obj_table,
>                                      unsigned n)
>          {
>         -       return __odph_ring_sp_do_enqueue(r, obj_table, n,
>         +       return __shm_ring_sp_do_enqueue(r, obj_table, n,
>          ODPH_RING_QUEUE_FIXED);
>          }
>
>          /**
>           * Dequeue several objects from a ring (multi-consumers safe).
>           */
>         -int odph_ring_mc_dequeue_bulk(odph_ring_t *r, void
>         **obj_table, unsigned n)
>         +int shm_ring_mc_dequeue_bulk(shm_ring_t *r, void **obj_table,
>         unsigned n)
>          {
>         -       return __odph_ring_mc_do_dequeue(r, obj_table, n,
>         +       return __shm_ring_mc_do_dequeue(r, obj_table, n,
>          ODPH_RING_QUEUE_FIXED);
>          }
>
>          /**
>           * Dequeue several objects from a ring (NOT multi-consumers
>         safe).
>           */
>         -int odph_ring_sc_dequeue_bulk(odph_ring_t *r, void
>         **obj_table, unsigned n)
>         +int shm_ring_sc_dequeue_bulk(shm_ring_t *r, void **obj_table,
>         unsigned n)
>          {
>         -       return __odph_ring_sc_do_dequeue(r, obj_table, n,
>         +       return __shm_ring_sc_do_dequeue(r, obj_table, n,
>          ODPH_RING_QUEUE_FIXED);
>          }
>
>          /**
>           * Test if a ring is full.
>           */
>         -int odph_ring_full(const odph_ring_t *r)
>         +int shm_ring_full(const shm_ring_t *r)
>          {
>                 uint32_t prod_tail = r->prod.tail;
>                 uint32_t cons_tail = r->cons.tail;
>         @@ -502,7 +502,7 @@ int odph_ring_full(const odph_ring_t *r)
>          /**
>           * Test if a ring is empty.
>           */
>         -int odph_ring_empty(const odph_ring_t *r)
>         +int shm_ring_empty(const shm_ring_t *r)
>          {
>                 uint32_t prod_tail = r->prod.tail;
>                 uint32_t cons_tail = r->cons.tail;
>         @@ -512,7 +512,7 @@ int odph_ring_empty(const odph_ring_t *r)
>          /**
>           * Return the number of entries in a ring.
>           */
>         -unsigned odph_ring_count(const odph_ring_t *r)
>         +unsigned shm_ring_count(const shm_ring_t *r)
>          {
>                 uint32_t prod_tail = r->prod.tail;
>                 uint32_t cons_tail = r->cons.tail;
>         @@ -522,7 +522,7 @@ unsigned odph_ring_count(const odph_ring_t *r)
>          /**
>           * Return the number of free entries in a ring.
>           */
>         -unsigned odph_ring_free_count(const odph_ring_t *r)
>         +unsigned shm_ring_free_count(const shm_ring_t *r)
>          {
>                 uint32_t prod_tail = r->prod.tail;
>                 uint32_t cons_tail = r->cons.tail;
>         @@ -530,7 +530,7 @@ unsigned odph_ring_free_count(const
>         odph_ring_t *r)
>          }
>
>          /* dump the status of the ring on the console */
>         -void odph_ring_dump(const odph_ring_t *r)
>         +void shm_ring_dump(const shm_ring_t *r)
>          {
>                 ODPH_DBG("ring <%s>@%p\n", r->name, r);
>                 ODPH_DBG("  flags=%x\n", r->flags);
>         @@ -539,8 +539,8 @@ void odph_ring_dump(const odph_ring_t *r)
>                 ODPH_DBG("  ch=%" PRIu32 "\n", r->cons.head);
>                 ODPH_DBG("  pt=%" PRIu32 "\n", r->prod.tail);
>                 ODPH_DBG("  ph=%" PRIu32 "\n", r->prod.head);
>         -       ODPH_DBG("  used=%u\n", odph_ring_count(r));
>         -       ODPH_DBG("  avail=%u\n", odph_ring_free_count(r));
>         +       ODPH_DBG("  used=%u\n", shm_ring_count(r));
>         +       ODPH_DBG("  avail=%u\n", shm_ring_free_count(r));
>                 if (r->prod.watermark == r->prod.size)
>                         ODPH_DBG("  watermark=0\n");
>                 else
>         @@ -548,23 +548,23 @@ void odph_ring_dump(const odph_ring_t *r)
>          }
>
>          /* dump the status of all rings on the console */
>         -void odph_ring_list_dump(void)
>         +void shm_ring_list_dump(void)
>          {
>         -       const odph_ring_t *mp = NULL;
>         +       const shm_ring_t *mp = NULL;
>
>                 odp_rwlock_read_lock(&qlock);
>
>                 TAILQ_FOREACH(mp, &odp_ring_list, next) {
>         -               odph_ring_dump(mp);
>         +               shm_ring_dump(mp);
>                 }
>
>                 odp_rwlock_read_unlock(&qlock);
>          }
>
>          /* search a ring from its name */
>         -odph_ring_t *odph_ring_lookup(const char *name)
>         +shm_ring_t *shm_ring_lookup(const char *name)
>          {
>         -       odph_ring_t *r;
>         +       shm_ring_t *r;
>
>                 odp_rwlock_read_lock(&qlock);
>                 TAILQ_FOREACH(r, &odp_ring_list, next) {
>         @@ -579,60 +579,60 @@ odph_ring_t *odph_ring_lookup(const char
>         *name)
>          /**
>           * Enqueue several objects on the ring (multi-producers safe).
>           */
>         -int odph_ring_mp_enqueue_burst(odph_ring_t *r, void * const
>         *obj_table,
>         +int shm_ring_mp_enqueue_burst(shm_ring_t *r, void * const
>         *obj_table,
>                                       unsigned n)
>          {
>         -       return __odph_ring_mp_do_enqueue(r, obj_table, n,
>         +       return __shm_ring_mp_do_enqueue(r, obj_table, n,
>          ODPH_RING_QUEUE_VARIABLE);
>          }
>
>          /**
>           * Enqueue several objects on a ring (NOT multi-producers safe).
>           */
>         -int odph_ring_sp_enqueue_burst(odph_ring_t *r, void * const
>         *obj_table,
>         +int shm_ring_sp_enqueue_burst(shm_ring_t *r, void * const
>         *obj_table,
>                                       unsigned n)
>          {
>         -       return __odph_ring_sp_do_enqueue(r, obj_table, n,
>         +       return __shm_ring_sp_do_enqueue(r, obj_table, n,
>         ODPH_RING_QUEUE_VARIABLE);
>          }
>
>          /**
>           * Enqueue several objects on a ring.
>           */
>         -int odph_ring_enqueue_burst(odph_ring_t *r, void * const
>         *obj_table,
>         +int shm_ring_enqueue_burst(shm_ring_t *r, void * const
>         *obj_table,
>                                    unsigned n)
>          {
>                 if (r->prod.sp_enqueue)
>         -               return odph_ring_sp_enqueue_burst(r,
>         obj_table, n);
>         +               return shm_ring_sp_enqueue_burst(r, obj_table, n);
>                 else
>         -               return odph_ring_mp_enqueue_burst(r,
>         obj_table, n);
>         +               return shm_ring_mp_enqueue_burst(r, obj_table, n);
>          }
>
>          /**
>           * Dequeue several objects from a ring (multi-consumers safe).
>           */
>         -int odph_ring_mc_dequeue_burst(odph_ring_t *r, void
>         **obj_table, unsigned n)
>         +int shm_ring_mc_dequeue_burst(shm_ring_t *r, void
>         **obj_table, unsigned n)
>          {
>         -       return __odph_ring_mc_do_dequeue(r, obj_table, n,
>         +       return __shm_ring_mc_do_dequeue(r, obj_table, n,
>         ODPH_RING_QUEUE_VARIABLE);
>          }
>
>          /**
>           * Dequeue several objects from a ring (NOT multi-consumers
>         safe).
>           */
>         -int odph_ring_sc_dequeue_burst(odph_ring_t *r, void
>         **obj_table, unsigned n)
>         +int shm_ring_sc_dequeue_burst(shm_ring_t *r, void
>         **obj_table, unsigned n)
>          {
>         -       return __odph_ring_sc_do_dequeue(r, obj_table, n,
>         +       return __shm_ring_sc_do_dequeue(r, obj_table, n,
>          ODPH_RING_QUEUE_VARIABLE);
>          }
>
>          /**
>           * Dequeue multiple objects from a ring up to a maximum number.
>           */
>         -int odph_ring_dequeue_burst(odph_ring_t *r, void **obj_table,
>         unsigned n)
>         +int shm_ring_dequeue_burst(shm_ring_t *r, void **obj_table,
>         unsigned n)
>          {
>                 if (r->cons.sc_dequeue)
>         -               return odph_ring_sc_dequeue_burst(r,
>         obj_table, n);
>         +               return shm_ring_sc_dequeue_burst(r, obj_table, n);
>                 else
>         -               return odph_ring_mc_dequeue_burst(r,
>         obj_table, n);
>         +               return shm_ring_mc_dequeue_burst(r, obj_table, n);
>          }
>         diff --git a/platform/linux-generic/test/ring/odp_ring_test.c
>         b/platform/linux-generic/test/ring/odp_ring_test.c
>         index cec8221..799f5c6 100644
>         --- a/platform/linux-generic/test/ring/odp_ring_test.c
>         +++ b/platform/linux-generic/test/ring/odp_ring_test.c
>         @@ -57,7 +57,7 @@
>
>          #define RING_TEST_BASIC
>
>         -static int test_ring_basic(odph_ring_t *r)
>         +static int test_ring_basic(shm_ring_t *r)
>          {
>                 void **src = NULL, **cur_src = NULL, **dst = NULL,
>         **cur_dst = NULL;
>                 int ret;
>         @@ -86,7 +86,7 @@ static int test_ring_basic(odph_ring_t *r)
>
>                 printf("Test SP & SC basic functions\n");
>                 printf("enqueue 1 obj\n");
>         -       ret = odph_ring_sp_enqueue_burst(r, cur_src, 1);
>         +       ret = shm_ring_sp_enqueue_burst(r, cur_src, 1);
>                 cur_src += 1;
>                 if ((ret & ODPH_RING_SZ_MASK) != 1) {
>                         LOG_ERR("sp_enq for 1 obj failed\n");
>         @@ -94,7 +94,7 @@ static int test_ring_basic(odph_ring_t *r)
>                 }
>
>                 printf("enqueue 2 objs\n");
>         -       ret = odph_ring_sp_enqueue_burst(r, cur_src, 2);
>         +       ret = shm_ring_sp_enqueue_burst(r, cur_src, 2);
>                 cur_src += 2;
>                 if ((ret & ODPH_RING_SZ_MASK) != 2) {
>                         LOG_ERR("sp_enq for 2 obj failed\n");
>         @@ -102,14 +102,14 @@ static int test_ring_basic(odph_ring_t *r)
>                 }
>
>                 printf("enqueue MAX_BULK objs\n");
>         -       ret = odph_ring_sp_enqueue_burst(r, cur_src, MAX_BULK);
>         +       ret = shm_ring_sp_enqueue_burst(r, cur_src, MAX_BULK);
>                 if ((ret & ODPH_RING_SZ_MASK) != MAX_BULK) {
>                         LOG_ERR("sp_enq for %d obj failed\n", MAX_BULK);
>                         goto fail;
>                 }
>
>                 printf("dequeue 1 obj\n");
>         -       ret = odph_ring_sc_dequeue_burst(r, cur_dst, 1);
>         +       ret = shm_ring_sc_dequeue_burst(r, cur_dst, 1);
>                 cur_dst += 1;
>                 if ((ret & ODPH_RING_SZ_MASK) != 1) {
>                         LOG_ERR("sc_deq for 1 obj failed\n");
>         @@ -117,7 +117,7 @@ static int test_ring_basic(odph_ring_t *r)
>                 }
>
>                 printf("dequeue 2 objs\n");
>         -       ret = odph_ring_sc_dequeue_burst(r, cur_dst, 2);
>         +       ret = shm_ring_sc_dequeue_burst(r, cur_dst, 2);
>                 cur_dst += 2;
>                 if ((ret & ODPH_RING_SZ_MASK) != 2) {
>                         LOG_ERR("sc_deq for 2 obj failed\n");
>         @@ -125,7 +125,7 @@ static int test_ring_basic(odph_ring_t *r)
>                 }
>
>                 printf("dequeue MAX_BULK objs\n");
>         -       ret = odph_ring_sc_dequeue_burst(r, cur_dst, MAX_BULK);
>         +       ret = shm_ring_sc_dequeue_burst(r, cur_dst, MAX_BULK);
>                 cur_dst += MAX_BULK;
>                 if ((ret & ODPH_RING_SZ_MASK) != MAX_BULK) {
>                         LOG_ERR("sc_deq for %d obj failed\n", MAX_BULK);
>         @@ -144,41 +144,41 @@ static int test_ring_basic(odph_ring_t *r)
>                 printf("Test MP & MC basic functions\n");
>
>                 printf("enqueue 1 obj\n");
>         -       ret = odph_ring_mp_enqueue_bulk(r, cur_src, 1);
>         +       ret = shm_ring_mp_enqueue_bulk(r, cur_src, 1);
>                 cur_src += 1;
>                 if (ret != 0) {
>                         LOG_ERR("mp_enq for 1 obj failed\n");
>                         goto fail;
>                 }
>                 printf("enqueue 2 objs\n");
>         -       ret = odph_ring_mp_enqueue_bulk(r, cur_src, 2);
>         +       ret = shm_ring_mp_enqueue_bulk(r, cur_src, 2);
>                 cur_src += 2;
>                 if (ret != 0) {
>                         LOG_ERR("mp_enq for 2 obj failed\n");
>                         goto fail;
>                 }
>                 printf("enqueue MAX_BULK objs\n");
>         -       ret = odph_ring_mp_enqueue_bulk(r, cur_src, MAX_BULK);
>         +       ret = shm_ring_mp_enqueue_bulk(r, cur_src, MAX_BULK);
>                 if (ret != 0) {
>                         LOG_ERR("mp_enq for %d obj failed\n", MAX_BULK);
>                         goto fail;
>                 }
>                 printf("dequeue 1 obj\n");
>         -       ret = odph_ring_mc_dequeue_bulk(r, cur_dst, 1);
>         +       ret = shm_ring_mc_dequeue_bulk(r, cur_dst, 1);
>                 cur_dst += 1;
>                 if (ret != 0) {
>                         LOG_ERR("mc_deq for 1 obj failed\n");
>                         goto fail;
>                 }
>                 printf("dequeue 2 objs\n");
>         -       ret = odph_ring_mc_dequeue_bulk(r, cur_dst, 2);
>         +       ret = shm_ring_mc_dequeue_bulk(r, cur_dst, 2);
>                 cur_dst += 2;
>                 if (ret != 0) {
>                         LOG_ERR("mc_deq for 2 obj failed\n");
>                         goto fail;
>                 }
>                 printf("dequeue MAX_BULK objs\n");
>         -       ret = odph_ring_mc_dequeue_bulk(r, cur_dst, MAX_BULK);
>         +       ret = shm_ring_mc_dequeue_bulk(r, cur_dst, MAX_BULK);
>                 cur_dst += MAX_BULK;
>                 if (ret != 0) {
>                         LOG_ERR("mc_deq for %d obj failed\n", MAX_BULK);
>         @@ -191,30 +191,30 @@ static int test_ring_basic(odph_ring_t *r)
>                 }
>
>                 printf("test watermark and default bulk enqueue /
>         dequeue\n");
>         -       odph_ring_set_water_mark(r, 20);
>         +       shm_ring_set_water_mark(r, 20);
>                 num_elems = 16;
>
>                 cur_src = src;
>                 cur_dst = dst;
>
>         -       ret = odph_ring_mp_enqueue_bulk(r, cur_src, num_elems);
>         +       ret = shm_ring_mp_enqueue_bulk(r, cur_src, num_elems);
>                 cur_src += num_elems;
>                 if (ret != 0) {
>                         LOG_ERR("Cannot enqueue\n");
>                         goto fail;
>                 }
>         -       ret = odph_ring_mp_enqueue_bulk(r, cur_src, num_elems);
>         +       ret = shm_ring_mp_enqueue_bulk(r, cur_src, num_elems);
>                 if (ret != -EDQUOT) {
>                         LOG_ERR("Watermark not exceeded\n");
>                         goto fail;
>                 }
>         -       ret = odph_ring_mc_dequeue_bulk(r, cur_dst, num_elems);
>         +       ret = shm_ring_mc_dequeue_bulk(r, cur_dst, num_elems);
>                 cur_dst += num_elems;
>                 if (ret != 0) {
>                         LOG_ERR("Cannot dequeue\n");
>                         goto fail;
>                 }
>         -       ret = odph_ring_mc_dequeue_bulk(r, cur_dst, num_elems);
>         +       ret = shm_ring_mc_dequeue_bulk(r, cur_dst, num_elems);
>                 cur_dst += num_elems;
>                 if (ret != 0) {
>                         LOG_ERR("Cannot dequeue2\n");
>         @@ -241,7 +241,7 @@ fail:
>          }
>
>          /* global shared ring used for stress testing */
>         -static odph_ring_t *r_stress;
>         +static shm_ring_t *r_stress;
>
>          /* Stress func for Multi producer only */
>          static int producer_fn(void)
>         @@ -260,7 +260,7 @@ static int producer_fn(void)
>                         src[i] = (void *)(unsigned long)i;
>
>                 do {
>         -               i = odph_ring_mp_enqueue_bulk(r_stress, src,
>         MAX_BULK);
>         +               i = shm_ring_mp_enqueue_bulk(r_stress, src,
>         MAX_BULK);
>                         if (i == 0) {
>                                 free(src);
>                                 return 0;
>         @@ -282,7 +282,7 @@ static int consumer_fn(void)
>                 }
>
>                 do {
>         -               i = odph_ring_mc_dequeue_bulk(r_stress, src,
>         MAX_BULK);
>         +               i = shm_ring_mc_dequeue_bulk(r_stress, src,
>         MAX_BULK);
>                         if (i == 0) {
>                                 for (i = 0; i < MAX_BULK; i++) {
>                                         if (src[i] != (void
>         *)(unsigned long)i) {
>         @@ -356,7 +356,7 @@ static void *test_ring(void *arg)
>                 ring_arg_t *parg = (ring_arg_t *)arg;
>                 int thr;
>                 char ring_name[ODPH_RING_NAMESIZE];
>         -       odph_ring_t *r;
>         +       shm_ring_t *r;
>                 int result = 0;
>
>                 thr = odp_thread_id();
>         @@ -367,7 +367,7 @@ static void *test_ring(void *arg)
>                 case ODP_RING_TEST_BASIC:
>                         snprintf(ring_name, sizeof(ring_name),
>         "test_ring_%i", thr);
>
>         -               r = odph_ring_create(ring_name, RING_SIZE,
>         +               r = shm_ring_create(ring_name, RING_SIZE,
>                                             0 /* not used, alignement
>                                                  taken care inside
>         func : todo */);
>                         if (r == NULL) {
>         @@ -376,7 +376,7 @@ static void *test_ring(void *arg)
>                                 break;
>                         }
>                         /* lookup ring from its name */
>         -               if (odph_ring_lookup(ring_name) != r) {
>         +               if (shm_ring_lookup(ring_name) != r) {
>                                 LOG_ERR("ring lookup failed\n");
>                                 result = -1;
>                                 break;
>         @@ -389,7 +389,7 @@ static void *test_ring(void *arg)
>                         }
>
>                         /* dump ring stats */
>         -               odph_ring_list_dump();
>         +               shm_ring_list_dump();
>
>                         break;
>
>         @@ -397,7 +397,7 @@ static void *test_ring(void *arg)
>         test_ring_stress(parg->stress_type);
>
>                         /* dump ring stats */
>         -               odph_ring_list_dump();
>         +               shm_ring_list_dump();
>                         break;
>
>                 default:
>         @@ -428,7 +428,7 @@ int main(int argc __attribute__((__unused__)),
>
>                 odp_print_system_info();
>
>         -       odph_ring_tailq_init();
>         +       shm_ring_tailq_init();
>
>                 rarg.thrdarg.numthrds = odp_cpu_count();
>
>         @@ -444,7 +444,7 @@ int main(int argc __attribute__((__unused__)),
>                 /* create a ring */
>                 snprintf(ring_name, sizeof(ring_name),
>         "test_ring_stress");
>
>         -       r_stress = odph_ring_create(ring_name, RING_SIZE,
>         +       r_stress = shm_ring_create(ring_name, RING_SIZE,
>                                         0 /* not used, alignement
>                                          taken care inside func : todo
>         */);
>                 if (r_stress == NULL) {
>         @@ -452,7 +452,7 @@ int main(int argc __attribute__((__unused__)),
>                         goto fail;
>                 }
>                 /* lookup ring from its name */
>         -       if (odph_ring_lookup(ring_name) != r_stress) {
>         +       if (shm_ring_lookup(ring_name) != r_stress) {
>                         LOG_ERR("ring lookup failed\n");
>                         goto fail;
>                 }
>         --
>         1.9.1
>
>         _______________________________________________
>         lng-odp mailing list
>         lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>         https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
>
>     _______________________________________________
>     lng-odp mailing list
>     lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
>
>
> -- 
> Mike Holmes
> Technical Manager - Linaro Networking Group
> Linaro.org <http://www.linaro.org/>***│ *Open source software for ARM SoCs
>
Mike Holmes Sept. 10, 2015, 6:39 p.m. UTC | #4
On 10 September 2015 at 08:13, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

> On 09/10/15 14:59, Mike Holmes wrote:
>
>>
>>
>> On 9 September 2015 at 23:18, Bill Fischofer <bill.fischofer@linaro.org
>> <mailto:bill.fischofer@linaro.org>> wrote:
>>
>>     Why shm_ring_xxx rather than odp_ring_xxx (or _odp_ring_xxx if
>>     these are internal APIs?)  That would seem to be consistent with
>>     other internal APIs.
>>
>>
>> I really like the prefix "_" for internal functions, its very clear and
>> low overhead in naming.
>>
>
> I planned to use ring for pktio. In general it's good to have even api for
> ring support as we plan to add some algorithms. So I'm not really sure what
> is better - put it to common layer or keep it in pktio until somebody will
> try to reuse it. I specially remove odp_ prefix to be understandable that
> it's some internal function. But I'm ok to rename it to any.
>

http://docs.opendataplane.org/master/linux-generic-doxygen-html/api_guide_lines.html#odp_internal

Looks like we do actually spell out the preference for "_"


>
> Maxim.
>
>
>>
>>
>>     On Wed, Sep 9, 2015 at 5:06 AM, Maxim Uvarov
>>     <maxim.uvarov@linaro.org <mailto:maxim.uvarov@linaro.org>> wrote:
>>
>>         Drop odph_ prefix due to it's not helper anymore and do not
>>         add odp_ prefix because it's not api.
>>
>>         Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org
>>         <mailto:maxim.uvarov@linaro.org>>
>>
>>         ---
>>          platform/linux-generic/include/odp_ring_internal.h | 64
>>         +++++++-------
>>          platform/linux-generic/pktio/ring.c     | 98
>>         +++++++++++-----------
>>          platform/linux-generic/test/ring/odp_ring_test.c  | 58
>>         ++++++-------
>>          3 files changed, 110 insertions(+), 110 deletions(-)
>>
>>         diff --git
>>         a/platform/linux-generic/include/odp_ring_internal.h
>>         b/platform/linux-generic/include/odp_ring_internal.h
>>         index 65c32ad..596bf9b 100644
>>         --- a/platform/linux-generic/include/odp_ring_internal.h
>>         +++ b/platform/linux-generic/include/odp_ring_internal.h
>>         @@ -103,7 +103,7 @@ extern "C" {
>>          #include <errno.h>
>>          #include <sys/queue.h>
>>
>>         -enum odph_ring_queue_behavior {
>>         +enum shm_ring_queue_behavior {
>>                 ODPH_RING_QUEUE_FIXED = 0, /**< Enq/Deq a fixed number
>>                                         of items from a ring */
>>                 ODPH_RING_QUEUE_VARIABLE   /**< Enq/Deq as many items
>>         @@ -123,9 +123,9 @@ enum odph_ring_queue_behavior {
>>           * values in a modulo-32bit base: that's why the overflow of
>>         the indexes is not
>>           * a problem.
>>           */
>>         -typedef struct odph_ring {
>>         +typedef struct shm_ring {
>>                 /** @private Next in list. */
>>         -       TAILQ_ENTRY(odph_ring) next;
>>         +       TAILQ_ENTRY(shm_ring) next;
>>
>>                 /** @private Name of the ring. */
>>                 char name[ODPH_RING_NAMESIZE];
>>         @@ -153,7 +153,7 @@ typedef struct odph_ring {
>>
>>                 /** @private Memory space of ring starts here. */
>>                 void *ring[0] ODP_ALIGNED_CACHE;
>>         -} odph_ring_t;
>>         +} shm_ring_t;
>>
>>
>>          #define ODPH_RING_F_SP_ENQ 0x0001 /* The default enqueue is
>>         "single-producer".*/
>>         @@ -191,7 +191,7 @@ typedef struct odph_ring {
>>           *    - EEXIST - a memzone with the same name already exists
>>           *    - ENOMEM - no appropriate memory area found in which to
>>         create memzone
>>           */
>>         -odph_ring_t *odph_ring_create(const char *name, unsigned count,
>>         +shm_ring_t *shm_ring_create(const char *name, unsigned count,
>>                                     unsigned flags);
>>
>>
>>         @@ -210,14 +210,14 @@ odph_ring_t *odph_ring_create(const char
>>         *name, unsigned count,
>>           * @return 0: Success; water mark changed.
>>           *             -EINVAL: Invalid water mark value.
>>           */
>>         -int odph_ring_set_water_mark(odph_ring_t *r, unsigned count);
>>         +int shm_ring_set_water_mark(shm_ring_t *r, unsigned count);
>>
>>          /**
>>           * Dump the status of the ring to the console.
>>           *
>>           * @param r A pointer to the ring structure.
>>           */
>>         -void odph_ring_dump(const odph_ring_t *r);
>>         +void shm_ring_dump(const shm_ring_t *r);
>>
>>          /**
>>           * Enqueue several objects on the ring (multi-producers safe).
>>         @@ -244,9 +244,9 @@ void odph_ring_dump(const odph_ring_t *r);
>>           *   if behavior = ODP_RING_QUEUE_VARIABLE
>>           *   - n: Actual number of objects enqueued.
>>           */
>>         -int __odph_ring_mp_do_enqueue(odph_ring_t *r, void * const
>>         *obj_table,
>>         +int __shm_ring_mp_do_enqueue(shm_ring_t *r, void * const
>>         *obj_table,
>>                                       unsigned n,
>>         -                             enum odph_ring_queue_behavior
>>         behavior);
>>         +                             enum shm_ring_queue_behavior
>>         behavior);
>>
>>          /**
>>           * Enqueue several objects on a ring (NOT multi-producers safe).
>>         @@ -270,9 +270,9 @@ int __odph_ring_mp_do_enqueue(odph_ring_t
>>         *r, void * const *obj_table,
>>           *   if behavior = ODP_RING_QUEUE_VARIABLE
>>           *   - n: Actual number of objects enqueued.
>>           */
>>         -int __odph_ring_sp_do_enqueue(odph_ring_t *r, void * const
>>         *obj_table,
>>         +int __shm_ring_sp_do_enqueue(shm_ring_t *r, void * const
>>         *obj_table,
>>                                       unsigned n,
>>         -                             enum odph_ring_queue_behavior
>>         behavior);
>>         +                             enum shm_ring_queue_behavior
>>         behavior);
>>
>>          /**
>>           * Dequeue several objects from a ring (multi-consumers
>>         safe). When
>>         @@ -301,9 +301,9 @@ int __odph_ring_sp_do_enqueue(odph_ring_t
>>         *r, void * const *obj_table,
>>           *   - n: Actual number of objects dequeued.
>>           */
>>
>>         -int __odph_ring_mc_do_dequeue(odph_ring_t *r, void **obj_table,
>>         +int __shm_ring_mc_do_dequeue(shm_ring_t *r, void **obj_table,
>>                                       unsigned n,
>>         -                             enum odph_ring_queue_behavior
>>         behavior);
>>         +                             enum shm_ring_queue_behavior
>>         behavior);
>>
>>          /**
>>           * Dequeue several objects from a ring (NOT multi-consumers
>>         safe).
>>         @@ -328,9 +328,9 @@ int __odph_ring_mc_do_dequeue(odph_ring_t
>>         *r, void **obj_table,
>>           *   if behavior = ODP_RING_QUEUE_VARIABLE
>>           *   - n: Actual number of objects dequeued.
>>           */
>>         -int __odph_ring_sc_do_dequeue(odph_ring_t *r, void **obj_table,
>>         +int __shm_ring_sc_do_dequeue(shm_ring_t *r, void **obj_table,
>>                                       unsigned n,
>>         -                             enum odph_ring_queue_behavior
>>         behavior);
>>         +                             enum shm_ring_queue_behavior
>>         behavior);
>>
>>          /**
>>           * Enqueue several objects on the ring (multi-producers safe).
>>         @@ -350,7 +350,7 @@ int __odph_ring_sc_do_dequeue(odph_ring_t
>>         *r, void **obj_table,
>>           *     high water mark is exceeded.
>>           *   - -ENOBUFS: Not enough room in the ring to enqueue, no
>>         object is enqueued.
>>           */
>>         -int odph_ring_mp_enqueue_bulk(odph_ring_t *r, void * const
>>         *obj_table,
>>         +int shm_ring_mp_enqueue_bulk(shm_ring_t *r, void * const
>>         *obj_table,
>>                                       unsigned n);
>>
>>          /**
>>         @@ -368,7 +368,7 @@ int odph_ring_mp_enqueue_bulk(odph_ring_t
>>         *r, void * const *obj_table,
>>           *     high water mark is exceeded.
>>           *   - -ENOBUFS: Not enough room in the ring to enqueue; no
>>         object is enqueued.
>>           */
>>         -int odph_ring_sp_enqueue_bulk(odph_ring_t *r, void * const
>>         *obj_table,
>>         +int shm_ring_sp_enqueue_bulk(shm_ring_t *r, void * const
>>         *obj_table,
>>                                       unsigned n);
>>
>>          /**
>>         @@ -388,7 +388,7 @@ int odph_ring_sp_enqueue_bulk(odph_ring_t
>>         *r, void * const *obj_table,
>>           *   - -ENOENT: Not enough entries in the ring to dequeue; no
>>         object is
>>           *     dequeued.
>>           */
>>         -int odph_ring_mc_dequeue_bulk(odph_ring_t *r, void
>>         **obj_table, unsigned n);
>>         +int shm_ring_mc_dequeue_bulk(shm_ring_t *r, void **obj_table,
>>         unsigned n);
>>
>>          /**
>>           * Dequeue several objects from a ring (NOT multi-consumers
>>         safe).
>>         @@ -405,7 +405,7 @@ int odph_ring_mc_dequeue_bulk(odph_ring_t
>>         *r, void **obj_table, unsigned n);
>>           *   - -ENOENT: Not enough entries in the ring to dequeue; no
>>         object is
>>           *     dequeued.
>>           */
>>         -int odph_ring_sc_dequeue_bulk(odph_ring_t *r, void
>>         **obj_table, unsigned n);
>>         +int shm_ring_sc_dequeue_bulk(shm_ring_t *r, void **obj_table,
>>         unsigned n);
>>
>>          /**
>>           * Test if a ring is full.
>>         @@ -416,7 +416,7 @@ int odph_ring_sc_dequeue_bulk(odph_ring_t
>>         *r, void **obj_table, unsigned n);
>>           *   - 1: The ring is full.
>>           *   - 0: The ring is not full.
>>           */
>>         -int odph_ring_full(const odph_ring_t *r);
>>         +int shm_ring_full(const shm_ring_t *r);
>>
>>          /**
>>           * Test if a ring is empty.
>>         @@ -427,7 +427,7 @@ int odph_ring_full(const odph_ring_t *r);
>>           *   - 1: The ring is empty.
>>           *   - 0: The ring is not empty.
>>           */
>>         -int odph_ring_empty(const odph_ring_t *r);
>>         +int shm_ring_empty(const shm_ring_t *r);
>>
>>          /**
>>           * Return the number of entries in a ring.
>>         @@ -437,7 +437,7 @@ int odph_ring_empty(const odph_ring_t *r);
>>           * @return
>>           *   The number of entries in the ring.
>>           */
>>         -unsigned odph_ring_count(const odph_ring_t *r);
>>         +unsigned shm_ring_count(const shm_ring_t *r);
>>
>>          /**
>>           * Return the number of free entries in a ring.
>>         @@ -447,14 +447,14 @@ unsigned odph_ring_count(const
>>         odph_ring_t *r);
>>           * @return
>>           *   The number of free entries in the ring.
>>           */
>>         -unsigned odph_ring_free_count(const odph_ring_t *r);
>>         +unsigned shm_ring_free_count(const shm_ring_t *r);
>>
>>          /**
>>           * search ring by name
>>           * @param name ring name to search
>>           * @return     pointer to ring otherwise NULL
>>           */
>>         -odph_ring_t *odph_ring_lookup(const char *name);
>>         +shm_ring_t *shm_ring_lookup(const char *name);
>>
>>          /**
>>           * Enqueue several objects on the ring (multi-producers safe).
>>         @@ -471,7 +471,7 @@ odph_ring_t *odph_ring_lookup(const char
>>         *name);
>>           * @return
>>           *   - n: Actual number of objects enqueued.
>>           */
>>         -int odph_ring_mp_enqueue_burst(odph_ring_t *r, void * const
>>         *obj_table,
>>         +int shm_ring_mp_enqueue_burst(shm_ring_t *r, void * const
>>         *obj_table,
>>                                        unsigned n);
>>
>>          /**
>>         @@ -486,7 +486,7 @@ int odph_ring_mp_enqueue_burst(odph_ring_t
>>         *r, void * const *obj_table,
>>           * @return
>>           *   - n: Actual number of objects enqueued.
>>           */
>>         -int odph_ring_sp_enqueue_burst(odph_ring_t *r, void * const
>>         *obj_table,
>>         +int shm_ring_sp_enqueue_burst(shm_ring_t *r, void * const
>>         *obj_table,
>>                                        unsigned n);
>>          /**
>>           * Enqueue several objects on a ring.
>>         @@ -504,7 +504,7 @@ int odph_ring_sp_enqueue_burst(odph_ring_t
>>         *r, void * const *obj_table,
>>           * @return
>>           *   - n: Actual number of objects enqueued.
>>           */
>>         -int odph_ring_enqueue_burst(odph_ring_t *r, void * const
>>         *obj_table,
>>         +int shm_ring_enqueue_burst(shm_ring_t *r, void * const
>>         *obj_table,
>>                                     unsigned n);
>>
>>          /**
>>         @@ -524,7 +524,7 @@ int odph_ring_enqueue_burst(odph_ring_t
>>         *r, void * const *obj_table,
>>           * @return
>>           *   - n: Actual number of objects dequeued, 0 if ring is empty
>>           */
>>         -int odph_ring_mc_dequeue_burst(odph_ring_t *r, void
>>         **obj_table, unsigned n);
>>         +int shm_ring_mc_dequeue_burst(shm_ring_t *r, void
>>         **obj_table, unsigned n);
>>
>>          /**
>>           * Dequeue several objects from a ring (NOT multi-consumers
>>         safe).When the
>>         @@ -540,7 +540,7 @@ int odph_ring_mc_dequeue_burst(odph_ring_t
>>         *r, void **obj_table, unsigned n);
>>           * @return
>>           *   - n: Actual number of objects dequeued, 0 if ring is empty
>>           */
>>         -int odph_ring_sc_dequeue_burst(odph_ring_t *r, void
>>         **obj_table, unsigned n);
>>         +int shm_ring_sc_dequeue_burst(shm_ring_t *r, void
>>         **obj_table, unsigned n);
>>
>>          /**
>>           * Dequeue multiple objects from a ring up to a maximum number.
>>         @@ -558,17 +558,17 @@ int
>>         odph_ring_sc_dequeue_burst(odph_ring_t *r, void **obj_table,
>>         unsigned n);
>>           * @return
>>           *   - Number of objects dequeued, or a negative error code
>>         on error
>>           */
>>         -int odph_ring_dequeue_burst(odph_ring_t *r, void **obj_table,
>>         unsigned n);
>>         +int shm_ring_dequeue_burst(shm_ring_t *r, void **obj_table,
>>         unsigned n);
>>
>>          /**
>>           * dump the status of all rings on the console
>>           */
>>         -void odph_ring_list_dump(void);
>>         +void shm_ring_list_dump(void);
>>
>>          /**
>>           * initialise ring tailq
>>           */
>>         -void odph_ring_tailq_init(void);
>>         +void shm_ring_tailq_init(void);
>>
>>          #ifdef __cplusplus
>>          }
>>         diff --git a/platform/linux-generic/pktio/ring.c
>>         b/platform/linux-generic/pktio/ring.c
>>         index 4bb6b4e..9ff457f 100644
>>         --- a/platform/linux-generic/pktio/ring.c
>>         +++ b/platform/linux-generic/pktio/ring.c
>>         @@ -80,7 +80,7 @@
>>          #include <odp_ring_internal.h>
>>          #include <odph_debug.h>
>>
>>         -static TAILQ_HEAD(, odph_ring) odp_ring_list;
>>         +static TAILQ_HEAD(, shm_ring) odp_ring_list;
>>
>>          #define RING_VAL_IS_POWER_2(x) ((((x) - 1) & (x)) == 0)
>>
>>         @@ -145,18 +145,18 @@ static TAILQ_HEAD(, odph_ring)
>>         odp_ring_list;
>>          static odp_rwlock_t    qlock;  /* rings tailq lock */
>>
>>          /* init tailq_ring */
>>         -void odph_ring_tailq_init(void)
>>         +void shm_ring_tailq_init(void)
>>          {
>>                 TAILQ_INIT(&odp_ring_list);
>>                 odp_rwlock_init(&qlock);
>>          }
>>
>>          /* create the ring */
>>         -odph_ring_t *
>>         -odph_ring_create(const char *name, unsigned count, unsigned
>>         flags)
>>         +shm_ring_t *
>>         +shm_ring_create(const char *name, unsigned count, unsigned flags)
>>          {
>>                 char ring_name[ODPH_RING_NAMESIZE];
>>         -       odph_ring_t *r;
>>         +       shm_ring_t *r;
>>                 size_t ring_size;
>>                 odp_shm_t shm;
>>
>>         @@ -168,7 +168,7 @@ odph_ring_create(const char *name,
>>         unsigned count, unsigned flags)
>>                 }
>>
>>                 snprintf(ring_name, sizeof(ring_name), "%s", name);
>>         -       ring_size = count*sizeof(void *)+sizeof(odph_ring_t);
>>         +       ring_size = count*sizeof(void *)+sizeof(shm_ring_t);
>>
>>                 odp_rwlock_write_lock(&qlock);
>>                 /* reserve a memory zone for this ring.*/
>>         @@ -205,7 +205,7 @@ odph_ring_create(const char *name,
>>         unsigned count, unsigned flags)
>>           * change the high water mark. If *count* is 0, water marking is
>>           * disabled
>>           */
>>         -int odph_ring_set_water_mark(odph_ring_t *r, unsigned count)
>>         +int shm_ring_set_water_mark(shm_ring_t *r, unsigned count)
>>          {
>>                 if (count >= r->prod.size)
>>                         return -EINVAL;
>>         @@ -221,8 +221,8 @@ int odph_ring_set_water_mark(odph_ring_t
>>         *r, unsigned count)
>>          /**
>>           * Enqueue several objects on the ring (multi-producers safe).
>>           */
>>         -int __odph_ring_mp_do_enqueue(odph_ring_t *r, void * const
>>         *obj_table,
>>         -                        unsigned n, enum
>>         odph_ring_queue_behavior behavior)
>>         +int __shm_ring_mp_do_enqueue(shm_ring_t *r, void * const
>>         *obj_table,
>>         +                        unsigned n, enum
>>         shm_ring_queue_behavior behavior)
>>          {
>>                 uint32_t prod_head, prod_next;
>>                 uint32_t cons_tail, free_entries;
>>         @@ -294,8 +294,8 @@ int __odph_ring_mp_do_enqueue(odph_ring_t
>>         *r, void * const *obj_table,
>>          /**
>>           * Enqueue several objects on a ring (NOT multi-producers safe).
>>           */
>>         -int __odph_ring_sp_do_enqueue(odph_ring_t *r, void * const
>>         *obj_table,
>>         -                            unsigned n, enum
>>         odph_ring_queue_behavior behavior)
>>         +int __shm_ring_sp_do_enqueue(shm_ring_t *r, void * const
>>         *obj_table,
>>         +                            unsigned n, enum
>>         shm_ring_queue_behavior behavior)
>>          {
>>                 uint32_t prod_head, cons_tail;
>>                 uint32_t prod_next, free_entries;
>>         @@ -348,8 +348,8 @@ int __odph_ring_sp_do_enqueue(odph_ring_t
>>         *r, void * const *obj_table,
>>           * Dequeue several objects from a ring (multi-consumers safe).
>>           */
>>
>>         -int __odph_ring_mc_do_dequeue(odph_ring_t *r, void **obj_table,
>>         -                        unsigned n, enum
>>         odph_ring_queue_behavior behavior)
>>         +int __shm_ring_mc_do_dequeue(shm_ring_t *r, void **obj_table,
>>         +                        unsigned n, enum
>>         shm_ring_queue_behavior behavior)
>>          {
>>                 uint32_t cons_head, prod_tail;
>>                 uint32_t cons_next, entries;
>>         @@ -412,8 +412,8 @@ int __odph_ring_mc_do_dequeue(odph_ring_t
>>         *r, void **obj_table,
>>          /**
>>           * Dequeue several objects from a ring (NOT multi-consumers
>>         safe).
>>           */
>>         -int __odph_ring_sc_do_dequeue(odph_ring_t *r, void **obj_table,
>>         -                            unsigned n, enum
>>         odph_ring_queue_behavior behavior)
>>         +int __shm_ring_sc_do_dequeue(shm_ring_t *r, void **obj_table,
>>         +                            unsigned n, enum
>>         shm_ring_queue_behavior behavior)
>>          {
>>                 uint32_t cons_head, prod_tail;
>>                 uint32_t cons_next, entries;
>>         @@ -454,45 +454,45 @@ int
>>         __odph_ring_sc_do_dequeue(odph_ring_t *r, void **obj_table,
>>          /**
>>           * Enqueue several objects on the ring (multi-producers safe).
>>           */
>>         -int odph_ring_mp_enqueue_bulk(odph_ring_t *r, void * const
>>         *obj_table,
>>         +int shm_ring_mp_enqueue_bulk(shm_ring_t *r, void * const
>>         *obj_table,
>>                                         unsigned n)
>>          {
>>         -       return __odph_ring_mp_do_enqueue(r, obj_table, n,
>>         +       return __shm_ring_mp_do_enqueue(r, obj_table, n,
>>          ODPH_RING_QUEUE_FIXED);
>>          }
>>
>>          /**
>>           * Enqueue several objects on a ring (NOT multi-producers safe).
>>           */
>>         -int odph_ring_sp_enqueue_bulk(odph_ring_t *r, void * const
>>         *obj_table,
>>         +int shm_ring_sp_enqueue_bulk(shm_ring_t *r, void * const
>>         *obj_table,
>>                                      unsigned n)
>>          {
>>         -       return __odph_ring_sp_do_enqueue(r, obj_table, n,
>>         +       return __shm_ring_sp_do_enqueue(r, obj_table, n,
>>          ODPH_RING_QUEUE_FIXED);
>>          }
>>
>>          /**
>>           * Dequeue several objects from a ring (multi-consumers safe).
>>           */
>>         -int odph_ring_mc_dequeue_bulk(odph_ring_t *r, void
>>         **obj_table, unsigned n)
>>         +int shm_ring_mc_dequeue_bulk(shm_ring_t *r, void **obj_table,
>>         unsigned n)
>>          {
>>         -       return __odph_ring_mc_do_dequeue(r, obj_table, n,
>>         +       return __shm_ring_mc_do_dequeue(r, obj_table, n,
>>          ODPH_RING_QUEUE_FIXED);
>>          }
>>
>>          /**
>>           * Dequeue several objects from a ring (NOT multi-consumers
>>         safe).
>>           */
>>         -int odph_ring_sc_dequeue_bulk(odph_ring_t *r, void
>>         **obj_table, unsigned n)
>>         +int shm_ring_sc_dequeue_bulk(shm_ring_t *r, void **obj_table,
>>         unsigned n)
>>          {
>>         -       return __odph_ring_sc_do_dequeue(r, obj_table, n,
>>         +       return __shm_ring_sc_do_dequeue(r, obj_table, n,
>>          ODPH_RING_QUEUE_FIXED);
>>          }
>>
>>          /**
>>           * Test if a ring is full.
>>           */
>>         -int odph_ring_full(const odph_ring_t *r)
>>         +int shm_ring_full(const shm_ring_t *r)
>>          {
>>                 uint32_t prod_tail = r->prod.tail;
>>                 uint32_t cons_tail = r->cons.tail;
>>         @@ -502,7 +502,7 @@ int odph_ring_full(const odph_ring_t *r)
>>          /**
>>           * Test if a ring is empty.
>>           */
>>         -int odph_ring_empty(const odph_ring_t *r)
>>         +int shm_ring_empty(const shm_ring_t *r)
>>          {
>>                 uint32_t prod_tail = r->prod.tail;
>>                 uint32_t cons_tail = r->cons.tail;
>>         @@ -512,7 +512,7 @@ int odph_ring_empty(const odph_ring_t *r)
>>          /**
>>           * Return the number of entries in a ring.
>>           */
>>         -unsigned odph_ring_count(const odph_ring_t *r)
>>         +unsigned shm_ring_count(const shm_ring_t *r)
>>          {
>>                 uint32_t prod_tail = r->prod.tail;
>>                 uint32_t cons_tail = r->cons.tail;
>>         @@ -522,7 +522,7 @@ unsigned odph_ring_count(const odph_ring_t *r)
>>          /**
>>           * Return the number of free entries in a ring.
>>           */
>>         -unsigned odph_ring_free_count(const odph_ring_t *r)
>>         +unsigned shm_ring_free_count(const shm_ring_t *r)
>>          {
>>                 uint32_t prod_tail = r->prod.tail;
>>                 uint32_t cons_tail = r->cons.tail;
>>         @@ -530,7 +530,7 @@ unsigned odph_ring_free_count(const
>>         odph_ring_t *r)
>>          }
>>
>>          /* dump the status of the ring on the console */
>>         -void odph_ring_dump(const odph_ring_t *r)
>>         +void shm_ring_dump(const shm_ring_t *r)
>>          {
>>                 ODPH_DBG("ring <%s>@%p\n", r->name, r);
>>                 ODPH_DBG("  flags=%x\n", r->flags);
>>         @@ -539,8 +539,8 @@ void odph_ring_dump(const odph_ring_t *r)
>>                 ODPH_DBG("  ch=%" PRIu32 "\n", r->cons.head);
>>                 ODPH_DBG("  pt=%" PRIu32 "\n", r->prod.tail);
>>                 ODPH_DBG("  ph=%" PRIu32 "\n", r->prod.head);
>>         -       ODPH_DBG("  used=%u\n", odph_ring_count(r));
>>         -       ODPH_DBG("  avail=%u\n", odph_ring_free_count(r));
>>         +       ODPH_DBG("  used=%u\n", shm_ring_count(r));
>>         +       ODPH_DBG("  avail=%u\n", shm_ring_free_count(r));
>>                 if (r->prod.watermark == r->prod.size)
>>                         ODPH_DBG("  watermark=0\n");
>>                 else
>>         @@ -548,23 +548,23 @@ void odph_ring_dump(const odph_ring_t *r)
>>          }
>>
>>          /* dump the status of all rings on the console */
>>         -void odph_ring_list_dump(void)
>>         +void shm_ring_list_dump(void)
>>          {
>>         -       const odph_ring_t *mp = NULL;
>>         +       const shm_ring_t *mp = NULL;
>>
>>                 odp_rwlock_read_lock(&qlock);
>>
>>                 TAILQ_FOREACH(mp, &odp_ring_list, next) {
>>         -               odph_ring_dump(mp);
>>         +               shm_ring_dump(mp);
>>                 }
>>
>>                 odp_rwlock_read_unlock(&qlock);
>>          }
>>
>>          /* search a ring from its name */
>>         -odph_ring_t *odph_ring_lookup(const char *name)
>>         +shm_ring_t *shm_ring_lookup(const char *name)
>>          {
>>         -       odph_ring_t *r;
>>         +       shm_ring_t *r;
>>
>>                 odp_rwlock_read_lock(&qlock);
>>                 TAILQ_FOREACH(r, &odp_ring_list, next) {
>>         @@ -579,60 +579,60 @@ odph_ring_t *odph_ring_lookup(const char
>>         *name)
>>          /**
>>           * Enqueue several objects on the ring (multi-producers safe).
>>           */
>>         -int odph_ring_mp_enqueue_burst(odph_ring_t *r, void * const
>>         *obj_table,
>>         +int shm_ring_mp_enqueue_burst(shm_ring_t *r, void * const
>>         *obj_table,
>>                                       unsigned n)
>>          {
>>         -       return __odph_ring_mp_do_enqueue(r, obj_table, n,
>>         +       return __shm_ring_mp_do_enqueue(r, obj_table, n,
>>          ODPH_RING_QUEUE_VARIABLE);
>>          }
>>
>>          /**
>>           * Enqueue several objects on a ring (NOT multi-producers safe).
>>           */
>>         -int odph_ring_sp_enqueue_burst(odph_ring_t *r, void * const
>>         *obj_table,
>>         +int shm_ring_sp_enqueue_burst(shm_ring_t *r, void * const
>>         *obj_table,
>>                                       unsigned n)
>>          {
>>         -       return __odph_ring_sp_do_enqueue(r, obj_table, n,
>>         +       return __shm_ring_sp_do_enqueue(r, obj_table, n,
>>         ODPH_RING_QUEUE_VARIABLE);
>>          }
>>
>>          /**
>>           * Enqueue several objects on a ring.
>>           */
>>         -int odph_ring_enqueue_burst(odph_ring_t *r, void * const
>>         *obj_table,
>>         +int shm_ring_enqueue_burst(shm_ring_t *r, void * const
>>         *obj_table,
>>                                    unsigned n)
>>          {
>>                 if (r->prod.sp_enqueue)
>>         -               return odph_ring_sp_enqueue_burst(r,
>>         obj_table, n);
>>         +               return shm_ring_sp_enqueue_burst(r, obj_table, n);
>>                 else
>>         -               return odph_ring_mp_enqueue_burst(r,
>>         obj_table, n);
>>         +               return shm_ring_mp_enqueue_burst(r, obj_table, n);
>>          }
>>
>>          /**
>>           * Dequeue several objects from a ring (multi-consumers safe).
>>           */
>>         -int odph_ring_mc_dequeue_burst(odph_ring_t *r, void
>>         **obj_table, unsigned n)
>>         +int shm_ring_mc_dequeue_burst(shm_ring_t *r, void
>>         **obj_table, unsigned n)
>>          {
>>         -       return __odph_ring_mc_do_dequeue(r, obj_table, n,
>>         +       return __shm_ring_mc_do_dequeue(r, obj_table, n,
>>         ODPH_RING_QUEUE_VARIABLE);
>>          }
>>
>>          /**
>>           * Dequeue several objects from a ring (NOT multi-consumers
>>         safe).
>>           */
>>         -int odph_ring_sc_dequeue_burst(odph_ring_t *r, void
>>         **obj_table, unsigned n)
>>         +int shm_ring_sc_dequeue_burst(shm_ring_t *r, void
>>         **obj_table, unsigned n)
>>          {
>>         -       return __odph_ring_sc_do_dequeue(r, obj_table, n,
>>         +       return __shm_ring_sc_do_dequeue(r, obj_table, n,
>>          ODPH_RING_QUEUE_VARIABLE);
>>          }
>>
>>          /**
>>           * Dequeue multiple objects from a ring up to a maximum number.
>>           */
>>         -int odph_ring_dequeue_burst(odph_ring_t *r, void **obj_table,
>>         unsigned n)
>>         +int shm_ring_dequeue_burst(shm_ring_t *r, void **obj_table,
>>         unsigned n)
>>          {
>>                 if (r->cons.sc_dequeue)
>>         -               return odph_ring_sc_dequeue_burst(r,
>>         obj_table, n);
>>         +               return shm_ring_sc_dequeue_burst(r, obj_table, n);
>>                 else
>>         -               return odph_ring_mc_dequeue_burst(r,
>>         obj_table, n);
>>         +               return shm_ring_mc_dequeue_burst(r, obj_table, n);
>>          }
>>         diff --git a/platform/linux-generic/test/ring/odp_ring_test.c
>>         b/platform/linux-generic/test/ring/odp_ring_test.c
>>         index cec8221..799f5c6 100644
>>         --- a/platform/linux-generic/test/ring/odp_ring_test.c
>>         +++ b/platform/linux-generic/test/ring/odp_ring_test.c
>>         @@ -57,7 +57,7 @@
>>
>>          #define RING_TEST_BASIC
>>
>>         -static int test_ring_basic(odph_ring_t *r)
>>         +static int test_ring_basic(shm_ring_t *r)
>>          {
>>                 void **src = NULL, **cur_src = NULL, **dst = NULL,
>>         **cur_dst = NULL;
>>                 int ret;
>>         @@ -86,7 +86,7 @@ static int test_ring_basic(odph_ring_t *r)
>>
>>                 printf("Test SP & SC basic functions\n");
>>                 printf("enqueue 1 obj\n");
>>         -       ret = odph_ring_sp_enqueue_burst(r, cur_src, 1);
>>         +       ret = shm_ring_sp_enqueue_burst(r, cur_src, 1);
>>                 cur_src += 1;
>>                 if ((ret & ODPH_RING_SZ_MASK) != 1) {
>>                         LOG_ERR("sp_enq for 1 obj failed\n");
>>         @@ -94,7 +94,7 @@ static int test_ring_basic(odph_ring_t *r)
>>                 }
>>
>>                 printf("enqueue 2 objs\n");
>>         -       ret = odph_ring_sp_enqueue_burst(r, cur_src, 2);
>>         +       ret = shm_ring_sp_enqueue_burst(r, cur_src, 2);
>>                 cur_src += 2;
>>                 if ((ret & ODPH_RING_SZ_MASK) != 2) {
>>                         LOG_ERR("sp_enq for 2 obj failed\n");
>>         @@ -102,14 +102,14 @@ static int test_ring_basic(odph_ring_t *r)
>>                 }
>>
>>                 printf("enqueue MAX_BULK objs\n");
>>         -       ret = odph_ring_sp_enqueue_burst(r, cur_src, MAX_BULK);
>>         +       ret = shm_ring_sp_enqueue_burst(r, cur_src, MAX_BULK);
>>                 if ((ret & ODPH_RING_SZ_MASK) != MAX_BULK) {
>>                         LOG_ERR("sp_enq for %d obj failed\n", MAX_BULK);
>>                         goto fail;
>>                 }
>>
>>                 printf("dequeue 1 obj\n");
>>         -       ret = odph_ring_sc_dequeue_burst(r, cur_dst, 1);
>>         +       ret = shm_ring_sc_dequeue_burst(r, cur_dst, 1);
>>                 cur_dst += 1;
>>                 if ((ret & ODPH_RING_SZ_MASK) != 1) {
>>                         LOG_ERR("sc_deq for 1 obj failed\n");
>>         @@ -117,7 +117,7 @@ static int test_ring_basic(odph_ring_t *r)
>>                 }
>>
>>                 printf("dequeue 2 objs\n");
>>         -       ret = odph_ring_sc_dequeue_burst(r, cur_dst, 2);
>>         +       ret = shm_ring_sc_dequeue_burst(r, cur_dst, 2);
>>                 cur_dst += 2;
>>                 if ((ret & ODPH_RING_SZ_MASK) != 2) {
>>                         LOG_ERR("sc_deq for 2 obj failed\n");
>>         @@ -125,7 +125,7 @@ static int test_ring_basic(odph_ring_t *r)
>>                 }
>>
>>                 printf("dequeue MAX_BULK objs\n");
>>         -       ret = odph_ring_sc_dequeue_burst(r, cur_dst, MAX_BULK);
>>         +       ret = shm_ring_sc_dequeue_burst(r, cur_dst, MAX_BULK);
>>                 cur_dst += MAX_BULK;
>>                 if ((ret & ODPH_RING_SZ_MASK) != MAX_BULK) {
>>                         LOG_ERR("sc_deq for %d obj failed\n", MAX_BULK);
>>         @@ -144,41 +144,41 @@ static int test_ring_basic(odph_ring_t *r)
>>                 printf("Test MP & MC basic functions\n");
>>
>>                 printf("enqueue 1 obj\n");
>>         -       ret = odph_ring_mp_enqueue_bulk(r, cur_src, 1);
>>         +       ret = shm_ring_mp_enqueue_bulk(r, cur_src, 1);
>>                 cur_src += 1;
>>                 if (ret != 0) {
>>                         LOG_ERR("mp_enq for 1 obj failed\n");
>>                         goto fail;
>>                 }
>>                 printf("enqueue 2 objs\n");
>>         -       ret = odph_ring_mp_enqueue_bulk(r, cur_src, 2);
>>         +       ret = shm_ring_mp_enqueue_bulk(r, cur_src, 2);
>>                 cur_src += 2;
>>                 if (ret != 0) {
>>                         LOG_ERR("mp_enq for 2 obj failed\n");
>>                         goto fail;
>>                 }
>>                 printf("enqueue MAX_BULK objs\n");
>>         -       ret = odph_ring_mp_enqueue_bulk(r, cur_src, MAX_BULK);
>>         +       ret = shm_ring_mp_enqueue_bulk(r, cur_src, MAX_BULK);
>>                 if (ret != 0) {
>>                         LOG_ERR("mp_enq for %d obj failed\n", MAX_BULK);
>>                         goto fail;
>>                 }
>>                 printf("dequeue 1 obj\n");
>>         -       ret = odph_ring_mc_dequeue_bulk(r, cur_dst, 1);
>>         +       ret = shm_ring_mc_dequeue_bulk(r, cur_dst, 1);
>>                 cur_dst += 1;
>>                 if (ret != 0) {
>>                         LOG_ERR("mc_deq for 1 obj failed\n");
>>                         goto fail;
>>                 }
>>                 printf("dequeue 2 objs\n");
>>         -       ret = odph_ring_mc_dequeue_bulk(r, cur_dst, 2);
>>         +       ret = shm_ring_mc_dequeue_bulk(r, cur_dst, 2);
>>                 cur_dst += 2;
>>                 if (ret != 0) {
>>                         LOG_ERR("mc_deq for 2 obj failed\n");
>>                         goto fail;
>>                 }
>>                 printf("dequeue MAX_BULK objs\n");
>>         -       ret = odph_ring_mc_dequeue_bulk(r, cur_dst, MAX_BULK);
>>         +       ret = shm_ring_mc_dequeue_bulk(r, cur_dst, MAX_BULK);
>>                 cur_dst += MAX_BULK;
>>                 if (ret != 0) {
>>                         LOG_ERR("mc_deq for %d obj failed\n", MAX_BULK);
>>         @@ -191,30 +191,30 @@ static int test_ring_basic(odph_ring_t *r)
>>                 }
>>
>>                 printf("test watermark and default bulk enqueue /
>>         dequeue\n");
>>         -       odph_ring_set_water_mark(r, 20);
>>         +       shm_ring_set_water_mark(r, 20);
>>                 num_elems = 16;
>>
>>                 cur_src = src;
>>                 cur_dst = dst;
>>
>>         -       ret = odph_ring_mp_enqueue_bulk(r, cur_src, num_elems);
>>         +       ret = shm_ring_mp_enqueue_bulk(r, cur_src, num_elems);
>>                 cur_src += num_elems;
>>                 if (ret != 0) {
>>                         LOG_ERR("Cannot enqueue\n");
>>                         goto fail;
>>                 }
>>         -       ret = odph_ring_mp_enqueue_bulk(r, cur_src, num_elems);
>>         +       ret = shm_ring_mp_enqueue_bulk(r, cur_src, num_elems);
>>                 if (ret != -EDQUOT) {
>>                         LOG_ERR("Watermark not exceeded\n");
>>                         goto fail;
>>                 }
>>         -       ret = odph_ring_mc_dequeue_bulk(r, cur_dst, num_elems);
>>         +       ret = shm_ring_mc_dequeue_bulk(r, cur_dst, num_elems);
>>                 cur_dst += num_elems;
>>                 if (ret != 0) {
>>                         LOG_ERR("Cannot dequeue\n");
>>                         goto fail;
>>                 }
>>         -       ret = odph_ring_mc_dequeue_bulk(r, cur_dst, num_elems);
>>         +       ret = shm_ring_mc_dequeue_bulk(r, cur_dst, num_elems);
>>                 cur_dst += num_elems;
>>                 if (ret != 0) {
>>                         LOG_ERR("Cannot dequeue2\n");
>>         @@ -241,7 +241,7 @@ fail:
>>          }
>>
>>          /* global shared ring used for stress testing */
>>         -static odph_ring_t *r_stress;
>>         +static shm_ring_t *r_stress;
>>
>>          /* Stress func for Multi producer only */
>>          static int producer_fn(void)
>>         @@ -260,7 +260,7 @@ static int producer_fn(void)
>>                         src[i] = (void *)(unsigned long)i;
>>
>>                 do {
>>         -               i = odph_ring_mp_enqueue_bulk(r_stress, src,
>>         MAX_BULK);
>>         +               i = shm_ring_mp_enqueue_bulk(r_stress, src,
>>         MAX_BULK);
>>                         if (i == 0) {
>>                                 free(src);
>>                                 return 0;
>>         @@ -282,7 +282,7 @@ static int consumer_fn(void)
>>                 }
>>
>>                 do {
>>         -               i = odph_ring_mc_dequeue_bulk(r_stress, src,
>>         MAX_BULK);
>>         +               i = shm_ring_mc_dequeue_bulk(r_stress, src,
>>         MAX_BULK);
>>                         if (i == 0) {
>>                                 for (i = 0; i < MAX_BULK; i++) {
>>                                         if (src[i] != (void
>>         *)(unsigned long)i) {
>>         @@ -356,7 +356,7 @@ static void *test_ring(void *arg)
>>                 ring_arg_t *parg = (ring_arg_t *)arg;
>>                 int thr;
>>                 char ring_name[ODPH_RING_NAMESIZE];
>>         -       odph_ring_t *r;
>>         +       shm_ring_t *r;
>>                 int result = 0;
>>
>>                 thr = odp_thread_id();
>>         @@ -367,7 +367,7 @@ static void *test_ring(void *arg)
>>                 case ODP_RING_TEST_BASIC:
>>                         snprintf(ring_name, sizeof(ring_name),
>>         "test_ring_%i", thr);
>>
>>         -               r = odph_ring_create(ring_name, RING_SIZE,
>>         +               r = shm_ring_create(ring_name, RING_SIZE,
>>                                             0 /* not used, alignement
>>                                                  taken care inside
>>         func : todo */);
>>                         if (r == NULL) {
>>         @@ -376,7 +376,7 @@ static void *test_ring(void *arg)
>>                                 break;
>>                         }
>>                         /* lookup ring from its name */
>>         -               if (odph_ring_lookup(ring_name) != r) {
>>         +               if (shm_ring_lookup(ring_name) != r) {
>>                                 LOG_ERR("ring lookup failed\n");
>>                                 result = -1;
>>                                 break;
>>         @@ -389,7 +389,7 @@ static void *test_ring(void *arg)
>>                         }
>>
>>                         /* dump ring stats */
>>         -               odph_ring_list_dump();
>>         +               shm_ring_list_dump();
>>
>>                         break;
>>
>>         @@ -397,7 +397,7 @@ static void *test_ring(void *arg)
>>         test_ring_stress(parg->stress_type);
>>
>>                         /* dump ring stats */
>>         -               odph_ring_list_dump();
>>         +               shm_ring_list_dump();
>>                         break;
>>
>>                 default:
>>         @@ -428,7 +428,7 @@ int main(int argc __attribute__((__unused__)),
>>
>>                 odp_print_system_info();
>>
>>         -       odph_ring_tailq_init();
>>         +       shm_ring_tailq_init();
>>
>>                 rarg.thrdarg.numthrds = odp_cpu_count();
>>
>>         @@ -444,7 +444,7 @@ int main(int argc __attribute__((__unused__)),
>>                 /* create a ring */
>>                 snprintf(ring_name, sizeof(ring_name),
>>         "test_ring_stress");
>>
>>         -       r_stress = odph_ring_create(ring_name, RING_SIZE,
>>         +       r_stress = shm_ring_create(ring_name, RING_SIZE,
>>                                         0 /* not used, alignement
>>                                          taken care inside func : todo
>>         */);
>>                 if (r_stress == NULL) {
>>         @@ -452,7 +452,7 @@ int main(int argc __attribute__((__unused__)),
>>                         goto fail;
>>                 }
>>                 /* lookup ring from its name */
>>         -       if (odph_ring_lookup(ring_name) != r_stress) {
>>         +       if (shm_ring_lookup(ring_name) != r_stress) {
>>                         LOG_ERR("ring lookup failed\n");
>>                         goto fail;
>>                 }
>>         --
>>         1.9.1
>>
>>         _______________________________________________
>>         lng-odp mailing list
>>         lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>>         https://lists.linaro.org/mailman/listinfo/lng-odp
>>
>>
>>
>>     _______________________________________________
>>     lng-odp mailing list
>>     lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>>     https://lists.linaro.org/mailman/listinfo/lng-odp
>>
>>
>>
>>
>> --
>> Mike Holmes
>> Technical Manager - Linaro Networking Group
>> Linaro.org <http://www.linaro.org/>***│ *Open source software for ARM
>> SoCs
>>
>>
>
diff mbox

Patch

diff --git a/platform/linux-generic/include/odp_ring_internal.h b/platform/linux-generic/include/odp_ring_internal.h
index 65c32ad..596bf9b 100644
--- a/platform/linux-generic/include/odp_ring_internal.h
+++ b/platform/linux-generic/include/odp_ring_internal.h
@@ -103,7 +103,7 @@  extern "C" {
 #include <errno.h>
 #include <sys/queue.h>
 
-enum odph_ring_queue_behavior {
+enum shm_ring_queue_behavior {
 	ODPH_RING_QUEUE_FIXED = 0, /**< Enq/Deq a fixed number
 				of items from a ring */
 	ODPH_RING_QUEUE_VARIABLE   /**< Enq/Deq as many items
@@ -123,9 +123,9 @@  enum odph_ring_queue_behavior {
  * values in a modulo-32bit base: that's why the overflow of the indexes is not
  * a problem.
  */
-typedef struct odph_ring {
+typedef struct shm_ring {
 	/** @private Next in list. */
-	TAILQ_ENTRY(odph_ring) next;
+	TAILQ_ENTRY(shm_ring) next;
 
 	/** @private Name of the ring. */
 	char name[ODPH_RING_NAMESIZE];
@@ -153,7 +153,7 @@  typedef struct odph_ring {
 
 	/** @private Memory space of ring starts here. */
 	void *ring[0] ODP_ALIGNED_CACHE;
-} odph_ring_t;
+} shm_ring_t;
 
 
 #define ODPH_RING_F_SP_ENQ 0x0001 /* The default enqueue is "single-producer".*/
@@ -191,7 +191,7 @@  typedef struct odph_ring {
  *    - EEXIST - a memzone with the same name already exists
  *    - ENOMEM - no appropriate memory area found in which to create memzone
  */
-odph_ring_t *odph_ring_create(const char *name, unsigned count,
+shm_ring_t *shm_ring_create(const char *name, unsigned count,
 			    unsigned flags);
 
 
@@ -210,14 +210,14 @@  odph_ring_t *odph_ring_create(const char *name, unsigned count,
  * @return 0: Success; water mark changed.
  *		-EINVAL: Invalid water mark value.
  */
-int odph_ring_set_water_mark(odph_ring_t *r, unsigned count);
+int shm_ring_set_water_mark(shm_ring_t *r, unsigned count);
 
 /**
  * Dump the status of the ring to the console.
  *
  * @param r A pointer to the ring structure.
  */
-void odph_ring_dump(const odph_ring_t *r);
+void shm_ring_dump(const shm_ring_t *r);
 
 /**
  * Enqueue several objects on the ring (multi-producers safe).
@@ -244,9 +244,9 @@  void odph_ring_dump(const odph_ring_t *r);
  *   if behavior = ODP_RING_QUEUE_VARIABLE
  *   - n: Actual number of objects enqueued.
  */
-int __odph_ring_mp_do_enqueue(odph_ring_t *r, void * const *obj_table,
+int __shm_ring_mp_do_enqueue(shm_ring_t *r, void * const *obj_table,
 			      unsigned n,
-			      enum odph_ring_queue_behavior behavior);
+			      enum shm_ring_queue_behavior behavior);
 
 /**
  * Enqueue several objects on a ring (NOT multi-producers safe).
@@ -270,9 +270,9 @@  int __odph_ring_mp_do_enqueue(odph_ring_t *r, void * const *obj_table,
  *   if behavior = ODP_RING_QUEUE_VARIABLE
  *   - n: Actual number of objects enqueued.
  */
-int __odph_ring_sp_do_enqueue(odph_ring_t *r, void * const *obj_table,
+int __shm_ring_sp_do_enqueue(shm_ring_t *r, void * const *obj_table,
 			      unsigned n,
-			      enum odph_ring_queue_behavior behavior);
+			      enum shm_ring_queue_behavior behavior);
 
 /**
  * Dequeue several objects from a ring (multi-consumers safe). When
@@ -301,9 +301,9 @@  int __odph_ring_sp_do_enqueue(odph_ring_t *r, void * const *obj_table,
  *   - n: Actual number of objects dequeued.
  */
 
-int __odph_ring_mc_do_dequeue(odph_ring_t *r, void **obj_table,
+int __shm_ring_mc_do_dequeue(shm_ring_t *r, void **obj_table,
 			      unsigned n,
-			      enum odph_ring_queue_behavior behavior);
+			      enum shm_ring_queue_behavior behavior);
 
 /**
  * Dequeue several objects from a ring (NOT multi-consumers safe).
@@ -328,9 +328,9 @@  int __odph_ring_mc_do_dequeue(odph_ring_t *r, void **obj_table,
  *   if behavior = ODP_RING_QUEUE_VARIABLE
  *   - n: Actual number of objects dequeued.
  */
-int __odph_ring_sc_do_dequeue(odph_ring_t *r, void **obj_table,
+int __shm_ring_sc_do_dequeue(shm_ring_t *r, void **obj_table,
 			      unsigned n,
-			      enum odph_ring_queue_behavior behavior);
+			      enum shm_ring_queue_behavior behavior);
 
 /**
  * Enqueue several objects on the ring (multi-producers safe).
@@ -350,7 +350,7 @@  int __odph_ring_sc_do_dequeue(odph_ring_t *r, void **obj_table,
  *     high water mark is exceeded.
  *   - -ENOBUFS: Not enough room in the ring to enqueue, no object is enqueued.
  */
-int odph_ring_mp_enqueue_bulk(odph_ring_t *r, void * const *obj_table,
+int shm_ring_mp_enqueue_bulk(shm_ring_t *r, void * const *obj_table,
 			      unsigned n);
 
 /**
@@ -368,7 +368,7 @@  int odph_ring_mp_enqueue_bulk(odph_ring_t *r, void * const *obj_table,
  *     high water mark is exceeded.
  *   - -ENOBUFS: Not enough room in the ring to enqueue; no object is enqueued.
  */
-int odph_ring_sp_enqueue_bulk(odph_ring_t *r, void * const *obj_table,
+int shm_ring_sp_enqueue_bulk(shm_ring_t *r, void * const *obj_table,
 			      unsigned n);
 
 /**
@@ -388,7 +388,7 @@  int odph_ring_sp_enqueue_bulk(odph_ring_t *r, void * const *obj_table,
  *   - -ENOENT: Not enough entries in the ring to dequeue; no object is
  *     dequeued.
  */
-int odph_ring_mc_dequeue_bulk(odph_ring_t *r, void **obj_table, unsigned n);
+int shm_ring_mc_dequeue_bulk(shm_ring_t *r, void **obj_table, unsigned n);
 
 /**
  * Dequeue several objects from a ring (NOT multi-consumers safe).
@@ -405,7 +405,7 @@  int odph_ring_mc_dequeue_bulk(odph_ring_t *r, void **obj_table, unsigned n);
  *   - -ENOENT: Not enough entries in the ring to dequeue; no object is
  *     dequeued.
  */
-int odph_ring_sc_dequeue_bulk(odph_ring_t *r, void **obj_table, unsigned n);
+int shm_ring_sc_dequeue_bulk(shm_ring_t *r, void **obj_table, unsigned n);
 
 /**
  * Test if a ring is full.
@@ -416,7 +416,7 @@  int odph_ring_sc_dequeue_bulk(odph_ring_t *r, void **obj_table, unsigned n);
  *   - 1: The ring is full.
  *   - 0: The ring is not full.
  */
-int odph_ring_full(const odph_ring_t *r);
+int shm_ring_full(const shm_ring_t *r);
 
 /**
  * Test if a ring is empty.
@@ -427,7 +427,7 @@  int odph_ring_full(const odph_ring_t *r);
  *   - 1: The ring is empty.
  *   - 0: The ring is not empty.
  */
-int odph_ring_empty(const odph_ring_t *r);
+int shm_ring_empty(const shm_ring_t *r);
 
 /**
  * Return the number of entries in a ring.
@@ -437,7 +437,7 @@  int odph_ring_empty(const odph_ring_t *r);
  * @return
  *   The number of entries in the ring.
  */
-unsigned odph_ring_count(const odph_ring_t *r);
+unsigned shm_ring_count(const shm_ring_t *r);
 
 /**
  * Return the number of free entries in a ring.
@@ -447,14 +447,14 @@  unsigned odph_ring_count(const odph_ring_t *r);
  * @return
  *   The number of free entries in the ring.
  */
-unsigned odph_ring_free_count(const odph_ring_t *r);
+unsigned shm_ring_free_count(const shm_ring_t *r);
 
 /**
  * search ring by name
  * @param name	ring name to search
  * @return	pointer to ring otherwise NULL
  */
-odph_ring_t *odph_ring_lookup(const char *name);
+shm_ring_t *shm_ring_lookup(const char *name);
 
 /**
  * Enqueue several objects on the ring (multi-producers safe).
@@ -471,7 +471,7 @@  odph_ring_t *odph_ring_lookup(const char *name);
  * @return
  *   - n: Actual number of objects enqueued.
  */
-int odph_ring_mp_enqueue_burst(odph_ring_t *r, void * const *obj_table,
+int shm_ring_mp_enqueue_burst(shm_ring_t *r, void * const *obj_table,
 			       unsigned n);
 
 /**
@@ -486,7 +486,7 @@  int odph_ring_mp_enqueue_burst(odph_ring_t *r, void * const *obj_table,
  * @return
  *   - n: Actual number of objects enqueued.
  */
-int odph_ring_sp_enqueue_burst(odph_ring_t *r, void * const *obj_table,
+int shm_ring_sp_enqueue_burst(shm_ring_t *r, void * const *obj_table,
 			       unsigned n);
 /**
  * Enqueue several objects on a ring.
@@ -504,7 +504,7 @@  int odph_ring_sp_enqueue_burst(odph_ring_t *r, void * const *obj_table,
  * @return
  *   - n: Actual number of objects enqueued.
  */
-int odph_ring_enqueue_burst(odph_ring_t *r, void * const *obj_table,
+int shm_ring_enqueue_burst(shm_ring_t *r, void * const *obj_table,
 			    unsigned n);
 
 /**
@@ -524,7 +524,7 @@  int odph_ring_enqueue_burst(odph_ring_t *r, void * const *obj_table,
  * @return
  *   - n: Actual number of objects dequeued, 0 if ring is empty
  */
-int odph_ring_mc_dequeue_burst(odph_ring_t *r, void **obj_table, unsigned n);
+int shm_ring_mc_dequeue_burst(shm_ring_t *r, void **obj_table, unsigned n);
 
 /**
  * Dequeue several objects from a ring (NOT multi-consumers safe).When the
@@ -540,7 +540,7 @@  int odph_ring_mc_dequeue_burst(odph_ring_t *r, void **obj_table, unsigned n);
  * @return
  *   - n: Actual number of objects dequeued, 0 if ring is empty
  */
-int odph_ring_sc_dequeue_burst(odph_ring_t *r, void **obj_table, unsigned n);
+int shm_ring_sc_dequeue_burst(shm_ring_t *r, void **obj_table, unsigned n);
 
 /**
  * Dequeue multiple objects from a ring up to a maximum number.
@@ -558,17 +558,17 @@  int odph_ring_sc_dequeue_burst(odph_ring_t *r, void **obj_table, unsigned n);
  * @return
  *   - Number of objects dequeued, or a negative error code on error
  */
-int odph_ring_dequeue_burst(odph_ring_t *r, void **obj_table, unsigned n);
+int shm_ring_dequeue_burst(shm_ring_t *r, void **obj_table, unsigned n);
 
 /**
  * dump the status of all rings on the console
  */
-void odph_ring_list_dump(void);
+void shm_ring_list_dump(void);
 
 /**
  * initialise ring tailq
  */
-void odph_ring_tailq_init(void);
+void shm_ring_tailq_init(void);
 
 #ifdef __cplusplus
 }
diff --git a/platform/linux-generic/pktio/ring.c b/platform/linux-generic/pktio/ring.c
index 4bb6b4e..9ff457f 100644
--- a/platform/linux-generic/pktio/ring.c
+++ b/platform/linux-generic/pktio/ring.c
@@ -80,7 +80,7 @@ 
 #include <odp_ring_internal.h>
 #include <odph_debug.h>
 
-static TAILQ_HEAD(, odph_ring) odp_ring_list;
+static TAILQ_HEAD(, shm_ring) odp_ring_list;
 
 #define RING_VAL_IS_POWER_2(x) ((((x) - 1) & (x)) == 0)
 
@@ -145,18 +145,18 @@  static TAILQ_HEAD(, odph_ring) odp_ring_list;
 static odp_rwlock_t	qlock;	/* rings tailq lock */
 
 /* init tailq_ring */
-void odph_ring_tailq_init(void)
+void shm_ring_tailq_init(void)
 {
 	TAILQ_INIT(&odp_ring_list);
 	odp_rwlock_init(&qlock);
 }
 
 /* create the ring */
-odph_ring_t *
-odph_ring_create(const char *name, unsigned count, unsigned flags)
+shm_ring_t *
+shm_ring_create(const char *name, unsigned count, unsigned flags)
 {
 	char ring_name[ODPH_RING_NAMESIZE];
-	odph_ring_t *r;
+	shm_ring_t *r;
 	size_t ring_size;
 	odp_shm_t shm;
 
@@ -168,7 +168,7 @@  odph_ring_create(const char *name, unsigned count, unsigned flags)
 	}
 
 	snprintf(ring_name, sizeof(ring_name), "%s", name);
-	ring_size = count*sizeof(void *)+sizeof(odph_ring_t);
+	ring_size = count*sizeof(void *)+sizeof(shm_ring_t);
 
 	odp_rwlock_write_lock(&qlock);
 	/* reserve a memory zone for this ring.*/
@@ -205,7 +205,7 @@  odph_ring_create(const char *name, unsigned count, unsigned flags)
  * change the high water mark. If *count* is 0, water marking is
  * disabled
  */
-int odph_ring_set_water_mark(odph_ring_t *r, unsigned count)
+int shm_ring_set_water_mark(shm_ring_t *r, unsigned count)
 {
 	if (count >= r->prod.size)
 		return -EINVAL;
@@ -221,8 +221,8 @@  int odph_ring_set_water_mark(odph_ring_t *r, unsigned count)
 /**
  * Enqueue several objects on the ring (multi-producers safe).
  */
-int __odph_ring_mp_do_enqueue(odph_ring_t *r, void * const *obj_table,
-			 unsigned n, enum odph_ring_queue_behavior behavior)
+int __shm_ring_mp_do_enqueue(shm_ring_t *r, void * const *obj_table,
+			 unsigned n, enum shm_ring_queue_behavior behavior)
 {
 	uint32_t prod_head, prod_next;
 	uint32_t cons_tail, free_entries;
@@ -294,8 +294,8 @@  int __odph_ring_mp_do_enqueue(odph_ring_t *r, void * const *obj_table,
 /**
  * Enqueue several objects on a ring (NOT multi-producers safe).
  */
-int __odph_ring_sp_do_enqueue(odph_ring_t *r, void * const *obj_table,
-			     unsigned n, enum odph_ring_queue_behavior behavior)
+int __shm_ring_sp_do_enqueue(shm_ring_t *r, void * const *obj_table,
+			     unsigned n, enum shm_ring_queue_behavior behavior)
 {
 	uint32_t prod_head, cons_tail;
 	uint32_t prod_next, free_entries;
@@ -348,8 +348,8 @@  int __odph_ring_sp_do_enqueue(odph_ring_t *r, void * const *obj_table,
  * Dequeue several objects from a ring (multi-consumers safe).
  */
 
-int __odph_ring_mc_do_dequeue(odph_ring_t *r, void **obj_table,
-			 unsigned n, enum odph_ring_queue_behavior behavior)
+int __shm_ring_mc_do_dequeue(shm_ring_t *r, void **obj_table,
+			 unsigned n, enum shm_ring_queue_behavior behavior)
 {
 	uint32_t cons_head, prod_tail;
 	uint32_t cons_next, entries;
@@ -412,8 +412,8 @@  int __odph_ring_mc_do_dequeue(odph_ring_t *r, void **obj_table,
 /**
  * Dequeue several objects from a ring (NOT multi-consumers safe).
  */
-int __odph_ring_sc_do_dequeue(odph_ring_t *r, void **obj_table,
-			     unsigned n, enum odph_ring_queue_behavior behavior)
+int __shm_ring_sc_do_dequeue(shm_ring_t *r, void **obj_table,
+			     unsigned n, enum shm_ring_queue_behavior behavior)
 {
 	uint32_t cons_head, prod_tail;
 	uint32_t cons_next, entries;
@@ -454,45 +454,45 @@  int __odph_ring_sc_do_dequeue(odph_ring_t *r, void **obj_table,
 /**
  * Enqueue several objects on the ring (multi-producers safe).
  */
-int odph_ring_mp_enqueue_bulk(odph_ring_t *r, void * const *obj_table,
+int shm_ring_mp_enqueue_bulk(shm_ring_t *r, void * const *obj_table,
 				unsigned n)
 {
-	return __odph_ring_mp_do_enqueue(r, obj_table, n,
+	return __shm_ring_mp_do_enqueue(r, obj_table, n,
 					 ODPH_RING_QUEUE_FIXED);
 }
 
 /**
  * Enqueue several objects on a ring (NOT multi-producers safe).
  */
-int odph_ring_sp_enqueue_bulk(odph_ring_t *r, void * const *obj_table,
+int shm_ring_sp_enqueue_bulk(shm_ring_t *r, void * const *obj_table,
 			     unsigned n)
 {
-	return __odph_ring_sp_do_enqueue(r, obj_table, n,
+	return __shm_ring_sp_do_enqueue(r, obj_table, n,
 					 ODPH_RING_QUEUE_FIXED);
 }
 
 /**
  * Dequeue several objects from a ring (multi-consumers safe).
  */
-int odph_ring_mc_dequeue_bulk(odph_ring_t *r, void **obj_table, unsigned n)
+int shm_ring_mc_dequeue_bulk(shm_ring_t *r, void **obj_table, unsigned n)
 {
-	return __odph_ring_mc_do_dequeue(r, obj_table, n,
+	return __shm_ring_mc_do_dequeue(r, obj_table, n,
 					 ODPH_RING_QUEUE_FIXED);
 }
 
 /**
  * Dequeue several objects from a ring (NOT multi-consumers safe).
  */
-int odph_ring_sc_dequeue_bulk(odph_ring_t *r, void **obj_table, unsigned n)
+int shm_ring_sc_dequeue_bulk(shm_ring_t *r, void **obj_table, unsigned n)
 {
-	return __odph_ring_sc_do_dequeue(r, obj_table, n,
+	return __shm_ring_sc_do_dequeue(r, obj_table, n,
 					 ODPH_RING_QUEUE_FIXED);
 }
 
 /**
  * Test if a ring is full.
  */
-int odph_ring_full(const odph_ring_t *r)
+int shm_ring_full(const shm_ring_t *r)
 {
 	uint32_t prod_tail = r->prod.tail;
 	uint32_t cons_tail = r->cons.tail;
@@ -502,7 +502,7 @@  int odph_ring_full(const odph_ring_t *r)
 /**
  * Test if a ring is empty.
  */
-int odph_ring_empty(const odph_ring_t *r)
+int shm_ring_empty(const shm_ring_t *r)
 {
 	uint32_t prod_tail = r->prod.tail;
 	uint32_t cons_tail = r->cons.tail;
@@ -512,7 +512,7 @@  int odph_ring_empty(const odph_ring_t *r)
 /**
  * Return the number of entries in a ring.
  */
-unsigned odph_ring_count(const odph_ring_t *r)
+unsigned shm_ring_count(const shm_ring_t *r)
 {
 	uint32_t prod_tail = r->prod.tail;
 	uint32_t cons_tail = r->cons.tail;
@@ -522,7 +522,7 @@  unsigned odph_ring_count(const odph_ring_t *r)
 /**
  * Return the number of free entries in a ring.
  */
-unsigned odph_ring_free_count(const odph_ring_t *r)
+unsigned shm_ring_free_count(const shm_ring_t *r)
 {
 	uint32_t prod_tail = r->prod.tail;
 	uint32_t cons_tail = r->cons.tail;
@@ -530,7 +530,7 @@  unsigned odph_ring_free_count(const odph_ring_t *r)
 }
 
 /* dump the status of the ring on the console */
-void odph_ring_dump(const odph_ring_t *r)
+void shm_ring_dump(const shm_ring_t *r)
 {
 	ODPH_DBG("ring <%s>@%p\n", r->name, r);
 	ODPH_DBG("  flags=%x\n", r->flags);
@@ -539,8 +539,8 @@  void odph_ring_dump(const odph_ring_t *r)
 	ODPH_DBG("  ch=%" PRIu32 "\n", r->cons.head);
 	ODPH_DBG("  pt=%" PRIu32 "\n", r->prod.tail);
 	ODPH_DBG("  ph=%" PRIu32 "\n", r->prod.head);
-	ODPH_DBG("  used=%u\n", odph_ring_count(r));
-	ODPH_DBG("  avail=%u\n", odph_ring_free_count(r));
+	ODPH_DBG("  used=%u\n", shm_ring_count(r));
+	ODPH_DBG("  avail=%u\n", shm_ring_free_count(r));
 	if (r->prod.watermark == r->prod.size)
 		ODPH_DBG("  watermark=0\n");
 	else
@@ -548,23 +548,23 @@  void odph_ring_dump(const odph_ring_t *r)
 }
 
 /* dump the status of all rings on the console */
-void odph_ring_list_dump(void)
+void shm_ring_list_dump(void)
 {
-	const odph_ring_t *mp = NULL;
+	const shm_ring_t *mp = NULL;
 
 	odp_rwlock_read_lock(&qlock);
 
 	TAILQ_FOREACH(mp, &odp_ring_list, next) {
-		odph_ring_dump(mp);
+		shm_ring_dump(mp);
 	}
 
 	odp_rwlock_read_unlock(&qlock);
 }
 
 /* search a ring from its name */
-odph_ring_t *odph_ring_lookup(const char *name)
+shm_ring_t *shm_ring_lookup(const char *name)
 {
-	odph_ring_t *r;
+	shm_ring_t *r;
 
 	odp_rwlock_read_lock(&qlock);
 	TAILQ_FOREACH(r, &odp_ring_list, next) {
@@ -579,60 +579,60 @@  odph_ring_t *odph_ring_lookup(const char *name)
 /**
  * Enqueue several objects on the ring (multi-producers safe).
  */
-int odph_ring_mp_enqueue_burst(odph_ring_t *r, void * const *obj_table,
+int shm_ring_mp_enqueue_burst(shm_ring_t *r, void * const *obj_table,
 			      unsigned n)
 {
-	return __odph_ring_mp_do_enqueue(r, obj_table, n,
+	return __shm_ring_mp_do_enqueue(r, obj_table, n,
 					 ODPH_RING_QUEUE_VARIABLE);
 }
 
 /**
  * Enqueue several objects on a ring (NOT multi-producers safe).
  */
-int odph_ring_sp_enqueue_burst(odph_ring_t *r, void * const *obj_table,
+int shm_ring_sp_enqueue_burst(shm_ring_t *r, void * const *obj_table,
 			      unsigned n)
 {
-	return __odph_ring_sp_do_enqueue(r, obj_table, n,
+	return __shm_ring_sp_do_enqueue(r, obj_table, n,
 					ODPH_RING_QUEUE_VARIABLE);
 }
 
 /**
  * Enqueue several objects on a ring.
  */
-int odph_ring_enqueue_burst(odph_ring_t *r, void * const *obj_table,
+int shm_ring_enqueue_burst(shm_ring_t *r, void * const *obj_table,
 			   unsigned n)
 {
 	if (r->prod.sp_enqueue)
-		return odph_ring_sp_enqueue_burst(r, obj_table, n);
+		return shm_ring_sp_enqueue_burst(r, obj_table, n);
 	else
-		return odph_ring_mp_enqueue_burst(r, obj_table, n);
+		return shm_ring_mp_enqueue_burst(r, obj_table, n);
 }
 
 /**
  * Dequeue several objects from a ring (multi-consumers safe).
  */
-int odph_ring_mc_dequeue_burst(odph_ring_t *r, void **obj_table, unsigned n)
+int shm_ring_mc_dequeue_burst(shm_ring_t *r, void **obj_table, unsigned n)
 {
-	return __odph_ring_mc_do_dequeue(r, obj_table, n,
+	return __shm_ring_mc_do_dequeue(r, obj_table, n,
 					ODPH_RING_QUEUE_VARIABLE);
 }
 
 /**
  * Dequeue several objects from a ring (NOT multi-consumers safe).
  */
-int odph_ring_sc_dequeue_burst(odph_ring_t *r, void **obj_table, unsigned n)
+int shm_ring_sc_dequeue_burst(shm_ring_t *r, void **obj_table, unsigned n)
 {
-	return __odph_ring_sc_do_dequeue(r, obj_table, n,
+	return __shm_ring_sc_do_dequeue(r, obj_table, n,
 					 ODPH_RING_QUEUE_VARIABLE);
 }
 
 /**
  * Dequeue multiple objects from a ring up to a maximum number.
  */
-int odph_ring_dequeue_burst(odph_ring_t *r, void **obj_table, unsigned n)
+int shm_ring_dequeue_burst(shm_ring_t *r, void **obj_table, unsigned n)
 {
 	if (r->cons.sc_dequeue)
-		return odph_ring_sc_dequeue_burst(r, obj_table, n);
+		return shm_ring_sc_dequeue_burst(r, obj_table, n);
 	else
-		return odph_ring_mc_dequeue_burst(r, obj_table, n);
+		return shm_ring_mc_dequeue_burst(r, obj_table, n);
 }
diff --git a/platform/linux-generic/test/ring/odp_ring_test.c b/platform/linux-generic/test/ring/odp_ring_test.c
index cec8221..799f5c6 100644
--- a/platform/linux-generic/test/ring/odp_ring_test.c
+++ b/platform/linux-generic/test/ring/odp_ring_test.c
@@ -57,7 +57,7 @@ 
 
 #define RING_TEST_BASIC
 
-static int test_ring_basic(odph_ring_t *r)
+static int test_ring_basic(shm_ring_t *r)
 {
 	void **src = NULL, **cur_src = NULL, **dst = NULL, **cur_dst = NULL;
 	int ret;
@@ -86,7 +86,7 @@  static int test_ring_basic(odph_ring_t *r)
 
 	printf("Test SP & SC basic functions\n");
 	printf("enqueue 1 obj\n");
-	ret = odph_ring_sp_enqueue_burst(r, cur_src, 1);
+	ret = shm_ring_sp_enqueue_burst(r, cur_src, 1);
 	cur_src += 1;
 	if ((ret & ODPH_RING_SZ_MASK) != 1) {
 		LOG_ERR("sp_enq for 1 obj failed\n");
@@ -94,7 +94,7 @@  static int test_ring_basic(odph_ring_t *r)
 	}
 
 	printf("enqueue 2 objs\n");
-	ret = odph_ring_sp_enqueue_burst(r, cur_src, 2);
+	ret = shm_ring_sp_enqueue_burst(r, cur_src, 2);
 	cur_src += 2;
 	if ((ret & ODPH_RING_SZ_MASK) != 2) {
 		LOG_ERR("sp_enq for 2 obj failed\n");
@@ -102,14 +102,14 @@  static int test_ring_basic(odph_ring_t *r)
 	}
 
 	printf("enqueue MAX_BULK objs\n");
-	ret = odph_ring_sp_enqueue_burst(r, cur_src, MAX_BULK);
+	ret = shm_ring_sp_enqueue_burst(r, cur_src, MAX_BULK);
 	if ((ret & ODPH_RING_SZ_MASK) != MAX_BULK) {
 		LOG_ERR("sp_enq for %d obj failed\n", MAX_BULK);
 		goto fail;
 	}
 
 	printf("dequeue 1 obj\n");
-	ret = odph_ring_sc_dequeue_burst(r, cur_dst, 1);
+	ret = shm_ring_sc_dequeue_burst(r, cur_dst, 1);
 	cur_dst += 1;
 	if ((ret & ODPH_RING_SZ_MASK) != 1) {
 		LOG_ERR("sc_deq for 1 obj failed\n");
@@ -117,7 +117,7 @@  static int test_ring_basic(odph_ring_t *r)
 	}
 
 	printf("dequeue 2 objs\n");
-	ret = odph_ring_sc_dequeue_burst(r, cur_dst, 2);
+	ret = shm_ring_sc_dequeue_burst(r, cur_dst, 2);
 	cur_dst += 2;
 	if ((ret & ODPH_RING_SZ_MASK) != 2) {
 		LOG_ERR("sc_deq for 2 obj failed\n");
@@ -125,7 +125,7 @@  static int test_ring_basic(odph_ring_t *r)
 	}
 
 	printf("dequeue MAX_BULK objs\n");
-	ret = odph_ring_sc_dequeue_burst(r, cur_dst, MAX_BULK);
+	ret = shm_ring_sc_dequeue_burst(r, cur_dst, MAX_BULK);
 	cur_dst += MAX_BULK;
 	if ((ret & ODPH_RING_SZ_MASK) != MAX_BULK) {
 		LOG_ERR("sc_deq for %d obj failed\n", MAX_BULK);
@@ -144,41 +144,41 @@  static int test_ring_basic(odph_ring_t *r)
 	printf("Test MP & MC basic functions\n");
 
 	printf("enqueue 1 obj\n");
-	ret = odph_ring_mp_enqueue_bulk(r, cur_src, 1);
+	ret = shm_ring_mp_enqueue_bulk(r, cur_src, 1);
 	cur_src += 1;
 	if (ret != 0) {
 		LOG_ERR("mp_enq for 1 obj failed\n");
 		goto fail;
 	}
 	printf("enqueue 2 objs\n");
-	ret = odph_ring_mp_enqueue_bulk(r, cur_src, 2);
+	ret = shm_ring_mp_enqueue_bulk(r, cur_src, 2);
 	cur_src += 2;
 	if (ret != 0) {
 		LOG_ERR("mp_enq for 2 obj failed\n");
 		goto fail;
 	}
 	printf("enqueue MAX_BULK objs\n");
-	ret = odph_ring_mp_enqueue_bulk(r, cur_src, MAX_BULK);
+	ret = shm_ring_mp_enqueue_bulk(r, cur_src, MAX_BULK);
 	if (ret != 0) {
 		LOG_ERR("mp_enq for %d obj failed\n", MAX_BULK);
 		goto fail;
 	}
 	printf("dequeue 1 obj\n");
-	ret = odph_ring_mc_dequeue_bulk(r, cur_dst, 1);
+	ret = shm_ring_mc_dequeue_bulk(r, cur_dst, 1);
 	cur_dst += 1;
 	if (ret != 0) {
 		LOG_ERR("mc_deq for 1 obj failed\n");
 		goto fail;
 	}
 	printf("dequeue 2 objs\n");
-	ret = odph_ring_mc_dequeue_bulk(r, cur_dst, 2);
+	ret = shm_ring_mc_dequeue_bulk(r, cur_dst, 2);
 	cur_dst += 2;
 	if (ret != 0) {
 		LOG_ERR("mc_deq for 2 obj failed\n");
 		goto fail;
 	}
 	printf("dequeue MAX_BULK objs\n");
-	ret = odph_ring_mc_dequeue_bulk(r, cur_dst, MAX_BULK);
+	ret = shm_ring_mc_dequeue_bulk(r, cur_dst, MAX_BULK);
 	cur_dst += MAX_BULK;
 	if (ret != 0) {
 		LOG_ERR("mc_deq for %d obj failed\n", MAX_BULK);
@@ -191,30 +191,30 @@  static int test_ring_basic(odph_ring_t *r)
 	}
 
 	printf("test watermark and default bulk enqueue / dequeue\n");
-	odph_ring_set_water_mark(r, 20);
+	shm_ring_set_water_mark(r, 20);
 	num_elems = 16;
 
 	cur_src = src;
 	cur_dst = dst;
 
-	ret = odph_ring_mp_enqueue_bulk(r, cur_src, num_elems);
+	ret = shm_ring_mp_enqueue_bulk(r, cur_src, num_elems);
 	cur_src += num_elems;
 	if (ret != 0) {
 		LOG_ERR("Cannot enqueue\n");
 		goto fail;
 	}
-	ret = odph_ring_mp_enqueue_bulk(r, cur_src, num_elems);
+	ret = shm_ring_mp_enqueue_bulk(r, cur_src, num_elems);
 	if (ret != -EDQUOT) {
 		LOG_ERR("Watermark not exceeded\n");
 		goto fail;
 	}
-	ret = odph_ring_mc_dequeue_bulk(r, cur_dst, num_elems);
+	ret = shm_ring_mc_dequeue_bulk(r, cur_dst, num_elems);
 	cur_dst += num_elems;
 	if (ret != 0) {
 		LOG_ERR("Cannot dequeue\n");
 		goto fail;
 	}
-	ret = odph_ring_mc_dequeue_bulk(r, cur_dst, num_elems);
+	ret = shm_ring_mc_dequeue_bulk(r, cur_dst, num_elems);
 	cur_dst += num_elems;
 	if (ret != 0) {
 		LOG_ERR("Cannot dequeue2\n");
@@ -241,7 +241,7 @@  fail:
 }
 
 /* global shared ring used for stress testing */
-static odph_ring_t *r_stress;
+static shm_ring_t *r_stress;
 
 /* Stress func for Multi producer only */
 static int producer_fn(void)
@@ -260,7 +260,7 @@  static int producer_fn(void)
 		src[i] = (void *)(unsigned long)i;
 
 	do {
-		i = odph_ring_mp_enqueue_bulk(r_stress, src, MAX_BULK);
+		i = shm_ring_mp_enqueue_bulk(r_stress, src, MAX_BULK);
 		if (i == 0) {
 			free(src);
 			return 0;
@@ -282,7 +282,7 @@  static int consumer_fn(void)
 	}
 
 	do {
-		i = odph_ring_mc_dequeue_bulk(r_stress, src, MAX_BULK);
+		i = shm_ring_mc_dequeue_bulk(r_stress, src, MAX_BULK);
 		if (i == 0) {
 			for (i = 0; i < MAX_BULK; i++) {
 				if (src[i] != (void *)(unsigned long)i) {
@@ -356,7 +356,7 @@  static void *test_ring(void *arg)
 	ring_arg_t *parg = (ring_arg_t *)arg;
 	int thr;
 	char ring_name[ODPH_RING_NAMESIZE];
-	odph_ring_t *r;
+	shm_ring_t *r;
 	int result = 0;
 
 	thr = odp_thread_id();
@@ -367,7 +367,7 @@  static void *test_ring(void *arg)
 	case ODP_RING_TEST_BASIC:
 		snprintf(ring_name, sizeof(ring_name), "test_ring_%i", thr);
 
-		r = odph_ring_create(ring_name, RING_SIZE,
+		r = shm_ring_create(ring_name, RING_SIZE,
 				    0 /* not used, alignement
 					 taken care inside func : todo */);
 		if (r == NULL) {
@@ -376,7 +376,7 @@  static void *test_ring(void *arg)
 			break;
 		}
 		/* lookup ring from its name */
-		if (odph_ring_lookup(ring_name) != r) {
+		if (shm_ring_lookup(ring_name) != r) {
 			LOG_ERR("ring lookup failed\n");
 			result = -1;
 			break;
@@ -389,7 +389,7 @@  static void *test_ring(void *arg)
 		}
 
 		/* dump ring stats */
-		odph_ring_list_dump();
+		shm_ring_list_dump();
 
 		break;
 
@@ -397,7 +397,7 @@  static void *test_ring(void *arg)
 		test_ring_stress(parg->stress_type);
 
 		/* dump ring stats */
-		odph_ring_list_dump();
+		shm_ring_list_dump();
 		break;
 
 	default:
@@ -428,7 +428,7 @@  int main(int argc __attribute__((__unused__)),
 
 	odp_print_system_info();
 
-	odph_ring_tailq_init();
+	shm_ring_tailq_init();
 
 	rarg.thrdarg.numthrds = odp_cpu_count();
 
@@ -444,7 +444,7 @@  int main(int argc __attribute__((__unused__)),
 	/* create a ring */
 	snprintf(ring_name, sizeof(ring_name), "test_ring_stress");
 
-	r_stress = odph_ring_create(ring_name, RING_SIZE,
+	r_stress = shm_ring_create(ring_name, RING_SIZE,
 				0 /* not used, alignement
 				 taken care inside func : todo */);
 	if (r_stress == NULL) {
@@ -452,7 +452,7 @@  int main(int argc __attribute__((__unused__)),
 		goto fail;
 	}
 	/* lookup ring from its name */
-	if (odph_ring_lookup(ring_name) != r_stress) {
+	if (shm_ring_lookup(ring_name) != r_stress) {
 		LOG_ERR("ring lookup failed\n");
 		goto fail;
 	}