diff options
author | Matias Elo <matias.elo@nokia.com> | 2024-06-05 13:51:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-05 13:51:39 +0300 |
commit | 616034b9c9c789923f7ebe7f1c6d014c4ce8a5d2 (patch) | |
tree | dd1b579c93404d2d98b78944bbdf8313ec499bee /include/odp/api/spec | |
parent | 8063101c4fac56e16c5a2bb9843f2fd9c5acbfd7 (diff) | |
parent | 87913e636da621d47a8d3bc91fbe131abc09c294 (diff) |
Merge ODP v1.45.0.0HEADv1.45.0.0_DPDK_22.11master
Merge ODP linux-generic v1.45.0.0 into linux-dpdk.
Diffstat (limited to 'include/odp/api/spec')
25 files changed, 418 insertions, 81 deletions
diff --git a/include/odp/api/spec/classification.h b/include/odp/api/spec/classification.h index 518b2bd3c..2186c0bff 100644 --- a/include/odp/api/spec/classification.h +++ b/include/odp/api/spec/classification.h @@ -49,7 +49,7 @@ extern "C" { /** * @def ODP_COS_NAME_LEN - * Maximum class of service name length in chars including null char + * Maximum class of service name length, including the null character */ /** @@ -719,7 +719,7 @@ int odp_cls_capability(odp_cls_capability_t *capability); * values. * * @param name Name of the class-of-service or NULL. Maximum string - * length is ODP_COS_NAME_LEN. + * length is ODP_COS_NAME_LEN, including the null character. * @param param Class-of-service parameters * * @retval Class-of-service handle diff --git a/include/odp/api/spec/cpu.h b/include/odp/api/spec/cpu.h index 9550354fa..63f313ef3 100644 --- a/include/odp/api/spec/cpu.h +++ b/include/odp/api/spec/cpu.h @@ -176,6 +176,100 @@ uint64_t odp_cpu_cycles_resolution(void); void odp_cpu_pause(void); /** + * Prefetch into data cache + * + * Hints CPU to prefetch data into all data cache levels. Depending on implementation, this + * function may be equal to odp_prefetch_l1(). + * + * @param addr Data address to be prefetched (may be invalid) + */ +void odp_prefetch(const void *addr); + +/** + * Prefetch into L1 data cache + * + * Hints CPU to prefetch data into L1 data cache. + * + * @param addr Data address to be prefetched (may be invalid) + */ +void odp_prefetch_l1(const void *addr); + +/** + * Prefetch into L2 data cache + * + * Hints CPU to prefetch data into L2 data cache. + * + * @param addr Data address to be prefetched (may be invalid) + */ +void odp_prefetch_l2(const void *addr); + +/** + * Prefetch into L3 data cache + * + * Hints CPU to prefetch data into L3 data cache. + * + * @param addr Data address to be prefetched (may be invalid) + */ +void odp_prefetch_l3(const void *addr); + +/** + * Prefetch into data cache for storing + * + * Hints CPU to prefetch data into all data cache levels for storing. Depending on implementation, + * this function may be equal to odp_prefetch_store_l1(). + * + * @param addr Data address to be prefetched (may be invalid) + */ +void odp_prefetch_store(const void *addr); + +/** + * Prefetch into L1 data cache for storing + * + * Hints CPU to prefetch data into L1 data cache for storing. + * + * @param addr Data address to be prefetched (may be invalid) + */ +void odp_prefetch_store_l1(const void *addr); + +/** + * Prefetch into L2 data cache for storing + * + * Hints CPU to prefetch data into L2 data cache for storing. + * + * @param addr Data address to be prefetched (may be invalid) + */ +void odp_prefetch_store_l2(const void *addr); + +/** + * Prefetch into L3 data cache for storing + * + * Hints CPU to prefetch data into L3 data cache for storing. + * + * @param addr Data address to be prefetched (may be invalid) + */ +void odp_prefetch_store_l3(const void *addr); + +/** + * Streaming prefetch into L1 data cache + * + * Hints CPU to prefetch data of low temporal locality into L1 data cache. Streaming prefetch is + * optimal for data that will be used only once. + * + * @param addr Data address to be prefetched (may be invalid) + */ +void odp_prefetch_strm_l1(const void *addr); + +/** + * Streaming prefetch into L1 data cache for storing + * + * Hints CPU to prefetch data of low temporal locality into L1 data cache for storing. Streaming + * prefetch is optimal for data that will be used only once. + * + * @param addr Data address to be prefetched (may be invalid) + */ +void odp_prefetch_store_strm_l1(const void *addr); + +/** * @} */ diff --git a/include/odp/api/spec/crypto_types.h b/include/odp/api/spec/crypto_types.h index 579022762..987c9e1a1 100644 --- a/include/odp/api/spec/crypto_types.h +++ b/include/odp/api/spec/crypto_types.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright (c) 2014-2018 Linaro Limited - * Copyright (c) 2021-2023 Nokia + * Copyright (c) 2021-2024 Nokia */ /** @@ -163,6 +163,42 @@ typedef enum { */ ODP_CIPHER_ALG_ZUC_EEA3, + /** SNOW-V stream cipher */ + ODP_CIPHER_ALG_SNOW_V, + + /** SNOW-V-GCM AEAD algorithm + * + * SNOW-V-GCM provides both authentication and encryption. This cipher + * algorithm must always be paired with ODP_AUTH_ALG_SNOW_V_GCM auth + * algorithm in crypto session creation. + */ + ODP_CIPHER_ALG_SNOW_V_GCM, + + /** SM4 block cipher in ECB mode */ + ODP_CIPHER_ALG_SM4_ECB, + + /** SM4 block cipher in CBC mode */ + ODP_CIPHER_ALG_SM4_CBC, + + /** SM4 block cipher in CTR mode */ + ODP_CIPHER_ALG_SM4_CTR, + + /** SM4-GCM AEAD algorithm + * + * SM4-GCM provides both authentication and encryption. This cipher + * algorithm must always be paired with ODP_AUTH_ALG_SM4_GCM auth + * algorithm in crypto session creation. + */ + ODP_CIPHER_ALG_SM4_GCM, + + /** SM4-CCM AEAD algorithm + * + * SM4-CCM provides both authentication and encryption. This cipher + * algorithm must always be paired with ODP_AUTH_ALG_SM4_CCM auth + * algorithm in crypto session creation. + */ + ODP_CIPHER_ALG_SM4_CCM, + } odp_cipher_alg_t; /** @@ -208,6 +244,18 @@ typedef enum { */ ODP_AUTH_ALG_SHA512_HMAC, + /** HMAC using SHA3-224 */ + ODP_AUTH_ALG_SHA3_224_HMAC, + + /** HMAC using SHA3-256 */ + ODP_AUTH_ALG_SHA3_256_HMAC, + + /** HMAC using SHA3-384 */ + ODP_AUTH_ALG_SHA3_384_HMAC, + + /** HMAC using SHA3-512 */ + ODP_AUTH_ALG_SHA3_512_HMAC, + /** AES-GCM * * AES in Galois/Counter Mode (GCM) algorithm. GCM provides both @@ -322,6 +370,63 @@ typedef enum { */ ODP_AUTH_ALG_ZUC_EIA3, + /** SNOW-V-GCM AEAD algorithm + * + * SNOW-V-GCM provides both authentication and encryption. This auth + * algorithm must always be paired with ODP_CIPHER_ALG_SNOW_V_GCM + * cipher algorithm in crypto session creation. + */ + ODP_AUTH_ALG_SNOW_V_GCM, + + /** SNOW-V-GMAC + * + * SNOW-V-GMAC is similar to SNOW-V-GCM without any ciphered data. + * This algorithm can be paired only with ODP_CIPHER_ALG_NULL. + * + * Unlike with SNOW-V-GCM, authenticated data is not provided as + * AAD in ODP but as packet data indicated by the auth_range. + * The auth_aad_len session parameter and the aad_ptr operation + * parameter are ignored. + * + * GMAC needs an initialization vector, which must be passed via + * operation parameters (auth_iv_ptr). + */ + ODP_AUTH_ALG_SNOW_V_GMAC, + + /** HMAC using SM3 */ + ODP_AUTH_ALG_SM3_HMAC, + + /** SM4-GCM AEAD algorithm + * + * SM4-GCM provides both authentication and encryption. This auth + * algorithm must always be paired with ODP_CIPHER_ALG_SM4_GCM cipher + * algorithm in crypto session creation. + */ + ODP_AUTH_ALG_SM4_GCM, + + /** SM4-GMAC + * + * SM4-GMAC is similar to SM4-GCM without any ciphered data. + * This algorithm can be paired only with ODP_CIPHER_ALG_NULL. + * + * Unlike with SM4-GCM, authenticated data is not provided as + * AAD in ODP but as packet data indicated by the auth_range. + * The auth_aad_len session parameter and the aad_ptr operation + * parameter are ignored. + * + * GMAC needs an initialization vector, which must be passed via + * operation parameters (auth_iv_ptr). + */ + ODP_AUTH_ALG_SM4_GMAC, + + /** SM4-CCM AEAD algorithm + * + * SM4-CCM provides both authentication and encryption. This auth + * algorithm must always be paired with ODP_CIPHER_ALG_SM4_CCM cipher + * algorithm in crypto session creation. + */ + ODP_AUTH_ALG_SM4_CCM, + /** MD5 algorithm */ ODP_AUTH_ALG_MD5, @@ -340,6 +445,21 @@ typedef enum { /** 512 bit SHA2 algorithm */ ODP_AUTH_ALG_SHA512, + /** SHA-3 hash function producing 224-bit digests */ + ODP_AUTH_ALG_SHA3_224, + + /** SHA-3 hash function producing 256-bit digests */ + ODP_AUTH_ALG_SHA3_256, + + /** SHA-3 hash function producing 384-bit digests */ + ODP_AUTH_ALG_SHA3_384, + + /** SHA-3 hash function producing 512-bit digests */ + ODP_AUTH_ALG_SHA3_512, + + /** SM3 hash function */ + ODP_AUTH_ALG_SM3, + } odp_auth_alg_t; /** @@ -396,13 +516,34 @@ typedef union odp_crypto_cipher_algos_t { /** ODP_CIPHER_ALG_ZUC_EEA3 */ uint32_t zuc_eea3 : 1; + /** ODP_CIPHER_ALG_SNOW_V */ + uint32_t snow_v : 1; + + /** ODP_CIPHER_ALG_SNOW_V_GCM */ + uint32_t snow_v_gcm : 1; + + /** ODP_CIPHER_ALG_SM4_ECB */ + uint32_t sm4_ecb : 1; + + /** ODP_CIPHER_ALG_SM4_CBC */ + uint32_t sm4_cbc : 1; + + /** ODP_CIPHER_ALG_SM4_CTR */ + uint32_t sm4_ctr : 1; + + /** ODP_CIPHER_ALG_SM4_GCM */ + uint32_t sm4_gcm : 1; + + /** ODP_CIPHER_ALG_SM4_CCM */ + uint32_t sm4_ccm : 1; + } bit; /** All bits of the bit field structure * * This field can be used to set/clear all flags, or bitwise * operations over the entire structure. */ - uint32_t all_bits; + uint64_t all_bits; } odp_crypto_cipher_algos_t; /** @@ -432,6 +573,18 @@ typedef union odp_crypto_auth_algos_t { /** ODP_AUTH_ALG_SHA512_HMAC */ uint32_t sha512_hmac : 1; + /** ODP_AUTH_ALG_SHA3_224_HMAC */ + uint32_t sha3_224_hmac : 1; + + /** ODP_AUTH_ALG_SHA3_256_HMAC */ + uint32_t sha3_256_hmac : 1; + + /** ODP_AUTH_ALG_SHA3_384_HMAC */ + uint32_t sha3_384_hmac : 1; + + /** ODP_AUTH_ALG_SHA3_512_HMAC */ + uint32_t sha3_512_hmac : 1; + /** ODP_AUTH_ALG_AES_GCM */ uint32_t aes_gcm : 1; @@ -462,6 +615,24 @@ typedef union odp_crypto_auth_algos_t { /** ODP_AUTH_ALG_ZUC_EIA3 */ uint32_t zuc_eia3 : 1; + /** ODP_AUTH_ALG_SNOW_V_GCM */ + uint32_t snow_v_gcm : 1; + + /** ODP_AUTH_ALG_SNOW_V_GMAC */ + uint32_t snow_v_gmac : 1; + + /** ODP_AUTH_ALG_SM3_HMAC */ + uint32_t sm3_hmac : 1; + + /** ODP_AUTH_ALG_SM4_GCM */ + uint32_t sm4_gcm : 1; + + /** ODP_AUTH_ALG_SM4_GMAC */ + uint32_t sm4_gmac : 1; + + /** ODP_AUTH_ALG_SM4_CCM */ + uint32_t sm4_ccm : 1; + /** ODP_AUTH_ALG_MD5 */ uint32_t md5 : 1; @@ -480,13 +651,28 @@ typedef union odp_crypto_auth_algos_t { /** ODP_AUTH_ALG_SHA512 */ uint32_t sha512 : 1; + /** ODP_AUTH_ALG_SHA3_224 */ + uint32_t sha3_224 : 1; + + /** ODP_AUTH_ALG_SHA3_256 */ + uint32_t sha3_256 : 1; + + /** ODP_AUTH_ALG_SHA3_384 */ + uint32_t sha3_384 : 1; + + /** ODP_AUTH_ALG_SHA3_512 */ + uint32_t sha3_512 : 1; + + /** ODP_AUTH_ALG_SM3 */ + uint32_t sm3 : 1; + } bit; /** All bits of the bit field structure * * This field can be used to set/clear all flags, or bitwise * operations over the entire structure. */ - uint32_t all_bits; + uint64_t all_bits; } odp_crypto_auth_algos_t; /** @@ -673,19 +859,18 @@ typedef struct odp_crypto_session_param_t { * Select authentication algorithm to be used. ODP_AUTH_ALG_NULL * indicates that authentication is disabled. Use * odp_crypto_capability() for supported algorithms. Note that some - * algorithms restrict choice of the pairing cipher algorithm. When - * single algorithm provides both ciphering and authentication - * (i.e. Authenticated Encryption), authentication side key - * (auth_key) and IV (auth_iv) are ignored, and cipher side values are - * used instead. These algorithms ignore authentication side key - * and IV: ODP_AUTH_ALG_AES_GCM, ODP_AUTH_ALG_AES_CCM and - * ODP_AUTH_ALG_CHACHA20_POLY1305. Otherwise, all authentication side - * parameters must be set when authentication is enabled. The default - * value is ODP_AUTH_ALG_NULL. + * algorithms restrict choice of the pairing cipher algorithm. + * + * When single algorithm provides both ciphering and authentication + * (i.e. authenticated encryption), authentication side key (auth_key) + * and IV (auth_iv) are ignored, and cipher side parameters are used + * instead. * * When authentication is disabled, i.e. auth_alg is * ODP_AUTH_ALG_NULL, auth_key, auth_iv_len, auth_digest_len, * auth_aad_len and hash_result_in_auth_range parameters are ignored. + * + * The default value is ODP_AUTH_ALG_NULL. */ odp_auth_alg_t auth_alg; @@ -811,7 +996,7 @@ typedef struct odp_crypto_packet_op_param_t { * odp_crypto_result() or through a negative return value of * odp_crypto_op()/odp_crypto_op_enq(). * - * As a special case AES-GMAC uses this field instead of aad_ptr + * Algorithms in GMAC mode use this field instead of aad_ptr * for the data bytes to be authenticated. */ odp_packet_data_range_t auth_range; diff --git a/include/odp/api/spec/dma.h b/include/odp/api/spec/dma.h index 5303dc03f..0d07544dd 100644 --- a/include/odp/api/spec/dma.h +++ b/include/odp/api/spec/dma.h @@ -51,7 +51,8 @@ void odp_dma_param_init(odp_dma_param_t *param); * names are not required. However, odp_dma_lookup() returns only a single matching named session. * Use odp_dma_param_init() to initialize parameters into their default values. * - * @param name DMA session name or NULL. Maximum string length is ODP_DMA_NAME_LEN. + * @param name DMA session name or NULL. Maximum string length is ODP_DMA_NAME_LEN, + * including the null character. * @param param DMA session parameters * * @return DMA session handle on success @@ -349,7 +350,8 @@ void odp_dma_pool_param_init(odp_dma_pool_param_t *pool_param); * into their default values. Parameters values must not exceed pool capabilities * (odp_dma_pool_capability_t). * - * @param name Name of the pool or NULL. Maximum string length is ODP_POOL_NAME_LEN. + * @param name Name of the pool or NULL. Maximum string length is ODP_POOL_NAME_LEN, + * including the null character. * @param pool_param Pool parameters * * @return Handle of the created pool diff --git a/include/odp/api/spec/dma_types.h b/include/odp/api/spec/dma_types.h index 0a0e267df..36a04eb5c 100644 --- a/include/odp/api/spec/dma_types.h +++ b/include/odp/api/spec/dma_types.h @@ -58,7 +58,7 @@ extern "C" { /** * @def ODP_DMA_NAME_LEN - * Maximum DMA name length in chars including null char + * Maximum DMA name length, including the null character */ /** diff --git a/include/odp/api/spec/event.h b/include/odp/api/spec/event.h index 69464125b..e5684c634 100644 --- a/include/odp/api/spec/event.h +++ b/include/odp/api/spec/event.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright (c) 2015-2018 Linaro Limited - * Copyright (c) 2022-2023 Nokia + * Copyright (c) 2022-2024 Nokia */ /** @@ -144,6 +144,20 @@ void *odp_event_user_area(odp_event_t event); void *odp_event_user_area_and_flag(odp_event_t event, int *flag); /** + * Set event user flag + * + * Set (or clear) the user flag. + * + * The user flag maps to the user flag value of underlying event type (e.g. + * odp_packet_user_flag() for packets). If the event does not have user flag, + * nothing is done. + * + * @param event Event handle + * @param val New value for the flag. Zero clears the flag, other values set the flag. + */ +void odp_event_user_flag_set(odp_event_t event, int val); + +/** * Filter and convert packet events * * Checks event type of all input events, converts all packet events and outputs diff --git a/include/odp/api/spec/hints.h b/include/odp/api/spec/hints.h index fa5b1b9bb..58272c16a 100644 --- a/include/odp/api/spec/hints.h +++ b/include/odp/api/spec/hints.h @@ -63,23 +63,6 @@ extern "C" { */ #define odp_unlikely(x) __builtin_expect(!!(x), 0) -/* - * __builtin_prefetch (const void *addr, rw, locality) - * - * rw 0..1 (0: read, 1: write) - * locality 0..3 (0: don't leave to cache, 3: leave on all cache levels) - */ - -/** - * Cache prefetch address - */ -#define odp_prefetch(x) __builtin_prefetch((x), 0, 3) - -/** - * Cache prefetch address for storing - */ -#define odp_prefetch_store(x) __builtin_prefetch((x), 1, 3) - #else #define ODP_WEAK_SYMBOL @@ -88,8 +71,6 @@ extern "C" { #define ODP_UNUSED #define odp_likely(x) #define odp_unlikely(x) -#define odp_prefetch(x) -#define odp_prefetch_store(x) #endif diff --git a/include/odp/api/spec/ml.h b/include/odp/api/spec/ml.h index 1a7710ab3..443c6136d 100644 --- a/include/odp/api/spec/ml.h +++ b/include/odp/api/spec/ml.h @@ -111,8 +111,7 @@ void odp_ml_model_param_init(odp_ml_model_param_t *param); * * Creates an ML model according to the parameters. Use odp_ml_model_param_init() to initialize * parameters into their default values. The use of model name is optional. Unique names are not - * required. However, odp_ml_model_lookup() returns only a single matching model. Maximum name - * string length is #ODP_ML_MODEL_NAME_LEN. + * required. However, odp_ml_model_lookup() returns only a single matching model. * * The call copies the model binary and prepares it for loading. Application may free memory * buffers pointed by the parameters when the call returns. Use odp_ml_model_load() @@ -124,7 +123,8 @@ void odp_ml_model_param_init(odp_ml_model_param_t *param); * implementation specific extra parameters (e.g. hints about HW resource usage), user can pass * those with odp_ml_model_param_t.extra_param when applicable. * - * @param name Name of the model, or NULL + * @param name Name of the model, or NULL. Maximum string length is ODP_ML_MODEL_NAME_LEN, + * including the null character. * @param param ML model parameters * * @return ML model handle on success @@ -454,7 +454,8 @@ void odp_ml_compl_pool_param_init(odp_ml_compl_pool_param_t *param); * parameters into their default values. Parameters values must not exceed pool capabilities * (see odp_ml_compl_pool_capability_t). * - * @param name Name of the pool or NULL. Maximum string length is #ODP_POOL_NAME_LEN. + * @param name Name of the pool or NULL. Maximum string length is ODP_POOL_NAME_LEN, + * including the null character. * @param param Pool parameters * * @return Pool handle on success diff --git a/include/odp/api/spec/ml_types.h b/include/odp/api/spec/ml_types.h index 2b8f9d6c8..c91b49036 100644 --- a/include/odp/api/spec/ml_types.h +++ b/include/odp/api/spec/ml_types.h @@ -47,22 +47,22 @@ extern "C" { /** * @def ODP_ML_MODEL_NAME_LEN - * Maximum length of model name in chars (including null char) + * Maximum length of model name, including the null character */ /** * @def ODP_ML_MODEL_IO_NAME_LEN - * Maximum length of model input/output name in chars (including null char) + * Maximum length of model input/output name, including the null character */ /** * @def ODP_ML_SHAPE_NAME_LEN - * Maximum length of data dimension name in chars (including null char) + * Maximum length of data dimension name, including the null character */ /** * @def ODP_ML_EXTRA_STAT_NAME_LEN - * Maximum length of extra statistics counter name in chars (including null char) + * Maximum length of extra statistics counter name, including the null character */ /** diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h index 7f6c732ee..624c3c7c3 100644 --- a/include/odp/api/spec/packet.h +++ b/include/odp/api/spec/packet.h @@ -123,21 +123,59 @@ void odp_packet_free_sp(const odp_packet_t pkt[], int num); /** * Reset packet * - * Resets all packet metadata to their default values. Packet length is used - * to initialize pointers and lengths. It must be less than the total buffer - * length of the packet. Packet is not modified on failure. + * Resets all packet metadata and adjusts packet data to start according to pool + * parameters (align, seg_len, headroom). Packet data length is set to 'len'. + * Maximum value for 'len' can be queried with odp_packet_reset_max_len() + * function. Passing larger 'len' than the maximum value is allowed, but will + * cause failure to be returned. + * + * Packet reset maintains the original user area content. The operation may + * change data layout in packet segments and free possible extra segments. Data + * content may not be preserved. Packet is not modified on failure. + * + * This function must not be called for packets with references or incomplete + * reassembly status (ODP_PACKET_REASS_INCOMPLETE). * * @param pkt Packet handle - * @param len Packet data length (1 ... odp_packet_buf_len()) + * @param len Packet data length (1 ... odp_packet_reset_max_len()) * * @retval 0 on success * @retval <0 on failure - * - * @see odp_packet_buf_len() */ int odp_packet_reset(odp_packet_t pkt, uint32_t len); /** + * Maximum packet data reset length + * + * Returns the maximum packet data reset length for odp_packet_reset() based + * on current packet buffer space and pool parameters (align, seg_len, + * headroom). + * + * @param pkt Packet handle + * + * @return Maximum packet data length for odp_packet_reset() + */ +uint32_t odp_packet_reset_max_len(odp_packet_t pkt); + +/** + * Reset packet metadata + * + * Resets all packet metadata to their default values, except the ones listed + * below which are not modified: + * - Data pointer and length + * - Headroom and tailroom pointers and lengths + * - Packet segmentation + * - User area content + * - Dynamic reference count + * + * This function must not be called for packets with static references or + * incomplete reassembly status (ODP_PACKET_REASS_INCOMPLETE). + * + * @param pkt Packet handle + */ +void odp_packet_reset_meta(odp_packet_t pkt); + +/** * Get packet handle from event * * Converts an ODP_EVENT_PACKET type event to a packet. @@ -243,13 +281,12 @@ void *odp_packet_head(odp_packet_t pkt); /** * Total packet buffer length * - * Returns sum of buffer lengths over all packet segments. + * Returns sum of buffer lengths over all packet segments. Buffer length + * includes headroom, data, and tailroom lengths. * * @param pkt Packet handle * * @return Total packet buffer length in bytes - * - * @see odp_packet_reset() */ uint32_t odp_packet_buf_len(odp_packet_t pkt); @@ -2414,7 +2451,7 @@ odp_event_t odp_packet_tx_compl_to_event(odp_packet_tx_compl_t tx_compl); * * @param tx_compl Packet Tx completion handle * - * @see odp_packet_tx_completion_request() + * @see odp_packet_tx_compl_request() */ void odp_packet_tx_compl_free(odp_packet_tx_compl_t tx_compl); diff --git a/include/odp/api/spec/packet_io_stats.h b/include/odp/api/spec/packet_io_stats.h index d711d75f7..39ce86920 100644 --- a/include/odp/api/spec/packet_io_stats.h +++ b/include/odp/api/spec/packet_io_stats.h @@ -25,8 +25,8 @@ extern "C" { /** * @def ODP_PKTIO_STATS_EXTRA_NAME_LEN - * Maximum packet IO extra statistics counter name length in chars including - * null char + * Maximum packet IO extra statistics counter name length, including the null + * character */ /** diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h index 1b71a5a09..32f01fb59 100644 --- a/include/odp/api/spec/pool.h +++ b/include/odp/api/spec/pool.h @@ -46,7 +46,7 @@ int odp_pool_capability(odp_pool_capability_t *capa); * into their default values. * * @param name Name of the pool or NULL. Maximum string length is - * ODP_POOL_NAME_LEN. + * ODP_POOL_NAME_LEN, including the null character. * @param param Pool parameters. * * @return Handle of the created pool @@ -246,7 +246,8 @@ void odp_pool_ext_param_init(odp_pool_type_t type, odp_pool_ext_param_t *param); * single matching pool. Use odp_pool_ext_param_init() to initialize parameters * into their default values. * - * @param name Name of the pool or NULL. Maximum string length is ODP_POOL_NAME_LEN. + * @param name Name of the pool or NULL. Maximum string length is + * ODP_POOL_NAME_LEN, including the null character. * @param param Pool parameters * * @return Pool handle on success diff --git a/include/odp/api/spec/pool_types.h b/include/odp/api/spec/pool_types.h index cb3db4737..c9e629374 100644 --- a/include/odp/api/spec/pool_types.h +++ b/include/odp/api/spec/pool_types.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright (c) 2021-2023 Nokia + * Copyright (c) 2021-2024 Nokia */ /** @@ -36,7 +36,7 @@ extern "C" { /** * @def ODP_POOL_NAME_LEN - * Maximum pool name length in chars including null char + * Maximum pool name length, including the null character */ /** @@ -437,8 +437,10 @@ typedef struct odp_pool_param_t { /** Number of buffers in the pool */ uint32_t num; - /** Buffer size in bytes. The maximum number of bytes - * application will store in each buffer. + /** Minimum buffer size in bytes. + * + * An implementation may round up the given value. The maximum + * value is defined by buf.max_size pool capability. */ uint32_t size; diff --git a/include/odp/api/spec/proto_stats.h b/include/odp/api/spec/proto_stats.h index 7dd57ac0f..5fa0f4cea 100644 --- a/include/odp/api/spec/proto_stats.h +++ b/include/odp/api/spec/proto_stats.h @@ -55,7 +55,8 @@ int odp_proto_stats_capability(odp_pktio_t pktio, odp_proto_stats_capability_t * * for that PKTIO associated packets. Same proto stats object can be used with * any PKTIO. * - * @param name Object name + * @param name Object name. Maximum string length is ODP_PROTO_STATS_NAME_LEN, + * including the null character. * @param param Proto stats parameters * * @return Proto stats object handle diff --git a/include/odp/api/spec/proto_stats_types.h b/include/odp/api/spec/proto_stats_types.h index 4c08e60ab..4ba51f48e 100644 --- a/include/odp/api/spec/proto_stats_types.h +++ b/include/odp/api/spec/proto_stats_types.h @@ -33,6 +33,11 @@ extern "C" { * Invalid proto stats handle */ +/** + * @def ODP_PROTO_STATS_NAME_LEN + * Maximum proto stats name length, including the null character + */ + /** ODP proto stats counters * * Statistics that can be enabled in proto stats object. For Tx stats counters, diff --git a/include/odp/api/spec/queue.h b/include/odp/api/spec/queue.h index 9ce2ac73f..f12c3a185 100644 --- a/include/odp/api/spec/queue.h +++ b/include/odp/api/spec/queue.h @@ -36,7 +36,7 @@ extern "C" { * 'param' pointer is NULL. * * @param name Name of the queue or NULL. Maximum string length is - * ODP_QUEUE_NAME_LEN. + * ODP_QUEUE_NAME_LEN, including the null character. * @param param Queue parameters. Uses defaults if NULL. * * @return Queue handle diff --git a/include/odp/api/spec/queue_types.h b/include/odp/api/spec/queue_types.h index 9edf7271d..057df405a 100644 --- a/include/odp/api/spec/queue_types.h +++ b/include/odp/api/spec/queue_types.h @@ -34,7 +34,7 @@ extern "C" { /** * @def ODP_QUEUE_NAME_LEN - * Maximum queue name length in chars including null char + * Maximum queue name length, including the null character */ /** diff --git a/include/odp/api/spec/schedule.h b/include/odp/api/spec/schedule.h index 7226c198b..62422b43d 100644 --- a/include/odp/api/spec/schedule.h +++ b/include/odp/api/spec/schedule.h @@ -329,7 +329,7 @@ int odp_schedule_capability(odp_schedule_capability_t *capa); * returns only a single matching group. * * @param name Name of the schedule group or NULL. Maximum string length is - * ODP_SCHED_GROUP_NAME_LEN. + * ODP_SCHED_GROUP_NAME_LEN, including the null character. * @param mask Thread mask * * @return Schedule group handle diff --git a/include/odp/api/spec/schedule_types.h b/include/odp/api/spec/schedule_types.h index 30cb939dc..9525ee423 100644 --- a/include/odp/api/spec/schedule_types.h +++ b/include/odp/api/spec/schedule_types.h @@ -36,7 +36,7 @@ extern "C" { /** * @def ODP_SCHED_GROUP_NAME_LEN - * Maximum schedule group name length in chars including null char + * Maximum schedule group name length, including the null character */ /** diff --git a/include/odp/api/spec/shared_memory.h b/include/odp/api/spec/shared_memory.h index 3845f6e4d..7b2b28d11 100644 --- a/include/odp/api/spec/shared_memory.h +++ b/include/odp/api/spec/shared_memory.h @@ -35,7 +35,7 @@ extern "C" { /** * @def ODP_SHM_NAME_LEN - * Maximum shared memory block name length in chars including null char + * Maximum shared memory block name length, including the null character */ /** @@ -208,7 +208,8 @@ int odp_shm_capability(odp_shm_capability_t *capa); * searched with odp_shm_lookup() or odp_shm_import(), a unique name is needed * for correct match. * - * @param name Name of the block or NULL. Maximum string length is ODP_SHM_NAME_LEN. + * @param name Name of the block or NULL. Maximum string length is ODP_SHM_NAME_LEN, including the + * null character. * @param size Block size in bytes * @param align Block alignment in bytes * @param flags Shared memory parameter flags (ODP_SHM_*). Default value is 0. @@ -257,7 +258,8 @@ odp_shm_t odp_shm_lookup(const char *name); * @param odp_inst Remote ODP instance, as returned by odp_init_global() * @param local_name Name given to the block, in the local ODP instance * May be NULL, if the application doesn't need a name - * (for a lookup). + * (for a lookup). Maximum string length is + * ODP_SHM_NAME_LEN, including the null character. * * @return A handle to access a block exported by another ODP instance. * @retval ODP_SHM_INVALID on failure diff --git a/include/odp/api/spec/stash.h b/include/odp/api/spec/stash.h index 61ae58eba..d1b2f66c9 100644 --- a/include/odp/api/spec/stash.h +++ b/include/odp/api/spec/stash.h @@ -61,7 +61,7 @@ void odp_stash_param_init(odp_stash_param_t *param); * odp_stash_lookup() returns only a single matching stash. * * @param name Name of the stash or NULL. Maximum string length is - * ODP_STASH_NAME_LEN. + * ODP_STASH_NAME_LEN, including the null character. * @param param Stash creation parameters * * @return Handle of the created stash diff --git a/include/odp/api/spec/stash_types.h b/include/odp/api/spec/stash_types.h index 48c4b9be8..0f56a98d4 100644 --- a/include/odp/api/spec/stash_types.h +++ b/include/odp/api/spec/stash_types.h @@ -34,7 +34,7 @@ extern "C" { /** * @def ODP_STASH_NAME_LEN - * Maximum stash name length in chars including null char + * Maximum stash name length, including the null character */ /** diff --git a/include/odp/api/spec/timer.h b/include/odp/api/spec/timer.h index 1e7a06ad4..9766eafa3 100644 --- a/include/odp/api/spec/timer.h +++ b/include/odp/api/spec/timer.h @@ -125,7 +125,7 @@ void odp_timer_pool_param_init(odp_timer_pool_param_t *param); * The call returns failure when requested parameter values are not supported. * * @param name Name of the timer pool or NULL. Maximum string length is - * ODP_TIMER_POOL_NAME_LEN. + * ODP_TIMER_POOL_NAME_LEN, including the null character. * @param params Timer pool parameters. The content will be copied. * * @return Timer pool handle on success diff --git a/include/odp/api/spec/timer_types.h b/include/odp/api/spec/timer_types.h index 7db57c340..e2e8b917e 100644 --- a/include/odp/api/spec/timer_types.h +++ b/include/odp/api/spec/timer_types.h @@ -58,7 +58,7 @@ extern "C" { /** * @def ODP_TIMER_POOL_NAME_LEN - * Maximum timer pool name length in chars including null char + * Maximum timer pool name length, including the null character */ /** diff --git a/include/odp/api/spec/traffic_mngr.h b/include/odp/api/spec/traffic_mngr.h index 117ed22cd..d75277f2b 100644 --- a/include/odp/api/spec/traffic_mngr.h +++ b/include/odp/api/spec/traffic_mngr.h @@ -101,6 +101,11 @@ extern "C" { */ /** + * @def ODP_TM_NAME_LEN + * Maximum traffic manager name length, including the null character + */ + +/** * @typedef odp_tm_percent_t * Is used when specifying fields that are percentages. It is a fixed point * integer whose units are 1/100 of a percent. Hence 100% is represented as @@ -771,7 +776,8 @@ int odp_tm_egress_capabilities(odp_tm_capabilities_t *capabilities, * * @param name The name to be assigned to this TM system. Cannot * be NULL, and also must be unique amongst all other - * TM system names. + * TM system names. Maximum string length is + * ODP_TM_NAME_LEN, including the null character. * @param requirements The minimum required feature set and limits needed * by the ODP application. * @param egress Describes the single egress "spigot" of this @@ -1129,7 +1135,8 @@ void odp_tm_shaper_params_init(odp_tm_shaper_params_t *params); * * @param name Optional name associated with this shaper profile. Can * be NULL. If non-NULL must be unique amongst the set of - * all other shaper profiles. + * all other shaper profiles. Maximum string length is + * ODP_TM_NAME_LEN, including the null character. * @param params The profile parameters. See comments associated with * the odp_tm_shaper_params_t for more details. * @return Returns ODP_TM_INVALID upon failure, or the newly @@ -1242,7 +1249,8 @@ void odp_tm_sched_params_init(odp_tm_sched_params_t *params); * * @param name Optional name associated with this scheduler profile. * Can be NULL. If non-NULL must be unique amongst the - * set of all other scheduler profiles. + * set of all other scheduler profiles. Maximum string length is + * ODP_TM_NAME_LEN, including the null character. * @param params The profile parameters. See comments associated with * the odp_tm_sched_params_t for more details. * @return Returns ODP_TM_INVALID upon failure, or the newly @@ -1339,6 +1347,8 @@ void odp_tm_threshold_params_init(odp_tm_threshold_params_t *params); * @param name Optional name associated with this queue threshold * profile. Can be NULL. If non-NULL must be unique * amongst the set of all other queue threshold profiles. + * Maximum string length is ODP_TM_NAME_LEN, including the null + * character. * @param params The profile parameters. See comments associated with * the odp_tm_threshold_params_t for more details. * @return Returns ODP_TM_INVALID upon failure, or the newly @@ -1477,7 +1487,8 @@ void odp_tm_wred_params_init(odp_tm_wred_params_t *params); * * @param name Optional name associated with this WRED profile. Can * be NULL. If non-NULL must be unique amongst the set of - * all other WRED profiles. + * all other WRED profiles. Maximum string length is + * ODP_TM_NAME_LEN, including the null character. * @param params The profile parameters. See comments associated with the * odp_tm_wred_params_t for more details. * @return Returns ODP_TM_INVALID upon failure, or the newly @@ -1616,7 +1627,8 @@ void odp_tm_node_params_init(odp_tm_node_params_t *params); * created. * @param name Optional name that can be used later later to find this * same odp_tm_node_t. Can be NULL, otherwise must be - * unique across all odp_tm_node objects. + * unique across all odp_tm_node objects. Maximum string length + * is ODP_TM_NAME_LEN, including the null character. * @param params TM node parameters. * * @return Returns ODP_TM_INVALID upon failure, otherwise returns |