diff options
Diffstat (limited to 'include')
42 files changed, 631 insertions, 300 deletions
diff --git a/include/Makefile.am b/include/Makefile.am index 89dfddebc..510154753 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -26,6 +26,7 @@ odpapiinclude_HEADERS = \ odp/api/dma_types.h \ odp/api/errno.h \ odp/api/event.h \ + odp/api/event_types.h \ odp/api/hash.h \ odp/api/hints.h \ odp/api/init.h \ @@ -86,6 +87,7 @@ odpapispecinclude_HEADERS = \ odp/api/spec/dma_types.h \ odp/api/spec/errno.h \ odp/api/spec/event.h \ + odp/api/spec/event_types.h \ odp/api/spec/hash.h \ odp/api/spec/hints.h \ odp/api/spec/init.h \ @@ -148,6 +150,7 @@ odpapiabidefaultinclude_HEADERS = \ odp/api/abi-default/dma_types.h \ odp/api/abi-default/errno.h \ odp/api/abi-default/event.h \ + odp/api/abi-default/event_types.h \ odp/api/abi-default/hash.h \ odp/api/abi-default/init.h \ odp/api/abi-default/ipsec.h \ @@ -178,6 +181,7 @@ odpapiabidefaultinclude_HEADERS = \ odp/api/abi-default/thrmask.h \ odp/api/abi-default/ticketlock.h \ odp/api/abi-default/time.h \ + odp/api/abi-default/timer.h \ odp/api/abi-default/timer_types.h \ odp/api/abi-default/traffic_mngr.h \ odp/api/abi-default/version.h @@ -202,6 +206,7 @@ odpapiabiarchinclude_HEADERS = \ odp/arch/arm32-linux/odp/api/abi/dma_types.h \ odp/arch/arm32-linux/odp/api/abi/errno.h \ odp/arch/arm32-linux/odp/api/abi/event.h \ + odp/arch/arm32-linux/odp/api/abi/event_types.h \ odp/arch/arm32-linux/odp/api/abi/hash.h \ odp/arch/arm32-linux/odp/api/abi/init.h \ odp/arch/arm32-linux/odp/api/abi/ipsec.h \ @@ -232,6 +237,7 @@ odpapiabiarchinclude_HEADERS = \ odp/arch/arm32-linux/odp/api/abi/thrmask.h \ odp/arch/arm32-linux/odp/api/abi/ticketlock.h \ odp/arch/arm32-linux/odp/api/abi/time.h \ + odp/arch/arm32-linux/odp/api/abi/timer.h \ odp/arch/arm32-linux/odp/api/abi/timer_types.h \ odp/arch/arm32-linux/odp/api/abi/traffic_mngr.h \ odp/arch/arm32-linux/odp/api/abi/version.h @@ -252,6 +258,7 @@ odpapiabiarchinclude_HEADERS = \ odp/arch/arm64-linux/odp/api/abi/dma_types.h \ odp/arch/arm64-linux/odp/api/abi/errno.h \ odp/arch/arm64-linux/odp/api/abi/event.h \ + odp/arch/arm64-linux/odp/api/abi/event_types.h \ odp/arch/arm64-linux/odp/api/abi/hash.h \ odp/arch/arm64-linux/odp/api/abi/init.h \ odp/arch/arm64-linux/odp/api/abi/ipsec.h \ @@ -282,6 +289,7 @@ odpapiabiarchinclude_HEADERS = \ odp/arch/arm64-linux/odp/api/abi/thrmask.h \ odp/arch/arm64-linux/odp/api/abi/ticketlock.h \ odp/arch/arm64-linux/odp/api/abi/time.h \ + odp/arch/arm64-linux/odp/api/abi/timer.h \ odp/arch/arm64-linux/odp/api/abi/timer_types.h \ odp/arch/arm64-linux/odp/api/abi/traffic_mngr.h \ odp/arch/arm64-linux/odp/api/abi/version.h @@ -302,6 +310,7 @@ odpapiabiarchinclude_HEADERS = \ odp/arch/default-linux/odp/api/abi/dma_types.h \ odp/arch/default-linux/odp/api/abi/errno.h \ odp/arch/default-linux/odp/api/abi/event.h \ + odp/arch/default-linux/odp/api/abi/event_types.h \ odp/arch/default-linux/odp/api/abi/hash.h \ odp/arch/default-linux/odp/api/abi/init.h \ odp/arch/default-linux/odp/api/abi/ipsec.h \ @@ -332,6 +341,7 @@ odpapiabiarchinclude_HEADERS = \ odp/arch/default-linux/odp/api/abi/thrmask.h \ odp/arch/default-linux/odp/api/abi/ticketlock.h \ odp/arch/default-linux/odp/api/abi/time.h \ + odp/arch/default-linux/odp/api/abi/timer.h \ odp/arch/default-linux/odp/api/abi/timer_types.h \ odp/arch/default-linux/odp/api/abi/traffic_mngr.h \ odp/arch/default-linux/odp/api/abi/version.h @@ -352,6 +362,7 @@ odpapiabiarchinclude_HEADERS = \ odp/arch/power64-linux/odp/api/abi/dma_types.h \ odp/arch/power64-linux/odp/api/abi/errno.h \ odp/arch/power64-linux/odp/api/abi/event.h \ + odp/arch/power64-linux/odp/api/abi/event_types.h \ odp/arch/power64-linux/odp/api/abi/hash.h \ odp/arch/power64-linux/odp/api/abi/init.h \ odp/arch/power64-linux/odp/api/abi/ipsec.h \ @@ -382,6 +393,7 @@ odpapiabiarchinclude_HEADERS = \ odp/arch/power64-linux/odp/api/abi/thrmask.h \ odp/arch/power64-linux/odp/api/abi/ticketlock.h \ odp/arch/power64-linux/odp/api/abi/time.h \ + odp/arch/power64-linux/odp/api/abi/timer.h \ odp/arch/power64-linux/odp/api/abi/timer_types.h \ odp/arch/power64-linux/odp/api/abi/traffic_mngr.h \ odp/arch/power64-linux/odp/api/abi/version.h @@ -402,6 +414,7 @@ odpapiabiarchinclude_HEADERS = \ odp/arch/x86_32-linux/odp/api/abi/dma_types.h \ odp/arch/x86_32-linux/odp/api/abi/errno.h \ odp/arch/x86_32-linux/odp/api/abi/event.h \ + odp/arch/x86_32-linux/odp/api/abi/event_types.h \ odp/arch/x86_32-linux/odp/api/abi/hash.h \ odp/arch/x86_32-linux/odp/api/abi/init.h \ odp/arch/x86_32-linux/odp/api/abi/ipsec.h \ @@ -432,6 +445,7 @@ odpapiabiarchinclude_HEADERS = \ odp/arch/x86_32-linux/odp/api/abi/thrmask.h \ odp/arch/x86_32-linux/odp/api/abi/ticketlock.h \ odp/arch/x86_32-linux/odp/api/abi/time.h \ + odp/arch/x86_32-linux/odp/api/abi/timer.h \ odp/arch/x86_32-linux/odp/api/abi/timer_types.h \ odp/arch/x86_32-linux/odp/api/abi/traffic_mngr.h \ odp/arch/x86_32-linux/odp/api/abi/version.h @@ -452,6 +466,7 @@ odpapiabiarchinclude_HEADERS = \ odp/arch/x86_64-linux/odp/api/abi/dma_types.h \ odp/arch/x86_64-linux/odp/api/abi/errno.h \ odp/arch/x86_64-linux/odp/api/abi/event.h \ + odp/arch/x86_64-linux/odp/api/abi/event_types.h \ odp/arch/x86_64-linux/odp/api/abi/hash.h \ odp/arch/x86_64-linux/odp/api/abi/init.h \ odp/arch/x86_64-linux/odp/api/abi/ipsec.h \ @@ -482,6 +497,7 @@ odpapiabiarchinclude_HEADERS = \ odp/arch/x86_64-linux/odp/api/abi/thrmask.h \ odp/arch/x86_64-linux/odp/api/abi/ticketlock.h \ odp/arch/x86_64-linux/odp/api/abi/time.h \ + odp/arch/x86_64-linux/odp/api/abi/timer.h \ odp/arch/x86_64-linux/odp/api/abi/timer_types.h \ odp/arch/x86_64-linux/odp/api/abi/traffic_mngr.h \ odp/arch/x86_64-linux/odp/api/abi/version.h diff --git a/include/odp/api/abi-default/event.h b/include/odp/api/abi-default/event.h index ecedda3bd..a1563ac9b 100644 --- a/include/odp/api/abi-default/event.h +++ b/include/odp/api/abi-default/event.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2017-2018, Linaro Limited +/* Copyright (c) 2022, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -11,41 +11,7 @@ extern "C" { #endif -#include <stdint.h> - -/** @internal Dummy type for strong typing */ -typedef struct { char dummy; /**< @internal Dummy */ } _odp_abi_event_t; - -/** @ingroup odp_event - * @{ - */ - -typedef _odp_abi_event_t *odp_event_t; - -#define ODP_EVENT_INVALID ((odp_event_t)0) - -typedef enum { - ODP_EVENT_BUFFER = 1, - ODP_EVENT_PACKET = 2, - ODP_EVENT_TIMEOUT = 3, - ODP_EVENT_CRYPTO_COMPL = 4, - ODP_EVENT_IPSEC_STATUS = 5, - ODP_EVENT_PACKET_VECTOR = 6, - ODP_EVENT_PACKET_TX_COMPL = 7, - ODP_EVENT_DMA_COMPL = 8, -} odp_event_type_t; - -typedef enum { - ODP_EVENT_NO_SUBTYPE = 0, - ODP_EVENT_PACKET_BASIC = 1, - ODP_EVENT_PACKET_CRYPTO = 2, - ODP_EVENT_PACKET_IPSEC = 3, - ODP_EVENT_PACKET_COMP = 4 -} odp_event_subtype_t; - -/** - * @} - */ +/* Empty header required due to the inline functions */ #ifdef __cplusplus } diff --git a/include/odp/api/abi-default/event_types.h b/include/odp/api/abi-default/event_types.h new file mode 100644 index 000000000..fc685cfd9 --- /dev/null +++ b/include/odp/api/abi-default/event_types.h @@ -0,0 +1,58 @@ +/* Copyright (c) 2017-2018, Linaro Limited + * Copyright (c) 2022, Nokia + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef ODP_ABI_EVENT_TYPES_H_ +#define ODP_ABI_EVENT_TYPES_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <stdint.h> +#include <odp/api/deprecated.h> + +/** @internal Dummy type for strong typing */ +typedef struct { char dummy; /**< @internal Dummy */ } _odp_abi_event_t; + +/** @ingroup odp_event + * @{ + */ + +typedef _odp_abi_event_t *odp_event_t; + +#define ODP_EVENT_INVALID ((odp_event_t)0) + +typedef enum { + ODP_EVENT_BUFFER = 1, + ODP_EVENT_PACKET = 2, + ODP_EVENT_TIMEOUT = 3, +#if ODP_DEPRECATED_API + ODP_EVENT_CRYPTO_COMPL = 4, +#endif + ODP_EVENT_IPSEC_STATUS = 5, + ODP_EVENT_PACKET_VECTOR = 6, + ODP_EVENT_PACKET_TX_COMPL = 7, + ODP_EVENT_DMA_COMPL = 8, +} odp_event_type_t; + +typedef enum { + ODP_EVENT_NO_SUBTYPE = 0, + ODP_EVENT_PACKET_BASIC = 1, + ODP_EVENT_PACKET_CRYPTO = 2, + ODP_EVENT_PACKET_IPSEC = 3, + ODP_EVENT_PACKET_COMP = 4 +} odp_event_subtype_t; + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/odp/api/abi-default/timer.h b/include/odp/api/abi-default/timer.h new file mode 100644 index 000000000..faf690ae3 --- /dev/null +++ b/include/odp/api/abi-default/timer.h @@ -0,0 +1,20 @@ +/* Copyright (c) 2022, Nokia + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef ODP_ABI_TIMER_H_ +#define ODP_ABI_TIMER_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Empty header required due to the timer inline functions */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/odp/api/abi-default/traffic_mngr.h b/include/odp/api/abi-default/traffic_mngr.h index 06dc6c3c7..78985313d 100644 --- a/include/odp/api/abi-default/traffic_mngr.h +++ b/include/odp/api/abi-default/traffic_mngr.h @@ -76,11 +76,6 @@ extern "C" { */ #define ODP_TM_MAX_TM_NODE_FANIN (4 * 1024) -/** The ODP_NUM_SHAPER_COLORS constant just counts the number of enumeration - * values defined in the odp_tm_shaper_color_t type. - */ -#define ODP_NUM_SHAPER_COLORS 3 - /** The INVALID_PRIORITY constant is used when one needs to indicate an * invalid priority value. */ diff --git a/include/odp/api/buffer.h b/include/odp/api/buffer.h index 27622c2a3..a56cd0660 100644 --- a/include/odp/api/buffer.h +++ b/include/odp/api/buffer.h @@ -17,8 +17,6 @@ extern "C" { #endif -#include <odp/api/std_types.h> -#include <odp/api/abi/event.h> #include <odp/api/abi/buffer.h> #include <odp/api/spec/buffer.h> diff --git a/include/odp/api/comp.h b/include/odp/api/comp.h index c3294e79e..300d12a61 100644 --- a/include/odp/api/comp.h +++ b/include/odp/api/comp.h @@ -18,8 +18,6 @@ extern "C" { #endif #include <odp/api/abi/comp.h> -#include <odp/api/abi/event.h> -#include <odp/api/abi/queue_types.h> #include <odp/api/spec/comp.h> diff --git a/include/odp/api/dma_types.h b/include/odp/api/dma_types.h index 5a726a319..eeaa7bee8 100644 --- a/include/odp/api/dma_types.h +++ b/include/odp/api/dma_types.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2021, Nokia +/* Copyright (c) 2021-2022, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -17,7 +17,6 @@ extern "C" { #endif -#include <odp/api/abi/event.h> #include <odp/api/abi/dma_types.h> #include <odp/api/spec/dma_types.h> diff --git a/include/odp/api/event_types.h b/include/odp/api/event_types.h new file mode 100644 index 000000000..a4d20a341 --- /dev/null +++ b/include/odp/api/event_types.h @@ -0,0 +1,28 @@ +/* Copyright (c) 2022, Nokia + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODP event API type definitions + */ + +#ifndef ODP_API_EVENT_TYPES_H_ +#define ODP_API_EVENT_TYPES_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <odp/api/abi/event_types.h> + +#include <odp/api/spec/event_types.h> + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/odp/api/packet.h b/include/odp/api/packet.h index eb75d18fa..1f04c026d 100644 --- a/include/odp/api/packet.h +++ b/include/odp/api/packet.h @@ -1,4 +1,5 @@ /* Copyright (c) 2013-2018, Linaro Limited + * Copyright (c) 2022, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -17,12 +18,7 @@ extern "C" { #endif -#include <odp/api/std_types.h> -#include <odp/api/abi/event.h> -#include <odp/api/abi/packet_io_types.h> -#include <odp/api/abi/packet_types.h> #include <odp/api/abi/packet.h> -#include <odp/api/abi/buffer.h> #include <odp/api/spec/packet.h> diff --git a/include/odp/api/queue.h b/include/odp/api/queue.h index 7897fff86..666d5eaf9 100644 --- a/include/odp/api/queue.h +++ b/include/odp/api/queue.h @@ -1,4 +1,5 @@ /* Copyright (c) 2013-2018, Linaro Limited + * Copyright (c) 2022, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -17,11 +18,7 @@ extern "C" { #endif -#include <odp/api/std_types.h> -#include <odp/api/abi/event.h> -#include <odp/api/abi/queue_types.h> #include <odp/api/abi/queue.h> -#include <odp/api/abi/buffer.h> #include <odp/api/spec/queue.h> diff --git a/include/odp/api/spec/buffer.h b/include/odp/api/spec/buffer.h index 7945b59f9..c11a3c7b4 100644 --- a/include/odp/api/spec/buffer.h +++ b/include/odp/api/spec/buffer.h @@ -18,7 +18,9 @@ extern "C" { #endif +#include <odp/api/event_types.h> #include <odp/api/pool_types.h> +#include <odp/api/std_types.h> /** @defgroup odp_buffer ODP BUFFER * Buffer event metadata and operations. diff --git a/include/odp/api/spec/classification.h b/include/odp/api/spec/classification.h index b9682c7cb..1c76ea192 100644 --- a/include/odp/api/spec/classification.h +++ b/include/odp/api/spec/classification.h @@ -36,9 +36,7 @@ extern "C" { /** * @def ODP_COS_INVALID - * This value is returned from odp_cls_cos_create() on failure, - * May also be used as a sink class of service that - * results in packets being discarded. + * This value is returned from odp_cls_cos_create() on failure. */ /** @@ -179,6 +177,30 @@ typedef struct odp_bp_param_t { } odp_bp_param_t; /** + * Classifier CoS specific statistics counters + * + * Counters are incremented per packet classified to the CoS. In a CoS chain, + * counters are incremented in every CoS for which counters are enabled. + */ +typedef struct odp_cls_cos_stats_t { + /** Number of octets in classified packets. In case of Ethernet, packet + * size includes MAC header. */ + uint64_t octets; + + /** Number of classified packets, including packets dropped due to drop + * action. */ + uint64_t packets; + + /** Number of discarded packets due to other reasons than packet + * errors or drop action. */ + uint64_t discards; + + /** Number of packets with errors. */ + uint64_t errors; + +} odp_cls_cos_stats_t; + +/** * Classifier queue specific statistics counters * * Counters are incremented per packet destined to the queue per originating @@ -206,6 +228,34 @@ typedef struct odp_cls_queue_stats_t { * Classifier statistics capabilities */ typedef struct odp_cls_stats_capability_t { + /** CoS level capabilities */ + struct { + /** Supported counters */ + union { + /** Statistics counters in a bit field structure */ + struct { + /** @see odp_cls_cos_stats_t::octets */ + uint64_t octets : 1; + + /** @see odp_cls_cos_stats_t::packets */ + uint64_t packets : 1; + + /** @see odp_cls_cos_stats_t::discards */ + uint64_t discards : 1; + + /** @see odp_cls_cos_stats_t::errors */ + uint64_t errors : 1; + + } counter; + + /** All bits of the bit field structure + * + * This field can be used to set/clear all flags, or + * for bitwise operations over the entire structure. */ + uint64_t all_counters; + }; + } cos; + /** Queue level capabilities */ struct { /** Supported counters */ @@ -247,17 +297,22 @@ typedef struct odp_cls_capability_t { odp_cls_pmr_terms_t supported_terms; /** Maximum number of PMR terms */ - unsigned int max_pmr_terms; + uint32_t max_pmr_terms; /** Number of PMR terms available for use now */ - unsigned int available_pmr_terms; + uint32_t available_pmr_terms; /** Maximum number of CoS supported */ - unsigned int max_cos; + uint32_t max_cos; + + /** Maximum number of CoSes that can have statistics enabled at the same + * time. If this value is zero, then CoS level statistics are not + * supported. */ + uint32_t max_cos_stats; /** Maximun number of queues supported per CoS * if the value is 1, then hashing is not supported*/ - unsigned int max_hash_queues; + uint32_t max_hash_queues; /** Protocol header combination supported for Hashing */ odp_pktin_hash_proto_t hash_protocols; @@ -315,10 +370,48 @@ typedef enum { } odp_cos_hdr_flow_fields_t; /** + * Enumeration of actions for CoS. + */ +typedef enum { + /** + * Enqueue packet + * + * Packets that arrive in the CoS are enqueued to a destination queue. + */ + ODP_COS_ACTION_ENQUEUE, + + /** + * Drop packet + * + * Packets that arrive in the CoS are dropped. Packets are freed into + * their originating pool. + */ + ODP_COS_ACTION_DROP, +} odp_cos_action_t; + +/** * Class of service parameters * Used to communicate class of service creation options */ typedef struct odp_cls_cos_param { + /** Action to take. When action is ODP_COS_ACTION_DROP, all the other + * parameters are ignored. + * + * The final match in the CoS chain defines the action for a packet. + * I.e. packet is dropped only when the CoS of the last matching rule + * has drop action. Actions in the previous CoSes in the chain are + * ignored. + * + * Default is ODP_COS_ACTION_ENQUEUE. + */ + odp_cos_action_t action; + + /** Enable statistics. If true, counters are incremented when packets + * are classified to the CoS. Default is false. @see + * odp_cls_cos_stats(). + */ + odp_bool_t stats_enable; + /** Number of queues to be linked to this CoS. * If the number is greater than 1 then hashing is enabled. * If number is equal to 1 then hashing is disabled. @@ -391,6 +484,9 @@ int odp_cls_capability(odp_cls_capability_t *capability); /** * Create a class-of-service * + * Depending on the action parameter, packets to the CoS are either enqueued to + * a destination queue, or dropped. + * * The use of class-of-service name is optional. Unique names are not required. * Use odp_cls_cos_param_init() to initialize parameters into their default * values. @@ -401,10 +497,6 @@ int odp_cls_capability(odp_cls_capability_t *capability); * * @retval Class-of-service handle * @retval ODP_COS_INVALID on failure. - * - * @note ODP_QUEUE_INVALID and ODP_POOL_INVALID are valid values for queue - * and pool associated with a class of service. When either of these values - * is configured as INVALID packets assigned to the CoS get dropped. */ odp_cos_t odp_cls_cos_create(const char *name, const odp_cls_cos_param_t *param); @@ -542,6 +634,25 @@ int odp_cos_with_l3_qos(odp_pktio_t pktio_in, odp_bool_t l3_preference); /** + * Get statistics for a CoS + * + * The statistics counters are incremented for packets classified to the + * given CoS. + * + * Counters that are not supported are set to zero. + * + * It's implementation defined if odp_pktio_stats_reset() call affects these + * counters. + * + * @param cos CoS handle + * @param[out] stats Statistics structure for output + * + * @retval 0 on success + * @retval <0 on failure + */ +int odp_cls_cos_stats(odp_cos_t cos, odp_cls_cos_stats_t *stats); + +/** * Get statistics for a queue assigned to a CoS * * The statistics counters are incremented only for packets originating from the diff --git a/include/odp/api/spec/comp.h b/include/odp/api/spec/comp.h index 7f64cca5d..39ecbfde4 100644 --- a/include/odp/api/spec/comp.h +++ b/include/odp/api/spec/comp.h @@ -14,8 +14,11 @@ #define ODP_API_SPEC_COMP_H_ #include <odp/visibility_begin.h> + +#include <odp/api/event_types.h> +#include <odp/api/packet_types.h> +#include <odp/api/queue_types.h> #include <odp/api/std_types.h> -#include <odp/api/packet.h> #ifdef __cplusplus extern "C" { diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h index c0ff3710d..7cd69f4d2 100644 --- a/include/odp/api/spec/crypto.h +++ b/include/odp/api/spec/crypto.h @@ -16,6 +16,7 @@ #include <odp/visibility_begin.h> #include <odp/api/deprecated.h> +#include <odp/api/packet_types.h> #include <odp/api/pool_types.h> #include <odp/api/std_types.h> @@ -23,8 +24,6 @@ extern "C" { #endif -#include <odp/api/packet.h> - /** @defgroup odp_crypto ODP CRYPTO * Data ciphering and authentication. * @{ @@ -42,7 +41,7 @@ extern "C" { /** * @typedef odp_crypto_compl_t -* Crypto API completion event (platform dependent). +* @deprecated Crypto API completion event (platform dependent). */ /** @@ -559,8 +558,10 @@ typedef struct odp_crypto_session_param_t { /** Preferred sync vs. async for odp_crypto_operation() * * The default value is ODP_CRYPTO_SYNC. + * + * @deprecated Used only with deprecated odp_crypto_operation() */ - odp_crypto_op_mode_t pref_mode; + odp_crypto_op_mode_t ODP_DEPRECATE(pref_mode); /** Operation mode when using packet interface: sync or async * @@ -672,8 +673,8 @@ typedef struct odp_crypto_session_param_t { /** Async mode completion event queue * * The completion queue is used to return completions from - * odp_crypto_operation() or odp_crypto_op_enq() results to the - * application. + * odp_crypto_op_enq() (and the deprecated odp_crypto_operation()) + * to the application. */ odp_queue_t compl_queue; @@ -689,6 +690,8 @@ typedef struct odp_crypto_session_param_t { /** * Crypto API per packet operation parameters + * + * @deprecated Use odp_crypto_packet_op_param_t instead. */ typedef struct odp_crypto_op_param_t { /** Session handle from creation */ @@ -760,7 +763,7 @@ typedef struct odp_crypto_op_param_t { */ odp_packet_data_range_t auth_range; -} odp_crypto_op_param_t; +} ODP_DEPRECATE(odp_crypto_op_param_t); /** * Crypto packet API per packet operation parameters @@ -895,6 +898,8 @@ typedef struct odp_crypto_op_status { /** * Crypto API operation result + * + * @deprecated Use odp_crypto_packet_result_t instead. */ typedef struct odp_crypto_op_result { /** Request completed successfully */ @@ -912,7 +917,7 @@ typedef struct odp_crypto_op_result { /** Authentication status */ odp_crypto_op_status_t auth_status; -} odp_crypto_op_result_t; +} ODP_DEPRECATE(odp_crypto_op_result_t); /** * Crypto packet API operation result @@ -1141,9 +1146,13 @@ int odp_crypto_session_create(const odp_crypto_session_param_t *param, */ int odp_crypto_session_destroy(odp_crypto_session_t session); +#if ODP_DEPRECATED_API + /** * Return crypto completion handle that is associated with event * + * @deprecated Used only with the deprecated odp_crypto_operation() + * * Note: any invalid parameters will cause undefined behavior and may cause * the application to abort or crash. * @@ -1156,6 +1165,8 @@ odp_crypto_compl_t odp_crypto_compl_from_event(odp_event_t ev); /** * Convert crypto completion handle to event handle * + * @deprecated Used only with the deprecated odp_crypto_operation() + * * @param completion_event Completion event to convert to generic event * * @return Event handle @@ -1165,6 +1176,8 @@ odp_event_t odp_crypto_compl_to_event(odp_crypto_compl_t completion_event); /** * Release crypto completion event * + * @deprecated Used only with the deprecated odp_crypto_operation() + * * @param completion_event Completion event we are done accessing */ void odp_crypto_compl_free(odp_crypto_compl_t completion_event); @@ -1172,6 +1185,8 @@ void odp_crypto_compl_free(odp_crypto_compl_t completion_event); /** * Crypto per packet operation * + * @deprecated Use odp_crypto_op() or odp_crypto_op_enq() instead. + * * Performs the cryptographic operations specified during session creation * on the packet. If the operation is performed synchronously, "posted" * will return FALSE and the result of the operation is immediately available. @@ -1192,12 +1207,16 @@ int odp_crypto_operation(odp_crypto_op_param_t *param, /** * Crypto per packet operation query result from completion event * + * @deprecated Used only with the deprecated odp_crypto_operation() + * * @param completion_event Event containing operation results * @param result Pointer to result structure */ void odp_crypto_compl_result(odp_crypto_compl_t completion_event, odp_crypto_op_result_t *result); +#endif /* ODP_DEPRECATED_API */ + /** * Get printable value for an odp_crypto_session_t * @@ -1211,9 +1230,12 @@ void odp_crypto_compl_result(odp_crypto_compl_t completion_event, */ uint64_t odp_crypto_session_to_u64(odp_crypto_session_t hdl); +#if ODP_DEPRECATED_API /** * Get printable value for an odp_crypto_compl_t * + * @deprecated Used only with the deprecated odp_crypto_operation() + * * @param hdl odp_crypto_compl_t handle to be printed * @return uint64_t value that can be used to print/display this * handle @@ -1223,6 +1245,7 @@ uint64_t odp_crypto_session_to_u64(odp_crypto_session_t hdl); * an odp_crypto_compl_t handle. */ uint64_t odp_crypto_compl_to_u64(odp_crypto_compl_t hdl); +#endif /** * Initialize crypto session parameters diff --git a/include/odp/api/spec/dma_types.h b/include/odp/api/spec/dma_types.h index d7ccc6d56..ae3d05287 100644 --- a/include/odp/api/spec/dma_types.h +++ b/include/odp/api/spec/dma_types.h @@ -18,7 +18,9 @@ extern "C" { #endif +#include <odp/api/event_types.h> #include <odp/api/packet_types.h> +#include <odp/api/queue_types.h> #include <odp/api/std_types.h> /** @defgroup odp_dma ODP DMA diff --git a/include/odp/api/spec/event.h b/include/odp/api/spec/event.h index dc99f35c7..c36d9cef1 100644 --- a/include/odp/api/spec/event.h +++ b/include/odp/api/spec/event.h @@ -1,4 +1,5 @@ /* Copyright (c) 2015-2018, Linaro Limited + * Copyright (c) 2022, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -18,7 +19,8 @@ extern "C" { #endif -#include <odp/api/packet.h> +#include <odp/api/event_types.h> +#include <odp/api/packet_types.h> /** @defgroup odp_event ODP EVENT * Generic event metadata and operations. @@ -26,81 +28,6 @@ extern "C" { */ /** - * @typedef odp_event_t - * ODP event - */ - -/** - * @def ODP_EVENT_INVALID - * Invalid event - */ - -/** - * @typedef odp_event_type_t - * Event type - * - * Event type specifies purpose and general format of an event. It can be - * checked with odp_event_type() or odp_event_types(). Each event type has - * functions (e.g. odp_buffer_from_event()) to convert between the generic event - * handle (odp_event_t) and the type specific handle (e.g. odp_buffer_t). - * Results are undefined, if conversion function of a wrong event type is used. - * Application cannot change event type by chaining conversion functions. - * - * List of event types: - * - ODP_EVENT_BUFFER - * - Buffer event (odp_buffer_t) for simple data storage and message passing - * - ODP_EVENT_PACKET - * - Packet event (odp_packet_t) containing packet data and plenty of - * packet processing related metadata - * - ODP_EVENT_TIMEOUT - * - Timeout event (odp_timeout_t) from a timer - * - ODP_EVENT_CRYPTO_COMPL - * - Crypto completion event (odp_crypto_compl_t) - * - ODP_EVENT_IPSEC_STATUS - * - IPSEC status update event (odp_ipsec_status_t) - * - ODP_EVENT_PACKET_VECTOR - * - Vector of packet events (odp_packet_t) as odp_packet_vector_t - * - ODP_EVENT_PACKET_TX_COMPL - * - Packet Tx completion event (odp_packet_tx_compl_t) generated as a result of a Packet Tx - * completion. - * - ODP_EVENT_DMA_COMPL - * - DMA completion event (odp_dma_compl_t) indicates that a DMA transfer has finished - */ - -/** - * @typedef odp_event_subtype_t - * Event subtype - * - * Event subtype expands event type specification by providing more detailed - * purpose and format of an event. It can be checked with odp_event_subtype() or - * odp_event_types(). Each event subtype may define specific functions - * (e.g. odp_ipsec_packet_from_event()) to convert between the generic event - * handle (odp_event_t) and event type specific handle (e.g. odp_packet_t). When - * subtype is known, these subtype specific functions should be preferred over - * the event type general function (e.g. odp_packet_from_event()). Results are - * undefined, if conversion function of a wrong event subtype is used. - * Application cannot change event subtype by chaining conversion functions. - * - * List of event subtypes: - * - ODP_EVENT_PACKET_BASIC - * - Packet event (odp_packet_t) with basic packet metadata - * - ODP_EVENT_PACKET_COMP - * - Packet event (odp_packet_t) generated as a result of a compression/ - * decompression operation. It contains compression specific metadata in - * addition to the basic packet metadata. - * - ODP_EVENT_PACKET_CRYPTO - * - Packet event (odp_packet_t) generated as a result of a Crypto - * operation. It contains crypto specific metadata in addition to the - * basic packet metadata. - * - ODP_EVENT_PACKET_IPSEC - * - Packet event (odp_packet_t) generated as a result of an IPsec - * operation. It contains IPSEC specific metadata in addition to the basic - * packet metadata. - * - ODP_EVENT_NO_SUBTYPE - * - An event type does not have any subtypes defined - */ - -/** * Event type of an event * * Event type specifies purpose and general format of an event. diff --git a/include/odp/api/spec/event_types.h b/include/odp/api/spec/event_types.h new file mode 100644 index 000000000..529d031e7 --- /dev/null +++ b/include/odp/api/spec/event_types.h @@ -0,0 +1,110 @@ +/* Copyright (c) 2015-2018, Linaro Limited + * Copyright (c) 2022, Nokia + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODP event API type definitions + */ + +#ifndef ODP_API_SPEC_EVENT_TYPES_H_ +#define ODP_API_SPEC_EVENT_TYPES_H_ +#include <odp/visibility_begin.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup odp_event + * @{ + */ + +/** + * @typedef odp_event_t + * ODP event + */ + +/** + * @def ODP_EVENT_INVALID + * Invalid event + */ + +/** + * @typedef odp_event_type_t + * Event type + * + * Event type specifies purpose and general format of an event. It can be + * checked with odp_event_type() or odp_event_types(). Each event type has + * functions (e.g. odp_buffer_from_event()) to convert between the generic event + * handle (odp_event_t) and the type specific handle (e.g. odp_buffer_t). + * Results are undefined, if conversion function of a wrong event type is used. + * Application cannot change event type by chaining conversion functions. + * + * List of event types: + * - ODP_EVENT_BUFFER + * - Buffer event (odp_buffer_t) for simple data storage and message passing + * - ODP_EVENT_PACKET + * - Packet event (odp_packet_t) containing packet data and plenty of + * packet processing related metadata + * - ODP_EVENT_TIMEOUT + * - Timeout event (odp_timeout_t) from a timer + * - ODP_EVENT_CRYPTO_COMPL + * - Crypto completion event (odp_crypto_compl_t) + * - ODP_EVENT_IPSEC_STATUS + * - IPSEC status update event (odp_ipsec_status_t) + * - ODP_EVENT_PACKET_VECTOR + * - Vector of packet events (odp_packet_t) as odp_packet_vector_t + * - ODP_EVENT_PACKET_TX_COMPL + * - Packet Tx completion event (odp_packet_tx_compl_t) generated as a result of a Packet Tx + * completion. + * - ODP_EVENT_DMA_COMPL + * - DMA completion event (odp_dma_compl_t) indicates that a DMA transfer has finished + */ + +/** + * @typedef odp_event_subtype_t + * Event subtype + * + * Event subtype expands event type specification by providing more detailed + * purpose and format of an event. It can be checked with odp_event_subtype() or + * odp_event_types(). Each event subtype may define specific functions + * (e.g. odp_ipsec_packet_from_event()) to convert between the generic event + * handle (odp_event_t) and event type specific handle (e.g. odp_packet_t). When + * subtype is known, these subtype specific functions should be preferred over + * the event type general function (e.g. odp_packet_from_event()). Results are + * undefined, if conversion function of a wrong event subtype is used. + * Application cannot change event subtype by chaining conversion functions. + * + * List of event subtypes: + * - ODP_EVENT_PACKET_BASIC + * - Packet event (odp_packet_t) with basic packet metadata + * - ODP_EVENT_PACKET_COMP + * - Packet event (odp_packet_t) generated as a result of a compression/ + * decompression operation. It contains compression specific metadata in + * addition to the basic packet metadata. + * - ODP_EVENT_PACKET_CRYPTO + * - Packet event (odp_packet_t) generated as a result of a Crypto + * operation. It contains crypto specific metadata in addition to the + * basic packet metadata. + * - ODP_EVENT_PACKET_IPSEC + * - Packet event (odp_packet_t) generated as a result of an IPsec + * operation. It contains IPSEC specific metadata in addition to the basic + * packet metadata. + * - ODP_EVENT_NO_SUBTYPE + * - An event type does not have any subtypes defined + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#include <odp/visibility_end.h> +#endif diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h index 8dc0a77bb..c745d29ad 100644 --- a/include/odp/api/spec/packet.h +++ b/include/odp/api/spec/packet.h @@ -19,10 +19,13 @@ extern "C" { #endif -#include <odp/api/proto_stats_types.h> -#include <odp/api/time.h> +#include <odp/api/event_types.h> #include <odp/api/packet_types.h> +#include <odp/api/packet_io_types.h> #include <odp/api/pool_types.h> +#include <odp/api/proto_stats_types.h> +#include <odp/api/std_types.h> +#include <odp/api/time.h> /** @defgroup odp_packet ODP PACKET * Packet event metadata and operations. diff --git a/include/odp/api/spec/packet_flags.h b/include/odp/api/spec/packet_flags.h index 7c1386cb6..98bf2b7bf 100644 --- a/include/odp/api/spec/packet_flags.h +++ b/include/odp/api/spec/packet_flags.h @@ -19,7 +19,7 @@ extern "C" { #endif #include <odp/api/std_types.h> -#include <odp/api/packet.h> +#include <odp/api/packet_types.h> /** @addtogroup odp_packet * Operations on packet metadata flags. diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h index 3be45446d..4a8635d0a 100644 --- a/include/odp/api/spec/packet_io.h +++ b/include/odp/api/spec/packet_io.h @@ -431,9 +431,8 @@ int odp_pktin_recv_tmo(odp_pktin_queue_t queue, odp_packet_t packets[], * @return Number of packets received * @retval <0 on failure */ -int odp_pktin_recv_mq_tmo(const odp_pktin_queue_t queues[], unsigned int num_q, - unsigned int *from, odp_packet_t packets[], int num, - uint64_t wait); +int odp_pktin_recv_mq_tmo(const odp_pktin_queue_t queues[], uint32_t num_q, uint32_t *from, + odp_packet_t packets[], int num, uint64_t wait); /** * Packet input wait time diff --git a/include/odp/api/spec/packet_io_types.h b/include/odp/api/spec/packet_io_types.h index 2d43822fe..153e188b7 100644 --- a/include/odp/api/spec/packet_io_types.h +++ b/include/odp/api/spec/packet_io_types.h @@ -257,7 +257,7 @@ typedef struct odp_pktin_queue_param_t { * More than one input queues require flow hashing configured. * The maximum value is defined by pktio capability 'max_input_queues'. * Queue type is defined by the input mode. The default value is 1. */ - unsigned int num_queues; + uint32_t num_queues; /** Queue parameters * @@ -304,7 +304,7 @@ typedef struct odp_pktout_queue_param_t { /** Number of output queues to be created. The value must be between * 1 and interface capability. The default value is 1. */ - unsigned int num_queues; + uint32_t num_queues; /** Output queue size array * @@ -820,12 +820,12 @@ typedef struct odp_pktin_vector_capability_t { */ typedef struct odp_pktio_capability_t { /** Maximum number of input queues */ - unsigned int max_input_queues; + uint32_t max_input_queues; /** Maximum number of output queues * * Value does not exceed ODP_PKTOUT_MAX_QUEUES. */ - unsigned int max_output_queues; + uint32_t max_output_queues; /** Minimum output queue size * diff --git a/include/odp/api/spec/pool_types.h b/include/odp/api/spec/pool_types.h index b0d5b37c9..ef272b67d 100644 --- a/include/odp/api/spec/pool_types.h +++ b/include/odp/api/spec/pool_types.h @@ -127,12 +127,12 @@ typedef struct odp_pool_stats_t { */ typedef struct odp_pool_capability_t { /** Maximum number of pools of any type */ - unsigned int max_pools; + uint32_t max_pools; /** Buffer pool capabilities */ struct { /** Maximum number of buffer pools */ - unsigned int max_pools; + uint32_t max_pools; /** Maximum buffer data alignment in bytes */ uint32_t max_align; @@ -162,7 +162,7 @@ typedef struct odp_pool_capability_t { /** Packet pool capabilities */ struct { /** Maximum number of packet pools */ - unsigned int max_pools; + uint32_t max_pools; /** Maximum packet data length in bytes * @@ -250,7 +250,7 @@ typedef struct odp_pool_capability_t { /** Timeout pool capabilities */ struct { /** Maximum number of timeout pools */ - unsigned int max_pools; + uint32_t max_pools; /** Maximum number of timeout events in a pool * @@ -271,7 +271,7 @@ typedef struct odp_pool_capability_t { /** Vector pool capabilities */ struct { /** Maximum number of vector pools */ - unsigned int max_pools; + uint32_t max_pools; /** Maximum number of vector events in a pool * diff --git a/include/odp/api/spec/queue.h b/include/odp/api/spec/queue.h index 9c677c926..65cf3d1ee 100644 --- a/include/odp/api/spec/queue.h +++ b/include/odp/api/spec/queue.h @@ -18,8 +18,9 @@ extern "C" { #endif -#include <odp/api/event.h> +#include <odp/api/event_types.h> #include <odp/api/queue_types.h> +#include <odp/api/std_types.h> /** @defgroup odp_queue ODP QUEUE * Queues for event passing and scheduling. diff --git a/include/odp/api/spec/schedule.h b/include/odp/api/spec/schedule.h index 12da88f7d..524d9e2bf 100644 --- a/include/odp/api/spec/schedule.h +++ b/include/odp/api/spec/schedule.h @@ -19,7 +19,7 @@ extern "C" { #endif #include <odp/api/std_types.h> -#include <odp/api/event.h> +#include <odp/api/event_types.h> #include <odp/api/queue_types.h> #include <odp/api/schedule_types.h> #include <odp/api/thrmask.h> diff --git a/include/odp/api/spec/shared_memory.h b/include/odp/api/spec/shared_memory.h index 6ba6f7fc2..d1955db26 100644 --- a/include/odp/api/spec/shared_memory.h +++ b/include/odp/api/spec/shared_memory.h @@ -133,7 +133,7 @@ typedef struct odp_shm_capability_t { * * This number of separate shared memory blocks can be * reserved concurrently. */ - unsigned int max_blocks; + uint32_t max_blocks; /** Maximum memory block size in bytes * diff --git a/include/odp/api/spec/timer.h b/include/odp/api/spec/timer.h index 9df43d034..b51db7dbc 100644 --- a/include/odp/api/spec/timer.h +++ b/include/odp/api/spec/timer.h @@ -21,7 +21,7 @@ extern "C" { #endif #include <odp/api/timer_types.h> -#include <odp/api/event.h> +#include <odp/api/event_types.h> #include <odp/api/pool_types.h> #include <odp/api/queue_types.h> diff --git a/include/odp/api/spec/timer_types.h b/include/odp/api/spec/timer_types.h index 56c118ce3..754c831b2 100644 --- a/include/odp/api/spec/timer_types.h +++ b/include/odp/api/spec/timer_types.h @@ -21,7 +21,7 @@ extern "C" { #endif #include <odp/api/std_types.h> -#include <odp/api/event.h> +#include <odp/api/event_types.h> /** @defgroup odp_timer ODP TIMER * Timer generating timeout events. diff --git a/include/odp/api/spec/traffic_mngr.h b/include/odp/api/spec/traffic_mngr.h index 64f2eac83..b22887fc6 100644 --- a/include/odp/api/spec/traffic_mngr.h +++ b/include/odp/api/spec/traffic_mngr.h @@ -98,11 +98,6 @@ extern "C" { */ /** - * @def ODP_NUM_SHAPER_COLORS - * The number of enumeration values defined in the odp_tm_shaper_color_t type. - */ - -/** * @def ODP_TM_INVALID_PRIORITY * Used to indicate an invalid priority value. */ @@ -344,9 +339,19 @@ typedef struct { * the legal range of such weights. */ odp_bool_t weights_supported; - /** tm_node_threshold indicates that the tm_nodes at this - * level support threshold profiles. */ - odp_bool_t tm_node_threshold; + /** TM node threshold profile support */ + struct { + /** Threshold given as bytes */ + uint8_t byte : 1; + + /** Threshold given as packets */ + uint8_t packet : 1; + + /** Threshold given as bytes and packets simultaneously */ + uint8_t byte_and_packet : 1; + + } tm_node_threshold; + } odp_tm_level_capabilities_t; /** The tm_pkt_prio_mode_t enumeration type is used to indicate different @@ -515,11 +520,18 @@ typedef struct { /** TM queue statistics counter capabilities */ odp_tm_queue_stats_capability_t queue_stats; - /** tm_queue_threshold indicates support for threshold profile on a - * TM queue. When TRUE, users can set/clear/update threshold profile - * on a TM queue. When false none of it is supported. - */ - odp_bool_t tm_queue_threshold; + /** TM queue threshold profile support */ + struct { + /** Threshold given as bytes */ + uint8_t byte : 1; + + /** Threshold given as packets */ + uint8_t packet : 1; + + /** Threshold given as bytes and packets simultaneously */ + uint8_t byte_and_packet : 1; + + } tm_queue_threshold; /** tm_queue_query_flags indicates supported types of TM queue query. * Types of TM queue query are same as query_flags that are passed to @@ -719,7 +731,6 @@ typedef struct { * * odp_tm_requirements_init() must be called to initialize any * odp_tm_requirements_t record before it is first used or assigned to. - * This is done to allow for vendor specific additions to this record. * * @param requirements A pointer to an odp_tm_requirements_t record which * is to be initialized. @@ -730,7 +741,6 @@ void odp_tm_requirements_init(odp_tm_requirements_t *requirements); * * odp_tm_egress_init() must be called to initialize any odp_tm_egress_t * record before it is first used or assigned to. - * This is done to allow for vendor specific additions to this record. * * @param egress A pointer to an odp_tm_egress_t record which * is to be initialized. @@ -940,9 +950,9 @@ int odp_tm_destroy(odp_tm_t tm); * The odp_tm_vlan_marking() function allows one to configure the TM egress * so as to have it set the one bit VLAN Drop Eligibility Indicator (DEI) * field (but only for pkts that already carry a VLAN tag) of a pkt based upon - * the final pkt (or shaper?) color assigned to the pkt when it reaches the - * egress node. When drop_eligible_enabled is false, then the given color has - * no effect on the VLAN fields. See IEEE 802.1q for more details. + * the final pkt color assigned to the pkt when it reaches the egress node. When + * drop_eligible_enabled is false, then the given color has no effect on the + * VLAN fields. See IEEE 802.1q for more details. * * Note that ALL ODP implementations are required to SUCCESSFULLY handle all * calls to this function with drop_eligible_enabled == FALSE - i.e. must @@ -1037,24 +1047,11 @@ int odp_tm_drop_prec_marking(odp_tm_t tm, /* Shaper profile types and functions * -------------------------------------------------------- */ -/** Possible values of running the shaper algorithm. ODP_TM_SHAPER_GREEN - * means that the traffic is within the commit specification (rate and burst - * size), ODP_TM_SHAPER_YELLOW means that the traffic is within the peak - * specification (rate and burst size) and ODP_TM_SHAPER_RED means that the - * traffic is exceeding both its commit and peak specifications. Note that - * packets can also have an assigned <b> packet color</b> of ODP_PACKET_GREEN, - * ODP_PACKET_YELLOW or ODP_PACKET_RED which has a different meaning and - * purpose than the shaper colors. - */ -typedef enum { - ODP_TM_SHAPER_GREEN, ODP_TM_SHAPER_YELLOW, ODP_TM_SHAPER_RED -} odp_tm_shaper_color_t; - -/** The odp_tm_shaper_params_t record type is used to supply the parameters - * associated with a shaper profile. Since it is expected that - * implementations might augment this record type with platform specific - * additional fields - it is required that odp_tm_shaper_params_init() be - * called on variables of this type before any of the fields are filled in. +/** + * TM shaper parameters + * + * Use odp_tm_shaper_params_init() to initialize parameters into their default + * values. */ typedef struct { /** The committed information rate for this shaper profile. The units @@ -1123,12 +1120,12 @@ typedef struct { odp_bool_t packet_mode; } odp_tm_shaper_params_t; -/** odp_tm_shaper_params_init() must be called to initialize any - * odp_tm_shaper_params_t record before it is first used or assigned to. - * The parameters are initialized to their default values. +/** + * Initialize TM shaper parameters * - * @param params A pointer to an odp_tm_shaper_params_t record which - * is to be initialized. + * Initialize an odp_tm_shaper_params_t to its default values for all fields. + * + * @param params Address of the odp_tm_shaper_params_t to be initialized */ void odp_tm_shaper_params_init(odp_tm_shaper_params_t *params); @@ -1176,8 +1173,8 @@ int odp_tm_shaper_params_read(odp_tm_shaper_t shaper_profile, /** odp_tm_shaper_params_update() "sets" the current set of values associated * with the specified shaper profile object. In addition, this call has the - * effect that all tm_input's and tm_nodes that are associated (attached?) - * with this shaper profile object will be updated with the new values. + * effect that all tm_input's and tm_nodes that are associated with this shaper + * profile object will be updated with the new values. * * @param shaper_profile Specifies the shaper profile object whose * values are to be set. @@ -1215,11 +1212,11 @@ typedef enum { ODP_TM_FRAME_BASED_WEIGHTS /**< Ignore the packet length */ } odp_tm_sched_mode_t; -/** The odp_tm_sched_params_t record type is used to supply the parameters - * associated with a scheduler profile. Since it is expected that - * implementations might augment this record type with platform specific - * additional fields - it is required that odp_tm_sched_params_init() be - * called on variables of this type before any of the fields are filled in. +/** + * TM scheduler parameters + * + * Use odp_tm_sched_params_init() to initialize parameters into their default + * values. */ typedef struct { /** sched_modes indicates whether weighted scheduling should be used @@ -1237,12 +1234,12 @@ typedef struct { uint32_t sched_weights[ODP_TM_MAX_PRIORITIES]; } odp_tm_sched_params_t; -/** odp_tm_sched_params_init() must be called to initialize any - * odp_tm_sched_params_t record before it is first used or assigned to. - * The parameters are initialized to their default values. +/** + * Initialize TM scheduler parameters * - * @param params A pointer to an odp_tm_sched_params_t record which - * is to be initialized. + * Initialize an odp_tm_sched_params_t to its default values for all fields. + * + * @param params Address of the odp_tm_sched_params_t to be initialized */ void odp_tm_sched_params_init(odp_tm_sched_params_t *params); @@ -1289,8 +1286,8 @@ int odp_tm_sched_params_read(odp_tm_sched_t sched_profile, /** odp_tm_sched_params_update() "sets" the current set of values associated * with the specified scheduler profile object. In addition, this call has - * the effect that all tm_nodes that are associated (attached?) with this - * Scheduler profile object will be updated with the new values. + * the effect that all tm_nodes that are associated with this scheduler profile + * object will be updated with the new values. * * @param sched_profile Specifies the Scheduler profile object whose * values are to be set. @@ -1315,11 +1312,11 @@ odp_tm_sched_t odp_tm_sched_lookup(const char *name); /* Queue Threshold Profiles - types and functions * -------------------------------------------------------- */ -/** The odp_tm_threshold_params_t record type is used to supply the parameters - * associated with a queue thresholds profile. Since it is expected that - * implementations might augment this record type with platform specific - * additional fields - it is required that odp_tm_threshold_params_init() be - * called on variables of this type before any of the fields are filled in +/** + * TM threshold parameters + * + * Use odp_tm_threshold_params_init() to initialize parameters into their + * default values. */ typedef struct { uint64_t max_pkts; /**< max pkt cnt for this threshold profile */ @@ -1332,12 +1329,12 @@ typedef struct { odp_bool_t enable_max_bytes; } odp_tm_threshold_params_t; -/** odp_tm_threshold_params_init() must be called to initialize any - * odp_tm_threshold_params_t record before it is first used or assigned to. - * The parameters are initialized to their default values. +/** + * Initialize TM threshold parameters * - * @param params A pointer to an odp_tm_threshold_params_t record which - * is to be initialized. + * Initialize an odp_tm_threshold_params_t to its default values for all fields. + * + * @param params Address of the odp_tm_threshold_params_t to be initialized */ void odp_tm_threshold_params_init(odp_tm_threshold_params_t *params); @@ -1387,8 +1384,8 @@ int odp_tm_thresholds_params_read(odp_tm_threshold_t threshold_profile, /** odp_tm_thresholds_params_update() "sets" the current set of values * associated with the specified queue thresholds profile object. In addition, * this call has the effect that all tm_input's and tm_nodes that are - * associated (attached?) with this queue thresholds profile object will be - * updated with the new values. + * associated with this queue thresholds profile object will be updated with the + * new values. * * @param threshold_profile Specifies the queue thresholds profile * object whose values are to be set. @@ -1413,11 +1410,11 @@ odp_tm_threshold_t odp_tm_thresholds_lookup(const char *name); /* WRED Profiles - types and functions * -------------------------------------------------------- */ -/** The odp_tm_wred_params_t record type is used to supply the parameters - * associated with a Random Early Detection profile. Since it is expected that - * implementations might augment this record type with platform specific - * additional fields - it is required that odp_tm_wred_params_init() be called - * on variables of this type before any of the fields are filled in. +/** + * TM WRED parameters + * + * Use odp_tm_wred_params_init() to initialize parameters into their default + * values. */ typedef struct { /** When min_threshold is set to zero then single-slope WRED is @@ -1471,12 +1468,12 @@ typedef struct { odp_bool_t use_byte_fullness; } odp_tm_wred_params_t; -/** odp_tm_wred_params_init() must be called to initialize any - * odp_tm_wred_params_t record before it is first used or assigned to. - * The parameters are initialized to their default values. +/** + * Initialize TM WRED parameters * - * @param params A pointer to an odp_tm_wred_params_t record which - * is to be initialized. + * Initialize an odp_tm_wred_params_t to its default values for all fields. + * + * @param params Address of the odp_tm_wred_params_t to be initialized */ void odp_tm_wred_params_init(odp_tm_wred_params_t *params); @@ -1524,8 +1521,8 @@ int odp_tm_wred_params_read(odp_tm_wred_t wred_profile, /** odp_tm_wred_params_update() "sets" the current set of values associated * with the specified WRED profile object. In addition, this call has the - * effect that all tm_input's and tm_nodes that are associated (attached?) - * with this WRED profile object will be updated with the new values. + * effect that all tm_input's and tm_nodes that are associated with this WRED + * profile object will be updated with the new values. * * @param wred_profile Specifies the WRED profile object whose * values are to be set. @@ -1547,12 +1544,11 @@ int odp_tm_wred_params_update(odp_tm_wred_t wred_profile, */ odp_tm_wred_t odp_tm_wred_lookup(const char *name); -/** The odp_tm_node_params_t record type is used to hold extra parameters when - * calling the odp_tm_node_create() function. Many of these fields are - * optional EXCEPT for max_fanin and level. Also since it is expected that - * implementations might augment this record type with platform specific - * additional fields - it is required that odp_tm_node_params_init() be called - * on variables of this type before any of the fields are filled in. +/** + * TM node parameters + * + * Many of these fields are optional EXCEPT for max_fanin and level. Use + * odp_tm_node_params_init() to initialize parameters into their default values. */ typedef struct { /** The user_context field is an generic pointer that the user can @@ -1571,9 +1567,9 @@ typedef struct { odp_tm_shaper_t shaper_profile; /** The threshold profile to be used in setting the max queue fullness - * for WRED and/or tail drop? Can be ODP_TM_INVALID and can also be - * set and changed post-creation via odp_tm_node_threshold_config(). - * The default value is ODP_TM_INVALID. */ + * for WRED and/or tail drop. Can be ODP_TM_INVALID and can also be set + * and changed post-creation via odp_tm_node_threshold_config(). The + * default value is ODP_TM_INVALID. */ odp_tm_threshold_t threshold_profile; /** The WRED profile(s) to be associated with this tm_node. Any or @@ -1606,12 +1602,12 @@ typedef struct { uint8_t priority; } odp_tm_node_params_t; -/** odp_tm_node_params_init() must be called to initialize any - * odp_tm_node_params_t record before it is first used or assigned to. - * The parameters are initialized to their default values. +/** + * Initialize TM node parameters * - * @param params A pointer to an odp_tm_node_params_t record which - * is to be initialized. + * Initialize an odp_tm_node_params_t to its default values for all fields. + * + * @param params Address of the odp_tm_node_params_t to be initialized */ void odp_tm_node_params_init(odp_tm_node_params_t *params); @@ -1627,8 +1623,7 @@ void odp_tm_node_params_init(odp_tm_node_params_t *params); * @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. - * @param params A pointer to a record holding (an extensible) set of - * properties/attributes of this tm_node. + * @param params TM node parameters. * * @return Returns ODP_TM_INVALID upon failure, otherwise returns * a valid odp_tm_node_t handle if successful. @@ -1739,12 +1734,11 @@ void *odp_tm_node_context(odp_tm_node_t tm_node); */ int odp_tm_node_context_set(odp_tm_node_t tm_node, void *user_context); -/** The odp_tm_queue_params_t record type is used to hold extra parameters - * when calling the odp_tm_queue_create() function. Many of these fields are - * optional EXCEPT for priority. Also since it is expected that - * implementations might augment this record type with platform specific - * additional fields - it is required that odp_tm_queue_params_init() be - * called on variables of this type before any of the fields are filled in. +/** + * TM queue parameters + * + * Use odp_tm_queue_params_init() to initialize parameters into their default + * values. */ typedef struct { /** The user_context field is an generic pointer that the user can @@ -1758,9 +1752,13 @@ typedef struct { odp_tm_shaper_t shaper_profile; /** The threshold profile to be used in setting the max queue fullness - * for WRED and/or tail drop? Can be ODP_TM_INVALID and can also be - * set and changed post-creation via odp_tm_queue_threshold_config(). - * The default value is ODP_TM_INVALID. */ + * for WRED and/or tail drop. Can be ODP_TM_INVALID and can also be set + * and changed post-creation via odp_tm_queue_threshold_config(). The + * default value is ODP_TM_INVALID. + * + * One can specify the maximum queue limits either as a maximum number + * of packets in the queue or as a maximum number of bytes in the queue, + * or if both are specified, then whichever limit is hit first. */ odp_tm_threshold_t threshold_profile; /** The WRED profile(s) to be associated with this tm_queue. Any or @@ -1782,27 +1780,24 @@ typedef struct { odp_bool_t ordered_enqueue; } odp_tm_queue_params_t; -/** odp_tm_queue_params_init() must be called to initialize any - * odp_tm_queue_params_t record before it is first used or assigned to. - * The parameters are initialized to their default values. +/** + * Initialize TM queue parameters * - * @param params A pointer to an odp_tm_queue_params_t record which - * is to be initialized. + * Initialize an odp_tm_queue_params_t to its default values for all fields. + * + * @param params Address of the odp_tm_queue_params_t to be initialized */ void odp_tm_queue_params_init(odp_tm_queue_params_t *params); -/** Create an tm_queue object. One can specify the maximum queue limits - * either as a maximum number of packets in the queue OR as a maximum number - * of bytes in the queue, or if both are specified, then whichever limit is - * hit first. Note that in the case of specifying the maximum queue memory - * size as bytes, the system is free to instead convert this byte value into a - * number of buffers and instead limit the queue memory usage by buffer counts - * versus strictly using byte counts. +/** + * TM queue create + * + * Create a TM queue according to the queue parameters. Use + * odp_tm_queue_params_init() to initialize parameters into their default values. * * @param tm Handle of the TM system into which this odp_tm_queue object is * created. - * @param params A pointer to a record holding (an extensible) set of - * properties/attributes of this tm_queue. + * @param params TM queue parameters. * * @return Returns ODP_TM_INVALID upon failure, otherwise a valid * odp_tm_queue_t handle. @@ -1965,18 +1960,16 @@ int odp_tm_queue_disconnect(odp_tm_queue_t tm_queue); /* Input API * -------------------------------------------------------- */ -/** The odp_tm_enq() function is used to add packets to a given TM system. - * Note that the System Metadata associated with the pkt needed by the TM - * system is (a) a drop_eligible bit, (b) a two bit "pkt_color", (c) a 16-bit - * pkt_len, and MAYBE? (d) a signed 8-bit shaper_len_adjust. +/** Send packet to TM system + * + * Note that the packet metadata utilized by the TM system is (a) + * drop_eligible, (b) pkt_color, (c) pkt_len, and (d) shaper_len_adjust. * * If there is a non-zero shaper_len_adjust, then it is added to the pkt_len * after any non-zero shaper_len_adjust that is part of the shaper profile. * * The pkt_color bits are a result of some earlier Metering/Marking/Policing - * processing (typically ingress based), and should not be confused with the - * shaper_color produced from the TM shaper entities within the tm_inputs and - * tm_nodes. + * processing. * * @param tm_queue Specifies the tm_queue (and indirectly the TM system). * @param pkt Handle to a packet. @@ -2023,8 +2016,8 @@ int odp_tm_enq_multi_lso(odp_tm_queue_t tm_queue, const odp_packet_t packets[], const odp_packet_lso_opt_t *lso_opt); /** The odp_tm_enq_with_cnt() function behaves identically to odp_tm_enq(), - * except that it also returns (an approximation to?) the current tm_queue - * packet queue count. + * except that it also returns the current tm_queue packet queue count (may be + * an approximation). * * @param tm_queue Specifies the tm_queue (and indirectly the TM system). * @param pkt Handle to a packet. @@ -2194,7 +2187,7 @@ int odp_tm_queue_info(odp_tm_queue_t tm_queue, odp_tm_queue_info_t *info); */ #define ODP_TM_QUERY_PKT_CNT 0x01 /**< The total_pkt_cnt value */ #define ODP_TM_QUERY_BYTE_CNT 0x02 /**< The total_byte_cnt value */ -#define ODP_TM_QUERY_THRESHOLDS 0x04 /**< The thresholds??? */ +#define ODP_TM_QUERY_THRESHOLDS 0x04 /**< The threshold values */ /** The odp_tm_query_info_t record type is used to return the various counts * as requested by functions like odp_tm_queue_query() and diff --git a/include/odp/api/timer.h b/include/odp/api/timer.h index 3041594f5..356f7e951 100644 --- a/include/odp/api/timer.h +++ b/include/odp/api/timer.h @@ -17,6 +17,8 @@ extern "C" { #endif +#include <odp/api/abi/timer.h> + #include <odp/api/spec/timer.h> #ifdef __cplusplus diff --git a/include/odp/arch/arm32-linux/odp/api/abi/event_types.h b/include/odp/arch/arm32-linux/odp/api/abi/event_types.h new file mode 100644 index 000000000..a8321920c --- /dev/null +++ b/include/odp/arch/arm32-linux/odp/api/abi/event_types.h @@ -0,0 +1,7 @@ +/* Copyright (c) 2022, Nokia + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <odp/api/abi-default/event_types.h> diff --git a/include/odp/arch/arm32-linux/odp/api/abi/timer.h b/include/odp/arch/arm32-linux/odp/api/abi/timer.h new file mode 100644 index 000000000..0351468d3 --- /dev/null +++ b/include/odp/arch/arm32-linux/odp/api/abi/timer.h @@ -0,0 +1,7 @@ +/* Copyright (c) 2022, Nokia + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <odp/api/abi-default/timer.h> diff --git a/include/odp/arch/arm64-linux/odp/api/abi/event_types.h b/include/odp/arch/arm64-linux/odp/api/abi/event_types.h new file mode 100644 index 000000000..a8321920c --- /dev/null +++ b/include/odp/arch/arm64-linux/odp/api/abi/event_types.h @@ -0,0 +1,7 @@ +/* Copyright (c) 2022, Nokia + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <odp/api/abi-default/event_types.h> diff --git a/include/odp/arch/arm64-linux/odp/api/abi/timer.h b/include/odp/arch/arm64-linux/odp/api/abi/timer.h new file mode 100644 index 000000000..0351468d3 --- /dev/null +++ b/include/odp/arch/arm64-linux/odp/api/abi/timer.h @@ -0,0 +1,7 @@ +/* Copyright (c) 2022, Nokia + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <odp/api/abi-default/timer.h> diff --git a/include/odp/arch/default-linux/odp/api/abi/event_types.h b/include/odp/arch/default-linux/odp/api/abi/event_types.h new file mode 100644 index 000000000..a8321920c --- /dev/null +++ b/include/odp/arch/default-linux/odp/api/abi/event_types.h @@ -0,0 +1,7 @@ +/* Copyright (c) 2022, Nokia + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <odp/api/abi-default/event_types.h> diff --git a/include/odp/arch/default-linux/odp/api/abi/timer.h b/include/odp/arch/default-linux/odp/api/abi/timer.h new file mode 100644 index 000000000..0351468d3 --- /dev/null +++ b/include/odp/arch/default-linux/odp/api/abi/timer.h @@ -0,0 +1,7 @@ +/* Copyright (c) 2022, Nokia + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <odp/api/abi-default/timer.h> diff --git a/include/odp/arch/power64-linux/odp/api/abi/event_types.h b/include/odp/arch/power64-linux/odp/api/abi/event_types.h new file mode 100644 index 000000000..a8321920c --- /dev/null +++ b/include/odp/arch/power64-linux/odp/api/abi/event_types.h @@ -0,0 +1,7 @@ +/* Copyright (c) 2022, Nokia + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <odp/api/abi-default/event_types.h> diff --git a/include/odp/arch/power64-linux/odp/api/abi/timer.h b/include/odp/arch/power64-linux/odp/api/abi/timer.h new file mode 100644 index 000000000..0351468d3 --- /dev/null +++ b/include/odp/arch/power64-linux/odp/api/abi/timer.h @@ -0,0 +1,7 @@ +/* Copyright (c) 2022, Nokia + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <odp/api/abi-default/timer.h> diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/event_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/event_types.h new file mode 100644 index 000000000..a8321920c --- /dev/null +++ b/include/odp/arch/x86_32-linux/odp/api/abi/event_types.h @@ -0,0 +1,7 @@ +/* Copyright (c) 2022, Nokia + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <odp/api/abi-default/event_types.h> diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/timer.h b/include/odp/arch/x86_32-linux/odp/api/abi/timer.h new file mode 100644 index 000000000..0351468d3 --- /dev/null +++ b/include/odp/arch/x86_32-linux/odp/api/abi/timer.h @@ -0,0 +1,7 @@ +/* Copyright (c) 2022, Nokia + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <odp/api/abi-default/timer.h> diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/event_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/event_types.h new file mode 100644 index 000000000..a8321920c --- /dev/null +++ b/include/odp/arch/x86_64-linux/odp/api/abi/event_types.h @@ -0,0 +1,7 @@ +/* Copyright (c) 2022, Nokia + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <odp/api/abi-default/event_types.h> diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/timer.h b/include/odp/arch/x86_64-linux/odp/api/abi/timer.h new file mode 100644 index 000000000..0351468d3 --- /dev/null +++ b/include/odp/arch/x86_64-linux/odp/api/abi/timer.h @@ -0,0 +1,7 @@ +/* Copyright (c) 2022, Nokia + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <odp/api/abi-default/timer.h> |