diff options
author | Vincent Hsu <vincent.hsu@linaro.org> | 2014-07-21 11:52:01 +0530 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2014-07-23 15:15:25 +0400 |
commit | 7cc718acd1fefaf3375fd7bbfad3dade0ca9e2dc (patch) | |
tree | 083dae11a6828a494325c0c0cce0b697ad63825b /platform/linux-dpdk/include/odp_buffer_pool_internal.h | |
parent | f9c3c07126c2d91e671464450cceb9c389a13cc9 (diff) |
Initial ODP-DPDK port
- Pulled necessary files from platform/linux-generic into
platform/linux-dpdk
- Made necessary changes in files to get it compiled with dpdk library
for eg.,
* odp_buffer_hdr_t is mapped to struct rte_mbuf
* All odp_buffer_* maps to rte_* in dpdk
* necessary initialisations like odp_init_dpdk
* All packet related changes in odp_packet.c and odp_packet_io.c
* dpdk support in odp_packet_dpdk.c
Signed-off-by: Vincent Hsu <vincent.hsu@linaro.org>
- Add/modify files to support linux-dpdk compilation in new automake
environment.
* Modified configure.ac
* Added platform/linux-dpdk/Makefile.am
* Moved all files from platform/linux-dpdk/source to
platform/linux-dpdk/.
- Added platform/linux-dpdk/README on how to clone, compile DPDK and
commands to execute on ODP.
- Made ODP_BUFFER_<TYPES> consistent with linux-generic.
- Removed odp_buffer_is_scatter API to be inline with linux-generic.
- Added platform/linux-dpdk/odp_linux.c to supply the function
and argument to the pthread created by dpdk.
Signed-off-by: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org>
Diffstat (limited to 'platform/linux-dpdk/include/odp_buffer_pool_internal.h')
-rw-r--r-- | platform/linux-dpdk/include/odp_buffer_pool_internal.h | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/platform/linux-dpdk/include/odp_buffer_pool_internal.h b/platform/linux-dpdk/include/odp_buffer_pool_internal.h new file mode 100644 index 000000000..1a3665591 --- /dev/null +++ b/platform/linux-dpdk/include/odp_buffer_pool_internal.h @@ -0,0 +1,90 @@ +/* Copyright (c) 2013, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + + +/** + * @file + * + * ODP buffer pool - internal header + */ + +#ifndef ODP_BUFFER_POOL_INTERNAL_H_ +#define ODP_BUFFER_POOL_INTERNAL_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <odp_std_types.h> +#include <odp_buffer_pool.h> +#include <odp_buffer_internal.h> +#include <odp_align.h> +#include <odp_hints.h> +#include <odp_config.h> +#include <odp_debug.h> + +/* for DPDK */ +#include <rte_mempool.h> + +/* Use ticketlock instead of spinlock */ +#define POOL_USE_TICKETLOCK + +/* Extra error checks */ +/* #define POOL_ERROR_CHECK */ + + +#ifdef POOL_USE_TICKETLOCK +#include <odp_ticketlock.h> +#else +#include <odp_spinlock.h> +#endif + + +struct pool_entry_s { +#ifdef POOL_USE_TICKETLOCK + odp_ticketlock_t lock ODP_ALIGNED_CACHE; +#else + odp_spinlock_t lock ODP_ALIGNED_CACHE; +#endif + + uint64_t free_bufs; + char name[ODP_BUFFER_POOL_NAME_LEN]; + + + odp_buffer_pool_t pool ODP_ALIGNED_CACHE; + uintptr_t buf_base; + size_t buf_size; + size_t buf_offset; + uint64_t num_bufs; + void *pool_base_addr; + uint64_t pool_size; + size_t payload_size; + size_t payload_align; + int buf_type; + size_t hdr_size; +}; + + +extern void *pool_entry_ptr[]; + + +static inline void *get_pool_entry(odp_buffer_pool_t pool_id) +{ + return pool_entry_ptr[pool_id]; +} + + +static inline odp_buffer_hdr_t *odp_buf_to_hdr(odp_buffer_t buf) +{ + return (odp_buffer_hdr_t *)buf; +} + + +#ifdef __cplusplus +} +#endif + +#endif |