API Reference Manual  1.47.0
api/spec/traffic_mngr.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2015-2018 Linaro Limited
3  * Copyright (c) 2021-2022 Nokia
4  * Copyright (c) 2022-2025 Marvell
5  */
6 
7 #ifndef ODP_API_SPEC_TRAFFIC_MNGR_H_
8 #define ODP_API_SPEC_TRAFFIC_MNGR_H_
9 #include <odp/visibility_begin.h>
10 
12 #include <odp/api/std_types.h>
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
183 typedef struct odp_tm_queue_stats_t {
186  uint64_t octets;
187 
189  uint64_t packets;
190 
193  uint64_t discards;
194 
197  uint64_t discard_octets;
198 
200  uint64_t errors;
201 
203 
209  union {
211  struct {
213  uint64_t octets : 1;
214 
216  uint64_t packets : 1;
217 
219  uint64_t discards : 1;
220 
222  uint64_t discard_octets : 1;
223 
225  uint64_t errors : 1;
226 
228 
233  uint64_t all_counters;
234  };
236 
238 typedef struct odp_tm_node_stats_t {
240  uint64_t discards;
241 
243  uint64_t discard_octets;
244 
246  uint64_t packets;
247 
249  uint64_t octets;
251 
257  union {
259  struct {
261  uint64_t discards : 1;
262 
264  uint64_t discard_octets : 1;
265 
267  uint64_t packets : 1;
268 
270  uint64_t octets : 1;
271 
273 
278  uint64_t all_counters;
279  };
281 
287 typedef struct {
291 
296 
301  uint8_t max_priority;
302 
306  uint32_t min_weight;
307 
311  uint32_t max_weight;
312 
318 
324 
330 
336 
341  uint32_t min_burst;
342 
347  uint32_t max_burst;
348 
353  uint64_t min_rate;
354 
359  uint64_t max_rate;
360 
363 
366 
370 
374 
379 
385 
391 
393  struct {
395  uint8_t byte : 1;
396 
398  uint8_t packet : 1;
399 
401  uint8_t byte_and_packet : 1;
402 
403  } tm_node_threshold;
404 
408 
414 typedef enum odp_tm_pkt_prio_mode {
422 
431 
435 
440 typedef struct {
444  char *name;
445 
448  uint32_t max_tm_queues;
449 
457  uint8_t max_levels;
458 
464 
467 
470 
474 
478 
483 
490 
498 
509 
516  odp_bool_t marking_colors_supported[ODP_NUM_PACKET_COLORS];
517 
521 
531 
540 
549 
558 
567 
570 
572  struct {
574  uint8_t byte : 1;
575 
577  uint8_t packet : 1;
578 
580  uint8_t byte_and_packet : 1;
581 
582  } tm_queue_threshold;
583 
595 
602 
613 
620 typedef struct {
624 
629 
634  uint8_t max_priority;
635 
639  uint32_t min_weight;
640 
644  uint32_t max_weight;
645 
649 
654 
659 
664 
670 
675 
683 typedef struct {
686  uint32_t max_tm_queues;
687 
692  uint8_t num_levels;
693 
697 
701 
706 
710 
716 
722 
728 
735  odp_bool_t marking_colors_needed[ODP_NUM_PACKET_COLORS];
736 
742 
747 
752 typedef void (*odp_tm_egress_fcn_t) (odp_packet_t odp_pkt);
753 
760 typedef enum {
761  ODP_TM_EGRESS_PKT_IO,
762  ODP_TM_EGRESS_FN,
764 
768 typedef struct {
772  union {
775  };
777 
787 
797 
820  const odp_tm_egress_t *egress);
821 
836 odp_tm_t odp_tm_create(const char *name,
837  odp_tm_requirements_t *requirements,
838  odp_tm_egress_t *egress);
839 
868 odp_tm_t odp_tm_find(const char *name,
869  odp_tm_requirements_t *requirements,
870  odp_tm_egress_t *egress);
871 
898 
911 
940 
960 
961 /* Marking APIs
962  * -------------------------------------------------------- */
963 
987  odp_packet_color_t color,
988  odp_bool_t drop_eligible_enabled);
989 
1020  odp_packet_color_t color,
1021  odp_bool_t ecn_ce_enabled);
1022 
1060  odp_packet_color_t color,
1061  odp_bool_t drop_prec_enabled);
1062 
1063 /* Shaper profile types and functions
1064  * -------------------------------------------------------- */
1065 
1067 typedef enum {
1076 
1088 
1090 
1097 typedef struct {
1110 
1115  uint64_t commit_rate;
1116 
1122  uint64_t peak_rate;
1123 
1128  uint32_t commit_burst;
1129 
1136  uint32_t peak_burst;
1137 
1151 
1160 
1167 
1169 
1178 
1194  const odp_tm_shaper_params_t *params);
1195 
1207 
1220  odp_tm_shaper_params_t *params);
1221 
1235  const odp_tm_shaper_params_t *params);
1236 
1246 
1247 /* Scheduler Profiles - types and functions
1248  * -------------------------------------------------------- */
1249 
1257 typedef enum {
1262 
1269 typedef struct {
1274 
1282  uint32_t sched_weights[ODP_TM_MAX_PRIORITIES];
1284 
1293 
1308  const odp_tm_sched_params_t *params);
1309 
1321 
1334  odp_tm_sched_params_t *params);
1335 
1349  const odp_tm_sched_params_t *params);
1350 
1360 
1361 /* Queue Threshold Profiles - types and functions
1362  * -------------------------------------------------------- */
1363 
1370 typedef struct {
1371  uint64_t max_pkts;
1372  uint64_t max_bytes;
1376 
1380 
1389 
1407  *params);
1408 
1420 
1433  odp_tm_threshold_params_t *params);
1434 
1449  const odp_tm_threshold_params_t *params);
1450 
1460 
1461 /* WRED Profiles - types and functions
1462  * -------------------------------------------------------- */
1463 
1470 typedef struct {
1487 
1496 
1501 
1507 
1512 
1521 
1530 
1546  const odp_tm_wred_params_t *params);
1547 
1559 
1572  odp_tm_wred_params_t *params);
1573 
1587  const odp_tm_wred_params_t *params);
1588 
1598 
1605 typedef struct {
1610 
1614  uint32_t max_fanin;
1615 
1620 
1626 
1632 
1638  uint8_t level;
1639 
1654  uint8_t priority;
1656 
1665 
1685  const odp_tm_node_params_t *params);
1686 
1696 
1709  odp_tm_shaper_t shaper_profile);
1710 
1725  odp_tm_node_t tm_fan_in_node,
1726  odp_tm_sched_t sched_profile);
1727 
1737  odp_tm_threshold_t thresholds_profile);
1738 
1755  odp_packet_color_t pkt_color,
1756  odp_tm_wred_t wred_profile);
1757 
1768 
1778 
1788 int odp_tm_node_context_set(odp_tm_node_t tm_node, void *user_context);
1789 
1796 typedef struct {
1801 
1806 
1816 
1822 
1827  uint8_t priority;
1828 
1835 
1844 
1859  const odp_tm_queue_params_t *params);
1860 
1869 
1880 
1890 int odp_tm_queue_context_set(odp_tm_queue_t tm_queue, void *user_context);
1891 
1904  odp_tm_shaper_t shaper_profile);
1905 
1922  odp_tm_queue_t tm_fan_in_queue,
1923  odp_tm_sched_t sched_profile);
1924 
1934  odp_tm_threshold_t thresholds_profile);
1935 
1952  odp_packet_color_t pkt_color,
1953  odp_tm_wred_t wred_profile);
1954 
1955 /* Topology setting functions
1956  * -------------------------------------------------------- */
1957 
1973 int odp_tm_node_connect(odp_tm_node_t src_tm_node, odp_tm_node_t dst_tm_node);
1974 
1988 
2001 
2012 
2013 /* Input API
2014  * -------------------------------------------------------- */
2015 
2033 
2050 int odp_tm_enq_multi(odp_tm_queue_t tm_queue, const odp_packet_t packets[], int num);
2051 
2068 int odp_tm_enq_multi_lso(odp_tm_queue_t tm_queue, const odp_packet_t packets[], int num,
2069  const odp_packet_lso_opt_t *lso_opt);
2070 
2081 
2082 /* Dynamic state query functions
2083  * -------------------------------------------------------- */
2084 
2088 typedef struct {
2092 
2096 
2101 
2103  uint32_t tm_queue_fanin;
2104 
2106  uint32_t tm_node_fanin;
2107 
2113 
2116  uint8_t level;
2118 
2131 
2138 typedef struct {
2142 
2147 
2152 
2157 
2192  odp_tm_node_fanin_info_t *info);
2193 
2210 
2214 typedef struct {
2219 
2224 
2230 
2236 
2241 
2254 
2258 #define ODP_TM_QUERY_PKT_CNT 0x01
2259 #define ODP_TM_QUERY_BYTE_CNT 0x02
2260 #define ODP_TM_QUERY_THRESHOLDS 0x04
2266 typedef struct {
2274  uint64_t total_pkt_cnt;
2275 
2282  uint64_t max_pkt_cnt;
2283 
2303  uint64_t total_byte_cnt;
2304 
2311  uint64_t max_byte_cnt;
2312 
2324 
2340  uint32_t query_flags,
2341  odp_tm_query_info_t *info);
2342 
2359  uint8_t priority,
2360  uint32_t query_flags,
2361  odp_tm_query_info_t *info);
2362 
2377  uint32_t query_flags,
2378  odp_tm_query_info_t *info);
2379 
2396  uint8_t priority,
2397  odp_tm_threshold_t thresholds_profile);
2398 
2413  odp_tm_threshold_t thresholds_profile);
2414 
2429 
2437 
2453 
2467 
2480 
2493 
2506 
2519 
2532 
2545 
2550 #ifdef __cplusplus
2551 }
2552 #endif
2553 
2554 #include <odp/visibility_end.h>
2555 #endif
ODP Packet IO.
Standard C language types and definitions for ODP.
#define ODP_NUM_PACKET_COLORS
Maximum number of packet colors which accommodates ODP_PACKET_GREEN, ODP_PACKET_YELLOW and ODP_PACKET...
odp_packet_color_t
Packet Color.
bool odp_bool_t
Boolean type.
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.
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 t...
int odp_tm_destroy(odp_tm_t tm)
Destroy a TM system.
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...
int odp_tm_drop_prec_marking(odp_tm_t tm, odp_packet_color_t color, odp_bool_t drop_prec_enabled)
Drop Precedence Marking.
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 give...
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 prioritie...
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.
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.
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...
uint64_t odp_tm_shaper_to_u64(odp_tm_shaper_t hdl)
Get printable value for an odp_tm_shaper_t.
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 n...
int odp_tm_ecn_marking(odp_tm_t tm, odp_packet_color_t color, odp_bool_t ecn_ce_enabled)
Explicit Congestion Notification Marking.
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 ...
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 attache...
void odp_tm_sched_params_init(odp_tm_sched_params_t *params)
Initialize TM scheduler parameters.
int odp_tm_shaper_destroy(odp_tm_shaper_t shaper_profile)
Destroy shaper profile object.
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,...
odp_tm_handle_t odp_tm_t
Each odp_tm_t value represents a specific TM system.
struct odp_tm_node_stats_t odp_tm_node_stats_t
TM node specific statistics counters.
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.
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 wit...
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 a...
void odp_tm_egress_init(odp_tm_egress_t *egress)
Initialize Egress record.
struct odp_tm_queue_stats_t odp_tm_queue_stats_t
TM queue specific statistics counters.
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 pro...
void odp_tm_node_params_init(odp_tm_node_params_t *params)
Initialize TM node parameters.
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...
int odp_tm_wred_destroy(odp_tm_wred_t wred_profile)
Destroy WRED profile object.
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...
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 s...
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.
int odp_tm_node_disconnect(odp_tm_node_t src_tm_node)
Disconnect a tm_node to tm_node linkage.
struct odp_tm_node_stats_capability_t odp_tm_node_stats_capability_t
TM node statistics capabilities.
uint64_t odp_tm_sched_to_u64(odp_tm_sched_t hdl)
Get printable value for an odp_tm_sched_t.
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_...
void odp_tm_queue_params_init(odp_tm_queue_params_t *params)
Initialize TM queue parameters.
int odp_tm_enq(odp_tm_queue_t tm_queue, odp_packet_t pkt)
Send packet to TM system.
uint64_t odp_tm_node_to_u64(odp_tm_node_t hdl)
Get printable value for an odp_tm_node_t.
int odp_tm_egress_capabilities(odp_tm_capabilities_t *capabilities, const odp_tm_egress_t *egress)
Query TM Capabilities specific to an egress.
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...
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 associat...
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 egr...
odp_tm_queue_t odp_tm_queue_create(odp_tm_t tm, const odp_tm_queue_params_t *params)
TM queue create.
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 as...
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...
uint64_t odp_tm_wred_to_u64(odp_tm_wred_t hdl)
Get printable value for an odp_tm_wred_t.
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 ...
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 p...
int odp_tm_node_info(odp_tm_node_t tm_node, odp_tm_node_info_t *info)
Get tm_node Info.
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...
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 queu...
void odp_tm_shaper_params_init(odp_tm_shaper_params_t *params)
Initialize TM shaper parameters.
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...
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 u...
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 num...
int odp_tm_start(odp_tm_t tm)
Start a TM system.
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 a...
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 s...
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.
int odp_tm_node_connect(odp_tm_node_t src_tm_node, odp_tm_node_t dst_tm_node)
Connects two tm_nodes.
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 ...
odp_tm_shaper_mode_t
Mode selection between rate shaping and rate limiting.
odp_tm_pkt_prio_mode
The tm_pkt_prio_mode_t enumeration type is used to indicate different modes a tm system supports with...
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 p...
struct odp_tm_queue_stats_capability_t odp_tm_queue_stats_capability_t
TM queue level statistics capabilities.
uint64_t odp_tm_to_u64(odp_tm_t tm)
Get printable value for an odp_tm_t.
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.
int odp_tm_queue_stats(odp_tm_queue_t tm_queue, odp_tm_queue_stats_t *stats)
Get statistics for a 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 ...
int odp_tm_vlan_marking(odp_tm_t tm, odp_packet_color_t color, odp_bool_t drop_eligible_enabled)
Vlan Marking.
int odp_tm_node_fanin_info(odp_tm_node_t tm_node, odp_tm_node_fanin_info_t *info)
Get tm_node Fanin Info.
odp_tm_egress_kind_t
The tm_egress_kind_e enumeration type is used to indicate the kind of egress object ("spigot") associ...
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.
#define ODP_TM_MAX_PRIORITIES
The ODP_TM_MAX_PRIORITIES constant specifies the largest range of priorities that any TM system can s...
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 nam...
uint16_t odp_tm_percent_t
The odp_tm_percent_t type is used when specifying fields that are percentages.
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...
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...
void odp_tm_threshold_params_init(odp_tm_threshold_params_t *params)
Initialize TM threshold parameters.
int odp_tm_queue_destroy(odp_tm_queue_t tm_queue)
Destroy an tm_queue object.
int odp_tm_threshold_destroy(odp_tm_threshold_t threshold_profile)
Destroy a queue threshold profile object.
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 ass...
int odp_tm_capability(odp_tm_t tm, odp_tm_capabilities_t *capabilities)
Query Specific TM Capabilities.
int odp_tm_queue_disconnect(odp_tm_queue_t tm_queue)
Disconnect a tm_queue from a tm_system.
void odp_tm_stats_print(odp_tm_t tm)
The odp_tm_stats_print function is used to write implementation-defined information about the specifi...
#define ODP_TM_MAX_LEVELS
The ODP_TM MAX_LEVELS constant specifies the largest range of tm_node levels that any TM system can s...
int odp_tm_sched_destroy(odp_tm_sched_t sched_profile)
Destroy scheduler profile object.
uint64_t odp_tm_threshold_to_u64(odp_tm_threshold_t hdl)
Get printable value for an odp_tm_threshold_t.
void odp_tm_wred_params_init(odp_tm_wred_params_t *params)
Initialize TM WRED parameters.
int odp_tm_queue_info(odp_tm_queue_t tm_queue, odp_tm_queue_info_t *info)
Get tm_queue Info.
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 asso...
int odp_tm_stop(odp_tm_t tm)
Stop a TM system.
int odp_tm_node_destroy(odp_tm_node_t tm_node)
Destroy a tm_node object.
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.
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 ...
uint64_t odp_tm_queue_to_u64(odp_tm_queue_t hdl)
Get printable value for an odp_tm_queue_t.
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/...
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 profi...
int odp_tm_node_stats(odp_tm_node_t tm_node, odp_tm_node_stats_t *stats)
Get statistics for a TM node.
void odp_tm_requirements_init(odp_tm_requirements_t *requirements)
Initialize Requirements record fields to their default values.
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 acro...
@ ODP_TM_BYTE_BASED_WEIGHTS
Use the packet length in scheduler algorithm.
@ ODP_TM_FRAME_BASED_WEIGHTS
Ignore the packet length.
@ ODP_TM_SHAPER_RATE_SHAPE
Rate shape traffic to the specified burst and rate by delaying packets.
@ ODP_TM_SHAPER_RATE_LIMIT
Rate limit traffic to the specified burst and rate by dropping excess packets.
@ ODP_TM_PKT_PRIO_MODE_OVERWRITE
Indicates Packet priority overwrite mode.
@ ODP_TM_PKT_PRIO_MODE_MAX
Max enum of Packet priority mode.
@ ODP_TM_PKT_PRIO_MODE_PRESERVE
Indicates Packet priority preserve mode.
TM Capabilities Record.
odp_bool_t dynamic_sched_update
dynamic_sched_update indicates support for TM system's dynamic sched profile changes.
odp_bool_t drop_prec_marking_supported
drop_prec_marking_supported indicates that this TM system supports SOME form of IPv4/IPv6 egress mark...
odp_bool_t tm_queue_shaper_packet_mode
tm_queue_shaper_packet_mode indicates that tm_queues support shaper in packet mode
odp_bool_t tm_queue_wred_supported
tm_queue_wred_supported indicates that the tm_queues support some form of Random Early Detection.
odp_bool_t dynamic_wred_update
dynamic_wred_update indicates support for TM system's dynamic wred profile changes.
odp_bool_t tm_queue_rate_limiter_supported
Shaper is supported in rate limit mode.
uint8_t packet
Threshold given as packets.
char * name
The name is an optional name associated with a capabilities record.
odp_bool_t tm_queue_shaper_supported
Shaper is supported in rate shape mode.
odp_bool_t vlan_marking_supported
vlan_marking_supported indicates that this TM system supports SOME form of VLAN egress marking using ...
odp_bool_t egress_fcn_supported
egress_fcn_supported indicates whether the tm system supports egress function.
odp_bool_t tm_queue_dual_slope_supported
tm_queue_dual_slope_supported indicates that the tm_queues support the dual slope WRED capability.
odp_bool_t dynamic_topology_update
dynamic_topology_update indicates support for TM system dynamic topology update.
uint8_t byte_and_packet
Threshold given as bytes and packets simultaneously.
odp_bool_t dynamic_threshold_update
dynamic_threshold_update indicates support for TM system's dynamic threshold profile changes.
uint8_t byte
Threshold given as bytes.
odp_bool_t ecn_marking_supported
ecn_marking_supported indicates that this TM system supports Explicit Congestion Notification egress ...
odp_tm_queue_stats_capability_t queue_stats
TM queue statistics counter capabilities.
uint32_t tm_queue_query_flags
tm_queue_query_flags indicates supported types of TM queue query.
uint8_t max_levels
max_levels specifies that maximum number of levels of hierarchical scheduling allowed by this TM Syst...
uint8_t max_schedulers_per_node
Maximum number of schedulers supported by a TM node at any level.
uint32_t max_tm_queues
max_tm_queues specifies the maximum number of tm_queues that can be in existence for this TM System.
odp_bool_t dynamic_shaper_update
dynamic_shaper_update indicates support for TM system's dynamic shaper profile changes.
The odp_tm_egress_t type is used to describe that type of "egress spigot" associated with this TM sys...
odp_pktio_t pktio
Output to PktIO.
odp_tm_egress_kind_t egress_kind
Union discriminator.
odp_tm_egress_fcn_t egress_fcn
Output to user func.
odp_bool_t tm_node_rate_limiter_supported
Shaper is supported in rate limit mode.
odp_bool_t fair_queuing_supported
fair_queuing_supported indicates that the tm_node schedulers at this level can implement WFQ or FQ sc...
uint32_t max_weight
max_weight only has significance when the weights_supported field below is true, in which case it spe...
uint64_t max_rate
Maximum allowed value for odp_tm_shaper_params_t::commit_rate and odp_tm_shaper_params_t::peak_rate w...
uint64_t min_rate
Minimum allowed value for odp_tm_shaper_params_t::commit_rate and odp_tm_shaper_params_t::peak_rate w...
uint32_t min_weight
min_weight only has significance when the weights_supported field below is true, in which case it spe...
uint64_t max_rate_packets
Maximum allowed value for odp_tm_shaper_params_t::commit_rate and odp_tm_shaper_params_t::peak_rate w...
uint8_t max_priority
max_priority specifies the maximum number of strict priority levels used by any tm_node at this level...
uint8_t byte
Threshold given as bytes.
uint8_t byte_and_packet
Threshold given as bytes and packets simultaneously.
odp_bool_t tm_node_wred_supported
tm_node_wred_supported indicates that the tm_nodes at this level support some form of Random Early De...
odp_bool_t tm_node_shaper_supported
Shaper is supported in rate shape mode.
uint64_t min_rate_packets
Minimum allowed value for odp_tm_shaper_params_t::commit_rate and odp_tm_shaper_params_t::peak_rate w...
uint32_t max_burst
Maximum allowed value for odp_tm_shaper_params_t::commit_burst and odp_tm_shaper_params_t::peak_burst...
odp_bool_t tm_node_dual_slope_supported
tm_node_dual_slope_supported indicates that the tm_nodes at this level support the dual slope WRED ca...
uint32_t min_burst
Minimum allowed value for odp_tm_shaper_params_t::commit_burst and odp_tm_shaper_params_t::peak_burst...
uint32_t max_burst_packets
Maximum allowed value for odp_tm_shaper_params_t::commit_burst and odp_tm_shaper_params_t::peak_burst...
odp_bool_t tm_node_shaper_packet_mode
tm_node_shaper_packet_mode indicates that tm_nodes at this level support shaper in packet mode
odp_bool_t weights_supported
weights_supported indicates that the tm_node schedulers at this level can have their different weight...
uint32_t max_num_tm_nodes
max_num_tm_nodes specifies the maximum number of tm_nodes allowed at this level.
uint32_t max_fanin_per_node
max_fanin_per_level specifies the maximum number of fan_in links to any given scheduler (whether weig...
uint32_t min_burst_packets
Minimum allowed value for odp_tm_shaper_params_t::commit_burst and odp_tm_shaper_params_t::peak_burst...
odp_tm_node_stats_capability_t node_stats
Node statistics counter capabilities.
uint8_t packet
Threshold given as packets.
odp_bool_t tm_node_dual_slope_needed
tm_node_dual_slope_needed indicates that the tm_nodes at this level are expected to use the dual slop...
odp_bool_t tm_node_wred_needed
tm_node_wred_needed indicates that the tm_nodes at this level are expected to participate in some for...
uint32_t max_num_tm_nodes
max_num_tm_nodes specifies the maximum number of tm_nodes required at this level.
uint32_t max_weight
max_weight only has significance when the weights_supported field below is true, in which case it spe...
odp_bool_t weights_needed
weights_needed indicates that the tm_node schedulers at this level are expected have different weight...
uint32_t max_fanin_per_node
max_fanin_per_level specifies the maximum number of fan_in links to any given scheduler (whether weig...
odp_bool_t tm_node_shaper_needed
tm_node_shaper_needed indicates that the tm_nodes at this level are expected to do TM shaping,
uint8_t max_priority
max_priority specifies the maximum number of strict priority levels that will be used by any tm_node ...
uint32_t min_weight
min_weight only has significance when the weights_supported field below is true, in which case it spe...
odp_bool_t fair_queuing_needed
fair_queuing_needed indicates that the tm_node schedulers at this level are expected to implement WFQ...
odp_bool_t tm_node_threshold_needed
tm_node_threshold_needed indicates that the tm_nodes at this level may use threshold profile support
The odp_tm_node_fanin_info_t record type is used to return various bits of information about a given ...
odp_tm_sched_t sched_profile
The sched profile currently associated with this fanin link.
odp_bool_t is_last
The is_last flag is set when the tm_queue/tm_node above is currently the last element in the fanin li...
odp_tm_node_t tm_node
The tm_node indicates the "producer" of this fanin.
odp_tm_queue_t tm_queue
The tm_queue indicates the "producer" of this fanin.
The odp_tm_node_info_t record type is used to return various bits of information about a given tm_nod...
odp_tm_shaper_t shaper_profile
The shaper profile currently associated with this tm_node.
odp_tm_node_t next_tm_node
The next_tm_node is the "next" node in the tree - i.e.
odp_tm_threshold_t threshold_profile
The threshold profile currently associated with this tm_node.
uint32_t tm_node_fanin
Current tm_node fanin.
uint8_t level
The level of this tm_node.
uint32_t tm_queue_fanin
Current tm_queue fanin.
odp_tm_shaper_t shaper_profile
The shaper profile to be associated with this tm_node.
uint32_t max_fanin
The max_fanin sets the maximum number of src tm_queues and producer tm_nodes that can be simultaneous...
uint8_t priority
New strict priority level assigned to packets going through this node when packet priority mode is OD...
odp_tm_threshold_t threshold_profile
The threshold profile to be used in setting the max queue fullness for WRED and/or tail drop.
uint8_t level
The level (or tm_node stage) sets the level for this tm_node It must be in range 0....
void * user_context
The user_context field is an generic pointer that the user can associate with a tm_node and then get ...
TM node statistics capabilities.
uint64_t all_counters
All bits of the bit field structure.
uint64_t packets
See odp_tm_node_stats_t::packets.
struct odp_tm_node_stats_capability_t::@181::@183 counter
Statistics counters in a bit field struct.
uint64_t discard_octets
See odp_tm_node_stats_t::discard_octets.
uint64_t discards
See odp_tm_node_stats_t::discards.
uint64_t octets
See odp_tm_node_stats_t::octets.
TM node specific statistics counters.
uint64_t octets
Number of octets in successfully processed packets.
uint64_t packets
Number of successfully processed packets.
uint64_t discards
Number of discarded packets.
uint64_t discard_octets
Number of octets in discarded packets.
The odp_tm_query_info_t record type is used to return the various counts as requested by functions li...
odp_bool_t max_byte_cnt_valid
TRUE if max_byte_cnt is valid.
odp_bool_t approx_byte_cnt
The approx_byte_cnt is TRUE if the total_byte_cnt field is valid AND if the buffer counting method is...
uint64_t total_pkt_cnt
The total_pkt_cnt field is the total number of packets currently stored/associated with the requested...
uint64_t max_pkt_cnt
If the requested set of tm_queues has an odp_tm_threshold_t profile associated with it,...
odp_bool_t total_byte_cnt_valid
TRUE if total_byte_cnt is valid.
uint64_t total_byte_cnt
The total_byte_cnt can either be the actual number of bytes used or an approximation of the number of...
odp_bool_t max_pkt_cnt_valid
TRUE if max_pkt_cnt is valid.
odp_bool_t total_pkt_cnt_valid
The following boolean values indicate which of the counts above are valid.
uint64_t max_byte_cnt
If the requested set of tm_queues has an odp_tm_threshold_t profile associated with it,...
The odp_tm_queue_info_t record type is used to return various bits of information about a given tm_qu...
odp_tm_threshold_t threshold_profile
The threshold profile currently associated with this tm_queue.
odp_tm_node_t next_tm_node
The next_tm_node is the "next" node in the tree - i.e.
odp_tm_shaper_t shaper_profile
The shaper profile currently associated with this tm_queue.
odp_packet_t active_pkt
The active_pkt is the current packet "at the head of the queue" that is being processed by this tm_qu...
odp_bool_t ordered_enqueue
Maintain original packet order of the source queue when enqueuing packets to this queue while holding...
odp_tm_threshold_t threshold_profile
The threshold profile to be used in setting the max queue fullness for WRED and/or tail drop.
void * user_context
The user_context field is an generic pointer that the user can associate with a tm_queue and then get...
uint8_t priority
The strict priority level assigned to packets in this tm_queue - in other words all packets associate...
odp_tm_shaper_t shaper_profile
The shaper profile to be associated with this tm_queue.
TM queue level statistics capabilities.
uint64_t errors
See odp_tm_queue_stats_t::errors.
struct odp_tm_queue_stats_capability_t::@178::@180 counter
Statistics counters in a bit field structure.
uint64_t octets
See odp_tm_queue_stats_t::octets.
uint64_t discard_octets
See odp_tm_queue_stats_t::discard_octets.
uint64_t all_counters
All bits of the bit field structure.
uint64_t packets
See odp_tm_queue_stats_t::packets.
uint64_t discards
See odp_tm_queue_stats_t::discards.
TM queue specific statistics counters.
uint64_t discards
Number of packets discarded due to other reasons (e.g.
uint64_t octets
Number of octets in successfully transmitted packets.
uint64_t packets
Number of successfully transmitted packets.
uint64_t errors
Number of packets with transmission errors.
uint64_t discard_octets
Number of octets in packets discarded due to other reasons (e.g.
TM Requirements Record.
odp_bool_t tm_queue_threshold_needed
tm_queue_threshold_needed indicates that the tm_queues are expected to use threshold profile support
uint32_t max_tm_queues
max_tm_queues specifies the maximum number of tm_queues that will be used for this TM System.
odp_bool_t tm_queue_wred_needed
tm_queue_wred_needed indicates that the tm_queues are expected to participate in some form of Random ...
odp_tm_pkt_prio_mode_t pkt_prio_mode
Packet priority mode.
uint8_t num_levels
num_levels specifies that number of levels of hierarchical scheduling that will be used.
odp_bool_t drop_prec_marking_needed
drop_prec_marking_needed indicates that the ODP application expects to use some form of IPv4 TOS or I...
odp_bool_t vlan_marking_needed
vlan_marking_needed indicates that the ODP application expects to use some form of VLAN egress markin...
odp_bool_t tm_queue_dual_slope_needed
tm_queue_dual_slope_needed indicates that the tm_queues are expected to use the dual slope WRED capab...
odp_bool_t ecn_marking_needed
ecn_marking_needed indicates that the ODP application expects to use some form of IPv4 TOS or IPv6 TC...
odp_bool_t tm_queue_shaper_needed
tm_queue_shaper_needed indicates that the tm_queues are expected to do TM shaping.
TM scheduler parameters.
odp_bool_t packet_mode
If packet_mode is TRUE it indicates that shaper should work in packet mode ignoring lengths of packet...
uint32_t commit_burst
The commit burst tolerance for this shaper profile.
odp_bool_t dual_rate
If dual_rate is TRUE it indicates the desire for the implementation to use dual rate shaping for pack...
int8_t shaper_len_adjust
The shaper_len_adjust is a value between -128 and 127 which is directly added to the frame_len of a p...
uint64_t commit_rate
The committed information rate for this shaper profile.
uint32_t peak_burst
The peak burst tolerance for this shaper profile.
uint64_t peak_rate
The peak information rate for this shaper profile.
odp_tm_shaper_mode_t mode
Shaper mode.
TM threshold parameters.
uint64_t max_bytes
max byte cnt for this threshold profile
odp_bool_t enable_max_bytes
TRUE if max_bytes is valid.
odp_bool_t enable_max_pkts
TRUE if max_pkts is valid.
uint64_t max_pkts
max pkt cnt for this threshold profile
odp_tm_percent_t med_drop_prob
The med_drop_prob is only used when dual-slope WRED is being used, in which case med_drop_prob MUST b...
odp_bool_t use_byte_fullness
When use_byte_fullness is true then WRED will use queue memory usage as the fullness criterion,...
odp_tm_percent_t med_threshold
The meaning of med_threshold depends upon whether single-slope or dual-slope WRED is being used or no...
odp_bool_t enable_wred
When enable_wred is false, all tm_queues and tm_nodes that are attached to this profile will not take...
odp_tm_percent_t max_drop_prob
The max_drop_prob equals the drop probability when the queue fullness almost equals 100%.
odp_tm_percent_t min_threshold
When min_threshold is set to zero then single-slope WRED is enabled, as described in the description ...