diff options
author | Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org> | 2014-10-06 14:00:52 +0530 |
---|---|---|
committer | Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org> | 2014-10-06 14:00:52 +0530 |
commit | 7d0090a443072ed354cc9e1cd81d16aacb26d64a (patch) | |
tree | b85c8cd81b2271ef58fa042a42fab9e31b7f4eb8 /platform/linux-dpdk/include/api/odp_buffer_pool.h | |
parent | 885542fb76691c49fd61f279f07d3d92841c249b (diff) |
Revert "git split: delete dpdk"
This reverts commit d8cda8b0f395d00902a50690fee3679f65780013.
Diffstat (limited to 'platform/linux-dpdk/include/api/odp_buffer_pool.h')
-rw-r--r-- | platform/linux-dpdk/include/api/odp_buffer_pool.h | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/platform/linux-dpdk/include/api/odp_buffer_pool.h b/platform/linux-dpdk/include/api/odp_buffer_pool.h new file mode 100644 index 000000000..4b75cf53c --- /dev/null +++ b/platform/linux-dpdk/include/api/odp_buffer_pool.h @@ -0,0 +1,99 @@ +/* Copyright (c) 2013, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + + +/** + * @file + * + * ODP buffer pool + */ + +#ifndef ODP_BUFFER_POOL_H_ +#define ODP_BUFFER_POOL_H_ + +#ifdef __cplusplus +extern "C" { +#endif + + + +#include <odp_std_types.h> +#include <odp_buffer.h> + +/** Maximum queue name lenght in chars */ +#define ODP_BUFFER_POOL_NAME_LEN 32 + +/** Invalid buffer pool */ +#define ODP_BUFFER_POOL_INVALID (0xffffffff) + +/** ODP buffer pool */ +typedef unsigned long odp_buffer_pool_t; + + +/** + * 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 + * + * @return Buffer pool handle + */ +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); + + +/** + * Find a buffer pool by name + * + * @param name Name of the pool + * + * @return Buffer pool handle, or ODP_BUFFER_POOL_INVALID if not found. + */ +odp_buffer_pool_t odp_buffer_pool_lookup(const char *name); + + +/** + * Print buffer pool info + * + * @param pool Pool handle + * + */ +void odp_buffer_pool_print(odp_buffer_pool_t pool); + + + +/** + * Buffer alloc + * + * @param pool Pool handle + * + * @return Buffer handle or ODP_BUFFER_INVALID + */ +odp_buffer_t odp_buffer_alloc(odp_buffer_pool_t pool); + + +/** + * Buffer free + * + * @param buf Buffer handle + * + */ +void odp_buffer_free(odp_buffer_t buf); + + + + +#ifdef __cplusplus +} +#endif + +#endif |