Re: [lng-odp] [API-NEXT PATCHv5 1/4] api: tm: add tm API definitions

2015-10-22 Thread Savolainen, Petri (Nokia - FI/Espoo)

> -Original Message-
> From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of EXT
> Bill Fischofer
> Sent: Thursday, October 22, 2015 2:48 AM
> To: lng-odp@lists.linaro.org
> Cc: Barry Spinney
> Subject: [lng-odp] [API-NEXT PATCHv5 1/4] api: tm: add tm API definitions
> 
> From: Barry Spinney 
> 
> This introduces an API for configuring and using Traffic Management
> systems.
> 
> The purpose of this API is as a general packet scheduling system that
> accepts packets from input queues and applies strict priority
> scheduling, weighted fair queuing scheduling and/or bandwidth controls
> to decide which input packet should be chosen as the next output
> packet and when this output packet can be sent onwards.
> 
> Signed-off-by: Barry Spinney 
> Signed-off-by: Bill Fischofer 
> ---
>  include/odp.h  |1 +
>  include/odp/api/packet.h   |   49 +
>  include/odp/api/traffic_mngr.h | 1610
> 
>  .../linux-generic/include/odp/plat/packet_types.h  |   11 +
>  .../include/odp/plat/traffic_mngr_types.h  |  185 +++
>  platform/linux-generic/include/odp/traffic_mngr.h  |   35 +
>  .../linux-generic/include/odp_packet_internal.h|5 +
>  7 files changed, 1896 insertions(+)
>  create mode 100644 include/odp/api/traffic_mngr.h
>  create mode 100644 platform/linux-
> generic/include/odp/plat/traffic_mngr_types.h
>  create mode 100644 platform/linux-generic/include/odp/traffic_mngr.h
> 
> diff --git a/include/odp.h b/include/odp.h
> index 825c7e1..f6a6ea9 100644
> --- a/include/odp.h
> +++ b/include/odp.h
> @@ -56,6 +56,7 @@ extern "C" {
>  #include 
>  #include 
>  #include 
> +#include 
> 
>  #ifdef __cplusplus
>  }
> diff --git a/include/odp/api/packet.h b/include/odp/api/packet.h
> index 5d46b7b..e7c52af 100644
> --- a/include/odp/api/packet.h
> +++ b/include/odp/api/packet.h
> @@ -700,6 +700,55 @@ odp_packet_seg_t odp_packet_last_seg(odp_packet_t
> pkt);
>   */
>  odp_packet_seg_t odp_packet_next_seg(odp_packet_t pkt, odp_packet_seg_t
> seg);
> 
> +/**
> + * Get packet color
> + *
> + * @param pkt Packet handle
> + * @return packet color
> + */
> +odp_packet_color_t odp_packet_color(odp_packet_t pkt);


The odp_packet_color_t type documentation should be visible here in the main 
level (packet) API file. Now it's buried inside linux-generic 
platform/linux-generic/include/odp/plat/packet_types.h

/**
 * @typedef odp_packet_color_t
 * Packet "colors"
 *
 */

ODP_PACKET_GREEN   /**< Packet is green */
ODP_PACKET_YELLOW  /**< Packet is yellow */
ODP_PACKET_RED /**< Packet is red */
ODP_PACKET_ALL_COLORS   /**< Packet is all colors */




> +/** The tm_egress_kind_e enumeration type is used to indicate the kind of
> + * egress object ("spigot") associated with this TM system.  Most of these
> + * kinds are optional - with TM_EGRESS_PKT_IO being the only mandatory
> kind.
> + * The TM_EGRESS_FN - if implemented - is useful for testing the TM
> subsystem,
> + * and users are warned that it's performance might be limited.
> + */
> +typedef enum {
> + TM_EGRESS_PKT_IO, TM_EGRESS_FN
> +} odp_tm_egress_kind_t;


Also enum values (TM_EGRESS_PKT_IO, TM_EGRESS_FN) need ODP_ prefix.



-Petri



___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [API-NEXT PATCHv5 1/4] api: tm: add tm API definitions

2015-10-21 Thread Bill Fischofer
From: Barry Spinney 

This introduces an API for configuring and using Traffic Management
systems.

The purpose of this API is as a general packet scheduling system that
accepts packets from input queues and applies strict priority
scheduling, weighted fair queuing scheduling and/or bandwidth controls
to decide which input packet should be chosen as the next output
packet and when this output packet can be sent onwards.

Signed-off-by: Barry Spinney 
Signed-off-by: Bill Fischofer 
---
 include/odp.h  |1 +
 include/odp/api/packet.h   |   49 +
 include/odp/api/traffic_mngr.h | 1610 
 .../linux-generic/include/odp/plat/packet_types.h  |   11 +
 .../include/odp/plat/traffic_mngr_types.h  |  185 +++
 platform/linux-generic/include/odp/traffic_mngr.h  |   35 +
 .../linux-generic/include/odp_packet_internal.h|5 +
 7 files changed, 1896 insertions(+)
 create mode 100644 include/odp/api/traffic_mngr.h
 create mode 100644 platform/linux-generic/include/odp/plat/traffic_mngr_types.h
 create mode 100644 platform/linux-generic/include/odp/traffic_mngr.h

diff --git a/include/odp.h b/include/odp.h
index 825c7e1..f6a6ea9 100644
--- a/include/odp.h
+++ b/include/odp.h
@@ -56,6 +56,7 @@ extern "C" {
 #include 
 #include 
 #include 
+#include 
 
 #ifdef __cplusplus
 }
diff --git a/include/odp/api/packet.h b/include/odp/api/packet.h
index 5d46b7b..e7c52af 100644
--- a/include/odp/api/packet.h
+++ b/include/odp/api/packet.h
@@ -700,6 +700,55 @@ odp_packet_seg_t odp_packet_last_seg(odp_packet_t pkt);
  */
 odp_packet_seg_t odp_packet_next_seg(odp_packet_t pkt, odp_packet_seg_t seg);
 
+/**
+ * Get packet color
+ *
+ * @param pkt Packet handle
+ * @return packet color
+ */
+odp_packet_color_t odp_packet_color(odp_packet_t pkt);
+
+/**
+ * Set packet color
+ *
+ * @param pkt Packet handle
+ * @param color Color to set
+ */
+void odp_packet_color_set(odp_packet_t pkt, odp_packet_color_t color);
+
+/**
+ * Get drop eligible status
+ *
+ * @param pkt Packet handle
+ * @return Packet drop eligibility status
+ * @retval 0 Packet is not drop eligible
+ * @retval 1 Packet is drop
+ */
+odp_bool_t odp_packet_drop_eligible(odp_packet_t pkt);
+
+/**
+ * Set drop eligible status
+ *
+ * @param pkt Packet handle
+ * @param status Drop eligibility status
+ */
+void odp_packet_drop_eligible_set(odp_packet_t pkt, odp_bool_t status);
+
+/**
+ * Get shaper length adjustment
+ *
+ * @param pkt Packet handle
+ * @return Shaper adjustment (-128..127)
+ */
+int8_t odp_packet_shaper_len_adjust(odp_packet_t pkt);
+
+/**
+ * Set shaper length adjustment
+ *
+ * @param pkt Packet handle
+ * @param adj Signed adjustment value
+ */
+void odp_packet_shaper_len_adjust_set(odp_packet_t pkt, int8_t adj);
 
 /*
  *
diff --git a/include/odp/api/traffic_mngr.h b/include/odp/api/traffic_mngr.h
new file mode 100644
index 000..5f9ddf3
--- /dev/null
+++ b/include/odp/api/traffic_mngr.h
@@ -0,0 +1,1610 @@
+/** Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef ODP_TRAFFIC_MNGR_H_
+#define ODP_TRAFFIC_MNGR_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include 
+#include 
+
+/**
+ * @file
+ *
+ */
+
+/** @defgroup odp_traffic_mngr ODP TRAFFIC MNGR
+ * @{
+ *
+ * An API for configuring and using Traffic Management systems
+ *
+ * This file forms a simple interface for creating, configuring and using
+ * Traffic Management (TM) subsystems.  By TM subsystem it is meant a general
+ * packet scheduling system that accepts packets from input queues and applies
+ * strict priority scheduling, weighted fair queueing scheduling and/or
+ * bandwidth controls to decide which input packet should be chosen as the
+ * next output packet and when this output packet can be sent onwards.
+ *
+ * A given platform supporting this TM API could support one or more pure
+ * hardware based packet scheduling systems, one or more pure software
+ * based systems or one or more hybrid systems - where because of
+ * hardware constraints some of the packet scheduling is done in hardware
+ * and some is done in software.  In addition, there may also be additional
+ * API's beyond those described here for (a) controlling advanced capabilities
+ * supported by specific hardware, software or hybrid subsystems or (b)
+ * dealing with constraints and limitations of specific implementations.
+ * The intention here is to be the simplest API that covers the vast majority
+ * of packet scheduling requirements.
+ *
+ * Often a TM subsystem's output(s) will be directly connected
+ * to a device's physical (or virtual) output interfaces/links, in which case
+ * sometimes such a system will be called an Egress Packet Scheduler or an
+ * Output Link Shaper, etc..  While the TM subsystems configured by this API
+ * can be used in such a way, this API equally well supports the ability to
+ * have the TM subsystem's ou