API Reference Manual  1.45.0
ODP TRAFFIC MNGR

API Description

Traffic management on packet output.

Macros and operations on a TM system.

This file forms a simple interface for creating, configuring and using Traffic Management (TM) subsystems. By TM subsystem it is meant a general packet scheduling system that accepts packets from input queues and applies strict priority scheduling, weighted fair queueing scheduling and/or bandwidth controls to decide which input packet should be chosen as the next output packet and when this output packet can be sent onwards.

A given platform supporting this TM API could support one or more pure hardware based packet scheduling systems, one or more pure software based systems or one or more hybrid systems - where because of hardware constraints some of the packet scheduling is done in hardware and some is done in software. In addition, there may also be additional APIs beyond those described here for (a) controlling advanced capabilities supported by specific hardware, software or hybrid subsystems or (b) dealing with constraints and limitations of specific implementations.

Data Structures

struct  odp_tm_queue_stats_t
 TM queue specific statistics counters. More...
 
struct  odp_tm_queue_stats_capability_t
 TM queue level statistics capabilities. More...
 
struct  odp_tm_level_capabilities_t
 Per Level Capabilities. More...
 
struct  odp_tm_capabilities_t
 TM Capabilities Record. More...
 
struct  odp_tm_level_requirements_t
 Per Level Requirements. More...
 
struct  odp_tm_requirements_t
 TM Requirements Record. More...
 
struct  odp_tm_egress_t
 The odp_tm_egress_t type is used to describe that type of "egress spigot" associated with this TM system. More...
 
struct  odp_tm_shaper_params_t
 TM shaper parameters. More...
 
struct  odp_tm_sched_params_t
 TM scheduler parameters. More...
 
struct  odp_tm_threshold_params_t
 TM threshold parameters. More...
 
struct  odp_tm_wred_params_t
 TM WRED parameters. More...
 
struct  odp_tm_node_params_t
 TM node parameters. More...
 
struct  odp_tm_queue_params_t
 TM queue parameters. More...
 
struct  odp_tm_node_info_t
 The odp_tm_node_info_t record type is used to return various bits of information about a given tm_node via the odp_tm_node_info() function. More...
 
struct  odp_tm_node_fanin_info_t
 The odp_tm_node_fanin_info_t record type is used to return various bits of information about a given "link"/"connection"/"fanin" between a tm_queue and a tm_node OR between a tm_node and a tm_node, It is also used as the state needed to implement an iterator that walks the complete fanin list of a given tm_node. More...
 
struct  odp_tm_queue_info_t
 The odp_tm_queue_info_t record type is used to return various bits of information about a given tm_queue via the odp_tm_queue_info() function. More...
 
struct  odp_tm_query_info_t
 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 odp_tm_total_query(). More...
 

Macros

#define ODP_TM_MAX_NUM_SYSTEMS   8
 The ODP_TM_MAX_NUM_SYSTEMS constant specifies the maximum number of TM systems that may be created. More...
 
#define ODP_TM_MAX_PRIORITIES   16
 The ODP_TM_MAX_PRIORITIES constant specifies the largest range of priorities that any TM system can support. More...
 
#define ODP_TM_MAX_LEVELS   8
 The ODP_TM MAX_LEVELS constant specifies the largest range of tm_node levels that any TM system can support. More...
 
#define ODP_TM_MIN_SCHED_WEIGHT   1U
 The smallest SCHED weight is 1 (i.e. More...
 
#define ODP_TM_MAX_SCHED_WEIGHT   255U
 The ODP_TM_MAX_SCHED_WEIGHT constant is the largest weight any TM system can support (at least from a configuration standpoint). More...
 
#define ODP_TM_MAX_TM_QUEUES   (4 * 1024)
 The ODP_TM_MAX_TM_QUEUES constant is the largest number of tm_queues that can be handled by any one TM system. More...
 
#define ODP_TM_MAX_NUM_OUTPUTS   256
 The ODP_TM_MAX_NUM_OUTPUTS constant is the largest number of outputs that can be configured for any one TM system. More...
 
#define ODP_TM_MAX_NUM_TM_NODES   (4 * 1024)
 The ODP_TM_MAX_NUM_TM_NODES constant is the largest number of tm_nodes that can be in existence for any one TM system. More...
 
#define ODP_TM_MAX_TM_NODE_FANIN   (4 * 1024)
 The ODP_TM_MAX_TM_NODE_FANIN constant is the largest number of fan-in "inputs" that can be simultaneously connected to a single tm_node. More...
 
#define ODP_TM_INVALID_PRIORITY   255
 The INVALID_PRIORITY constant is used when one needs to indicate an invalid priority value. More...
 
#define ODP_TM_NAME_LEN   32
 Maximum traffic manager name length, including the null character.
 
#define ODP_TM_INVALID   0
 The ODP_TM_INVALID constant can be used with any ODP TM handle type and indicates that this value does NOT represent a valid TM object. More...
 
#define ODP_TM_ROOT   ((odp_tm_handle_t)-1)
 Constant that is used to refer to the egress/root node of the TM subsystem's tree/hierarchy of nodes.
 
#define ODP_TM_QUERY_PKT_CNT   0x01
 The following bit mask constants are used to refine the queue query functions defined below. More...
 
#define ODP_TM_QUERY_BYTE_CNT   0x02
 The total_byte_cnt value.
 
#define ODP_TM_QUERY_THRESHOLDS   0x04
 The threshold values.
 

Typedefs

typedef uint16_t odp_tm_percent_t
 The odp_tm_percent_t type is used when specifying fields that are percentages. More...
 
typedef uint64_t odp_tm_handle_t
 The odp_tm_handle_t type is a generic type that can stand for any of the other ODP_TM handle types.
 
typedef odp_tm_handle_t odp_tm_t
 Each odp_tm_t value represents a specific TM system. More...
 
typedef odp_tm_handle_t odp_tm_queue_t
 Each odp_tm_queue_t value is an opaque ODP handle representing a specific tm_queue within a specific TM system.
 
typedef odp_tm_handle_t odp_tm_node_t
 Each odp_tm_node_t value is an opaque ODP handle representing a specific tm_node within a specific TM system. More...
 
typedef odp_tm_handle_t odp_tm_shaper_t
 Each odp_tm_shaper_t value is an opaque ODP handle representing a specific shaper profile usable across all TM systems described by this API. More...
 
typedef odp_tm_handle_t odp_tm_sched_t
 Each odp_tm_sched_t value is an opaque ODP handle representing a specific tm_node scheduler profile usable across all TM systems described by this API. More...
 
typedef odp_tm_handle_t odp_tm_threshold_t
 Each odp_tm_threshold_t value is an opaque ODP handle representing a specific queue threshold profile usable across all TM systems described by this API. More...
 
typedef odp_tm_handle_t odp_tm_wred_t
 Each odp_tm_wred_t value is an opaque ODP handle representing a specific WRED profile usable across all TM systems described by this API. More...
 
typedef struct odp_tm_queue_stats_t odp_tm_queue_stats_t
 TM queue specific statistics counters.
 
typedef struct odp_tm_queue_stats_capability_t odp_tm_queue_stats_capability_t
 TM queue level statistics capabilities.
 
typedef enum odp_tm_pkt_prio_mode odp_tm_pkt_prio_mode_t
 The tm_pkt_prio_mode_t enumeration type is used to indicate different modes a tm system supports with respect to assigning priority to a packet and propagating it across TM system. More...
 
typedef void(* odp_tm_egress_fcn_t) (odp_packet_t odp_pkt)
 The odp_tm_egress_fcn_t type defines the parameter profile of the egress function callback. More...
 

Enumerations

enum  odp_tm_pkt_prio_mode { ODP_TM_PKT_PRIO_MODE_PRESERVE , ODP_TM_PKT_PRIO_MODE_OVERWRITE , ODP_TM_PKT_PRIO_MODE_MAX }
 The tm_pkt_prio_mode_t enumeration type is used to indicate different modes a tm system supports with respect to assigning priority to a packet and propagating it across TM system. More...
 
enum  odp_tm_egress_kind_t { ODP_TM_EGRESS_PKT_IO , ODP_TM_EGRESS_FN }
 The tm_egress_kind_e enumeration type is used to indicate the kind of egress object ("spigot") associated with this TM system. More...
 
enum  odp_tm_shaper_mode_t { ODP_TM_SHAPER_RATE_SHAPE , ODP_TM_SHAPER_RATE_LIMIT }
 Mode selection between rate shaping and rate limiting. More...
 
enum  odp_tm_sched_mode_t { ODP_TM_BYTE_BASED_WEIGHTS , ODP_TM_FRAME_BASED_WEIGHTS }
 The odp_tm_sched_mode_t type is used to control whether a tm_node scheduler takes into account packet lengths (by setting the sched_mode to ODP_TM_BYTE_BASED_WEIGHTS) or instead treat packets with different lengths the same (by setting the sched_mode to ODP_TM_FRAME_BASED_WEIGHTS). More...
 

Functions

void odp_tm_requirements_init (odp_tm_requirements_t *requirements)
 Initialize Requirements record fields to their default values. More...
 
void odp_tm_egress_init (odp_tm_egress_t *egress)
 Initialize Egress record. More...
 
int odp_tm_egress_capabilities (odp_tm_capabilities_t *capabilities, const odp_tm_egress_t *egress)
 Query TM Capabilities specific to an egress. More...
 
odp_tm_t odp_tm_create (const char *name, odp_tm_requirements_t *requirements, odp_tm_egress_t *egress)
 Create/instantiate a TM Packet Scheduling system. More...
 
odp_tm_t odp_tm_find (const char *name, odp_tm_requirements_t *requirements, odp_tm_egress_t *egress)
 Find a pre-existing TM system. More...
 
int odp_tm_capability (odp_tm_t tm, odp_tm_capabilities_t *capabilities)
 Query Specific TM Capabilities. More...
 
int odp_tm_start (odp_tm_t tm)
 Start a TM system. More...
 
int odp_tm_stop (odp_tm_t tm)
 Stop a TM system. More...
 
int odp_tm_destroy (odp_tm_t tm)
 Destroy a TM system. More...
 
int odp_tm_vlan_marking (odp_tm_t tm, odp_packet_color_t color, odp_bool_t drop_eligible_enabled)
 Vlan Marking. More...
 
int odp_tm_ecn_marking (odp_tm_t tm, odp_packet_color_t color, odp_bool_t ecn_ce_enabled)
 Explicit Congestion Notification Marking. More...
 
int odp_tm_drop_prec_marking (odp_tm_t tm, odp_packet_color_t color, odp_bool_t drop_prec_enabled)
 Drop Precedence Marking. More...
 
void odp_tm_shaper_params_init (odp_tm_shaper_params_t *params)
 Initialize TM shaper parameters. More...
 
odp_tm_shaper_t odp_tm_shaper_create (const char *name, const odp_tm_shaper_params_t *params)
 odp_tm_shaper_create() creates a shaper profile object, which can subsequently be attached to any number (including zero) of tm_queues or tm_nodes. More...
 
int odp_tm_shaper_destroy (odp_tm_shaper_t shaper_profile)
 Destroy shaper profile object. More...
 
int odp_tm_shaper_params_read (odp_tm_shaper_t shaper_profile, odp_tm_shaper_params_t *params)
 odp_tm_shaper_params_read() "gets" the current set of values associated with the specified shaper profile object, and copies them into the supplied record. More...
 
int odp_tm_shaper_params_update (odp_tm_shaper_t shaper_profile, const odp_tm_shaper_params_t *params)
 odp_tm_shaper_params_update() "sets" the current set of values associated with the specified shaper profile object. More...
 
odp_tm_shaper_t odp_tm_shaper_lookup (const char *name)
 odp_tm_shaper_lookup() can be used to find the shaper profile object created with the specified name. More...
 
void odp_tm_sched_params_init (odp_tm_sched_params_t *params)
 Initialize TM scheduler parameters. More...
 
odp_tm_sched_t odp_tm_sched_create (const char *name, const odp_tm_sched_params_t *params)
 odp_tm_sched_create() creates a scheduler profile object, which can subsequently be attached to any number (including zero) of tm_nodes. More...
 
int odp_tm_sched_destroy (odp_tm_sched_t sched_profile)
 Destroy scheduler profile object. More...
 
int odp_tm_sched_params_read (odp_tm_sched_t sched_profile, odp_tm_sched_params_t *params)
 odp_tm_sched_params_read() "gets" the current set of values associated with the specified scheduler profile object, and copies them into the supplied record. More...
 
int odp_tm_sched_params_update (odp_tm_sched_t sched_profile, const odp_tm_sched_params_t *params)
 odp_tm_sched_params_update() "sets" the current set of values associated with the specified scheduler profile object. More...
 
odp_tm_sched_t odp_tm_sched_lookup (const char *name)
 odp_tm_sched_lookup() can be used to find the scheduler profile object created with the specified name. More...
 
void odp_tm_threshold_params_init (odp_tm_threshold_params_t *params)
 Initialize TM threshold parameters. More...
 
odp_tm_threshold_t odp_tm_threshold_create (const char *name, const odp_tm_threshold_params_t *params)
 odp_tm_threshold_create() creates a queue threshold profile object, which can subsequently be attached to any number (including zero) of tm_queues or tm_nodes. More...
 
int odp_tm_threshold_destroy (odp_tm_threshold_t threshold_profile)
 Destroy a queue threshold profile object. More...
 
int odp_tm_thresholds_params_read (odp_tm_threshold_t threshold_profile, odp_tm_threshold_params_t *params)
 odp_tm_thresholds_params_read() "gets" the current set of values associated with the specified queue thresholds profile object, and copies them into the supplied record. More...
 
int odp_tm_thresholds_params_update (odp_tm_threshold_t threshold_profile, const odp_tm_threshold_params_t *params)
 odp_tm_thresholds_params_update() "sets" the current set of values associated with the specified queue thresholds profile object. More...
 
odp_tm_threshold_t odp_tm_thresholds_lookup (const char *name)
 odp_tm_thresholds_lookup() can be used to find the queue thresholds profile object created with the specified name. More...
 
void odp_tm_wred_params_init (odp_tm_wred_params_t *params)
 Initialize TM WRED parameters. More...
 
odp_tm_wred_t odp_tm_wred_create (const char *name, const odp_tm_wred_params_t *params)
 odp_tm_wred_create() creates a WRED (Weighted Random Early Detection) profile object, which can subsequently be attached to any number (including zero) of tm_queues or tm_nodes. More...
 
int odp_tm_wred_destroy (odp_tm_wred_t wred_profile)
 Destroy WRED profile object. More...
 
int odp_tm_wred_params_read (odp_tm_wred_t wred_profile, odp_tm_wred_params_t *params)
 odp_tm_wred_params_read() "gets" the current set of values associated with the specified WRED profile object, and copies them into the supplied record. More...
 
int odp_tm_wred_params_update (odp_tm_wred_t wred_profile, const odp_tm_wred_params_t *params)
 odp_tm_wred_params_update() "sets" the current set of values associated with the specified WRED profile object. More...
 
odp_tm_wred_t odp_tm_wred_lookup (const char *name)
 odp_tm_wred_lookup() can be used to find the WRED profile object created with the specified name. More...
 
void odp_tm_node_params_init (odp_tm_node_params_t *params)
 Initialize TM node parameters. More...
 
odp_tm_node_t odp_tm_node_create (odp_tm_t tm, const char *name, const odp_tm_node_params_t *params)
 Create an tm_node with a specific set of implemented strict priority levels as given by the priorities array parameter. More...
 
int odp_tm_node_destroy (odp_tm_node_t tm_node)
 Destroy a tm_node object. More...
 
int odp_tm_node_shaper_config (odp_tm_node_t tm_node, odp_tm_shaper_t shaper_profile)
 The odp_tm_node_shaper_config() function is used to dynamically set or change the shaper profile associated with this tm_node. More...
 
int odp_tm_node_sched_config (odp_tm_node_t tm_node, odp_tm_node_t tm_fan_in_node, odp_tm_sched_t sched_profile)
 The odp_tm_node_sched_config() function is used to dynamically set or change the scheduler profile associated with a tm_node. More...
 
int odp_tm_node_threshold_config (odp_tm_node_t tm_node, odp_tm_threshold_t thresholds_profile)
 The odp_tm_node_threshold_config() function is used to dynamically set or change the queue threshold profile associated with this tm_node. More...
 
int odp_tm_node_wred_config (odp_tm_node_t tm_node, odp_packet_color_t pkt_color, odp_tm_wred_t wred_profile)
 The odp_tm_node_wred_config() function is used to dynamically set or change the WRED profile associated with this tm_node or tm_node/pkt_color combination. More...
 
odp_tm_node_t odp_tm_node_lookup (odp_tm_t tm, const char *name)
 odp_tm_node_lookup() can be used to find the tm_node object created with the specified name. More...
 
void * odp_tm_node_context (odp_tm_node_t tm_node)
 odp_tm_node_context() can be used to get the user_context value that is associated with the given tm_node. More...
 
int odp_tm_node_context_set (odp_tm_node_t tm_node, void *user_context)
 odp_tm_node_context_set() can be used to set the user_context value that is associated with the given tm_node. More...
 
void odp_tm_queue_params_init (odp_tm_queue_params_t *params)
 Initialize TM queue parameters. More...
 
odp_tm_queue_t odp_tm_queue_create (odp_tm_t tm, const odp_tm_queue_params_t *params)
 TM queue create. More...
 
int odp_tm_queue_destroy (odp_tm_queue_t tm_queue)
 Destroy an tm_queue object. More...
 
void * odp_tm_queue_context (odp_tm_queue_t tm_queue)
 odp_tm_queue_context() can be used to get the user_context value that is associated with the given tm_queue. More...
 
int odp_tm_queue_context_set (odp_tm_queue_t tm_queue, void *user_context)
 odp_tm_queue_context_set() can be used to set the user_context value that is associated with the given tm_queue. More...
 
int odp_tm_queue_shaper_config (odp_tm_queue_t tm_queue, odp_tm_shaper_t shaper_profile)
 The odp_tm_queue_shaper_config() function is used to dynamically set or change the shaper profile associated with this tm_queue. More...
 
int odp_tm_queue_sched_config (odp_tm_node_t tm_node, odp_tm_queue_t tm_fan_in_queue, odp_tm_sched_t sched_profile)
 The odp_tm_queue_sched_config() function is used to dynamically set or change the scheduler profile associated with a tm_node. More...
 
int odp_tm_queue_threshold_config (odp_tm_queue_t tm_queue, odp_tm_threshold_t thresholds_profile)
 The odp_tm_queue_threshold_config() function is used to dynamically set or change the queue threshold profile associated with this tm_queue. More...
 
int odp_tm_queue_wred_config (odp_tm_queue_t tm_queue, odp_packet_color_t pkt_color, odp_tm_wred_t wred_profile)
 odp_tm_queue_wred_config() function is used to dynamically set or change the WRED profile associated with this tm_queue or tm_queue/pkt_color combination. More...
 
int odp_tm_node_connect (odp_tm_node_t src_tm_node, odp_tm_node_t dst_tm_node)
 Connects two tm_nodes. More...
 
int odp_tm_node_disconnect (odp_tm_node_t src_tm_node)
 Disconnect a tm_node to tm_node linkage. More...
 
int odp_tm_queue_connect (odp_tm_queue_t tm_queue, odp_tm_node_t dst_tm_node)
 The odp_tm_queue_connect() function connects the indicated tm_queue to a parent tm_node or to the egress/root node. More...
 
int odp_tm_queue_disconnect (odp_tm_queue_t tm_queue)
 Disconnect a tm_queue from a tm_system. More...
 
int odp_tm_enq (odp_tm_queue_t tm_queue, odp_packet_t pkt)
 Send packet to TM system. More...
 
int odp_tm_enq_multi (odp_tm_queue_t tm_queue, const odp_packet_t packets[], int num)
 The odp_tm_enq_multi() function is used to add packets to a given TM system. More...
 
int odp_tm_enq_multi_lso (odp_tm_queue_t tm_queue, const odp_packet_t packets[], int num, const odp_packet_lso_opt_t *lso_opt)
 Send packets with segmentation offload to TM system. More...
 
int odp_tm_enq_with_cnt (odp_tm_queue_t tm_queue, odp_packet_t pkt)
 The odp_tm_enq_with_cnt() function behaves identically to odp_tm_enq(), except that it also returns the current tm_queue packet queue count (may be an approximation). More...
 
int odp_tm_node_info (odp_tm_node_t tm_node, odp_tm_node_info_t *info)
 Get tm_node Info. More...
 
int odp_tm_node_fanin_info (odp_tm_node_t tm_node, odp_tm_node_fanin_info_t *info)
 Get tm_node Fanin Info. More...
 
int odp_tm_queue_info (odp_tm_queue_t tm_queue, odp_tm_queue_info_t *info)
 Get tm_queue Info. More...
 
int odp_tm_queue_query (odp_tm_queue_t tm_queue, uint32_t query_flags, odp_tm_query_info_t *info)
 The odp_tm_queue_query() function can be used to check a single tm_queue's queue utilization. More...
 
int odp_tm_priority_query (odp_tm_t odp_tm, uint8_t priority, uint32_t query_flags, odp_tm_query_info_t *info)
 The odp_tm_priority_query() function can be used to check the queue utilization of all tm_queue's with the given priority. More...
 
int odp_tm_total_query (odp_tm_t odp_tm, uint32_t query_flags, odp_tm_query_info_t *info)
 The odp_tm_total_query() function can be used to check the queue utilization of all tm_queue's in a single TM system. More...
 
int odp_tm_priority_threshold_config (odp_tm_t odp_tm, uint8_t priority, odp_tm_threshold_t thresholds_profile)
 The odp_tm_priority_threshold_config() function is only used to associate a maximum packet count and/or a maximum byte count with a strict priority level - for the benefit of the odp_tm_priority_query() function. More...
 
int odp_tm_total_threshold_config (odp_tm_t tm, odp_tm_threshold_t thresholds_profile)
 The odp_tm_total_threshold_config() function is only used to associate a maximum packet count and/or a maximum byte count with a TM system - for the benefit of the odp_tm_total_query() function. More...
 
odp_bool_t odp_tm_is_idle (odp_tm_t tm)
 The odp_tm_is_idle function is used to determine if the specified ODP traffic management system still has "work" to do (i.e. More...
 
void odp_tm_stats_print (odp_tm_t tm)
 The odp_tm_stats_print function is used to write implementation-defined information about the specified TM system to the ODP log. More...
 
int odp_tm_queue_stats (odp_tm_queue_t tm_queue, odp_tm_queue_stats_t *stats)
 Get statistics for a TM queue. More...
 
uint64_t odp_tm_to_u64 (odp_tm_t tm)
 Get printable value for an odp_tm_t. More...
 
uint64_t odp_tm_queue_to_u64 (odp_tm_queue_t hdl)
 Get printable value for an odp_tm_queue_t. More...
 
uint64_t odp_tm_node_to_u64 (odp_tm_node_t hdl)
 Get printable value for an odp_tm_node_t. More...
 
uint64_t odp_tm_shaper_to_u64 (odp_tm_shaper_t hdl)
 Get printable value for an odp_tm_shaper_t. More...
 
uint64_t odp_tm_sched_to_u64 (odp_tm_sched_t hdl)
 Get printable value for an odp_tm_sched_t. More...
 
uint64_t odp_tm_threshold_to_u64 (odp_tm_threshold_t hdl)
 Get printable value for an odp_tm_threshold_t. More...
 
uint64_t odp_tm_wred_to_u64 (odp_tm_wred_t hdl)
 Get printable value for an odp_tm_wred_t. More...
 

Macro Definition Documentation

◆ ODP_TM_MAX_NUM_SYSTEMS

#define ODP_TM_MAX_NUM_SYSTEMS   8

The ODP_TM_MAX_NUM_SYSTEMS constant specifies the maximum number of TM systems that may be created.

The maximum number of TM systems that may be created.

On some platforms this might be much more limited to as little as one hardware TM system.

◆ ODP_TM_MAX_PRIORITIES

#define ODP_TM_MAX_PRIORITIES   16

The ODP_TM_MAX_PRIORITIES constant specifies the largest range of priorities that any TM system can support.

The largest range of priorities that any TM system can support.

All strict priority values MUST in the range 0..ODP_TM_MAX_PRIORITIES-1.

◆ ODP_TM_MAX_LEVELS

#define ODP_TM_MAX_LEVELS   8

The ODP_TM MAX_LEVELS constant specifies the largest range of tm_node levels that any TM system can support.

The largest range of tm_node levels that any TM system can support.

Hence all tm_node level values MUST be in the range 0..ODP_TM_MAX_LEVELS-1. Smaller tm_node levels are associated with tm_nodes closer to the TM system egress.

◆ ODP_TM_MIN_SCHED_WEIGHT

#define ODP_TM_MIN_SCHED_WEIGHT   1U

The smallest SCHED weight is 1 (i.e.

0 is not a legal WFQ/WRR value).

◆ ODP_TM_MAX_SCHED_WEIGHT

#define ODP_TM_MAX_SCHED_WEIGHT   255U

The ODP_TM_MAX_SCHED_WEIGHT constant is the largest weight any TM system can support (at least from a configuration standpoint).

The largest weight any TM system can support (at least from a configuration standpoint).

A given TM system could have a smaller value.

◆ ODP_TM_MAX_TM_QUEUES

#define ODP_TM_MAX_TM_QUEUES   (4 * 1024)

The ODP_TM_MAX_TM_QUEUES constant is the largest number of tm_queues that can be handled by any one TM system.

The largest number of tm_queues that can be handled by any one TM system.

◆ ODP_TM_MAX_NUM_OUTPUTS

#define ODP_TM_MAX_NUM_OUTPUTS   256

The ODP_TM_MAX_NUM_OUTPUTS constant is the largest number of outputs that can be configured for any one TM system.

The largest number of outputs that can be configured for any one TM system.

◆ ODP_TM_MAX_NUM_TM_NODES

#define ODP_TM_MAX_NUM_TM_NODES   (4 * 1024)

The ODP_TM_MAX_NUM_TM_NODES constant is the largest number of tm_nodes that can be in existence for any one TM system.

The largest number of tm_nodes that can be in existence for any one TM system.

◆ ODP_TM_MAX_TM_NODE_FANIN

#define ODP_TM_MAX_TM_NODE_FANIN   (4 * 1024)

The ODP_TM_MAX_TM_NODE_FANIN constant is the largest number of fan-in "inputs" that can be simultaneously connected to a single tm_node.

The largest number of fan-in "inputs" that can be simultaneously connected to a single tm_node.

TBD Does this need to be as large as ODP_TM_MAX_TM_QUEUES? TBD

◆ ODP_TM_INVALID_PRIORITY

#define ODP_TM_INVALID_PRIORITY   255

The INVALID_PRIORITY constant is used when one needs to indicate an invalid priority value.

Used to indicate an invalid priority value.

◆ ODP_TM_INVALID

#define ODP_TM_INVALID   0

The ODP_TM_INVALID constant can be used with any ODP TM handle type and indicates that this value does NOT represent a valid TM object.

Constant that can be used with any ODP TM handle type and indicates that this value does NOT represent a valid TM object.

Examples
odp_traffic_mgmt.c.

◆ ODP_TM_QUERY_PKT_CNT

#define ODP_TM_QUERY_PKT_CNT   0x01

The following bit mask constants are used to refine the queue query functions defined below.

The total_pkt_cnt value

Definition at line 2194 of file api/spec/traffic_mngr.h.

Typedef Documentation

◆ odp_tm_percent_t

The odp_tm_percent_t type is used when specifying fields that are percentages.

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 the integer value 10000. Note that because it is often used as a ratio of the current queue value and maximum queue threshold, it can be > 100%, but in any event will never be larger than 500% (i.e. it MUST be capped at 50000).

Definition at line 91 of file api/abi-default/traffic_mngr.h.

◆ odp_tm_t

Each odp_tm_t value represents a specific TM system.

Almost all functions in this API require a odp_tm_t value - either directly as a function parameter or indirectly by having another ODP TM handle value as a function parameter.

Definition at line 103 of file api/abi-default/traffic_mngr.h.

◆ odp_tm_node_t

Each odp_tm_node_t value is an opaque ODP handle representing a specific tm_node within a specific TM system.

Each odp_tm_node_t value is an opaque ODP handle representing a specific tm node within a specific TM system.

Definition at line 113 of file api/abi-default/traffic_mngr.h.

◆ odp_tm_shaper_t

Each odp_tm_shaper_t value is an opaque ODP handle representing a specific shaper profile usable across all TM systems described by this API.

A given shaper profile can then be attached to any tm_queue or tm_node.

Definition at line 119 of file api/abi-default/traffic_mngr.h.

◆ odp_tm_sched_t

Each odp_tm_sched_t value is an opaque ODP handle representing a specific tm_node scheduler profile usable across all TM systems described by this API.

A given tm_node scheduler profile can then be attached to any tm_node.

Definition at line 125 of file api/abi-default/traffic_mngr.h.

◆ odp_tm_threshold_t

Each odp_tm_threshold_t value is an opaque ODP handle representing a specific queue threshold profile usable across all TM systems described by this API.

A given queue threshold profile can then be attached to any tm_queue or tm_node.

Definition at line 132 of file api/abi-default/traffic_mngr.h.

◆ odp_tm_wred_t

Each odp_tm_wred_t value is an opaque ODP handle representing a specific WRED profile usable across all TM systems described by this API.

A given WRED profile can then be attached to any tm_queue or tm_node.

Definition at line 138 of file api/abi-default/traffic_mngr.h.

◆ odp_tm_pkt_prio_mode_t

The tm_pkt_prio_mode_t enumeration type is used to indicate different modes a tm system supports with respect to assigning priority to a packet and propagating it across TM system.

All the nodes in a TM system can function only on single mode specified at time of odp_tm_create().

◆ odp_tm_egress_fcn_t

typedef void(* odp_tm_egress_fcn_t) (odp_packet_t odp_pkt)

The odp_tm_egress_fcn_t type defines the parameter profile of the egress function callback.

Using an egress function callback is just one of several ways of getting packets out from an egress spigot.

Definition at line 705 of file api/spec/traffic_mngr.h.

Enumeration Type Documentation

◆ odp_tm_pkt_prio_mode

The tm_pkt_prio_mode_t enumeration type is used to indicate different modes a tm system supports with respect to assigning priority to a packet and propagating it across TM system.

All the nodes in a TM system can function only on single mode specified at time of odp_tm_create().

Enumerator
ODP_TM_PKT_PRIO_MODE_PRESERVE 

Indicates Packet priority preserve mode.

In this mode, a packet gets its priority based on a TM queue it gets enqueued to and then it carries the same priority along with it as long as it is in the TM system. At every TM node in the topology, that specific pkt is scheduled as per that priority.

ODP_TM_PKT_PRIO_MODE_OVERWRITE 

Indicates Packet priority overwrite mode.

In this mode, a packet gets a new priority every time it passes through a TM queue or a TM node. All the packets fed by a fan-in node will get the same priority and that will be valid until overwritten again by another TM node. This priority is part of the TM fan-in node parameters and is fixed at node creation time.

ODP_TM_PKT_PRIO_MODE_MAX 

Max enum of Packet priority mode.

Definition at line 367 of file api/spec/traffic_mngr.h.

◆ odp_tm_egress_kind_t

The tm_egress_kind_e enumeration type is used to indicate the kind of egress object ("spigot") associated with this TM system.

Most of these kinds are optional - with ODP_TM_EGRESS_PKT_IO being the only mandatory kind. The TM_EGRESS_FN - if implemented - is useful for testing the TM subsystem, and users are warned that its performance might be limited.

Definition at line 713 of file api/spec/traffic_mngr.h.

◆ odp_tm_shaper_mode_t

Mode selection between rate shaping and rate limiting.

Enumerator
ODP_TM_SHAPER_RATE_SHAPE 

Rate shape traffic to the specified burst and rate by delaying packets.

The shaper does not drop packets in normal operation, but since it delays packets, it can cause queues to fill up and cause queue management to drop packets.

ODP_TM_SHAPER_RATE_LIMIT 

Rate limit traffic to the specified burst and rate by dropping excess packets.

It is implementation dependent when exactly the limiter state update and packet drop happens. For example, they may occur immediately when packets are available from the source or when the downstream node and scheduler are accepting new packets from this node/queue. It is possible that in some cases a delayed packet drop causes queues to fill up.

Definition at line 1020 of file api/spec/traffic_mngr.h.

◆ odp_tm_sched_mode_t

The odp_tm_sched_mode_t type is used to control whether a tm_node scheduler takes into account packet lengths (by setting the sched_mode to ODP_TM_BYTE_BASED_WEIGHTS) or instead treat packets with different lengths the same (by setting the sched_mode to ODP_TM_FRAME_BASED_WEIGHTS).

Normally the sched_mode will be set to ODP_TM_BYTE_BASED_WEIGHTS, otherwise the scheduler becomes a weighted round robin scheduler.

Enumerator
ODP_TM_BYTE_BASED_WEIGHTS 

Use the packet length in scheduler algorithm.

ODP_TM_FRAME_BASED_WEIGHTS 

Ignore the packet length.

Definition at line 1210 of file api/spec/traffic_mngr.h.

Function Documentation

◆ odp_tm_requirements_init()

void odp_tm_requirements_init ( odp_tm_requirements_t requirements)

Initialize Requirements record fields to their default values.

odp_tm_requirements_init() must be called to initialize any odp_tm_requirements_t record before it is first used or assigned to.

Parameters
requirementsA pointer to an odp_tm_requirements_t record which is to be initialized.
Examples
odp_traffic_mgmt.c.

◆ odp_tm_egress_init()

void odp_tm_egress_init ( odp_tm_egress_t egress)

Initialize Egress record.

odp_tm_egress_init() must be called to initialize any odp_tm_egress_t record before it is first used or assigned to.

Parameters
egressA pointer to an odp_tm_egress_t record which is to be initialized.
Examples
odp_traffic_mgmt.c.

◆ odp_tm_egress_capabilities()

int odp_tm_egress_capabilities ( odp_tm_capabilities_t capabilities,
const odp_tm_egress_t egress 
)

Query TM Capabilities specific to an egress.

The function returns the set of TM limits supported by this implementation for a given egress. Unlike odp_tm_capability() which return's capabilities of already created TM system which are limited by its requirements, this function returns maximum TM system limits.

Lack of TM support in the given egress does not cause this function to return a failure. Lack of TM support is indicated by zero max_tm_queues capability.

If the pktio of an egress of the pktio kind has not been opened in the ODP_PKTOUT_MODE_TM pktout mode, the capabilities will indicate that TM is not supported.

Parameters
[out]capabilitiesodp_tm_capabilities_t record to be filled in.
egressOnly capabilities compatible with this egress are returned.
Return values
0on success
<0on failure

◆ odp_tm_create()

odp_tm_t odp_tm_create ( const char *  name,
odp_tm_requirements_t requirements,
odp_tm_egress_t egress 
)

Create/instantiate a TM Packet Scheduling system.

Parameters
nameThe name to be assigned to this TM system. Cannot be NULL, and also must be unique amongst all other TM system names. Maximum string length is ODP_TM_NAME_LEN, including the null character.
requirementsThe minimum required feature set and limits needed by the ODP application.
egressDescribes the single egress "spigot" of this TM system.
Returns
Returns ODP_TM_INVALID upon failure, otherwise the newly created TM system's odp_tm_t handle is returned.
Examples
odp_traffic_mgmt.c.

◆ odp_tm_find()

odp_tm_t odp_tm_find ( const char *  name,
odp_tm_requirements_t requirements,
odp_tm_egress_t egress 
)

Find a pre-existing TM system.

The odp_tm_find() function can be used either to find a TM system created previously with odp_tm_create OR get the odp_tm_t of a built-in TM system - usually based on HW. In this later case the format of the name used to refer to a specific built-in hardware TM system may be platform dependent, but in any case a name of "HW_TM_%u" where the number starts at 1, can be used to find a built-in system independently of the best requirements match. If name is NULL then the existing (built-in or created by odp_tm_create) TM system that best matches the requirements is returned.

Parameters
nameIf NULL then only uses the requirements parameter to find a closest match, otherwise if the name is matched by an existing TM system it is returned.
requirementsUsed when the name is NULL (in which case the closest match is returned) or when the name is not-NULL, but doesn't match any existing TM system in which case the requirements is used to find the FIRST TM system matching exactly these limits.
egressIf a TM system is found, then this specifies the egress "spigot" to be associated with this TM system.
Returns
If an existing TM system (built-in or previously created via odp_tm_create) is found, its odp_tm_t value is returned, otherwise ODP_TM_INVALID is returned.

◆ odp_tm_capability()

int odp_tm_capability ( odp_tm_t  tm,
odp_tm_capabilities_t capabilities 
)

Query Specific TM Capabilities.

The odp_tm_capability() function can be used to obtain the actual limits of the given TM system - that was either previous "found" or "created". Note that it is IMPORTANT to understand that the capabilities filled in here probably will NOT match any of the "complete set" of capabilities as returned by odp_tm_capabilities. This is because the capabilities here reflect the given requirements passed in. Hence these capabilities MAY (but are not always required to) contain reduced limits and features based upon the actual requirements as determined by the ODP application. In addition, ODP TM implementations should fail API requests that "exceed" the limits or features contracted for in the requirements.

Parameters
tmTM handle
[out]capabilitiesA pointer to an odp_tm_capabilities_t record where the actual limits used by the TM system are copied into. Note that these limits do NOT have to match the capability passed in if a TM system was created by odp_tm_create, but of course these limits in some cases could be larger.
Returns
Returns 0 upon success, < 0 upon failure (which indicates that the odp_tm value did not exist).
Examples
odp_traffic_mgmt.c.

◆ odp_tm_start()

int odp_tm_start ( odp_tm_t  tm)

Start a TM system.

odp_tm_start() needs to be used to start an already created or found TM system. By default, all the TM systems are in stopped state.

Parameters
tmTM handle
Return values
0on success
<0on failure
Examples
odp_traffic_mgmt.c.

◆ odp_tm_stop()

int odp_tm_stop ( odp_tm_t  tm)

Stop a TM system.

odp_tm_stop() can to used to stop a TM system that is already started for the purpose of reconfiguration that cannot be done dynamically.

When TM is in the stopped state,

  • New packets must not be sent to the TM either directly by TM API or indirectly via IPsec outbound inline API. New packets can only be enqueued after starting the TM system using odp_tm_start().
  • Packets already inflight inside TM or IPSec for transmit may get silently dropped or may get transmitted with unspecified TM treatment.

A following call to odp_tm_start() restarts TM system and its scheduling/shaping on existing and new packets.

Parameters
tmTM handle
Return values
0on success
<0on failure
See also
odp_tm_capabilities_t::dynamic_topology_update
odp_tm_capabilities_t::dynamic_shaper_update
odp_tm_capabilities_t::dynamic_sched_update
odp_tm_capabilities_t::dynamic_wred_update
odp_tm_capabilities_t::dynamic_threshold_update
Examples
odp_traffic_mgmt.c.

◆ odp_tm_destroy()

int odp_tm_destroy ( odp_tm_t  tm)

Destroy a TM system.

odp_tm_destroy() may be used to destroy TM systems created via odp_tm_create(). It generally CANNOT be used to destroy built-in TM systems. Also some platforms MAY not support destroying of TM systems created via odp_tm_create() under certain conditions. For example a given platform may require that the TM system be first "drained" of all of its queued packets before it will accept a odp_tm_destroy() call.

In general calling odp_tm_destroy() on an active TM system does not guarantee anything about the disposition of any packets queued within the TM system, other than EVENTUALLY these packets will be either sent (in ANY order) or freed.

Parameters
tmThe handle of the TM system to be destroyed (and hence freed).
Returns
0 upon success, < 0 upon failure.
Examples
odp_traffic_mgmt.c.

◆ odp_tm_vlan_marking()

int odp_tm_vlan_marking ( odp_tm_t  tm,
odp_packet_color_t  color,
odp_bool_t  drop_eligible_enabled 
)

Vlan Marking.

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 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 always return 0 when disabling this feature.

Parameters
tmHandle of the TM system whose egress behavior is being changed.
colorThe packet color whose egress marking is being changed.
drop_eligible_enabledIf true then will set the DEI bit for egressed VLAN tagged pkts with this color.
Returns
0 upon success, < 0 upon failure.

◆ odp_tm_ecn_marking()

int odp_tm_ecn_marking ( odp_tm_t  tm,
odp_packet_color_t  color,
odp_bool_t  ecn_ce_enabled 
)

Explicit Congestion Notification Marking.

The odp_tm_ecn_marking() function allows one to configure the TM egress so that the two bit ECN subfield of the eight bit TOS field of an IPv4 pkt OR the eight bit Traffic Class (TC) field of an IPv6 pkt can be selectively modified based upon the final color assigned to the pkt when it reaches the egress. Note that the IPv4 header checksum will be updated - but only if the IPv4 TOS field actually changes as a result of this setting or the odp_tm_drop_prec_marking setting. For IPv6, since there is no header checksum, nothing needs to be done. Note that this marking API will only ever cause both ECN bits to be set to 1 - but only for TCP pkts whose incoming ECN bits are not both 0. See RFC 3168 for more details.

Note that ALL ODP implementations are required to SUCCESSFULLY handle all calls to this function with ecn_ce_enabled == FALSE - i.e. must always return 0 when disabling this feature.

Parameters
tmHandle of the TM system whose egress behavior is being changed.
colorThe packet color whose egress marking is being changed.
ecn_ce_enabledIf true then egressed IPv4/IPv6 pkts whose protocol field is TCP AND whose ECN subfield has either one of the two values 1 or 2, will set this subfield to the value ECN_CE - i.e. Congestion Experienced (whose value is 3).
Returns
0 upon success, < 0 upon failure.

◆ odp_tm_drop_prec_marking()

int odp_tm_drop_prec_marking ( odp_tm_t  tm,
odp_packet_color_t  color,
odp_bool_t  drop_prec_enabled 
)

Drop Precedence Marking.

The odp_tm_drop_prec_marking() function allows one to configure the TM egress so that the two RFC 2597 Drop Precedence bits can be modified based upon the final color assigned to the pkt when it reaches the egress. The Drop Precedence bits are contained within the six bit Differentiated Services Code Point subfield of the IPv4 TOS field or the IPv6 Traffic Class (TC) field. Specifically the Drop Precedence sub-subfield can be accessed with a DSCP bit mask of 0x06. When enabled for a given color, these two bits will be set to Medium Drop Precedence (value 0x4) if the color is ODP_PACKET_YELLOW, set to High Drop Precedence (value 0x6) if the color is ODP_PACKET_RED, otherwise set to Low Drop Precedence for any other color. Of course an implementation can restrict the set of colors which can be enabled via the marking_colors_supported array in the odp_tm_capabilities_t record.

Note that the IPv4 header checksum will be updated - but only if the IPv4 TOS field actually changes as a result of this setting or the odp_tm_ecn_marking setting. For IPv6, since there is no header checksum, nothing else needs to be done.

Note that ALL ODP implementations are required to SUCCESSFULLY handle all calls to this function with drop_prec_enabled == FALSE - i.e. must always return 0 when disabling this feature.

Parameters
tmHandle of the TM system whose egress behavior is being changed.
colorThe packet color whose egress marking is being changed.
drop_prec_enabledIf true then egressed IPv4/IPv6 pkts with this color will have the pkt's Drop Precedence sub-subfield of the DSCP subfield set to LOW, MEDIUM or HIGH drop precedence.
Returns
0 upon success, < 0 upon failure.

◆ odp_tm_shaper_params_init()

void odp_tm_shaper_params_init ( odp_tm_shaper_params_t params)

Initialize TM shaper parameters.

Initialize an odp_tm_shaper_params_t to its default values for all fields.

Parameters
paramsAddress of the odp_tm_shaper_params_t to be initialized
Examples
odp_traffic_mgmt.c.

◆ odp_tm_shaper_create()

odp_tm_shaper_t odp_tm_shaper_create ( const char *  name,
const odp_tm_shaper_params_t params 
)

odp_tm_shaper_create() creates a shaper profile object, which can subsequently be attached to any number (including zero) of tm_queues or tm_nodes.

Parameters
nameOptional name associated with this shaper profile. Can be NULL. If non-NULL must be unique amongst the set of all other shaper profiles. Maximum string length is ODP_TM_NAME_LEN, including the null character.
paramsThe profile parameters. See comments associated with the odp_tm_shaper_params_t for more details.
Returns
Returns ODP_TM_INVALID upon failure, or the newly allocated odp_tm_shaper_t value representing this profile object.
Examples
odp_traffic_mgmt.c.

◆ odp_tm_shaper_destroy()

int odp_tm_shaper_destroy ( odp_tm_shaper_t  shaper_profile)

Destroy shaper profile object.

The odp_tm_shaper_destroy() function destroys/frees the given shaper profile object. It is an error if this shaper profile is still being referenced by an active (connected) tm_node.

Parameters
shaper_profileSpecifies the shaper profile object which is being destroyed.
Returns
Returns < 0 upon failure or 0 upon success.

◆ odp_tm_shaper_params_read()

int odp_tm_shaper_params_read ( odp_tm_shaper_t  shaper_profile,
odp_tm_shaper_params_t params 
)

odp_tm_shaper_params_read() "gets" the current set of values associated with the specified shaper profile object, and copies them into the supplied record.

Parameters
shaper_profileSpecifies the shaper profile object whose values are to be read.
[out]paramsA pointer to an odp_tm_shaper_params_t record where the current shaper profile object values are copied to.
Returns
Returns < 0 upon failure or 0 upon success.

◆ odp_tm_shaper_params_update()

int odp_tm_shaper_params_update ( odp_tm_shaper_t  shaper_profile,
const odp_tm_shaper_params_t params 
)

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 with this shaper profile object will be updated with the new values.

Parameters
shaper_profileSpecifies the shaper profile object whose values are to be set.
paramsA pointer to an odp_tm_shaper_params_t record where the new shaper profile object values are taken from.
Returns
Returns < 0 upon failure or 0 upon success.

◆ odp_tm_shaper_lookup()

odp_tm_shaper_t odp_tm_shaper_lookup ( const char *  name)

odp_tm_shaper_lookup() can be used to find the shaper profile object created with the specified name.

Parameters
nameName of a previously created shaper profile. Cannot be NULL.
Returns
Returns ODP_TM_INVALID upon failure, or the shaper profile handle created with this name.

◆ odp_tm_sched_params_init()

void odp_tm_sched_params_init ( odp_tm_sched_params_t params)

Initialize TM scheduler parameters.

Initialize an odp_tm_sched_params_t to its default values for all fields.

Parameters
paramsAddress of the odp_tm_sched_params_t to be initialized

◆ odp_tm_sched_create()

odp_tm_sched_t odp_tm_sched_create ( const char *  name,
const odp_tm_sched_params_t params 
)

odp_tm_sched_create() creates a scheduler profile object, which can subsequently be attached to any number (including zero) of tm_nodes.

Parameters
nameOptional name associated with this scheduler profile. Can be NULL. If non-NULL must be unique amongst the set of all other scheduler profiles. Maximum string length is ODP_TM_NAME_LEN, including the null character.
paramsThe profile parameters. See comments associated with the odp_tm_sched_params_t for more details.
Returns
Returns ODP_TM_INVALID upon failure, or the newly allocated odp_tm_sched_t value representing this profile object.

◆ odp_tm_sched_destroy()

int odp_tm_sched_destroy ( odp_tm_sched_t  sched_profile)

Destroy scheduler profile object.

The odp_tm_sched_destroy() function destroys/frees the given scheduler profile object. It is an error if this scheduler profile is still being referenced by an active (connected) tm_node.

Parameters
sched_profileSpecifies the shaper profile object which is being destroyed.
Returns
Returns < 0 upon failure or 0 upon success.

◆ odp_tm_sched_params_read()

int odp_tm_sched_params_read ( odp_tm_sched_t  sched_profile,
odp_tm_sched_params_t params 
)

odp_tm_sched_params_read() "gets" the current set of values associated with the specified scheduler profile object, and copies them into the supplied record.

Parameters
sched_profileSpecifies the scheduler profile whose values are to be read.
[out]paramsA pointer to an odp_tm_sched_params_t record where the current scheduler profile object values are copied to.
Returns
Returns < 0 upon failure or 0 upon success.

◆ odp_tm_sched_params_update()

int odp_tm_sched_params_update ( odp_tm_sched_t  sched_profile,
const odp_tm_sched_params_t params 
)

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 with this scheduler profile object will be updated with the new values.

Parameters
sched_profileSpecifies the Scheduler profile object whose values are to be set.
paramsA pointer to an odp_tm_sched_params_t record where the new scheduler profile object values are taken from.
Returns
Returns < 0 upon failure or 0 upon success.

◆ odp_tm_sched_lookup()

odp_tm_sched_t odp_tm_sched_lookup ( const char *  name)

odp_tm_sched_lookup() can be used to find the scheduler profile object created with the specified name.

Parameters
nameName of a previously created scheduler profile. Cannot be NULL.
Returns
Returns ODP_TM_INVALID upon failure, or the scheduler profile handle created with this name.

◆ odp_tm_threshold_params_init()

void odp_tm_threshold_params_init ( odp_tm_threshold_params_t params)

Initialize TM threshold parameters.

Initialize an odp_tm_threshold_params_t to its default values for all fields.

Parameters
paramsAddress of the odp_tm_threshold_params_t to be initialized
Examples
odp_traffic_mgmt.c.

◆ odp_tm_threshold_create()

odp_tm_threshold_t odp_tm_threshold_create ( const char *  name,
const odp_tm_threshold_params_t params 
)

odp_tm_threshold_create() creates a queue threshold profile object, which can subsequently be attached to any number (including zero) of tm_queues or tm_nodes.

Parameters
nameOptional 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.
paramsThe profile parameters. See comments associated with the odp_tm_threshold_params_t for more details.
Returns
Returns ODP_TM_INVALID upon failure, or the newly allocated odp_tm_threshold_t value representing this profile object.
Examples
odp_traffic_mgmt.c.

◆ odp_tm_threshold_destroy()

int odp_tm_threshold_destroy ( odp_tm_threshold_t  threshold_profile)

Destroy a queue threshold profile object.

The odp_tm_threshold_destroy() function destroys/frees the given threshold profile object. It is an error if this threshold profile is still being referenced by an active (connected) tm_queue or tm_node.

Parameters
threshold_profileSpecifies the queue thresholds profile object which is being destroyed.
Returns
Returns < 0 upon failure or 0 upon success.

◆ odp_tm_thresholds_params_read()

int odp_tm_thresholds_params_read ( odp_tm_threshold_t  threshold_profile,
odp_tm_threshold_params_t params 
)

odp_tm_thresholds_params_read() "gets" the current set of values associated with the specified queue thresholds profile object, and copies them into the supplied record.

Parameters
threshold_profileSpecifies the queue thresholds profile object whose values are to be read.
[out]paramsA pointer to an odp_tm_threshold_params_t record where the current queue thresholds profile object values are copied to.
Returns
Returns < 0 upon failure or 0 upon success.

◆ odp_tm_thresholds_params_update()

int odp_tm_thresholds_params_update ( odp_tm_threshold_t  threshold_profile,
const odp_tm_threshold_params_t params 
)

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 with this queue thresholds profile object will be updated with the new values.

Parameters
threshold_profileSpecifies the queue thresholds profile object whose values are to be set.
paramsA pointer to an odp_tm_threshold_params_t record where the current queue thresholds profile object values are taken from.
Returns
Returns < 0 upon failure or 0 upon success.

◆ odp_tm_thresholds_lookup()

odp_tm_threshold_t odp_tm_thresholds_lookup ( const char *  name)

odp_tm_thresholds_lookup() can be used to find the queue thresholds profile object created with the specified name.

Parameters
nameName of a previously created queue thresholds profile. Cannot be NULL.
Returns
Returns ODP_TM_INVALID upon failure, or the queue thresholds profile handle created with this name.

◆ odp_tm_wred_params_init()

void odp_tm_wred_params_init ( odp_tm_wred_params_t params)

Initialize TM WRED parameters.

Initialize an odp_tm_wred_params_t to its default values for all fields.

Parameters
paramsAddress of the odp_tm_wred_params_t to be initialized
Examples
odp_traffic_mgmt.c.

◆ odp_tm_wred_create()

odp_tm_wred_t odp_tm_wred_create ( const char *  name,
const odp_tm_wred_params_t params 
)

odp_tm_wred_create() creates a WRED (Weighted Random Early Detection) profile object, which can subsequently be attached to any number (including zero) of tm_queues or tm_nodes.

Parameters
nameOptional name associated with this WRED profile. Can be NULL. If non-NULL must be unique amongst the set of all other WRED profiles. Maximum string length is ODP_TM_NAME_LEN, including the null character.
paramsThe profile parameters. See comments associated with the odp_tm_wred_params_t for more details.
Returns
Returns ODP_TM_INVALID upon failure, or the newly allocated odp_tm_wred_t value representing this profile object.
Examples
odp_traffic_mgmt.c.

◆ odp_tm_wred_destroy()

int odp_tm_wred_destroy ( odp_tm_wred_t  wred_profile)

Destroy WRED profile object.

The odp_tm_wred_destroy() function destroys/frees the given WRED profile object. It is an error if this profile object is still being referenced by an active (connected) tm_node.

Parameters
wred_profileSpecifies the WRED profile object which is being destroyed.
Returns
Returns < 0 upon failure or 0 upon success.

◆ odp_tm_wred_params_read()

int odp_tm_wred_params_read ( odp_tm_wred_t  wred_profile,
odp_tm_wred_params_t params 
)

odp_tm_wred_params_read() "gets" the current set of values associated with the specified WRED profile object, and copies them into the supplied record.

Parameters
wred_profileSpecifies the WRED profile object whose values are to be read.
[out]paramsA pointer to an odp_tm_wred_params_t record where the current WRED profile object values are copied to.
Returns
Returns < 0 upon failure or 0 upon success.

◆ odp_tm_wred_params_update()

int odp_tm_wred_params_update ( odp_tm_wred_t  wred_profile,
const odp_tm_wred_params_t params 
)

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 with this WRED profile object will be updated with the new values.

Parameters
wred_profileSpecifies the WRED profile object whose values are to be set.
paramsA pointer to an odp_tm_wred_params_t record where the new WRED profile object values are taken from.
Returns
Returns < 0 upon failure or 0 upon success.

◆ odp_tm_wred_lookup()

odp_tm_wred_t odp_tm_wred_lookup ( const char *  name)

odp_tm_wred_lookup() can be used to find the WRED profile object created with the specified name.

Parameters
nameName of a previously created WRED profile. Cannot be NULL.
Returns
Returns ODP_TM_INVALID upon failure, or the WRED profile handle created with this name.

◆ odp_tm_node_params_init()

void odp_tm_node_params_init ( odp_tm_node_params_t params)

Initialize TM node parameters.

Initialize an odp_tm_node_params_t to its default values for all fields.

Parameters
paramsAddress of the odp_tm_node_params_t to be initialized
Examples
odp_traffic_mgmt.c.

◆ odp_tm_node_create()

odp_tm_node_t odp_tm_node_create ( odp_tm_t  tm,
const char *  name,
const odp_tm_node_params_t params 
)

Create an tm_node with a specific set of implemented strict priority levels as given by the priorities array parameter.

The set of priority levels does not have to "contiguous", but the "priorities" values for all indexes > max_priority MUST be FALSE. Note that the set of implemented strict priority levels for an tm_node cannot be changed after tm_node creation. The level parameter MUST be in the range 0..max_level - 1.

Parameters
tmHandle of the TM system into which this odp_tm_node object is created.
nameOptional 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. Maximum string length is ODP_TM_NAME_LEN, including the null character.
paramsTM node parameters.
Returns
Returns ODP_TM_INVALID upon failure, otherwise returns a valid odp_tm_node_t handle if successful.
Examples
odp_traffic_mgmt.c.

◆ odp_tm_node_destroy()

int odp_tm_node_destroy ( odp_tm_node_t  tm_node)

Destroy a tm_node object.

The odp_tm_node_destroy frees the resources used by a tm_node_t object. The tm_node to be destroyed MUST not have any parent or child entities.

Parameters
tm_nodeSpecifies the tm_node to be destroyed (freed).
Returns
Returns -1 upon failure, 0 upon success.

◆ odp_tm_node_shaper_config()

int odp_tm_node_shaper_config ( odp_tm_node_t  tm_node,
odp_tm_shaper_t  shaper_profile 
)

The odp_tm_node_shaper_config() function is used to dynamically set or change the shaper profile associated with this tm_node.

Parameters
tm_nodeSpecifies the tm_node to be changed.
shaper_profileSpecifies the shaper profile that should now be used for the shaper entity within the given tm_node. Note that it is legal to specify ODP_TM_INVALID indicating that this tm_node no longer implements a shaper function.
Returns
Returns 0 upon success and < 0 upon failure.

◆ odp_tm_node_sched_config()

int odp_tm_node_sched_config ( odp_tm_node_t  tm_node,
odp_tm_node_t  tm_fan_in_node,
odp_tm_sched_t  sched_profile 
)

The odp_tm_node_sched_config() function is used to dynamically set or change the scheduler profile associated with a tm_node.

Parameters
tm_nodeSpecifies the tm_node to be changed.
tm_fan_in_nodeSpecifies which of the specified tm_node's fan-in's weights etc are to be changed. The fan-in is identified by the "producer"/parent tm_node actually connected to this fan-in.
sched_profileSpecifies the scheduler profile that should now be used for the WFQ/RR entity within the given tm_node.
Returns
Returns 0 upon success and < 0 upon failure.

◆ odp_tm_node_threshold_config()

int odp_tm_node_threshold_config ( odp_tm_node_t  tm_node,
odp_tm_threshold_t  thresholds_profile 
)

The odp_tm_node_threshold_config() function is used to dynamically set or change the queue threshold profile associated with this tm_node.

Parameters
tm_nodeSpecifies the tm_node to be changed.
thresholds_profileSpecifies the queue threshold profile that should now be used for the given tm_node.
Returns
Returns 0 upon success and < 0 upon failure.

◆ odp_tm_node_wred_config()

int odp_tm_node_wred_config ( odp_tm_node_t  tm_node,
odp_packet_color_t  pkt_color,
odp_tm_wred_t  wred_profile 
)

The odp_tm_node_wred_config() function is used to dynamically set or change the WRED profile associated with this tm_node or tm_node/pkt_color combination.

Parameters
tm_nodeSpecifies the tm_node to be changed.
pkt_colorSpecifies the pkt_color that this profile is to be used with. Can also be the special value ALL_PKT_COLORS.
wred_profileSpecifies the WRED profile that should now be used by this tm_queue, when processing pkts of this pkt_color. It can be the value ODP_TM_INVALID indicating that this tm_queue/pkt_color combination no longer implements WRED.
Returns
Returns 0 upon success and < 0 upon failure.

◆ odp_tm_node_lookup()

odp_tm_node_t odp_tm_node_lookup ( odp_tm_t  tm,
const char *  name 
)

odp_tm_node_lookup() can be used to find the tm_node object created with the specified name.

Parameters
tmTM handle
nameName of a previously created tm_node. Cannot be NULL.
Returns
Returns ODP_TM_INVALID upon failure, or the tm_node handle created with this name.

◆ odp_tm_node_context()

void* odp_tm_node_context ( odp_tm_node_t  tm_node)

odp_tm_node_context() can be used to get the user_context value that is associated with the given tm_node.

Parameters
tm_nodeSpecifies the tm_node whose user_context is to be gotten.
Returns
Returns the user_context pointer associated with this tm_node. Returns NULL if the tm_node is not valid OR if the user_context was NULL.

◆ odp_tm_node_context_set()

int odp_tm_node_context_set ( odp_tm_node_t  tm_node,
void *  user_context 
)

odp_tm_node_context_set() can be used to set the user_context value that is associated with the given tm_node.

Parameters
tm_nodeSpecifies the tm_node whose user_context is to be set.
user_contextGeneric pointer associated with the given tm_node. Does not have any effect on the tm_node semantics.
Returns
Returns 0 upon success and -1 if the given tm_node is not valid.

◆ odp_tm_queue_params_init()

void odp_tm_queue_params_init ( odp_tm_queue_params_t params)

Initialize TM queue parameters.

Initialize an odp_tm_queue_params_t to its default values for all fields.

Parameters
paramsAddress of the odp_tm_queue_params_t to be initialized
Examples
odp_traffic_mgmt.c.

◆ odp_tm_queue_create()

odp_tm_queue_t odp_tm_queue_create ( odp_tm_t  tm,
const odp_tm_queue_params_t params 
)

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.

Parameters
tmHandle of the TM system into which this odp_tm_queue object is created.
paramsTM queue parameters.
Returns
Returns ODP_TM_INVALID upon failure, otherwise a valid odp_tm_queue_t handle.
Examples
odp_traffic_mgmt.c.

◆ odp_tm_queue_destroy()

int odp_tm_queue_destroy ( odp_tm_queue_t  tm_queue)

Destroy an tm_queue object.

The odp_tm_queue_destroy frees the resources used by a tm_queue_t object. The tm_queue to be destroyed MUST not be connected in a tm system, and consequently cannot contain any pkts.

Parameters
tm_queueSpecifies the tm_queue to be destroyed (freed).
Returns
Returns -1 upon failure, 0 upon success.
Examples
odp_traffic_mgmt.c.

◆ odp_tm_queue_context()

void* odp_tm_queue_context ( odp_tm_queue_t  tm_queue)

odp_tm_queue_context() can be used to get the user_context value that is associated with the given tm_queue.

Parameters
tm_queueSpecifies the tm_queue whose user_context is to be returned.
Returns
Returns the user_context pointer associated with this tm_queue. Returns NULL if the tm_queue is not valid OR if the user_context was NULL.

◆ odp_tm_queue_context_set()

int odp_tm_queue_context_set ( odp_tm_queue_t  tm_queue,
void *  user_context 
)

odp_tm_queue_context_set() can be used to set the user_context value that is associated with the given tm_queue.

Parameters
tm_queueSpecifies the tm_queue whose user_context is to be set.
user_contextGeneric pointer associated with the given tm_queue. Does not have any effect on the tm_queue semantics.
Returns
Returns 0 upon success and -1 if the given tm_queue is not valid.

◆ odp_tm_queue_shaper_config()

int odp_tm_queue_shaper_config ( odp_tm_queue_t  tm_queue,
odp_tm_shaper_t  shaper_profile 
)

The odp_tm_queue_shaper_config() function is used to dynamically set or change the shaper profile associated with this tm_queue.

Parameters
tm_queueSpecifies the tm_queue to be changed.
shaper_profileSpecifies the shaper profile that should now be used for shaping the tm_queue's packet stream. Note that it is legal to specify ODP_TM_INVALID indicating that this tm_queue no longer implements a shaper function.
Returns
Returns 0 upon success and < 0 upon failure.

◆ odp_tm_queue_sched_config()

int odp_tm_queue_sched_config ( odp_tm_node_t  tm_node,
odp_tm_queue_t  tm_fan_in_queue,
odp_tm_sched_t  sched_profile 
)

The odp_tm_queue_sched_config() function is used to dynamically set or change the scheduler profile associated with a tm_node.

Note that despite the name, this function affects a tm_node scheduler - specifically the scheduler fan-in when such fan-in comes from an tm_queue.

Parameters
tm_nodeSpecifies the tm_node to be changed.
tm_fan_in_queueSpecifies which of the specified tm_node's fan-in's weights etc are to be changed. The fan-in is identified by the "producer"/parent tm_queue actually connected to this fan-in.
sched_profileSpecifies the scheduler profile that should now be used for the WFQ/RR entity within the given tm_node.
Returns
Returns 0 upon success and < 0 upon failure.

◆ odp_tm_queue_threshold_config()

int odp_tm_queue_threshold_config ( odp_tm_queue_t  tm_queue,
odp_tm_threshold_t  thresholds_profile 
)

The odp_tm_queue_threshold_config() function is used to dynamically set or change the queue threshold profile associated with this tm_queue.

Parameters
tm_queueSpecifies the tm_queue to be changed.
thresholds_profileSpecifies the queue threshold profile that should now be used for the given tm_queue.
Returns
Returns 0 upon success and < 0 upon failure.

◆ odp_tm_queue_wred_config()

int odp_tm_queue_wred_config ( odp_tm_queue_t  tm_queue,
odp_packet_color_t  pkt_color,
odp_tm_wred_t  wred_profile 
)

odp_tm_queue_wred_config() function is used to dynamically set or change the WRED profile associated with this tm_queue or tm_queue/pkt_color combination.

Parameters
tm_queueSpecifies the tm_queue to be changed.
pkt_colorSpecifies the pkt_color that this profile is to be used with. Can also be the special value ALL_PKT_COLORS.
wred_profileSpecifies the WRED profile that should now be used by this tm_queue, when processing pkts of this pkt_color. It can be the value ODP_TM_INVALID indicating that this tm_queue/pkt_color combination no longer implements WRED.
Returns
Returns 0 upon success and < 0 upon failure.

◆ odp_tm_node_connect()

int odp_tm_node_connect ( odp_tm_node_t  src_tm_node,
odp_tm_node_t  dst_tm_node 
)

Connects two tm_nodes.

Connects the "output" of the src_tm_node to be a "producer" of the given dst_tm_node. Note that an ODP_TM_ROOT handle passed in for the dst_tm_node implies connection to the egress/root object of this TM system.

Parameters
src_tm_nodeodp_tm_node_t handle of the tm_node whose output is to be connected to the fan-in of the next tm_node as represented by the dst_tm_node.
dst_tm_nodeodp_tm_node_t handle of the tm_node object that will receive all of the pkt_descs from the src tm_node output. If ODP_TM_ROOT, then attachment is to the root egress object/spigot.
Returns
0 upon success, < 0 on failure.
Examples
odp_traffic_mgmt.c.

◆ odp_tm_node_disconnect()

int odp_tm_node_disconnect ( odp_tm_node_t  src_tm_node)

Disconnect a tm_node to tm_node linkage.

The odp_tm_node_disconnect() function is used to disconnect a given tm_node from its fanout. This function requires that no active, enabled tm_queue to be in the fanin tree (directly or indirectly) of this tm_node. Note that it is legal for this tm_node to no fanout connection.

Parameters
src_tm_nodeodp_tm_node_t handle of the tm_node whose output is to be disconnected from the fan-in of the next tm_node.
Returns
0 upon success, < 0 on failure.
Examples
odp_traffic_mgmt.c.

◆ odp_tm_queue_connect()

int odp_tm_queue_connect ( odp_tm_queue_t  tm_queue,
odp_tm_node_t  dst_tm_node 
)

The odp_tm_queue_connect() function connects the indicated tm_queue to a parent tm_node or to the egress/root node.

The tm_queue will then become one of the dst node's fan-in set.

Parameters
tm_queueSpecifies the tm_queue.
dst_tm_nodeodp_tm_node_t handle of the tm_node object that will receive all of the pkt_descs from the src tm_node output. If ODP_TM_ROOT, then attachment is to the root egress object/spigot.
Returns
Returns 0 upon success and < 0 upon failure.
Examples
odp_traffic_mgmt.c.

◆ odp_tm_queue_disconnect()

int odp_tm_queue_disconnect ( odp_tm_queue_t  tm_queue)

Disconnect a tm_queue from a tm_system.

The odp_tm_queue_disconnect() function is used to disconnect a given tm_queue from its fanout. Note that it is legal for this tm_queue to have no fanout connection.

Parameters
tm_queueSpecifies the tm_queue.
Returns
0 upon success, < 0 on failure.
Examples
odp_traffic_mgmt.c.

◆ odp_tm_enq()

int odp_tm_enq ( odp_tm_queue_t  tm_queue,
odp_packet_t  pkt 
)

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.

Parameters
tm_queueSpecifies the tm_queue (and indirectly the TM system).
pktHandle to a packet.
Returns
Returns 0 upon success, < 0 upon failure. One of the more common failure reasons is WRED drop.
Examples
odp_traffic_mgmt.c.

◆ odp_tm_enq_multi()

int odp_tm_enq_multi ( odp_tm_queue_t  tm_queue,
const odp_packet_t  packets[],
int  num 
)

The odp_tm_enq_multi() function is used to add packets to a given TM system.

This function enqueues multiple packets but is otherwise similar to odp_tm_enq(). Packets dropped by WRED or other queue management action do not cause this function to return a failure. Such packets get consumed just like the packets that are not dropped.

When the return value is less than 'num', the remaining packets at the end of the array are not consumed, and the caller maintains ownership of those.

Parameters
tm_queueSpecifies the tm_queue (and indirectly the TM system).
packetsArray of packets to enqueue.
numNumber of packets to enqueue.
Returns
Number of packets consumed (0 ... num)
Return values
<0on failure.

◆ odp_tm_enq_multi_lso()

int odp_tm_enq_multi_lso ( odp_tm_queue_t  tm_queue,
const odp_packet_t  packets[],
int  num,
const odp_packet_lso_opt_t lso_opt 
)

Send packets with segmentation offload to TM system.

Like odp_tm_enq_multi(), but segments packets according LSO configuration. See e.g. odp_pktout_send_lso() for documentation how packets are split into smaller packets during the segmentation offload. Packet segmentation is done first and TM functionality is applied to the resulting packets.

Parameters
tm_queueSpecifies the tm_queue (and indirectly the TM system)
packetsArray of packets to enqueue with segmentation offload
numNumber of packets in the array
lso_optLSO options to be used for all packets. When NULL, LSO options are read from each packet (see odp_packet_lso_request()).
Returns
Number of packets successfully processed and consumed (0 ... num)
Return values
<0on failure

◆ odp_tm_enq_with_cnt()

int odp_tm_enq_with_cnt ( odp_tm_queue_t  tm_queue,
odp_packet_t  pkt 
)

The odp_tm_enq_with_cnt() function behaves identically to odp_tm_enq(), except that it also returns the current tm_queue packet queue count (may be an approximation).

Parameters
tm_queueSpecifies the tm_queue (and indirectly the TM system).
pktHandle to a packet.
Returns
Returns the number of packets previously enqueued on this tm_queue upon success, < 0 upon failure.

◆ odp_tm_node_info()

int odp_tm_node_info ( odp_tm_node_t  tm_node,
odp_tm_node_info_t info 
)

Get tm_node Info.

The odp_tm_node_info() function is used to extract various bits of configuration associated with a given tm_node. The info structure is written only on success.

Parameters
tm_nodeSpecifies the tm_node to be queried.
[out]infoA pointer to an odp_tm_node_info_t record that is to be filled in by this call.
Returns
Returns < 0 upon failure, 0 upon success.

◆ odp_tm_node_fanin_info()

int odp_tm_node_fanin_info ( odp_tm_node_t  tm_node,
odp_tm_node_fanin_info_t info 
)

Get tm_node Fanin Info.

The odp_tm_node_fanin_info() function is used to extract various bits of configuration associated with a given tm_node's fanin. It can also be used to walk the complete fanin list of a given tm_node. Note in particular that the odp_tm_node_fanin_info_t record passed to this function is both an input AND output parameter. The semantics are that the application first clears the tm_queue, tm_node and is_last fields (to TM_ODP_INVALID, TM_ODP_INVALID and false respectively) before making its first call to odp_tm_node_fanin_info(). The fact that tm_queue and tm_node are both TM_ODP_INVALID indicates that the caller wants the FIRST entry in the given tm_node's fanin list. It will then update either the tm_queue or tm_node field in the info record with this first entry. On subsequent calls to this function, exactly one of the tm_queue or tm_node field will be != TM_ODP_INVALID, and this function will then replace the tm_queue and tm_node fields with the NEXT entry in this tm_node's fanin list. If this next entry is also the last entry then is_last will also be set. Note that this function will fail (returning < 0 code) if the incoming is_last field is set. In general walking a fanin list while it is being changed (via _connect() or _disconnect() calls) is problematic - BUT as long as the incoming tm_queue/tm_node values refer to entities that have not been disconnected from their fanin list, a reasonable list walk can occur - even while past or future entries are being removed or while future entries are being added. Note that all new additions to a fanin list always take place at the end of the list. The info structure is written only on success.

Parameters
tm_nodeSpecifies the tm_node to be queried.
[in,out]infoA pointer to an odp_tm_node_fanin_info_t record that is used to determine which fanin entry is to be next filled in by this call.
Returns
Returns < 0 upon failure, 0 upon success.

◆ odp_tm_queue_info()

int odp_tm_queue_info ( odp_tm_queue_t  tm_queue,
odp_tm_queue_info_t info 
)

Get tm_queue Info.

The odp_tm_queue_info() function is used to extract various bits of configuration associated with a given tm_queue. The info structure is written only on success.

Parameters
tm_queueSpecifies the tm_queue to be queried.
[out]infoA pointer to an odp_tm_queue_info_t record that is to be filled in by this call.
Returns
Returns < 0 upon failure, 0 upon success.
Examples
odp_traffic_mgmt.c.

◆ odp_tm_queue_query()

int odp_tm_queue_query ( odp_tm_queue_t  tm_queue,
uint32_t  query_flags,
odp_tm_query_info_t info 
)

The odp_tm_queue_query() function can be used to check a single tm_queue's queue utilization.

The query flags indicate which information is being requested. The implementation may choose to return additional information that was not requested. The info structure is written only on success.

Parameters
tm_queueSpecifies the tm_queue (and indirectly the TM system).
query_flagsA set of flag bits indicating which counters are being requested to be returned in the info record.
[out]infoPointer to an odp_tm_query_info_t record where the requested queue info is returned.
Returns
Returns 0 upon success, < 0 upon failure.

◆ odp_tm_priority_query()

int odp_tm_priority_query ( odp_tm_t  odp_tm,
uint8_t  priority,
uint32_t  query_flags,
odp_tm_query_info_t info 
)

The odp_tm_priority_query() function can be used to check the queue utilization of all tm_queue's with the given priority.

The query flags indicate which information is being requested. The implementation may choose to return additional information that was not requested. The info structure is written only on success.

Parameters
odp_tmSpecifies the TM system.
prioritySupplies the strict priority level used to specify which tm_queues are included in the info values.
query_flagsA set of flag bits indicating which counters are being requested to be returned in the info record.
[out]infoPointer to an odp_tm_query_info_t record where the requested queue info is returned.
Returns
Returns 0 upon success, < 0 upon failure.

◆ odp_tm_total_query()

int odp_tm_total_query ( odp_tm_t  odp_tm,
uint32_t  query_flags,
odp_tm_query_info_t info 
)

The odp_tm_total_query() function can be used to check the queue utilization of all tm_queue's in a single TM system.

The query_flags indicate which information is being requested. The implementation may choose to return additional information that was not requested. The info structure is written only on success.

Parameters
odp_tmSpecifies the TM system.
query_flagsA set of flag bits indicating which counters are being requested to be returned in the info record.
[out]infoPointer to an odp_tm_query_info_t record where the requested queue info is returned.
Returns
Returns 0 upon success, < 0 upon failure.

◆ odp_tm_priority_threshold_config()

int odp_tm_priority_threshold_config ( odp_tm_t  odp_tm,
uint8_t  priority,
odp_tm_threshold_t  thresholds_profile 
)

The odp_tm_priority_threshold_config() function is only used to associate a maximum packet count and/or a maximum byte count with a strict priority level - for the benefit of the odp_tm_priority_query() function.

It has no semantic effects other than returning these queue threshold values in the odp_tm_query_info_t record.

Parameters
odp_tmSpecifies the TM system.
prioritySupplies the strict priority level that the threshold profile params are associated with.
thresholds_profileSpecifies the queue threshold profile that should now be associated with the supplied strict priority level.
Returns
Returns 0 upon success and < 0 upon failure.

◆ odp_tm_total_threshold_config()

int odp_tm_total_threshold_config ( odp_tm_t  tm,
odp_tm_threshold_t  thresholds_profile 
)

The odp_tm_total_threshold_config() function is only used to associate a maximum packet count and/or a maximum byte count with a TM system - for the benefit of the odp_tm_total_query() function.

It has no semantic effects other than returning these queue threshold values in the odp_tm_query_info_t record.

Parameters
tmTM handle
thresholds_profileSpecifies the queue threshold profile that should now be used for the entire TM system.
Returns
Returns 0 upon success and < 0 upon failure.

◆ odp_tm_is_idle()

odp_bool_t odp_tm_is_idle ( odp_tm_t  tm)

The odp_tm_is_idle function is used to determine if the specified ODP traffic management system still has "work" to do (i.e.

has at least one non-empty tm_queue and perhaps some outstanding timers etc). This function can be used by test programs and ODP applications that wish to know when TM system has completed its work - presumably after they have stopped sending in new pkts. Note that this function should not be called often since for some implementations this call could take a fairly long time to execute!

Parameters
tmTM handle
Returns
Returns 1 if the TM system is idle and 0 otherwise.
Examples
odp_traffic_mgmt.c.

◆ odp_tm_stats_print()

void odp_tm_stats_print ( odp_tm_t  tm)

The odp_tm_stats_print function is used to write implementation-defined information about the specified TM system to the ODP log.

The intended use is for debugging.

Parameters
tmTM handle
Examples
odp_traffic_mgmt.c.

◆ odp_tm_queue_stats()

int odp_tm_queue_stats ( odp_tm_queue_t  tm_queue,
odp_tm_queue_stats_t stats 
)

Get statistics for a TM queue.

Counters not supported by the queue are set to zero.

It's implementation defined if odp_pktio_stats_reset() call affects these counters.

Parameters
tm_queueTM queue handle
[out]statsStatistics structure for output
Return values
0on success
<0on failure

◆ odp_tm_to_u64()

uint64_t odp_tm_to_u64 ( odp_tm_t  tm)

Get printable value for an odp_tm_t.

Parameters
tmTM handle
Returns
uint64_t value that can be used to print/display this handle
Note
This routine is intended to be used for diagnostic purposes to enable applications to generate a printable value that represents an odp_tm_t handle.

◆ odp_tm_queue_to_u64()

uint64_t odp_tm_queue_to_u64 ( odp_tm_queue_t  hdl)

Get printable value for an odp_tm_queue_t.

Parameters
hdlodp_tm_queue_t handle to be printed
Returns
uint64_t value that can be used to print/display this handle
Note
This routine is intended to be used for diagnostic purposes to enable applications to generate a printable value that represents an odp_tm_queue_t handle.

◆ odp_tm_node_to_u64()

uint64_t odp_tm_node_to_u64 ( odp_tm_node_t  hdl)

Get printable value for an odp_tm_node_t.

Parameters
hdlodp_tm_node_t handle to be printed
Returns
uint64_t value that can be used to print/display this handle
Note
This routine is intended to be used for diagnostic purposes to enable applications to generate a printable value that represents an odp_tm_node_t handle.

◆ odp_tm_shaper_to_u64()

uint64_t odp_tm_shaper_to_u64 ( odp_tm_shaper_t  hdl)

Get printable value for an odp_tm_shaper_t.

Parameters
hdlodp_tm_shaper_t handle to be printed
Returns
uint64_t value that can be used to print/display this handle
Note
This routine is intended to be used for diagnostic purposes to enable applications to generate a printable value that represents an odp_tm_shaper_t handle.

◆ odp_tm_sched_to_u64()

uint64_t odp_tm_sched_to_u64 ( odp_tm_sched_t  hdl)

Get printable value for an odp_tm_sched_t.

Parameters
hdlodp_tm_sched_t handle to be printed
Returns
uint64_t value that can be used to print/display this handle
Note
This routine is intended to be used for diagnostic purposes to enable applications to generate a printable value that represents an odp_tm_sched_t handle.

◆ odp_tm_threshold_to_u64()

uint64_t odp_tm_threshold_to_u64 ( odp_tm_threshold_t  hdl)

Get printable value for an odp_tm_threshold_t.

Parameters
hdlodp_tm_threshold_t handle to be printed
Returns
uint64_t value that can be used to print/display this handle
Note
This routine is intended to be used for diagnostic purposes to enable applications to generate a printable value that represents an odp_tm_threshold_t handle.

◆ odp_tm_wred_to_u64()

uint64_t odp_tm_wred_to_u64 ( odp_tm_wred_t  hdl)

Get printable value for an odp_tm_wred_t.

Parameters
hdlodp_tm_wred_t handle to be printed
Returns
uint64_t value that can be used to print/display this handle
Note
This routine is intended to be used for diagnostic purposes to enable applications to generate a printable value that represents an odp_tm_wred_t handle.