> -----Original Message-----
> From: [email protected] [mailto:lng-odp-
> [email protected]] On Behalf Of ext Bill Fischofer
> Sent: Wednesday, November 19, 2014 3:21 AM
> To: [email protected]
> Subject: [lng-odp] [PATCH 2/2] Changes for v1.0 buffer pool APIs
> 
> Signed-off-by: Bill Fischofer <[email protected]>
> ---
>  .../linux-generic/include/api/odp_buffer_pool.h    | 111
> +++++++++++++++++++--
>  .../linux-generic/include/api/odp_platform_types.h |   9 ++
>  .../linux-generic/include/api/odp_shared_memory.h  |  10 +-
>  .../include/odp_buffer_pool_internal.h             |   8 ++
>  platform/linux-generic/odp_buffer_pool.c           |  99
> ++++++++++++++++--
>  platform/linux-generic/odp_schedule.c              |  20 ++--
>  6 files changed, 212 insertions(+), 45 deletions(-)
> 
> diff --git a/platform/linux-generic/include/api/odp_buffer_pool.h
> b/platform/linux-generic/include/api/odp_buffer_pool.h
> index 30b83e0..d87872b 100644
> --- a/platform/linux-generic/include/api/odp_buffer_pool.h
> +++ b/platform/linux-generic/include/api/odp_buffer_pool.h
> @@ -36,32 +36,121 @@ extern "C" {
>  #define ODP_BUFFER_POOL_INVALID   0
> 
>  /**
> + * Buffer pool parameters
> + *
> + * @param[in] buf_size   Size of application data in each buffer

"Buffer size in bytes" == maximum number of bytes app will store in each buffer

> + * @param[in] buf_align  Alignment requested for buffer.  Specified
> + *                       as a power-of-2 integer (e.g., 8, 16, 64).

"Minimum buffer alignment in bytes. Valid values are power of twos. Use 0 for 
the default alignment. Default alignment is a multiple of 8."

> + * @param[in] num_bufs   Number of buffers that pool should contain

"Number of buffers in the pool"

> + * @param[in] buf_type   Buffer type
> + */
> +typedef struct odp_buffer_pool_param_t {
> +     size_t   buf_size;          /**< Application data size of each
> buffer */
> +     size_t   buf_align;         /**< Requested buffer alignment */
> +     uint32_t num_bufs;          /**< Number of buffers in this pool */
> +     int      buf_type;          /**< Buffer type */
> +} odp_buffer_pool_param_t;          /**< Type of buffer pool parameter
> struct */


Parameters are documented twice - remove extra copy.


> +
> +/**
>   * Create a buffer pool
>   *
> - * @param name      Name of the pool (max ODP_BUFFER_POOL_NAME_LEN - 1
> chars)
> - * @param base_addr Pool base address
> - * @param size      Pool size in bytes
> - * @param buf_size  Buffer size in bytes
> - * @param buf_align Minimum buffer alignment
> - * @param buf_type  Buffer type
> + * @param[in] name     Name of the pool, max ODP_BUFFER_POOL_NAME_LEN-1
> chars.
> + *                     May be specified as NULL for anonymous pools.
> + *
> + * @param[in] shm      The shared memory object in which to create the
> pool.
> + *                     May be specified as ODP_SHM_NULL to request that
> the
> + *                     storage needed for the pool be allocated by the
> API.


"Use ODP_SHM_NULL to reserve default memory type for the buffer type" ... or 
something similar


> + *
> + * @param[in] params   Parameters controlling the creation of this buffer
> pool.

"Buffer pool parameters"

> + *
> + * @return Buffer pool handle or ODP_BUFFER_POOL_NULL if call failed

or ODP_BUFFER_POOL_INVALID

.
>   *
> - * @return Buffer pool handle
> + * @note This routine is used to create a buffer pool. It take three
> + * arguments: the optional name of the pool to be created, an optional
> shared
> + * memory handle, and a parameter struct that describes the pool to be
> + * created.  If a name is not specified the result is an anonymous pool
> that
> + * cannot be referenced by odp_buffer_pool_lookup().
> + *
> + * @note The shm parameter is used to specify whether the pool should be
> + * created in an application-supplied shared memory object.  If specified
> as
> + * ODP_SHM_NULL, the implementation will allocate a shared memory object
> to
> + * contain the pool.

"Will allocate default memory for the pool"

Compress text above, remove @note's and move as the "long" description under 
the "short" description (== first line after /**). Avoid repeating 
specification, but tell purpose of the function.

> + *
> + * @note The parameter structure specifies the type of buffer to be
> contained
> + * in the pool as well as their number, size, and alignment.  The
> specified
> + * buf_align MUST be a power of two, and is the minimum alignment
> requested by
> + * the caller.  The buf_align parameter MAY be specified as 0 to request
> that
> + * the implementation use a default alignment which MUST be a minimum of
> 8
> + * bytes.
>   */

This text above can be removed (repeats the argument spec).


> +
>  odp_buffer_pool_t odp_buffer_pool_create(const char *name,
> -                                      void *base_addr, uint64_t size,
> -                                      size_t buf_size, size_t buf_align,
> -                                      int buf_type);
> +                                      odp_shm_t shm,
> +                                      odp_buffer_pool_param_t *params);
> 



-Petri


_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to