aboutsummaryrefslogtreecommitdiff
path: root/include/odp/api/spec
diff options
context:
space:
mode:
authorNithin Dabilpuram <ndabilpuram@marvell.com>2020-11-04 20:06:49 +0530
committerMatias Elo <matias.elo@nokia.com>2021-07-12 11:17:15 +0300
commit911d34fd4e8bb77d06b28e390c860bff2e1a6d0a (patch)
tree79bb910a9c6da8adb2522044d8e47558d18ed009 /include/odp/api/spec
parent3e43457c27b2b1fd0a1e15ea0698993e5a31b4c1 (diff)
api: tm: add missing capabilities and egress specific capability API
Not all platforms support TM node query, node threshold, queue query, and queue threshold features. Since they are missing from existing global and level capabilities, adding the same to express no support. Also, in some platforms capabilities are specific to a egress kind like a PKTIO. Since capabilities provide a way to application to know things like how many levels can be supported etc, prior to TM creation, add a capability get API to retrieve egress function specific capabilities records. Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com> Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
Diffstat (limited to 'include/odp/api/spec')
-rw-r--r--include/odp/api/spec/traffic_mngr.h106
1 files changed, 77 insertions, 29 deletions
diff --git a/include/odp/api/spec/traffic_mngr.h b/include/odp/api/spec/traffic_mngr.h
index 63344ad64..871481943 100644
--- a/include/odp/api/spec/traffic_mngr.h
+++ b/include/odp/api/spec/traffic_mngr.h
@@ -306,6 +306,10 @@ typedef struct {
* When true the min_weight and max_weight fields above specify
* the legal range of such weights. */
odp_bool_t weights_supported;
+
+ /** tm_node_threshold indicates that the tm_nodes at this
+ * level support threshold profiles. */
+ odp_bool_t tm_node_threshold;
} odp_tm_level_capabilities_t;
/** TM Capabilities Record.
@@ -447,6 +451,23 @@ typedef struct {
/** TM queue statistics counter capabilities */
odp_tm_queue_stats_capability_t queue_stats;
+ /** tm_queue_threshold indicates support for threshold profile on a
+ * TM queue. When TRUE, users can set/clear/update threshold profile
+ * on a TM queue. When false none of it is supported.
+ */
+ odp_bool_t tm_queue_threshold;
+
+ /** tm_queue_query_flags indicates supported types of TM queue query.
+ * Types of TM queue query are same as query_flags that are passed to
+ * odp_tm_queue_query(), odp_tm_priority_query() and
+ * odp_tm_total_query(). When zero, none of the queue query API's are
+ * supported. When non-zero, only the only supported types of passed
+ * query_flags are taken into account and corresponding fields updated.
+ *
+ * @see ODP_TM_QUERY_PKT_CNT, ODP_TM_QUERY_BYTE_CNT,
+ * ODP_TM_QUERY_THRESHOLDS.
+ */
+ uint32_t tm_queue_query_flags;
} odp_tm_capabilities_t;
/** Per Level Requirements
@@ -504,6 +525,10 @@ typedef struct {
* fanins. When true the min_weight and max_weight fields above
* specify the used range of such weights. */
odp_bool_t weights_needed;
+
+ /** tm_node_threshold_needed indicates that the tm_nodes at this
+ * level may use threshold profile support */
+ odp_bool_t tm_node_threshold_needed;
} odp_tm_level_requirements_t;
/** TM Requirements Record.
@@ -533,6 +558,10 @@ typedef struct {
* ignored if tm_queue_wred_needed above is false. */
odp_bool_t tm_queue_dual_slope_needed;
+ /** tm_queue_threshold_needed indicates that the tm_queues are
+ * expected to use threshold profile support */
+ odp_bool_t tm_queue_threshold_needed;
+
/** vlan_marking_needed indicates that the ODP application expects
* to use some form of VLAN egress marking using the
* odp_tm_vlan_marking() function. See also comments for
@@ -618,19 +647,20 @@ void odp_tm_egress_init(odp_tm_egress_t *egress);
/** Query All TM Capabilities
*
- * The odp_tm_capabilities() function can be used to obtain the complete set of
- * TM limits supported by this implementation. The reason that this returns
- * a SET of capabilities and not just one, is because it is expected that
- * many HW based implementations may have one set of limits for the HW and
- * also support a SW TM implementation with a (presumably larger) different
- * set of limits. There are also cases where there could be more than
- * SW implementation (one supporting say tens of thousands of tm_queues and
- * a variant supporting tens of millions of tm_queues).
+ * This function returns the set of TM capabilities that are common for all
+ * egresses. The reason that this returns a SET of capabilities and not just
+ * one, is because it is expected that many HW based implementations may have
+ * one set of limits for the HW and also support a SW TM implementation with a
+ * (presumably larger) different set of limits. There are also cases where
+ * there could be more than one SW implementation (one supporting say tens of
+ * thousands of tm_queues and a variant supporting tens of millions of
+ * tm_queues). It returns capabilities that are valid for all egresses.
* The caller passes in an array of odp_tm_capabilities_t records and the
- * number of such records. Then the first N of these records will be filled
- * in by the implementation and the number N will be returned. In the event
- * that N is larger than the capabilities_size, N will still be returned,
- * but only capabilities_size records will be filled in.
+ * maximum number of such records to output. If number of such records
+ * implementation supports is larger than caller requested number, then
+ * only caller requested number of records are written and return value is
+ * max number of records implementation supports.
+ * Caller then may again call with larger number of records to be returned.
*
* @param[out] capabilities An array of odp_tm_capabilities_t records to
* be filled in.
@@ -645,6 +675,30 @@ void odp_tm_egress_init(odp_tm_egress_t *egress);
int odp_tm_capabilities(odp_tm_capabilities_t capabilities[],
uint32_t capabilities_size);
+/** 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.
+ *
+ * @param[out] capabilities odp_tm_capabilities_t record to be filled in.
+ * @param egress Only capabilities compatible with this egress
+ * are returned.
+ * @retval 0 on success
+ * @retval <0 on failure
+ */
+int odp_tm_egress_capabilities(odp_tm_capabilities_t *capabilities,
+ const odp_tm_egress_t *egress);
+
/** Create/instantiate a TM Packet Scheduling system.
*
* @param name The name to be assigned to this TM system. Cannot
@@ -2044,12 +2098,10 @@ typedef struct {
} odp_tm_query_info_t;
/** The odp_tm_queue_query() function can be used to check a single tm_queue's
- * queue utilization. The query_flags indicate whether or not packet counts,
- * byte counts or both are being requested. It is an error to request
- * neither. The implementation may still return both sets of counts
- * regardless of query_flags if the cost of returning all the counts is
- * comparable to the cost of checking the query_flags. The info structure is
- * written only on success.
+ * 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.
*
* @param tm_queue Specifies the tm_queue (and indirectly the
* TM system).
@@ -2064,12 +2116,10 @@ int odp_tm_queue_query(odp_tm_queue_t tm_queue,
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 whether or not packet counts, byte counts or both are being
- * requested. It is an error to request neither. The implementation may
- * still return both sets of counts regardless of query_flags if the cost of
- * returning all the counts is comparable to the cost of checking the
- * query_flags. The info structure is written only on success.
+ * 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.
*
* @param odp_tm Specifies the TM system.
* @param priority Supplies the strict priority level used to specify
@@ -2087,11 +2137,9 @@ int odp_tm_priority_query(odp_tm_t odp_tm,
/** 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 whether or not packet counts, byte counts or both are being
- * requested. It is an error to request neither. The implementation may
- * still return both sets of counts regardless of query_flags if the cost of
- * returning all the counts is comparable to the cost of checking the
- * query_flags. The info structure is written only on success.
+ * 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.
*
* @param odp_tm Specifies the TM system.
* @param query_flags A set of flag bits indicating which counters are