API Reference Manual  1.50.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-2026 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 
612 
621 
623 
630 typedef struct {
634 
639 
644  uint8_t max_priority;
645 
649  uint32_t min_weight;
650 
654  uint32_t max_weight;
655 
659 
664 
669 
674 
680 
685 
693 typedef struct {
696  uint32_t max_tm_queues;
697 
702  uint8_t num_levels;
703 
707 
711 
716 
720 
726 
732 
738 
745  odp_bool_t marking_colors_needed[ODP_NUM_PACKET_COLORS];
746 
752 
757 
762 typedef void (*odp_tm_egress_fcn_t) (odp_packet_t odp_pkt);
763 
770 typedef enum {
771  ODP_TM_EGRESS_PKT_IO,
772  ODP_TM_EGRESS_FN,
774 
778 typedef struct {
782  union {
785  };
787 
797 
807 
830  const odp_tm_egress_t *egress);
831 
846 odp_tm_t odp_tm_create(const char *name,
847  odp_tm_requirements_t *requirements,
848  odp_tm_egress_t *egress);
849 
878 odp_tm_t odp_tm_find(const char *name,
879  odp_tm_requirements_t *requirements,
880  odp_tm_egress_t *egress);
881 
908 
921 
950 
970 
971 /* Marking APIs
972  * -------------------------------------------------------- */
973 
997  odp_packet_color_t color,
998  odp_bool_t drop_eligible_enabled);
999 
1030  odp_packet_color_t color,
1031  odp_bool_t ecn_ce_enabled);
1032 
1070  odp_packet_color_t color,
1071  odp_bool_t drop_prec_enabled);
1072 
1073 /* Shaper profile types and functions
1074  * -------------------------------------------------------- */
1075 
1077 typedef enum {
1086 
1098 
1100 
1107 typedef struct {
1120 
1125  uint64_t commit_rate;
1126 
1132  uint64_t peak_rate;
1133 
1138  uint32_t commit_burst;
1139 
1146  uint32_t peak_burst;
1147 
1161 
1170 
1177 
1179 
1188 
1204  const odp_tm_shaper_params_t *params);
1205 
1217 
1230  odp_tm_shaper_params_t *params);
1231 
1245  const odp_tm_shaper_params_t *params);
1246 
1256 
1257 /* Scheduler Profiles - types and functions
1258  * -------------------------------------------------------- */
1259 
1267 typedef enum {
1272 
1279 typedef struct {
1284 
1292  uint32_t sched_weights[ODP_TM_MAX_PRIORITIES];
1294 
1303 
1318  const odp_tm_sched_params_t *params);
1319 
1331 
1344  odp_tm_sched_params_t *params);
1345 
1359  const odp_tm_sched_params_t *params);
1360 
1370 
1371 /* Queue Threshold Profiles - types and functions
1372  * -------------------------------------------------------- */
1373 
1380 typedef struct {
1381  uint64_t max_pkts;
1382  uint64_t max_bytes;
1386 
1390 
1399 
1417  *params);
1418 
1430 
1443  odp_tm_threshold_params_t *params);
1444 
1459  const odp_tm_threshold_params_t *params);
1460 
1470 
1471 /* WRED Profiles - types and functions
1472  * -------------------------------------------------------- */
1473 
1480 typedef struct {
1497 
1506 
1511 
1517 
1522 
1531 
1540 
1556  const odp_tm_wred_params_t *params);
1557 
1569 
1582  odp_tm_wred_params_t *params);
1583 
1597  const odp_tm_wred_params_t *params);
1598 
1608 
1615 typedef struct {
1620 
1624  uint32_t max_fanin;
1625 
1630 
1636 
1642 
1648  uint8_t level;
1649 
1664  uint8_t priority;
1666 
1675 
1695  const odp_tm_node_params_t *params);
1696 
1706 
1719  odp_tm_shaper_t shaper_profile);
1720 
1735  odp_tm_node_t tm_fan_in_node,
1736  odp_tm_sched_t sched_profile);
1737 
1747  odp_tm_threshold_t thresholds_profile);
1748 
1765  odp_packet_color_t pkt_color,
1766  odp_tm_wred_t wred_profile);
1767 
1778 
1788 
1798 int odp_tm_node_context_set(odp_tm_node_t tm_node, void *user_context);
1799 
1806 typedef struct {
1811 
1816 
1826 
1832 
1837  uint8_t priority;
1838 
1845 
1854 
1869  const odp_tm_queue_params_t *params);
1870 
1879 
1890 
1900 int odp_tm_queue_context_set(odp_tm_queue_t tm_queue, void *user_context);
1901 
1914  odp_tm_shaper_t shaper_profile);
1915 
1932  odp_tm_queue_t tm_fan_in_queue,
1933  odp_tm_sched_t sched_profile);
1934 
1944  odp_tm_threshold_t thresholds_profile);
1945 
1962  odp_packet_color_t pkt_color,
1963  odp_tm_wred_t wred_profile);
1964 
1965 /* Topology setting functions
1966  * -------------------------------------------------------- */
1967 
1983 int odp_tm_node_connect(odp_tm_node_t src_tm_node, odp_tm_node_t dst_tm_node);
1984 
1998 
2011 
2022 
2023 /* Input API
2024  * -------------------------------------------------------- */
2025 
2047 
2064 int odp_tm_enq_multi(odp_tm_queue_t tm_queue, const odp_packet_t packets[], int num);
2065 
2082 int odp_tm_enq_multi_lso(odp_tm_queue_t tm_queue, const odp_packet_t packets[], int num,
2083  const odp_packet_lso_opt_t *lso_opt);
2084 
2095 
2096 /* Dynamic state query functions
2097  * -------------------------------------------------------- */
2098 
2102 typedef struct {
2106 
2110 
2115 
2117  uint32_t tm_queue_fanin;
2118 
2120  uint32_t tm_node_fanin;
2121 
2127 
2130  uint8_t level;
2132 
2145 
2152 typedef struct {
2156 
2161 
2166 
2171 
2206  odp_tm_node_fanin_info_t *info);
2207 
2224 
2228 typedef struct {
2233 
2238 
2244 
2250 
2255 
2268 
2272 #define ODP_TM_QUERY_PKT_CNT 0x01
2273 #define ODP_TM_QUERY_BYTE_CNT 0x02
2274 #define ODP_TM_QUERY_THRESHOLDS 0x04
2280 typedef struct {
2288  uint64_t total_pkt_cnt;
2289 
2296  uint64_t max_pkt_cnt;
2297 
2317  uint64_t total_byte_cnt;
2318 
2325  uint64_t max_byte_cnt;
2326 
2338 
2354  uint32_t query_flags,
2355  odp_tm_query_info_t *info);
2356 
2373  uint8_t priority,
2374  uint32_t query_flags,
2375  odp_tm_query_info_t *info);
2376 
2391  uint32_t query_flags,
2392  odp_tm_query_info_t *info);
2393 
2410  uint8_t priority,
2411  odp_tm_threshold_t thresholds_profile);
2412 
2427  odp_tm_threshold_t thresholds_profile);
2428 
2443 
2451 
2467 
2481 
2494 
2507 
2520 
2533 
2546 
2559 
2564 #ifdef __cplusplus
2565 }
2566 #endif
2567 
2568 #include <odp/visibility_end.h>
2569 #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
Color of packet for shaper/drop processing.
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.
Set of packet types that involve packet references.
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.
odp_packet_ref_types_t packet_ref
Supported packet reference types.
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.
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.
struct odp_tm_node_stats_capability_t::@196::@198 counter
Statistics counters in a bit field struct.
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.
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.
struct odp_tm_queue_stats_capability_t::@193::@195 counter
Statistics counters in a bit field structure.
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 ...