diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/odp/api/spec/packet_io.h | 3 | ||||
-rw-r--r-- | include/odp/api/spec/stash.h | 20 | ||||
-rw-r--r-- | include/odp/api/spec/traffic_mngr.h | 59 |
3 files changed, 61 insertions, 21 deletions
diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h index 4a8635d0a..3b636c42a 100644 --- a/include/odp/api/spec/packet_io.h +++ b/include/odp/api/spec/packet_io.h @@ -532,6 +532,9 @@ int odp_lso_profile_destroy(odp_lso_profile_t lso_profile); * performance as a number of packet metadata writes/reads are avoided. Results are undefined if * 'lso_opt' is NULL and a packet misses LSO options. * + * Packets with less than (or equal to) 'max_payload_len' payload bytes can be sent also, however + * odp_pktout_send() should be more optimal for those than this function. + * * Check LSO support level from packet IO capabilities (odp_pktio_capability_t). * * @param queue Packet output queue handle diff --git a/include/odp/api/spec/stash.h b/include/odp/api/spec/stash.h index 12214e200..81a6281fa 100644 --- a/include/odp/api/spec/stash.h +++ b/include/odp/api/spec/stash.h @@ -313,14 +313,14 @@ int32_t odp_stash_put(odp_stash_t stash, const void *obj, int32_t num); * integers. The stash must have been created with 'obj_size' of 4. * * @param stash Stash handle - * @param u32 Points to an array of 32-bit integers to be stored. The array + * @param val Points to an array of 32-bit integers to be stored. The array * must be 32-bit aligned in memory. * @param num Number of integers to store * * @return Number of integers actually stored (0 ... num) * @retval <0 on failure */ -int32_t odp_stash_put_u32(odp_stash_t stash, const uint32_t u32[], int32_t num); +int32_t odp_stash_put_u32(odp_stash_t stash, const uint32_t val[], int32_t num); /** * Put 64-bit integers into a stash @@ -329,14 +329,14 @@ int32_t odp_stash_put_u32(odp_stash_t stash, const uint32_t u32[], int32_t num); * integers. The stash must have been created with 'obj_size' of 8. * * @param stash Stash handle - * @param u64 Points to an array of 64-bit integers to be stored. The array + * @param val Points to an array of 64-bit integers to be stored. The array * must be 64-bit aligned in memory. * @param num Number of integers to store * * @return Number of integers actually stored (0 ... num) * @retval <0 on failure */ -int32_t odp_stash_put_u64(odp_stash_t stash, const uint64_t u64[], int32_t num); +int32_t odp_stash_put_u64(odp_stash_t stash, const uint64_t val[], int32_t num); /** * Put pointers into a stash @@ -380,14 +380,14 @@ int32_t odp_stash_get(odp_stash_t stash, void *obj, int32_t num); * integers. The stash must have been created with 'obj_size' of 4. * * @param stash Stash handle - * @param[out] u32 Points to an array of 32-bit integers for output. The + * @param[out] val Points to an array of 32-bit integers for output. The * array must be 32-bit aligned in memory. * @param num Maximum number of integers to get from the stash * - * @return Number of integers actually output (0 ... num) to 'u32' array + * @return Number of integers actually output (0 ... num) to 'val' array * @retval <0 on failure */ -int32_t odp_stash_get_u32(odp_stash_t stash, uint32_t u32[], int32_t num); +int32_t odp_stash_get_u32(odp_stash_t stash, uint32_t val[], int32_t num); /** * Get 64-bit integers from a stash @@ -396,14 +396,14 @@ int32_t odp_stash_get_u32(odp_stash_t stash, uint32_t u32[], int32_t num); * integers. The stash must have been created with 'obj_size' of 8. * * @param stash Stash handle - * @param[out] u64 Points to an array of 64-bit integers for output. The + * @param[out] val Points to an array of 64-bit integers for output. The * array must be 64-bit aligned in memory. * @param num Maximum number of integers to get from the stash * - * @return Number of integers actually output (0 ... num) to 'u64' array + * @return Number of integers actually output (0 ... num) to 'val' array * @retval <0 on failure */ -int32_t odp_stash_get_u64(odp_stash_t stash, uint64_t u64[], int32_t num); +int32_t odp_stash_get_u64(odp_stash_t stash, uint64_t val[], int32_t num); /** * Get pointers from a stash diff --git a/include/odp/api/spec/traffic_mngr.h b/include/odp/api/spec/traffic_mngr.h index e10f6e9e2..f634cfb44 100644 --- a/include/odp/api/spec/traffic_mngr.h +++ b/include/odp/api/spec/traffic_mngr.h @@ -268,7 +268,7 @@ typedef struct { */ uint32_t min_burst_packets; - /** Maximum allowed value fand odp_tm_shaper_params_t::commit_burst and + /** Maximum allowed value for odp_tm_shaper_params_t::commit_burst and * odp_tm_shaper_params_t::peak_burst when * odp_tm_shaper_params_t::packet_mode is true. */ @@ -310,10 +310,12 @@ typedef struct { */ uint64_t max_rate; - /** tm_node_shaper_supported indicates that the tm_nodes at this level - * all support TM shaping, */ + /** Shaper is supported in rate shape mode */ odp_bool_t tm_node_shaper_supported; + /** Shaper is supported in rate limit mode */ + odp_bool_t tm_node_rate_limiter_supported; + /** tm_node_shaper_packet_mode indicates that tm_nodes at this level * support shaper in packet mode */ odp_bool_t tm_node_shaper_packet_mode; @@ -410,16 +412,12 @@ typedef struct { */ odp_bool_t egress_fcn_supported; - /** tm_queue_shaper_supported indicates that the tm_queues support - * proper TM shaping. Note that TM Shaping is NOT the same thing as - * Ingress Metering/Policing as specified by RFC 2697 (A Single Rate - * Three Color Marker) or RFC 2698 (A Two Rate Three Color Marker). - * These RFCs can be used for a Diffserv traffic conditioner, or - * other ingress policing. They make no mention of and have no - * algorithms for delaying packets - which is what TM shapers are - * expected to do. */ + /** Shaper is supported in rate shape mode */ odp_bool_t tm_queue_shaper_supported; + /** Shaper is supported in rate limit mode */ + odp_bool_t tm_queue_rate_limiter_supported; + /** tm_queue_shaper_packet_mode indicates that tm_queues support * shaper in packet mode */ odp_bool_t tm_queue_shaper_packet_mode; @@ -1047,6 +1045,31 @@ int odp_tm_drop_prec_marking(odp_tm_t tm, /* Shaper profile types and functions * -------------------------------------------------------- */ +/** Mode selection between rate shaping and rate limiting */ +typedef enum { + /** Rate shape traffic to the specified burst and rate by delaying + * packets. + * + * The shaper does not drop packets in normal operation, but since + * it delays packets, it can cause queues to fill up and cause queue + * management to drop packets. + */ + ODP_TM_SHAPER_RATE_SHAPE, + + /** Rate limit traffic to the specified burst and rate by dropping + * excess packets. + * + * It is implementation dependent when exactly the limiter state + * update and packet drop happens. For example, they may occur + * immediately when packets are available from the source or when + * the downstream node and scheduler are accepting new packets from + * this node/queue. It is possible that in some cases a delayed + * packet drop causes queues to fill up. + */ + ODP_TM_SHAPER_RATE_LIMIT + +} odp_tm_shaper_mode_t; + /** * TM shaper parameters * @@ -1054,6 +1077,19 @@ int odp_tm_drop_prec_marking(odp_tm_t tm, * values. */ typedef struct { + /** Shaper mode. The default value is ODP_TM_SHAPER_RATE_SHAPE. + * + * A shaper profile must not be used in a TM queue or TM node if + * the queue/node does not support shaper or if it does not support + * the shaper mode set in the profile. + * + * @see odp_tm_capabilities_t::tm_queue_shaper_supported + * @see odp_tm_capabilities_t::tm_queue_rate_limiter_supported + * @see odp_tm_level_capabilities_t::tm_node_shaper_supported + * @see odp_tm_level_capabilities_t::tm_node_rate_limiter_supported + */ + odp_tm_shaper_mode_t mode; + /** The committed information rate for this shaper profile. The units * for this integer is in bits per second when packet_mode is * not TRUE while packets per second when packet mode is TRUE. @@ -1118,6 +1154,7 @@ typedef struct { * * The default value is false. */ odp_bool_t packet_mode; + } odp_tm_shaper_params_t; /** |