> 
> @@ -172,6 +172,7 @@ static pool_t *reserve_pool(void)
>  {
>       int i;
>       pool_t *pool;
> +     char ring_name[ODP_POOL_NAME_LEN];
> 
>       for (i = 0; i < ODP_CONFIG_POOLS; i++) {
>               pool = pool_entry(i);
> @@ -180,6 +181,17 @@ static pool_t *reserve_pool(void)
>               if (pool->reserved == 0) {
>                       pool->reserved = 1;
>                       UNLOCK(&pool->lock);
> +                     sprintf(ring_name, "_odp_pool_ring_%d", i);
> +                     pool->ring_shm =
> +                             odp_shm_reserve(ring_name,
> +                                             sizeof(pool_ring_t),
> +                                             ODP_CACHE_LINE_SIZE, 0);
> +                     if (pool->ring_shm == ODP_SHM_INVALID) {
> +                             ODP_ERR("Unable to alloc pool ring %d\n", i);
> +                             pool->reserved = 0;

This must be modified inside the lock, otherwise there's a race condition if a 
pool is reserved or not.

Also, I'd like to have performance impact of the extra indirection verified.

-Petri

Reply via email to