diff options
Diffstat (limited to 'platform/linux-generic')
-rw-r--r-- | platform/linux-generic/include/api/odp_buffer.h | 2 | ||||
-rw-r--r-- | platform/linux-generic/include/api/odp_crypto.h | 2 | ||||
-rw-r--r-- | platform/linux-generic/include/api/odp_packet.h | 10 | ||||
-rw-r--r-- | platform/linux-generic/include/api/odp_packet_io.h | 2 | ||||
-rw-r--r-- | platform/linux-generic/include/api/odp_platform_types.h | 4 | ||||
-rw-r--r-- | platform/linux-generic/include/api/odp_pool.h | 71 | ||||
-rw-r--r-- | platform/linux-generic/include/odp_buffer_internal.h | 4 | ||||
-rw-r--r-- | platform/linux-generic/include/odp_buffer_pool_internal.h | 14 | ||||
-rw-r--r-- | platform/linux-generic/include/odp_crypto_internal.h | 2 | ||||
-rw-r--r-- | platform/linux-generic/include/odp_packet_internal.h | 2 | ||||
-rw-r--r-- | platform/linux-generic/include/odp_packet_socket.h | 8 | ||||
-rw-r--r-- | platform/linux-generic/odp_buffer_pool.c | 37 | ||||
-rw-r--r-- | platform/linux-generic/odp_crypto.c | 2 | ||||
-rw-r--r-- | platform/linux-generic/odp_packet.c | 8 | ||||
-rw-r--r-- | platform/linux-generic/odp_packet_io.c | 6 | ||||
-rw-r--r-- | platform/linux-generic/odp_packet_socket.c | 10 | ||||
-rw-r--r-- | platform/linux-generic/odp_schedule.c | 14 |
17 files changed, 98 insertions, 100 deletions
diff --git a/platform/linux-generic/include/api/odp_buffer.h b/platform/linux-generic/include/api/odp_buffer.h index 2f18aa9..8e144b8 100644 --- a/platform/linux-generic/include/api/odp_buffer.h +++ b/platform/linux-generic/include/api/odp_buffer.h @@ -86,7 +86,7 @@ int odp_buffer_is_valid(odp_buffer_t buf); * * @return Handle of buffer pool buffer belongs to */ -odp_buffer_pool_t odp_buffer_pool(odp_buffer_t buf); +odp_pool_t odp_buffer_pool(odp_buffer_t buf); /** * Print buffer metadata to STDOUT diff --git a/platform/linux-generic/include/api/odp_crypto.h b/platform/linux-generic/include/api/odp_crypto.h index 4183442..da6041c 100644 --- a/platform/linux-generic/include/api/odp_crypto.h +++ b/platform/linux-generic/include/api/odp_crypto.h @@ -109,7 +109,7 @@ typedef struct odp_crypto_session_params { enum odp_auth_alg auth_alg; /**< Authentication algorithm */ odp_crypto_key_t auth_key; /**< Authentication key */ odp_queue_t compl_queue; /**< Async mode completion event queue */ - odp_buffer_pool_t output_pool; /**< Output buffer pool */ + odp_pool_t output_pool; /**< Output buffer pool */ } odp_crypto_session_params_t; /** diff --git a/platform/linux-generic/include/api/odp_packet.h b/platform/linux-generic/include/api/odp_packet.h index e71aa09..eca5b73 100644 --- a/platform/linux-generic/include/api/odp_packet.h +++ b/platform/linux-generic/include/api/odp_packet.h @@ -51,7 +51,7 @@ extern "C" { * Allocate a packet from a buffer pool * * Allocates a packet of the requested length from the specified buffer pool. - * Pool must have been created with buffer type ODP_BUFFER_TYPE_PACKET. The + * Pool must have been created with ODP_POOL_PACKET type. The * packet is initialized with data pointers and lengths set according to the * specified len, and the default headroom and tailroom length settings. All * other packet metadata are set to their default values. @@ -66,7 +66,7 @@ extern "C" { * the ODP_CONFIG_PACKET_HEADROOM and ODP_CONFIG_PACKET_TAILROOM defines in * odp_config.h. */ -odp_packet_t odp_packet_alloc(odp_buffer_pool_t pool, uint32_t len); +odp_packet_t odp_packet_alloc(odp_pool_t pool, uint32_t len); /** * Free packet @@ -383,7 +383,7 @@ void *odp_packet_offset(odp_packet_t pkt, uint32_t offset, uint32_t *len, * * @return Buffer pool handle */ -odp_buffer_pool_t odp_packet_pool(odp_packet_t pkt); +odp_pool_t odp_packet_pool(odp_packet_t pkt); /** * Packet input interface @@ -774,14 +774,14 @@ odp_packet_t odp_packet_rem_data(odp_packet_t pkt, uint32_t offset, * * Create a new copy of the packet. The new packet is exact copy of the source * packet (incl. data and metadata). The pool must have been created with - * buffer type ODP_BUFFER_TYPE_PACKET. + * ODP_POOL_PACKET type. * * @param pkt Packet handle * @param pool Buffer pool for allocation of the new packet. * * @return Handle to the copy of the packet, or ODP_PACKET_INVALID */ -odp_packet_t odp_packet_copy(odp_packet_t pkt, odp_buffer_pool_t pool); +odp_packet_t odp_packet_copy(odp_packet_t pkt, odp_pool_t pool); /** * Copy data from packet diff --git a/platform/linux-generic/include/api/odp_packet_io.h b/platform/linux-generic/include/api/odp_packet_io.h index 7dfcc4f..6e479aa 100644 --- a/platform/linux-generic/include/api/odp_packet_io.h +++ b/platform/linux-generic/include/api/odp_packet_io.h @@ -46,7 +46,7 @@ extern "C" { * device used for testing. Usually it's loop back * interface. */ -odp_pktio_t odp_pktio_open(const char *dev, odp_buffer_pool_t pool); +odp_pktio_t odp_pktio_open(const char *dev, odp_pool_t pool); /** * Close an ODP packet IO instance diff --git a/platform/linux-generic/include/api/odp_platform_types.h b/platform/linux-generic/include/api/odp_platform_types.h index 1d32e23..962ed4c 100644 --- a/platform/linux-generic/include/api/odp_platform_types.h +++ b/platform/linux-generic/include/api/odp_platform_types.h @@ -24,10 +24,10 @@ */ /** ODP Buffer pool */ -typedef uint32_t odp_buffer_pool_t; +typedef uint32_t odp_pool_t; /** Invalid buffer pool */ -#define ODP_BUFFER_POOL_INVALID (0xffffffff) +#define ODP_POOL_INVALID (0xffffffff) /** ODP buffer */ typedef uint32_t odp_buffer_t; diff --git a/platform/linux-generic/include/api/odp_pool.h b/platform/linux-generic/include/api/odp_pool.h index eba7b83..8a39fb3 100644 --- a/platform/linux-generic/include/api/odp_pool.h +++ b/platform/linux-generic/include/api/odp_pool.h @@ -76,100 +76,99 @@ typedef struct odp_pool_param_t { #define ODP_POOL_TIMEOUT ODP_EVENT_TIMEOUT /** - * Create a buffer pool - * This routine is used to create a buffer pool. It take three + * Create a pool + * This routine is used to create a 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(). + * cannot be referenced by odp_pool_lookup(). * - * @param name Name of the pool, max ODP_BUFFER_POOL_NAME_LEN-1 chars. + * @param name Name of the pool, max ODP_POOL_NAME_LEN-1 chars. * May be specified as NULL for anonymous pools. * * @param shm The shared memory object in which to create the pool. * Use ODP_SHM_NULL to reserve default memory type - * for the buffer type. + * for the pool type. * - * @param params Buffer pool parameters. + * @param params Pool parameters. * - * @return Handle of the created buffer pool - * @retval ODP_BUFFER_POOL_INVALID Buffer pool could not be created + * @return Handle of the created pool + * @retval ODP_POOL_INVALID Pool could not be created */ -odp_buffer_pool_t odp_buffer_pool_create(const char *name, - odp_shm_t shm, - odp_pool_param_t *params); +odp_pool_t odp_pool_create(const char *name, + odp_shm_t shm, + odp_pool_param_t *params); /** - * Destroy a buffer pool previously created by odp_buffer_pool_create() + * Destroy a pool previously created by odp_pool_create() * - * @param pool Handle of the buffer pool to be destroyed + * @param pool Handle of the pool to be destroyed * * @retval 0 Success * @retval -1 Failure * - * @note This routine destroys a previously created buffer pool. This call + * @note This routine destroys a previously created pool. This call * does not destroy any shared memory object passed to - * odp_buffer_pool_create() used to store the buffer pool contents. The caller + * odp_pool_create() used to store the pool contents. The caller * takes responsibility for that. If no shared memory object was passed as * part of the create call, then this routine will destroy any internal shared - * memory objects associated with the buffer pool. Results are undefined if - * an attempt is made to destroy a buffer pool that contains allocated or + * memory objects associated with the pool. Results are undefined if + * an attempt is made to destroy a pool that contains allocated or * otherwise active buffers. */ -int odp_buffer_pool_destroy(odp_buffer_pool_t pool); +int odp_pool_destroy(odp_pool_t pool); /** - * Find a buffer pool by name + * Find a pool by name * * @param name Name of the pool * - * @return Handle of found buffer pool - * @retval ODP_BUFFER_POOL_INVALID Buffer pool could not be found + * @return Handle of found pool + * @retval ODP_POOL_INVALID Pool could not be found * * @note This routine cannot be used to look up an anonymous pool (one created * with no name). */ -odp_buffer_pool_t odp_buffer_pool_lookup(const char *name); +odp_pool_t odp_pool_lookup(const char *name); /** - * Buffer pool information struct - * Used to get information about a buffer pool. + * Pool information struct + * Used to get information about a pool. */ -typedef struct odp_buffer_pool_info_t { +typedef struct odp_pool_info_t { const char *name; /**< pool name */ odp_shm_t shm; /**< handle of shared memory area supplied by application to - contain buffer pool, or + contain pool, or ODP_SHM_INVALID if this pool is managed by ODP */ odp_pool_param_t params; /**< pool parameters */ -} odp_buffer_pool_info_t; +} odp_pool_info_t; /** - * Retrieve information about a buffer pool + * Retrieve information about a pool * - * @param pool Buffer pool handle + * @param pool Pool handle * - * @param[out] info Receives an odp_buffer_pool_info_t object + * @param[out] info Receives an odp_pool_info_t object * that describes the pool. * * @retval 0 Success * @retval -1 Failure. Info could not be retrieved. */ -int odp_buffer_pool_info(odp_buffer_pool_t pool, - odp_buffer_pool_info_t *info); +int odp_pool_info(odp_pool_t pool, odp_pool_info_t *info); /** - * Print buffer pool info + * Print pool info * * @param pool Pool handle * * @note This routine writes implementation-defined information about the - * specified buffer pool to the ODP log. The intended use is for debugging. + * specified pool to the ODP log. The intended use is for debugging. */ -void odp_buffer_pool_print(odp_buffer_pool_t pool); +void odp_pool_print(odp_pool_t pool); /** * Buffer alloc @@ -180,7 +179,7 @@ void odp_buffer_pool_print(odp_buffer_pool_t pool); * @return Handle of allocated buffer * @retval ODP_BUFFER_INVALID Buffer could not be allocated */ -odp_buffer_t odp_buffer_alloc(odp_buffer_pool_t pool); +odp_buffer_t odp_buffer_alloc(odp_pool_t pool); /** * Buffer free diff --git a/platform/linux-generic/include/odp_buffer_internal.h b/platform/linux-generic/include/odp_buffer_internal.h index 14c32c1..e32bce0 100644 --- a/platform/linux-generic/include/odp_buffer_internal.h +++ b/platform/linux-generic/include/odp_buffer_internal.h @@ -121,7 +121,7 @@ typedef struct odp_buffer_hdr_t { int type; /* buffer type */ uint32_t size; /* max data size */ odp_atomic_u32_t ref_count; /* reference count */ - odp_buffer_pool_t pool_hdl; /* buffer pool handle */ + odp_pool_t pool_hdl; /* buffer pool handle */ union { uint64_t buf_u64; /* user u64 */ void *buf_ctx; /* user context */ @@ -152,7 +152,7 @@ typedef struct { #define ODP_FREEBUF -1 /* Forward declarations */ -odp_buffer_t buffer_alloc(odp_buffer_pool_t pool, size_t size); +odp_buffer_t buffer_alloc(odp_pool_t pool, size_t size); /* diff --git a/platform/linux-generic/include/odp_buffer_pool_internal.h b/platform/linux-generic/include/odp_buffer_pool_internal.h index 4ace3c3..d6f44d9 100644 --- a/platform/linux-generic/include/odp_buffer_pool_internal.h +++ b/platform/linux-generic/include/odp_buffer_pool_internal.h @@ -87,7 +87,7 @@ struct pool_entry_s { char name[ODP_POOL_NAME_LEN]; odp_pool_param_t params; _odp_buffer_pool_init_t init_params; - odp_buffer_pool_t pool_hdl; + odp_pool_t pool_hdl; uint32_t pool_id; odp_shm_t pool_shm; union { @@ -333,12 +333,12 @@ static inline void flush_cache(local_cache_t *buf_cache, buf_cache->buffrees = 0; } -static inline odp_buffer_pool_t pool_index_to_handle(uint32_t pool_id) +static inline odp_pool_t pool_index_to_handle(uint32_t pool_id) { return pool_id; } -static inline uint32_t pool_handle_to_index(odp_buffer_pool_t pool_hdl) +static inline uint32_t pool_handle_to_index(odp_pool_t pool_hdl) { return pool_hdl; } @@ -348,7 +348,7 @@ static inline void *get_pool_entry(uint32_t pool_id) return pool_entry_ptr[pool_id]; } -static inline pool_entry_t *odp_pool_to_entry(odp_buffer_pool_t pool) +static inline pool_entry_t *odp_pool_to_entry(odp_pool_t pool) { return (pool_entry_t *)get_pool_entry(pool_handle_to_index(pool)); } @@ -358,17 +358,17 @@ static inline pool_entry_t *odp_buf_to_pool(odp_buffer_hdr_t *buf) return odp_pool_to_entry(buf->pool_hdl); } -static inline uint32_t odp_buffer_pool_segment_size(odp_buffer_pool_t pool) +static inline uint32_t odp_buffer_pool_segment_size(odp_pool_t pool) { return odp_pool_to_entry(pool)->s.seg_size; } -static inline uint32_t odp_buffer_pool_headroom(odp_buffer_pool_t pool) +static inline uint32_t odp_buffer_pool_headroom(odp_pool_t pool) { return odp_pool_to_entry(pool)->s.headroom; } -static inline uint32_t odp_buffer_pool_tailroom(odp_buffer_pool_t pool) +static inline uint32_t odp_buffer_pool_tailroom(odp_pool_t pool) { return odp_pool_to_entry(pool)->s.tailroom; } diff --git a/platform/linux-generic/include/odp_crypto_internal.h b/platform/linux-generic/include/odp_crypto_internal.h index 2e5a71c..429c6c2 100644 --- a/platform/linux-generic/include/odp_crypto_internal.h +++ b/platform/linux-generic/include/odp_crypto_internal.h @@ -33,7 +33,7 @@ struct odp_crypto_generic_session { enum odp_crypto_op op; bool do_cipher_first; odp_queue_t compl_queue; - odp_buffer_pool_t output_pool; + odp_pool_t output_pool; struct { enum odp_cipher_alg alg; struct { diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index 33c9d92..0ebc14b 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -253,7 +253,7 @@ int _odp_packet_copy_to_packet(odp_packet_t srcpkt, uint32_t srcoffset, odp_packet_t dstpkt, uint32_t dstoffset, uint32_t len); -odp_packet_t _odp_packet_alloc(odp_buffer_pool_t pool_hdl); +odp_packet_t _odp_packet_alloc(odp_pool_t pool_hdl); int _odp_packet_parse(odp_packet_t pkt); diff --git a/platform/linux-generic/include/odp_packet_socket.h b/platform/linux-generic/include/odp_packet_socket.h index 0c4ad0b..08c7cb6 100644 --- a/platform/linux-generic/include/odp_packet_socket.h +++ b/platform/linux-generic/include/odp_packet_socket.h @@ -41,7 +41,7 @@ typedef struct { int sockfd; /**< socket descriptor */ - odp_buffer_pool_t pool; /**< buffer pool to alloc packets from */ + odp_pool_t pool; /**< pool to alloc packets from */ size_t buf_size; /**< size of buffer payload in 'pool' */ size_t max_frame_len; /**< max frame len = buf_size - sizeof(pkt_hdr) */ size_t frame_offset; /**< frame start offset from start of pkt buf */ @@ -75,7 +75,7 @@ typedef struct { struct ring tx_ring ODP_ALIGNED_CACHE; int sockfd ODP_ALIGNED_CACHE; - odp_buffer_pool_t pool; + odp_pool_t pool; size_t frame_offset; /**< frame start offset from start of pkt buf */ uint8_t *mmap_base; unsigned mmap_len; @@ -88,10 +88,10 @@ typedef struct { * Open & configure a raw packet socket */ int setup_pkt_sock(pkt_sock_t * const pkt_sock, const char *netdev, - odp_buffer_pool_t pool); + odp_pool_t pool); int setup_pkt_sock_mmap(pkt_sock_mmap_t * const pkt_sock, const char *netdev, - odp_buffer_pool_t pool, int fanout); + odp_pool_t pool, int fanout); /** * Close a packet socket diff --git a/platform/linux-generic/odp_buffer_pool.c b/platform/linux-generic/odp_buffer_pool.c index fb65c2d..35101c7 100644 --- a/platform/linux-generic/odp_buffer_pool.c +++ b/platform/linux-generic/odp_buffer_pool.c @@ -96,14 +96,14 @@ int odp_buffer_pool_init_global(void) } /** - * Buffer pool creation + * Pool creation */ -odp_buffer_pool_t odp_buffer_pool_create(const char *name, +odp_pool_t odp_pool_create(const char *name, odp_shm_t shm, odp_pool_param_t *params) { - odp_buffer_pool_t pool_hdl = ODP_BUFFER_POOL_INVALID; + odp_pool_t pool_hdl = ODP_POOL_INVALID; pool_entry_t *pool; uint32_t i, headroom = 0, tailroom = 0; @@ -117,7 +117,7 @@ odp_buffer_pool_t odp_buffer_pool_create(const char *name, _odp_buffer_pool_init_t *init_params = &default_init_params; if (params == NULL) - return ODP_BUFFER_POOL_INVALID; + return ODP_POOL_INVALID; /* Restriction for v1.0: All non-packet buffers are unsegmented */ int unsegmented = 1; @@ -136,7 +136,7 @@ odp_buffer_pool_t odp_buffer_pool_create(const char *name, /* Validate requested buffer alignment */ if (buf_align > ODP_CONFIG_BUFFER_ALIGN_MAX || buf_align != ODP_ALIGN_ROUNDDOWN_POWER_2(buf_align, buf_align)) - return ODP_BUFFER_POOL_INVALID; + return ODP_POOL_INVALID; /* Set correct alignment based on input request */ if (buf_align == 0) @@ -179,13 +179,13 @@ odp_buffer_pool_t odp_buffer_pool_create(const char *name, break; default: - return ODP_BUFFER_POOL_INVALID; + return ODP_POOL_INVALID; } /* Validate requested number of buffers against addressable limits */ if (params->buf.num > (ODP_BUFFER_MAX_BUFFERS / (buf_stride / ODP_CACHE_LINE_SIZE))) - return ODP_BUFFER_POOL_INVALID; + return ODP_POOL_INVALID; /* Find an unused buffer pool slot and iniitalize it as requested */ for (i = 0; i < ODP_CONFIG_BUFFER_POOLS; i++) { @@ -239,7 +239,7 @@ odp_buffer_pool_t odp_buffer_pool_create(const char *name, ODP_PAGE_SIZE, 0); if (shm == ODP_SHM_INVALID) { POOL_UNLOCK(&pool->s.lock); - return ODP_BUFFER_POOL_INVALID; + return ODP_POOL_INVALID; } pool->s.pool_base_addr = odp_shm_addr(shm); } else { @@ -247,7 +247,7 @@ odp_buffer_pool_t odp_buffer_pool_create(const char *name, if (odp_shm_info(shm, &info) != 0 || info.size < pool->s.pool_size) { POOL_UNLOCK(&pool->s.lock); - return ODP_BUFFER_POOL_INVALID; + return ODP_POOL_INVALID; } pool->s.pool_base_addr = odp_shm_addr(shm); void *page_addr = @@ -258,7 +258,7 @@ odp_buffer_pool_t odp_buffer_pool_create(const char *name, ((size_t)page_addr - (size_t)pool->s.pool_base_addr)) { POOL_UNLOCK(&pool->s.lock); - return ODP_BUFFER_POOL_INVALID; + return ODP_POOL_INVALID; } pool->s.pool_base_addr = page_addr; } @@ -375,7 +375,7 @@ odp_buffer_pool_t odp_buffer_pool_create(const char *name, } -odp_buffer_pool_t odp_buffer_pool_lookup(const char *name) +odp_pool_t odp_pool_lookup(const char *name) { uint32_t i; pool_entry_t *pool; @@ -392,11 +392,10 @@ odp_buffer_pool_t odp_buffer_pool_lookup(const char *name) POOL_UNLOCK(&pool->s.lock); } - return ODP_BUFFER_POOL_INVALID; + return ODP_POOL_INVALID; } -int odp_buffer_pool_info(odp_buffer_pool_t pool_hdl, - odp_buffer_pool_info_t *info) +int odp_pool_info(odp_pool_t pool_hdl, odp_pool_info_t *info) { uint32_t pool_id = pool_handle_to_index(pool_hdl); pool_entry_t *pool = get_pool_entry(pool_id); @@ -415,7 +414,7 @@ int odp_buffer_pool_info(odp_buffer_pool_t pool_hdl, return 0; } -int odp_buffer_pool_destroy(odp_buffer_pool_t pool_hdl) +int odp_pool_destroy(odp_pool_t pool_hdl) { uint32_t pool_id = pool_handle_to_index(pool_hdl); pool_entry_t *pool = get_pool_entry(pool_id); @@ -450,7 +449,7 @@ int odp_buffer_pool_destroy(odp_buffer_pool_t pool_hdl) return 0; } -odp_buffer_t buffer_alloc(odp_buffer_pool_t pool_hdl, size_t size) +odp_buffer_t buffer_alloc(odp_pool_t pool_hdl, size_t size) { uint32_t pool_id = pool_handle_to_index(pool_hdl); pool_entry_t *pool = get_pool_entry(pool_id); @@ -505,7 +504,7 @@ odp_buffer_t buffer_alloc(odp_buffer_pool_t pool_hdl, size_t size) return odp_hdr_to_buf(&buf->buf); } -odp_buffer_t odp_buffer_alloc(odp_buffer_pool_t pool_hdl) +odp_buffer_t odp_buffer_alloc(odp_pool_t pool_hdl) { return buffer_alloc(pool_hdl, odp_pool_to_entry(pool_hdl)->s.params.buf.size); @@ -532,7 +531,7 @@ void _odp_flush_caches(void) } } -void odp_buffer_pool_print(odp_buffer_pool_t pool_hdl) +void odp_pool_print(odp_pool_t pool_hdl) { pool_entry_t *pool; uint32_t pool_id; @@ -600,7 +599,7 @@ void odp_buffer_pool_print(odp_buffer_pool_t pool_hdl) } -odp_buffer_pool_t odp_buffer_pool(odp_buffer_t buf) +odp_pool_t odp_buffer_pool(odp_buffer_t buf) { return odp_buf_to_hdr(buf)->pool_hdl; } diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index d604dea..4436a0c 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -361,7 +361,7 @@ odp_crypto_operation(odp_crypto_op_params_t *params, /* Resolve output buffer */ if (ODP_PACKET_INVALID == params->out_pkt) - if (ODP_BUFFER_POOL_INVALID != session->output_pool) + if (ODP_POOL_INVALID != session->output_pool) params->out_pkt = odp_packet_alloc(session->output_pool, odp_packet_len(params->pkt)); diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 6b38b80..bb049d1 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -25,7 +25,7 @@ * */ -odp_packet_t odp_packet_alloc(odp_buffer_pool_t pool_hdl, uint32_t len) +odp_packet_t odp_packet_alloc(odp_pool_t pool_hdl, uint32_t len) { pool_entry_t *pool = odp_pool_to_entry(pool_hdl); @@ -209,7 +209,7 @@ void *odp_packet_offset(odp_packet_t pkt, uint32_t offset, uint32_t *len, * */ -odp_buffer_pool_t odp_packet_pool(odp_packet_t pkt) +odp_pool_t odp_packet_pool(odp_packet_t pkt) { return odp_packet_hdr(pkt)->buf_hdr.pool_hdl; } @@ -463,7 +463,7 @@ odp_packet_t odp_packet_rem_data(odp_packet_t pkt, uint32_t offset, * */ -odp_packet_t odp_packet_copy(odp_packet_t pkt, odp_buffer_pool_t pool) +odp_packet_t odp_packet_copy(odp_packet_t pkt, odp_pool_t pool) { odp_packet_hdr_t *srchdr = odp_packet_hdr(pkt); uint32_t pktlen = srchdr->frame_len; @@ -623,7 +623,7 @@ int _odp_packet_copy_to_packet(odp_packet_t srcpkt, uint32_t srcoffset, return 0; } -odp_packet_t _odp_packet_alloc(odp_buffer_pool_t pool_hdl) +odp_packet_t _odp_packet_alloc(odp_pool_t pool_hdl) { pool_entry_t *pool = odp_pool_to_entry(pool_hdl); diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index be8349b..f69d6b1 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -169,7 +169,7 @@ static int free_pktio_entry(odp_pktio_t id) } static int init_socket(pktio_entry_t *entry, const char *dev, - odp_buffer_pool_t pool) + odp_pool_t pool) { int fd = -1; @@ -215,7 +215,7 @@ static int init_loop(pktio_entry_t *entry, odp_pktio_t id) return 0; } -static odp_pktio_t setup_pktio_entry(const char *dev, odp_buffer_pool_t pool) +static odp_pktio_t setup_pktio_entry(const char *dev, odp_pool_t pool) { odp_pktio_t id; pktio_entry_t *pktio_entry; @@ -257,7 +257,7 @@ static odp_pktio_t setup_pktio_entry(const char *dev, odp_buffer_pool_t pool) return id; } -odp_pktio_t odp_pktio_open(const char *dev, odp_buffer_pool_t pool) +odp_pktio_t odp_pktio_open(const char *dev, odp_pool_t pool) { odp_pktio_t id; diff --git a/platform/linux-generic/odp_packet_socket.c b/platform/linux-generic/odp_packet_socket.c index da7fb2c..bf69511 100644 --- a/platform/linux-generic/odp_packet_socket.c +++ b/platform/linux-generic/odp_packet_socket.c @@ -123,7 +123,7 @@ static int set_pkt_sock_fanout_mmap(pkt_sock_mmap_t *const pkt_sock, * ODP_PACKET_SOCKET_MMSG: */ int setup_pkt_sock(pkt_sock_t *const pkt_sock, const char *netdev, - odp_buffer_pool_t pool) + odp_pool_t pool) { int sockfd; int err; @@ -131,7 +131,7 @@ int setup_pkt_sock(pkt_sock_t *const pkt_sock, const char *netdev, struct ifreq ethreq; struct sockaddr_ll sa_ll; - if (pool == ODP_BUFFER_POOL_INVALID) + if (pool == ODP_POOL_INVALID) return -1; pkt_sock->pool = pool; @@ -468,7 +468,7 @@ static inline void mmap_tx_user_ready(struct tpacket2_hdr *hdr) static inline unsigned pkt_mmap_v2_rx(int sock, struct ring *ring, odp_packet_t pkt_table[], unsigned len, - odp_buffer_pool_t pool, + odp_pool_t pool, unsigned char if_mac[]) { union frame_map ppd; @@ -733,14 +733,14 @@ static int mmap_store_hw_addr(pkt_sock_mmap_t *const pkt_sock, * ODP_PACKET_SOCKET_MMAP: */ int setup_pkt_sock_mmap(pkt_sock_mmap_t *const pkt_sock, const char *netdev, - odp_buffer_pool_t pool, int fanout) + odp_pool_t pool, int fanout) { int if_idx; int ret = 0; memset(pkt_sock, 0, sizeof(*pkt_sock)); - if (pool == ODP_BUFFER_POOL_INVALID) + if (pool == ODP_POOL_INVALID) return -1; /* Store eth buffer offset for pkt buffers from this pool */ diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c index 79ae1b3..4cb82b3 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -43,10 +43,10 @@ _ODP_STATIC_ASSERT((8*sizeof(pri_mask_t)) >= QUEUES_PER_PRIO, typedef struct { - odp_queue_t pri_queue[ODP_CONFIG_SCHED_PRIOS][QUEUES_PER_PRIO]; - pri_mask_t pri_mask[ODP_CONFIG_SCHED_PRIOS]; - odp_spinlock_t mask_lock; - odp_buffer_pool_t pool; + odp_queue_t pri_queue[ODP_CONFIG_SCHED_PRIOS][QUEUES_PER_PRIO]; + pri_mask_t pri_mask[ODP_CONFIG_SCHED_PRIOS]; + odp_spinlock_t mask_lock; + odp_pool_t pool; } sched_t; typedef struct { @@ -83,7 +83,7 @@ static inline odp_queue_t select_pri_queue(odp_queue_t queue, int prio) int odp_schedule_init_global(void) { odp_shm_t shm; - odp_buffer_pool_t pool; + odp_pool_t pool; int i, j; odp_pool_param_t params; @@ -105,9 +105,9 @@ int odp_schedule_init_global(void) params.buf.num = SCHED_POOL_SIZE/sizeof(queue_desc_t); params.type = ODP_POOL_BUFFER; - pool = odp_buffer_pool_create("odp_sched_pool", ODP_SHM_NULL, ¶ms); + pool = odp_pool_create("odp_sched_pool", ODP_SHM_NULL, ¶ms); - if (pool == ODP_BUFFER_POOL_INVALID) { + if (pool == ODP_POOL_INVALID) { ODP_ERR("Schedule init: Pool create failed.\n"); return -1; } |