API Reference Manual
1.46.0
|
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... | |
#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.
#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.
#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.
#define ODP_TM_MIN_SCHED_WEIGHT 1U |
The smallest SCHED weight is 1 (i.e.
0 is not a legal WFQ/WRR value).
#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.
#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.
#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.
#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.
#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
#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.
#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.
#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.
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.
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.
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.
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.
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.
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.
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.
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.
All the nodes in a TM system can function only on single mode specified at time of odp_tm_create().
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.
enum 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().
Definition at line 367 of file api/spec/traffic_mngr.h.
enum 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.
enum odp_tm_shaper_mode_t |
Mode selection between rate shaping and rate limiting.
Definition at line 1020 of file api/spec/traffic_mngr.h.
enum 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.
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.
requirements | A pointer to an odp_tm_requirements_t record which is to be initialized. |
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.
egress | A pointer to an odp_tm_egress_t record which is to be initialized. |
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.
[out] | capabilities | odp_tm_capabilities_t record to be filled in. |
egress | Only capabilities compatible with this egress are returned. |
0 | on success |
<0 | on failure |
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.
name | The 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. |
requirements | The minimum required feature set and limits needed by the ODP application. |
egress | Describes the single egress "spigot" of this TM system. |
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.
name | If 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. |
requirements | Used 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. |
egress | If a TM system is found, then this specifies the egress "spigot" to be associated with this TM system. |
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.
tm | TM handle | |
[out] | capabilities | A 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. |
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.
tm | TM handle |
0 | on success |
<0 | on failure |
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,
A following call to odp_tm_start() restarts TM system and its scheduling/shaping on existing and new packets.
tm | TM handle |
0 | on success |
<0 | on failure |
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.
tm | The handle of the TM system to be destroyed (and hence freed). |
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.
tm | Handle of the TM system whose egress behavior is being changed. |
color | The packet color whose egress marking is being changed. |
drop_eligible_enabled | If true then will set the DEI bit for egressed VLAN tagged pkts with this color. |
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.
tm | Handle of the TM system whose egress behavior is being changed. |
color | The packet color whose egress marking is being changed. |
ecn_ce_enabled | If 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). |
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.
tm | Handle of the TM system whose egress behavior is being changed. |
color | The packet color whose egress marking is being changed. |
drop_prec_enabled | If 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. |
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.
params | Address of the odp_tm_shaper_params_t to be initialized |
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.
name | Optional name associated with this shaper profile. Can be NULL. If non-NULL must be unique amongst the set of all other shaper profiles. Maximum string length is ODP_TM_NAME_LEN, including the null character. |
params | The profile parameters. See comments associated with the odp_tm_shaper_params_t for more details. |
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.
shaper_profile | Specifies the shaper profile object which is being destroyed. |
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.
shaper_profile | Specifies the shaper profile object whose values are to be read. | |
[out] | params | A pointer to an odp_tm_shaper_params_t record where the current shaper profile object values are copied to. |
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.
shaper_profile | Specifies the shaper profile object whose values are to be set. |
params | A pointer to an odp_tm_shaper_params_t record where the new shaper profile object values are taken from. |
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.
name | Name of a previously created shaper profile. Cannot be NULL. |
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.
params | Address of the odp_tm_sched_params_t to be initialized |
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.
name | Optional name associated with this scheduler profile. Can be NULL. If non-NULL must be unique amongst the set of all other scheduler profiles. Maximum string length is ODP_TM_NAME_LEN, including the null character. |
params | The profile parameters. See comments associated with the odp_tm_sched_params_t for more details. |
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.
sched_profile | Specifies the shaper profile object which is being destroyed. |
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.
sched_profile | Specifies the scheduler profile whose values are to be read. | |
[out] | params | A pointer to an odp_tm_sched_params_t record where the current scheduler profile object values are copied to. |
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.
sched_profile | Specifies the Scheduler profile object whose values are to be set. |
params | A pointer to an odp_tm_sched_params_t record where the new scheduler profile object values are taken from. |
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.
name | Name of a previously created scheduler profile. Cannot be NULL. |
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.
params | Address of the odp_tm_threshold_params_t to be initialized |
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.
name | Optional name associated with this queue threshold profile. Can be NULL. If non-NULL must be unique amongst the set of all other queue threshold profiles. Maximum string length is ODP_TM_NAME_LEN, including the null character. |
params | The profile parameters. See comments associated with the odp_tm_threshold_params_t for more details. |
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.
threshold_profile | Specifies the queue thresholds profile object which is being destroyed. |
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.
threshold_profile | Specifies the queue thresholds profile object whose values are to be read. | |
[out] | params | A pointer to an odp_tm_threshold_params_t record where the current queue thresholds profile object values are copied to. |
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.
threshold_profile | Specifies the queue thresholds profile object whose values are to be set. |
params | A pointer to an odp_tm_threshold_params_t record where the current queue thresholds profile object values are taken from. |
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.
name | Name of a previously created queue thresholds profile. Cannot be NULL. |
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.
params | Address of the odp_tm_wred_params_t to be initialized |
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.
name | Optional name associated with this WRED profile. Can be NULL. If non-NULL must be unique amongst the set of all other WRED profiles. Maximum string length is ODP_TM_NAME_LEN, including the null character. |
params | The profile parameters. See comments associated with the odp_tm_wred_params_t for more details. |
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.
wred_profile | Specifies the WRED profile object which is being destroyed. |
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.
wred_profile | Specifies the WRED profile object whose values are to be read. | |
[out] | params | A pointer to an odp_tm_wred_params_t record where the current WRED profile object values are copied to. |
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.
wred_profile | Specifies the WRED profile object whose values are to be set. |
params | A pointer to an odp_tm_wred_params_t record where the new WRED profile object values are taken from. |
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.
name | Name of a previously created WRED profile. Cannot be NULL. |
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.
params | Address of the odp_tm_node_params_t to be initialized |
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.
tm | Handle of the TM system into which this odp_tm_node object is created. |
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. Maximum string length is ODP_TM_NAME_LEN, including the null character. |
params | TM node parameters. |
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.
tm_node | Specifies the tm_node to be destroyed (freed). |
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.
tm_node | Specifies the tm_node to be changed. |
shaper_profile | Specifies 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. |
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.
tm_node | Specifies the tm_node to be changed. |
tm_fan_in_node | Specifies 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_profile | Specifies the scheduler profile that should now be used for the WFQ/RR entity within the given tm_node. |
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.
tm_node | Specifies the tm_node to be changed. |
thresholds_profile | Specifies the queue threshold profile that should now be used for the given tm_node. |
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.
tm_node | Specifies the tm_node to be changed. |
pkt_color | Specifies the pkt_color that this profile is to be used with. Can also be the special value ALL_PKT_COLORS. |
wred_profile | Specifies 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. |
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.
tm | TM handle |
name | Name of a previously created tm_node. Cannot be NULL. |
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.
tm_node | Specifies the tm_node whose user_context is to be gotten. |
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.
tm_node | Specifies the tm_node whose user_context is to be set. |
user_context | Generic pointer associated with the given tm_node. Does not have any effect on the tm_node semantics. |
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.
params | Address of the odp_tm_queue_params_t to be initialized |
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.
tm | Handle of the TM system into which this odp_tm_queue object is created. |
params | TM queue parameters. |
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.
tm_queue | Specifies the tm_queue to be destroyed (freed). |
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.
tm_queue | Specifies the tm_queue whose user_context is to be returned. |
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.
tm_queue | Specifies the tm_queue whose user_context is to be set. |
user_context | Generic pointer associated with the given tm_queue. Does not have any effect on the tm_queue semantics. |
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.
tm_queue | Specifies the tm_queue to be changed. |
shaper_profile | Specifies 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. |
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.
tm_node | Specifies the tm_node to be changed. |
tm_fan_in_queue | Specifies 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_profile | Specifies the scheduler profile that should now be used for the WFQ/RR entity within the given tm_node. |
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.
tm_queue | Specifies the tm_queue to be changed. |
thresholds_profile | Specifies the queue threshold profile that should now be used for the given tm_queue. |
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.
tm_queue | Specifies the tm_queue to be changed. |
pkt_color | Specifies the pkt_color that this profile is to be used with. Can also be the special value ALL_PKT_COLORS. |
wred_profile | Specifies 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. |
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.
src_tm_node | odp_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_node | odp_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. |
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.
src_tm_node | odp_tm_node_t handle of the tm_node whose output is to be disconnected from the fan-in of the next tm_node. |
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.
tm_queue | Specifies the tm_queue. |
dst_tm_node | odp_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. |
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.
tm_queue | Specifies the tm_queue. |
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.
tm_queue | Specifies the tm_queue (and indirectly the TM system). |
pkt | Handle to a packet. |
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.
tm_queue | Specifies the tm_queue (and indirectly the TM system). |
packets | Array of packets to enqueue. |
num | Number of packets to enqueue. |
<0 | on failure. |
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.
tm_queue | Specifies the tm_queue (and indirectly the TM system) |
packets | Array of packets to enqueue with segmentation offload |
num | Number of packets in the array |
lso_opt | LSO options to be used for all packets. When NULL, LSO options are read from each packet (see odp_packet_lso_request()). |
<0 | on failure |
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).
tm_queue | Specifies the tm_queue (and indirectly the TM system). |
pkt | Handle to a packet. |
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.
tm_node | Specifies the tm_node to be queried. | |
[out] | info | A pointer to an odp_tm_node_info_t record that is to be filled in by this call. |
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.
tm_node | Specifies the tm_node to be queried. | |
[in,out] | info | A 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. |
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.
tm_queue | Specifies the tm_queue to be queried. | |
[out] | info | A pointer to an odp_tm_queue_info_t record that is to be filled in by this call. |
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.
tm_queue | Specifies the tm_queue (and indirectly the TM system). | |
query_flags | A set of flag bits indicating which counters are being requested to be returned in the info record. | |
[out] | info | Pointer to an odp_tm_query_info_t record where the requested queue info is returned. |
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.
odp_tm | Specifies the TM system. | |
priority | Supplies the strict priority level used to specify which tm_queues are included in the info values. | |
query_flags | A set of flag bits indicating which counters are being requested to be returned in the info record. | |
[out] | info | Pointer to an odp_tm_query_info_t record where the requested queue info is returned. |
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.
odp_tm | Specifies the TM system. | |
query_flags | A set of flag bits indicating which counters are being requested to be returned in the info record. | |
[out] | info | Pointer to an odp_tm_query_info_t record where the requested queue info is returned. |
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.
odp_tm | Specifies the TM system. |
priority | Supplies the strict priority level that the threshold profile params are associated with. |
thresholds_profile | Specifies the queue threshold profile that should now be associated with the supplied strict priority level. |
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.
tm | TM handle |
thresholds_profile | Specifies the queue threshold profile that should now be used for the entire TM system. |
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!
tm | TM handle |
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.
tm | TM handle |
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.
tm_queue | TM queue handle | |
[out] | stats | Statistics structure for output |
0 | on success |
<0 | on failure |
uint64_t odp_tm_to_u64 | ( | odp_tm_t | tm | ) |
Get printable value for an odp_tm_t.
tm | TM handle |
uint64_t odp_tm_queue_to_u64 | ( | odp_tm_queue_t | hdl | ) |
Get printable value for an odp_tm_queue_t.
hdl | odp_tm_queue_t handle to be printed |
uint64_t odp_tm_node_to_u64 | ( | odp_tm_node_t | hdl | ) |
Get printable value for an odp_tm_node_t.
hdl | odp_tm_node_t handle to be printed |
uint64_t odp_tm_shaper_to_u64 | ( | odp_tm_shaper_t | hdl | ) |
Get printable value for an odp_tm_shaper_t.
hdl | odp_tm_shaper_t handle to be printed |
uint64_t odp_tm_sched_to_u64 | ( | odp_tm_sched_t | hdl | ) |
Get printable value for an odp_tm_sched_t.
hdl | odp_tm_sched_t handle to be printed |
uint64_t odp_tm_threshold_to_u64 | ( | odp_tm_threshold_t | hdl | ) |
Get printable value for an odp_tm_threshold_t.
hdl | odp_tm_threshold_t handle to be printed |
uint64_t odp_tm_wred_to_u64 | ( | odp_tm_wred_t | hdl | ) |
Get printable value for an odp_tm_wred_t.
hdl | odp_tm_wred_t handle to be printed |