diff options
Diffstat (limited to 'include/odp/api')
-rw-r--r-- | include/odp/api/spec/init.h | 26 | ||||
-rw-r--r-- | include/odp/api/spec/ipsec.h | 15 | ||||
-rw-r--r-- | include/odp/api/spec/packet_io.h | 5 | ||||
-rw-r--r-- | include/odp/api/spec/packet_types.h | 5 | ||||
-rw-r--r-- | include/odp/api/spec/pool.h | 8 | ||||
-rw-r--r-- | include/odp/api/spec/pool_types.h | 5 | ||||
-rw-r--r-- | include/odp/api/spec/protocols.h | 8 | ||||
-rw-r--r-- | include/odp/api/spec/stash.h | 100 | ||||
-rw-r--r-- | include/odp/api/spec/version.h.in | 5 |
9 files changed, 160 insertions, 17 deletions
diff --git a/include/odp/api/spec/init.h b/include/odp/api/spec/init.h index 67e616fce..69ca55767 100644 --- a/include/odp/api/spec/init.h +++ b/include/odp/api/spec/init.h @@ -1,5 +1,5 @@ /* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2019, Nokia + * Copyright (c) 2019-2021, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -36,11 +36,21 @@ extern "C" { * ODP log level. */ typedef enum { + /** Debug */ ODP_LOG_DBG, + + /** Error */ ODP_LOG_ERR, + + /** Unimplemented */ ODP_LOG_UNIMPLEMENTED, + + /** Abort */ ODP_LOG_ABORT, + + /** Print */ ODP_LOG_PRINT + } odp_log_level_t; /** @@ -346,6 +356,20 @@ int odp_term_global(odp_instance_t instance); void odp_log_thread_fn_set(odp_log_func_t func); /** + * Get instance handle + * + * A successful call outputs the calling thread's ODP instance handle. + * + * @param[out] instance Instance handle pointer for output + * + * @retval 0 on success + * @retval <0 on failure + * + * @see odp_init_global(), odp_init_local() + */ +int odp_instance(odp_instance_t *instance); + +/** * @} */ diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 6e28e7fb4..f66758341 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -1296,7 +1296,10 @@ typedef struct odp_ipsec_warn_t { uint32_t soft_exp_packets : 1; }; - /** All warnings bits */ + /** All warning bits + * + * This field can be used to set/clear all bits, or to perform + * bitwise operations over those. */ uint32_t all; }; @@ -1335,7 +1338,10 @@ typedef struct odp_ipsec_op_flag_t { }; - /** All flag bits */ + /** All flag bits + * + * This field can be used to set/clear all flags, or to perform + * bitwise operations over those. */ uint32_t all; }; @@ -1373,7 +1379,10 @@ typedef struct odp_ipsec_out_opt_t { } flag; - /** All flag bits */ + /** All flag bits + * + * This field can be used to set/clear all flags, or to perform + * bitwise operations over those. */ uint32_t all_flags; }; diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h index 2ccd7b4c8..0d5938e9e 100644 --- a/include/odp/api/spec/packet_io.h +++ b/include/odp/api/spec/packet_io.h @@ -134,7 +134,10 @@ typedef union odp_pktin_hash_proto_t { uint32_t ipv6 : 1; } proto; - /** All bits of the bit field structure */ + /** All bits of the bit field structure + * + * This field can be used to set/clear all bits, or to perform bitwise + * operations over those. */ uint32_t all_bits; } odp_pktin_hash_proto_t; diff --git a/include/odp/api/spec/packet_types.h b/include/odp/api/spec/packet_types.h index 52b0e22b6..113f24d94 100644 --- a/include/odp/api/spec/packet_types.h +++ b/include/odp/api/spec/packet_types.h @@ -324,7 +324,10 @@ typedef union odp_proto_chksums_t { } chksum; - /** All checksum bits. This can be used to set/clear all flags. */ + /** All checksum bits + * + * This field can be used to set/clear all flags, or to perform bitwise + * operations over those. */ uint32_t all_chksum; } odp_proto_chksums_t; diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h index 6314b827c..6ebfafe05 100644 --- a/include/odp/api/spec/pool.h +++ b/include/odp/api/spec/pool.h @@ -105,6 +105,14 @@ int odp_pool_info(odp_pool_t pool, odp_pool_info_t *info); void odp_pool_print(odp_pool_t pool); /** + * Print debug info about all pools + * + * Print implementation defined information about all created pools to the ODP + * log. The information is intended to be used for debugging. + */ +void odp_pool_print_all(void); + +/** * Get printable value for an odp_pool_t * * @param hdl odp_pool_t handle to be printed diff --git a/include/odp/api/spec/pool_types.h b/include/odp/api/spec/pool_types.h index 44d9297c1..583a81b67 100644 --- a/include/odp/api/spec/pool_types.h +++ b/include/odp/api/spec/pool_types.h @@ -418,8 +418,9 @@ typedef struct odp_pool_param_t { */ uint32_t align; - /** Minimum number of packet data bytes that are stored in the - * first segment of a packet. The maximum value is defined by + /** Minimum number of packet data bytes that can be stored in + * the first segment of a newly allocated packet (starting from + * odp_packet_data()). The maximum value is defined by * pool capability pkt.max_seg_len. Use 0 for default. */ uint32_t seg_len; diff --git a/include/odp/api/spec/protocols.h b/include/odp/api/spec/protocols.h index 71fc59909..95c9bc0ed 100644 --- a/include/odp/api/spec/protocols.h +++ b/include/odp/api/spec/protocols.h @@ -19,11 +19,9 @@ extern "C" { #endif /** - * @addtogroup odp_protocols - * @details - * <b> Protocols </b> - * - * @{ + * @defgroup odp_protocols ODP PROTOCOLS + * Network protocols + * @{ */ /** IPv4 address size */ diff --git a/include/odp/api/spec/stash.h b/include/odp/api/spec/stash.h index 42b3bd9d7..12214e200 100644 --- a/include/odp/api/spec/stash.h +++ b/include/odp/api/spec/stash.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2020, Nokia +/* Copyright (c) 2020-2021, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -307,6 +307,55 @@ uint64_t odp_stash_to_u64(odp_stash_t stash); int32_t odp_stash_put(odp_stash_t stash, const void *obj, int32_t num); /** + * Put 32-bit integers into a stash + * + * Otherwise like odp_stash_put(), except that this function operates on 32-bit + * integers. The stash must have been created with 'obj_size' of 4. + * + * @param stash Stash handle + * @param u32 Points to an array of 32-bit integers to be stored. The array + * must be 32-bit aligned in memory. + * @param num Number of integers to store + * + * @return Number of integers actually stored (0 ... num) + * @retval <0 on failure + */ +int32_t odp_stash_put_u32(odp_stash_t stash, const uint32_t u32[], int32_t num); + +/** + * Put 64-bit integers into a stash + * + * Otherwise like odp_stash_put(), except that this function operates on 64-bit + * integers. The stash must have been created with 'obj_size' of 8. + * + * @param stash Stash handle + * @param u64 Points to an array of 64-bit integers to be stored. The array + * must be 64-bit aligned in memory. + * @param num Number of integers to store + * + * @return Number of integers actually stored (0 ... num) + * @retval <0 on failure + */ +int32_t odp_stash_put_u64(odp_stash_t stash, const uint64_t u64[], int32_t num); + +/** + * Put pointers into a stash + * + * Otherwise like odp_stash_put(), except that this function operates on + * pointers. The stash must have been created with 'obj_size' matching to the + * size of uintptr_t. + * + * @param stash Stash handle + * @param ptr Points to an array of pointers to be stored. The array must be + * pointer size aligned in memory. + * @param num Number of pointers to store + * + * @return Number of pointers actually stored (0 ... num) + * @retval <0 on failure + */ +int32_t odp_stash_put_ptr(odp_stash_t stash, const uintptr_t ptr[], int32_t num); + +/** * Get object handles from a stash * * Get previously stored object handles from the stash. Application specifies @@ -325,6 +374,55 @@ int32_t odp_stash_put(odp_stash_t stash, const void *obj, int32_t num); int32_t odp_stash_get(odp_stash_t stash, void *obj, int32_t num); /** + * Get 32-bit integers from a stash + * + * Otherwise like odp_stash_get(), except that this function operates on 32-bit + * integers. The stash must have been created with 'obj_size' of 4. + * + * @param stash Stash handle + * @param[out] u32 Points to an array of 32-bit integers for output. The + * array must be 32-bit aligned in memory. + * @param num Maximum number of integers to get from the stash + * + * @return Number of integers actually output (0 ... num) to 'u32' array + * @retval <0 on failure + */ +int32_t odp_stash_get_u32(odp_stash_t stash, uint32_t u32[], int32_t num); + +/** + * Get 64-bit integers from a stash + * + * Otherwise like odp_stash_get(), except that this function operates on 64-bit + * integers. The stash must have been created with 'obj_size' of 8. + * + * @param stash Stash handle + * @param[out] u64 Points to an array of 64-bit integers for output. The + * array must be 64-bit aligned in memory. + * @param num Maximum number of integers to get from the stash + * + * @return Number of integers actually output (0 ... num) to 'u64' array + * @retval <0 on failure + */ +int32_t odp_stash_get_u64(odp_stash_t stash, uint64_t u64[], int32_t num); + +/** + * Get pointers from a stash + * + * Otherwise like odp_stash_get(), except that this function operates on + * pointers. The stash must have been created with 'obj_size' matching to the + * size of uintptr_t. + * + * @param stash Stash handle + * @param[out] ptr Points to an array of pointers for output. The array must + * be pointer size aligned in memory. + * @param num Maximum number of pointers to get from the stash + * + * @return Number of pointers actually output (0 ... num) to 'ptr' array + * @retval <0 on failure + */ +int32_t odp_stash_get_ptr(odp_stash_t stash, uintptr_t ptr[], int32_t num); + +/** * Flush object handles from the thread local cache * * Flushes all object handles from the thread local cache into the stash, so diff --git a/include/odp/api/spec/version.h.in b/include/odp/api/spec/version.h.in index 21a5f9a77..f07a9125f 100644 --- a/include/odp/api/spec/version.h.in +++ b/include/odp/api/spec/version.h.in @@ -1,5 +1,5 @@ /* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2020, Nokia + * Copyright (c) 2020-2021, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -21,8 +21,7 @@ extern "C" { /** * @defgroup odp_version ODP VERSION - * @details - * <b> ODP API and implementation versions </b> + * API and implementation versions * * ODP API version is identified by ODP_VERSION_API_XXX preprocessor macros. * In addition to these macros, API calls can be used to identify implementation |