Skip to contentSkip to conversation

Enable dyynamic configuration of subport bandwidth profile

RFC PATCH In review Savinay Dharmappa 4 participants 107 messages Jul 15, 2020 – Oct 15, 2020 Network drivers Page 2 of 2

lore
Share & tools
lore
#81 lore raw

PATCH v8 7/8 app/test_sched: update subport rate dynamically

In reply to Savinay Dharmappa

Modify the test_sched application to build the hierarchical scheduler with default subport bandwidth profile. It also allows to update a subport with different subport rates dynamically

---
 app/test/test_sched.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
app/test/test_sched.c +11 -2
index 5e5c2a59b..958b63114 100644
@@ -21,6 +21,7 @@
 #define PIPE            1
 #define TC              2
 #define QUEUE           0
+#define MAX_SCHED_SUBPORT_PROFILES  8
 
 static struct rte_sched_pipe_params pipe_profile[] = {
 	{ /* Profile #0 */
@@ -36,15 +37,20 @@ static struct rte_sched_pipe_params pipe_profile[] = {
 	},
 };
 
-static struct rte_sched_subport_params subport_param[] = {
+static struct rte_sched_subport_profile_params
+		subport_profile[] = {
 	{
 		.tb_rate = 1250000000,
 		.tb_size = 1000000,
-
 		.tc_rate = {1250000000, 1250000000, 1250000000, 1250000000,
 			1250000000, 1250000000, 1250000000, 1250000000, 1250000000,
 			1250000000, 1250000000, 1250000000, 1250000000},
 		.tc_period = 10,
+	},
+};
+
+static struct rte_sched_subport_params subport_param[] = {
+	{
 		.n_pipes_per_subport_enabled = 1024,
 		.qsize = {32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32},
 		.pipe_profiles = pipe_profile,
@@ -59,6 +65,9 @@ static struct rte_sched_port_params port_param = {
 	.mtu = 1522,
 	.frame_overhead = RTE_SCHED_FRAME_OVERHEAD_DEFAULT,
 	.n_subports_per_port = 1,
+	.n_subport_profiles = 1,
+	.subport_profiles = subport_profile,
+	.n_max_subport_profiles = MAX_SCHED_SUBPORT_PROFILES,
 	.n_pipes_per_subport = 1024,
 };
 
Signature · 1 line
2.17.1
#82 lore raw

PATCH v8 8/8 sched: remove redundant code

In reply to Savinay Dharmappa

Remove redundant data structure fields references from functions and subport level data structures. It also update the release and deprecation note

---
 doc/guides/rel_notes/deprecation.rst   |  6 ----
 doc/guides/rel_notes/release_20_11.rst |  1 +
 lib/librte_sched/rte_sched.c           | 42 ++------------------------
 lib/librte_sched/rte_sched.h           | 12 --------
 4 files changed, 3 insertions(+), 58 deletions(-)
doc/guides/rel_notes/deprecation.rst +0 -6
index 584e72087..f7363a585 100644
@@ -212,12 +212,6 @@ Deprecation Notices
   in "rte_sched.h". These changes are aligned to improvements suggested in the
   RFC https://mails.dpdk.org/archives/dev/2018-November/120035.html.
 
-* sched: To allow dynamic configuration of the subport bandwidth profile,
-  changes will be made to data structures ``rte_sched_subport_params``,
-  ``rte_sched_port_params`` and new data structure, API functions will be
-  defined in ``rte_sched.h``. These changes are aligned as suggested in the
-  RFC https://mails.dpdk.org/archives/dev/2020-July/175161.html
-
 * metrics: The function ``rte_metrics_init`` will have a non-void return
   in order to notify errors instead of calling ``rte_exit``.
 
doc/guides/rel_notes/release_20_11.rst +1 -0
index cdf20404c..45cda64b0 100644
@@ -116,6 +116,7 @@ New Features
   * Extern objects and functions can be plugged into the pipeline.
   * Transaction-oriented table updates.
 
+* sched: Add support to update subport bandwidth dynamically.
 
 Removed Items
 -------------
lib/librte_sched/rte_sched.c +2 -40

65 lines not on this page · raw message

lib/librte_sched/rte_sched.h +0 -12
index 1506c6487..c1a772b70 100644
@@ -149,18 +149,6 @@ struct rte_sched_pipe_params {
  * byte.
  */
 struct rte_sched_subport_params {
-	/** Token bucket rate (measured in bytes per second) */
-	uint64_t tb_rate;
-
-	/** Token bucket size (measured in credits) */
-	uint64_t tb_size;
-
-	/** Traffic class rates (measured in bytes per second) */
-	uint64_t tc_rate[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];
-
-	/** Enforcement period for rates (measured in milliseconds) */
-	uint64_t tc_period;
-
 	/** Number of subport pipes.
 	 * The subport can enable/allocate fewer pipes than the maximum
 	 * number set through struct port_params::n_max_pipes_per_subport,
Signature · 1 line
2.17.1
#83 lore raw

Re: [dpdk-dev] [PATCH v8 8/8] sched: remove redundant code

Hi,

Quoted 11 lines

Remove redundant data structure fields references from functions and subport level data structures. It also update the release and deprecation note

---

 doc/guides/rel_notes/deprecation.rst   |  6 ----
 doc/guides/rel_notes/release_20_11.rst |  1 +
 lib/librte_sched/rte_sched.c           | 42 ++------------------------
 lib/librte_sched/rte_sched.h           | 12 --------

I wonder why this patch exists.

Documentation updates should be done when adding the feature (patch 3). Please try to conform to the release notes format and recommendations.

Redundant code should be removed when it becomes useless. Or should it be last because the fields are used in apps? Anyway it is strange that a test for params->qsize is added.

About the API changes, please update the ABI section of the release notes in each patch removing some old API.

#84 lore raw

v9 cover Enable dynamic config of subport bandwidth

In reply to Savinay Dharmappa

DPDK sched library allows runtime configuration of the pipe profiles to the pipes of the subport once scheduler hierarchy is constructed. However, to change the subport level bandwidth, existing hierarchy needs to be dismantled and whole process of building hierarchy under subport nodes needs to be repeated which might result in router downtime. Furthermore, due to lack of dynamic configuration of the subport bandwidth profile configuration (shaper and Traffic class rates), the user application is unable to dynamically re-distribute the excess-bandwidth of one subport among other subports in the scheduler hierarchy. Therefore, it is also not possible to adjust the subport bandwidth profile in sync with dynamic changes in pipe profiles of subscribers who want to consume higher bandwidth opportunistically.

This patch series implements dynamic configuration of the subport bandwidth profile to overcome the runtime situation when group of subscribers are not using the allotted bandwidth and dynamic bandwidth re-distribution is needed the without making any structural changes in the hierarchy.

The implementation work includes refactoring the existing api and data structures defined for port and subport level, new APIs for adding subport level bandwidth profiles that can be used in runtime.

---
v8 -> v9
- updated ABI section in release notes.
- Addressed review comments from patch 8

     of v8.

v7 -> v8
- Fix doxygen and clang build error.

v6 -> v7
- Fix checkpatch warning
and patch apply issue.

v5 -> v6
- Fix build warning.
- change cli of tmgr :
* remove queue size and pipes per subport
from cmdline argument to add traffic
manager subport profile.

* add pipes per subport as cmdline argument to create traffic manger port.

v4 -> v5
- Review comments from patch 3 & 6
from v4 are addressed.

v3 -> v4
- Fix patch apply issue.

v2 -> v3
- Review comments from patch 3 & 5
from v2 are addressed.

v1 -> v2
- Fix checkpatch warnings.
---

Savinay Dharmappa (8):
sched: add support profile table
sched: introduce subport profile add function
sched: update subport rate dynamically example/qos_sched: update subport rate dynamically example/ip_pipeline: update subport rate dynamically drivers/softnic: update subport rate dynamically app/test_sched: update subport rate dynamically
sched: remove redundant code

 app/test/test_sched.c                         |  15 +-
 doc/guides/rel_notes/deprecation.rst          |   6 -
 doc/guides/rel_notes/release_20_11.rst        |  15 +
 .../net/softnic/rte_eth_softnic_internals.h   |  11 +-
 drivers/net/softnic/rte_eth_softnic_tm.c      | 243 +++++--
 examples/ip_pipeline/cli.c                    |  68 +-
 examples/ip_pipeline/tmgr.c                   | 121 +++-
 examples/ip_pipeline/tmgr.h                   |   5 +-
 examples/qos_sched/cfg_file.c                 | 151 ++--
 examples/qos_sched/cfg_file.h                 |   4 +
 examples/qos_sched/init.c                     |  21 +-
 examples/qos_sched/main.h                     |   1 +
 examples/qos_sched/profile.cfg                |   3 +
 lib/librte_sched/rte_sched.c                  | 678 ++++++++++++------
 lib/librte_sched/rte_sched.h                  |  73 +-
 lib/librte_sched/rte_sched_version.map        |   2 +
 16 files changed, 972 insertions(+), 445 deletions(-)
Signature · 1 line
2.17.1
#85 lore raw

PATCH v9 1/8 sched: add support profile table

Add subport profile table to internal port data structure and update the port config function.

---
 doc/guides/rel_notes/release_20_11.rst |   3 +
 lib/librte_sched/rte_sched.c           | 197 ++++++++++++++++++++++++-
 lib/librte_sched/rte_sched.h           |  25 ++++
 3 files changed, 222 insertions(+), 3 deletions(-)
doc/guides/rel_notes/release_20_11.rst +3 -0
index 808bdc4e5..6968c27f6 100644
@@ -283,6 +283,9 @@ ABI Changes
 
   * ``ethdev`` internal functions are marked with ``__rte_internal`` tag.
 
+* ``sched`` changes
+
+  * Added new fields to ``struct rte_sched_subport_port_params``.
 
 Known Issues
 ------------
lib/librte_sched/rte_sched.c +194 -3

286 lines not on this page · raw message

lib/librte_sched/rte_sched.h +25 -0
index 8a5a93c98..39339b7f1 100644
@@ -192,6 +192,20 @@ struct rte_sched_subport_params {
 #endif
 };
 
+struct rte_sched_subport_profile_params {
+	/** Token bucket rate (measured in bytes per second) */
+	uint64_t tb_rate;
+
+	/** Token bucket size (measured in credits) */
+	uint64_t tb_size;
+
+	/** Traffic class rates (measured in bytes per second) */
+	uint64_t tc_rate[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];
+
+	/** Enforcement period for rates (measured in milliseconds) */
+	uint64_t tc_period;
+};
+
 /** Subport statistics */
 struct rte_sched_subport_stats {
 	/** Number of packets successfully written */
@@ -254,6 +268,17 @@ struct rte_sched_port_params {
 	/** Number of subports */
 	uint32_t n_subports_per_port;
 
+	/** subport profile table.
+	 * Every pipe is configured using one of the profiles from this table.
+	 */
+	struct rte_sched_subport_profile_params *subport_profiles;
+
+	/** Profiles in the pipe profile table */
+	uint32_t n_subport_profiles;
+
+	/** Max allowed profiles in the pipe profile table */
+	uint32_t n_max_subport_profiles;
+
 	/** Maximum number of subport pipes.
 	 * This parameter is used to reserve a fixed number of bits
 	 * in struct rte_mbuf::sched.queue_id for the pipe_id for all
Signature · 1 line
2.17.1
#86 lore raw

PATCH v9 2/8 sched: introduce subport profile add function

In reply to Savinay Dharmappa

API to add new subport bandwidth profile.

---
 lib/librte_sched/rte_sched.c           | 66 ++++++++++++++++++++++++++
 lib/librte_sched/rte_sched.h           | 23 +++++++++
 lib/librte_sched/rte_sched_version.map |  2 +
 3 files changed, 91 insertions(+)
lib/librte_sched/rte_sched.c +66 -0
index a44638f31..895b40d72 100644
@@ -1528,6 +1528,72 @@ rte_sched_subport_pipe_profile_add(struct rte_sched_port *port,
 	return 0;
 }
 
+int
+rte_sched_port_subport_profile_add(struct rte_sched_port *port,
+	struct rte_sched_subport_profile_params *params,
+	uint32_t *subport_profile_id)
+{
+	int status;
+	uint32_t i;
+	struct rte_sched_subport_profile *dst;
+
+	/* Port */
+	if (port == NULL) {
+		RTE_LOG(ERR, SCHED, "%s: "
+		"Incorrect value for parameter port\n", __func__);
+		return -EINVAL;
+	}
+
+	if (params == NULL) {
+		RTE_LOG(ERR, SCHED, "%s: "
+		"Incorrect value for parameter profile\n", __func__);
+		return -EINVAL;
+	}
+
+	if (subport_profile_id == NULL) {
+		RTE_LOG(ERR, SCHED, "%s: "
+		"Incorrect value for parameter subport_profile_id\n",
+		__func__);
+		return -EINVAL;
+	}
+
+	dst = port->subport_profiles + port->n_subport_profiles;
+
+	/* Subport profiles exceeds the max limit */
+	if (port->n_subport_profiles >= port->n_max_subport_profiles) {
+		RTE_LOG(ERR, SCHED, "%s: "
+		"Number of subport profiles exceeds the max limit\n",
+		 __func__);
+		return -EINVAL;
+	}
+
+	status = subport_profile_check(params, port->rate);
+	if (status != 0) {
+		RTE_LOG(ERR, SCHED,
+		"%s: subport profile check failed(%d)\n", __func__, status);
+		return -EINVAL;
+	}
+
+	rte_sched_subport_profile_convert(params, dst, port->rate);
+
+	/* Subport profile should not exists */
+	for (i = 0; i < port->n_subport_profiles; i++)
+		if (memcmp(port->subport_profiles + i,
+		    dst, sizeof(*dst)) == 0) {
+			RTE_LOG(ERR, SCHED,
+			"%s: subport profile exists\n", __func__);
+			return -EINVAL;
+		}
+
+	/* Subport profile commit */
+	*subport_profile_id = port->n_subport_profiles;
+	port->n_subport_profiles++;
+
+	rte_sched_port_log_subport_profile(port, *subport_profile_id);
+
+	return 0;
+}
+
 static inline uint32_t
 rte_sched_port_qindex(struct rte_sched_port *port,
 	uint32_t subport,
lib/librte_sched/rte_sched.h +23 -0
index 39339b7f1..aede2e986 100644
@@ -336,6 +336,29 @@ rte_sched_subport_pipe_profile_add(struct rte_sched_port *port,
 	struct rte_sched_pipe_params *params,
 	uint32_t *pipe_profile_id);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Hierarchical scheduler subport bandwidth profile add
+ * Note that this function is safe to use in runtime for adding new
+ * subport bandwidth profile as it doesn't have any impact on hiearchical
+ * structure of the scheduler.
+ * @param port
+ *   Handle to port scheduler instance
+ * @param profile
+ *   Subport bandwidth profile
+ * @param subport_profile_id
+ *   Subport profile id
+ * @return
+ *   0 upon success, error code otherwise
+ */
+__rte_experimental
+int
+rte_sched_port_subport_profile_add(struct rte_sched_port *port,
+	struct rte_sched_subport_profile_params *profile,
+	uint32_t *subport_profile_id);
+
 /**
  * Hierarchical scheduler subport configuration
  *
lib/librte_sched/rte_sched_version.map +2 -0
index 3faef6f0a..ace284b7d 100644
@@ -28,4 +28,6 @@ EXPERIMENTAL {
 	global:
 
 	rte_sched_subport_pipe_profile_add;
+	# added in 20.11
+	rte_sched_port_subport_profile_add;
 };
Signature · 1 line
2.17.1
#87 lore raw

PATCH v9 3/8 sched: update subport rate dynamically

In reply to Savinay Dharmappa

Add support to update subport rate dynamically.

---
 app/test/test_sched.c                    |   2 +-
 doc/guides/rel_notes/deprecation.rst     |   6 -
 doc/guides/rel_notes/release_20_11.rst   |   9 +
 drivers/net/softnic/rte_eth_softnic_tm.c |   6 +-
 examples/ip_pipeline/tmgr.c              |   6 +-
 examples/qos_sched/init.c                |   3 +-
 lib/librte_sched/rte_sched.c             | 415 ++++++++++-------------
 lib/librte_sched/rte_sched.h             |  13 +-
 8 files changed, 213 insertions(+), 247 deletions(-)
app/test/test_sched.c +1 -1
index fc31080ef..5e5c2a59b 100644
@@ -138,7 +138,7 @@ test_sched(void)
 	port = rte_sched_port_config(&port_param);
 	TEST_ASSERT_NOT_NULL(port, "Error config sched port\n");
 
-	err = rte_sched_subport_config(port, SUBPORT, subport_param);
+	err = rte_sched_subport_config(port, SUBPORT, subport_param, 0);
 	TEST_ASSERT_SUCCESS(err, "Error config sched, err=%d\n", err);
 
 	for (pipe = 0; pipe < subport_param[0].n_pipes_per_subport_enabled; pipe++) {
doc/guides/rel_notes/deprecation.rst +0 -6
index 584e72087..f7363a585 100644
@@ -212,12 +212,6 @@ Deprecation Notices
   in "rte_sched.h". These changes are aligned to improvements suggested in the
   RFC https://mails.dpdk.org/archives/dev/2018-November/120035.html.
 
-* sched: To allow dynamic configuration of the subport bandwidth profile,
-  changes will be made to data structures ``rte_sched_subport_params``,
-  ``rte_sched_port_params`` and new data structure, API functions will be
-  defined in ``rte_sched.h``. These changes are aligned as suggested in the
-  RFC https://mails.dpdk.org/archives/dev/2020-July/175161.html
-
 * metrics: The function ``rte_metrics_init`` will have a non-void return
   in order to notify errors instead of calling ``rte_exit``.
 
doc/guides/rel_notes/release_20_11.rst +9 -0
index 6968c27f6..85d56d46c 100644
@@ -136,6 +136,12 @@ New Features
   * Extern objects and functions can be plugged into the pipeline.
   * Transaction-oriented table updates.
 
+* **Added support to update subport bandwidth dynamically.**
+
+   * Added new API ``rte_sched_port_subport_profile_add`` to add new
+     subport bandwidth profile to subport porfile table at runtime.
+
+   * Added support to update subport rate dynamically.
 
 Removed Items
 -------------
@@ -287,6 +293,9 @@ ABI Changes
 
   * Added new fields to ``struct rte_sched_subport_port_params``.
 
+  * Added ``subport_profile_id`` as a argument to function
+    ``rte_sched_subport_config``.
+
 Known Issues
 ------------
 
drivers/net/softnic/rte_eth_softnic_tm.c +3 -3
index d30976378..5199dd2cd 100644
@@ -92,7 +92,7 @@ softnic_tmgr_port_create(struct pmd_internals *p,
 
 		status = rte_sched_subport_config(sched,
 			subport_id,
-			&t->subport_params[subport_id]);
+			&t->subport_params[subport_id], 0);
 		if (status) {
 			rte_sched_port_free(sched);
 			return NULL;
@@ -1141,7 +1141,7 @@ update_subport_tc_rate(struct rte_eth_dev *dev,
 
 	/* Update the subport configuration. */
 	if (rte_sched_subport_config(SCHED(p),
-		subport_id, &subport_params))
+		subport_id, &subport_params, 0))
 		return -1;
 
 	/* Commit changes. */
@@ -2912,7 +2912,7 @@ update_subport_rate(struct rte_eth_dev *dev,
 
 	/* Update the subport configuration. */
 	if (rte_sched_subport_config(SCHED(p), subport_id,
-		&subport_params))
+		&subport_params, 0))
 		return -1;
 
 	/* Commit changes. */
examples/ip_pipeline/tmgr.c +4 -2
index 91ccbf60f..46c6a83a4 100644
@@ -119,7 +119,8 @@ tmgr_port_create(const char *name, struct tmgr_port_params *params)
 		status = rte_sched_subport_config(
 			s,
 			i,
-			&subport_profile[0]);
+			&subport_profile[0],
+			0);
 
 		if (status) {
 			rte_sched_port_free(s);
@@ -180,7 +181,8 @@ tmgr_subport_config(const char *port_name,
 	status = rte_sched_subport_config(
 		port->s,
 		subport_id,
-		&subport_profile[subport_profile_id]);
+		&subport_profile[subport_profile_id],
+		0);
 
 	return status;
 }
examples/qos_sched/init.c +2 -1
index 06328ddb2..b188c624b 100644
@@ -314,7 +314,8 @@ app_init_sched_port(uint32_t portid, uint32_t socketid)
 	}
 
 	for (subport = 0; subport < port_params.n_subports_per_port; subport ++) {
-		err = rte_sched_subport_config(port, subport, &subport_params[subport]);
+		err = rte_sched_subport_config(port, subport,
+				&subport_params[subport], 0);
 		if (err) {
 			rte_exit(EXIT_FAILURE, "Unable to config sched subport %u, err=%d\n",
 					subport, err);
lib/librte_sched/rte_sched.c +184 -231

590 lines not on this page · raw message

lib/librte_sched/rte_sched.h +10 -3
index aede2e986..1506c6487 100644
@@ -361,20 +361,27 @@ rte_sched_port_subport_profile_add(struct rte_sched_port *port,
 
 /**
  * Hierarchical scheduler subport configuration
- *
+ * Note that this function is safe to use at runtime
+ * to configure subport bandwidth profile.
  * @param port
  *   Handle to port scheduler instance
  * @param subport_id
  *   Subport ID
  * @param params
- *   Subport configuration parameters
+ *   Subport configuration parameters. Must be non-NULL
+ *   for first invocation (i.e initialization) for a given
+ *   subport. Ignored (recommended value is NULL) for all
+ *   subsequent invocation on the same subport.
+ * @param subport_profile_id
+ *   ID of subport bandwidth profile
  * @return
  *   0 upon success, error code otherwise
  */
 int
 rte_sched_subport_config(struct rte_sched_port *port,
 	uint32_t subport_id,
-	struct rte_sched_subport_params *params);
+	struct rte_sched_subport_params *params,
+	uint32_t subport_profile_id);
 
 /**
  * Hierarchical scheduler pipe configuration
Signature · 1 line
2.17.1
#88 lore raw

PATCH v9 4/8 example/qos_sched: update subport rate dynamically

In reply to Savinay Dharmappa

Modify the qos_sched application to build the hierarchical scheduler with default subport bandwidth profile. It also allows to update a subport with different subport rates dynamically.

---
 examples/qos_sched/cfg_file.c  | 151 +++++++++++++++++++--------------
 examples/qos_sched/cfg_file.h  |   4 +
 examples/qos_sched/init.c      |  20 +++--
 examples/qos_sched/main.h      |   1 +
 examples/qos_sched/profile.cfg |   3 +
 5 files changed, 110 insertions(+), 69 deletions(-)
examples/qos_sched/cfg_file.c +87 -64
index f078e4f7d..cd167bd8e 100644
@@ -142,6 +142,93 @@ cfg_load_pipe(struct rte_cfgfile *cfg, struct rte_sched_pipe_params *pipe_params
 	return 0;
 }
 
+int
+cfg_load_subport_profile(struct rte_cfgfile *cfg,
+	struct rte_sched_subport_profile_params *subport_profile)
+{
+	int i;
+	const char *entry;
+	int profiles;
+
+	if (!cfg || !subport_profile)
+		return -1;
+
+	profiles = rte_cfgfile_num_sections(cfg, "subport profile",
+					   sizeof("subport profile") - 1);
+	subport_params[0].n_pipe_profiles = profiles;
+
+	for (i = 0; i < profiles; i++) {
+		char sec_name[32];
+		snprintf(sec_name, sizeof(sec_name), "subport profile %d", i);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tb rate");
+		if (entry)
+			subport_profile[i].tb_rate = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tb size");
+		if (entry)
+			subport_profile[i].tb_size = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc period");
+		if (entry)
+			subport_profile[i].tc_period = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 0 rate");
+		if (entry)
+			subport_profile[i].tc_rate[0] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 1 rate");
+		if (entry)
+			subport_profile[i].tc_rate[1] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 2 rate");
+		if (entry)
+			subport_profile[i].tc_rate[2] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 3 rate");
+		if (entry)
+			subport_profile[i].tc_rate[3] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 4 rate");
+		if (entry)
+			subport_profile[i].tc_rate[4] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 5 rate");
+		if (entry)
+			subport_profile[i].tc_rate[5] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 6 rate");
+		if (entry)
+			subport_profile[i].tc_rate[6] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 7 rate");
+		if (entry)
+			subport_profile[i].tc_rate[7] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 8 rate");
+		if (entry)
+			subport_profile[i].tc_rate[8] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 9 rate");
+		if (entry)
+			subport_profile[i].tc_rate[9] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 10 rate");
+		if (entry)
+			subport_profile[i].tc_rate[10] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 11 rate");
+		if (entry)
+			subport_profile[i].tc_rate[11] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 12 rate");
+		if (entry)
+			subport_profile[i].tc_rate[12] = (uint64_t)atoi(entry);
+	}
+
+	return 0;
+}
+
 int
 cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subport_params)
 {
@@ -267,70 +354,6 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo
 				}
 			}
 
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tb rate");
-			if (entry)
-				subport_params[i].tb_rate = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tb size");
-			if (entry)
-				subport_params[i].tb_size = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc period");
-			if (entry)
-				subport_params[i].tc_period = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 0 rate");
-			if (entry)
-				subport_params[i].tc_rate[0] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 1 rate");
-			if (entry)
-				subport_params[i].tc_rate[1] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 2 rate");
-			if (entry)
-				subport_params[i].tc_rate[2] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 3 rate");
-			if (entry)
-				subport_params[i].tc_rate[3] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 4 rate");
-			if (entry)
-				subport_params[i].tc_rate[4] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 5 rate");
-			if (entry)
-				subport_params[i].tc_rate[5] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 6 rate");
-			if (entry)
-				subport_params[i].tc_rate[6] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 7 rate");
-			if (entry)
-				subport_params[i].tc_rate[7] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 8 rate");
-			if (entry)
-				subport_params[i].tc_rate[8] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 9 rate");
-			if (entry)
-				subport_params[i].tc_rate[9] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 10 rate");
-			if (entry)
-				subport_params[i].tc_rate[10] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 11 rate");
-			if (entry)
-				subport_params[i].tc_rate[11] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 12 rate");
-			if (entry)
-				subport_params[i].tc_rate[12] = (uint64_t)atoi(entry);
-
 			int n_entries = rte_cfgfile_section_num_entries(cfg, sec_name);
 			struct rte_cfgfile_entry entries[n_entries];
 
examples/qos_sched/cfg_file.h +4 -0
index 2eccf1ca0..0dc458aa7 100644
@@ -14,4 +14,8 @@ int cfg_load_pipe(struct rte_cfgfile *cfg, struct rte_sched_pipe_params *pipe);
 
 int cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subport);
 
+int cfg_load_subport_profile(struct rte_cfgfile *cfg,
+			     struct rte_sched_subport_profile_params
+			     *subport_profile);
+
 #endif
examples/qos_sched/init.c +15 -5
index b188c624b..1abe003fc 100644
@@ -192,15 +192,20 @@ static struct rte_sched_pipe_params pipe_profiles[MAX_SCHED_PIPE_PROFILES] = {
 	},
 };
 
-struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = {
+static struct rte_sched_subport_profile_params
+		subport_profile[MAX_SCHED_SUBPORT_PROFILES] = {
 	{
 		.tb_rate = 1250000000,
 		.tb_size = 1000000,
-
 		.tc_rate = {1250000000, 1250000000, 1250000000, 1250000000,
 			1250000000, 1250000000, 1250000000, 1250000000, 1250000000,
 			1250000000, 1250000000, 1250000000, 1250000000},
 		.tc_period = 10,
+	},
+};
+
+struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = {
+	{
 		.n_pipes_per_subport_enabled = 4096,
 		.qsize = {64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64},
 		.pipe_profiles = pipe_profiles,
@@ -285,6 +290,9 @@ struct rte_sched_port_params port_params = {
 	.mtu = 6 + 6 + 4 + 4 + 2 + 1500,
 	.frame_overhead = RTE_SCHED_FRAME_OVERHEAD_DEFAULT,
 	.n_subports_per_port = 1,
+	.n_subport_profiles = 1,
+	.subport_profiles = subport_profile,
+	.n_max_subport_profiles = MAX_SCHED_SUBPORT_PROFILES,
 	.n_pipes_per_subport = MAX_SCHED_PIPES,
 };
 
@@ -315,10 +323,11 @@ app_init_sched_port(uint32_t portid, uint32_t socketid)
 
 	for (subport = 0; subport < port_params.n_subports_per_port; subport ++) {
 		err = rte_sched_subport_config(port, subport,
-				&subport_params[subport], 0);
+				&subport_params[subport],
+				0);
 		if (err) {
-			rte_exit(EXIT_FAILURE, "Unable to config sched subport %u, err=%d\n",
-					subport, err);
+			rte_exit(EXIT_FAILURE, "Unable to config sched "
+				 "subport %u, err=%d\n", subport, err);
 		}
 
 		uint32_t n_pipes_per_subport =
@@ -351,6 +360,7 @@ app_load_cfg_profile(const char *profile)
 
 	cfg_load_port(file, &port_params);
 	cfg_load_subport(file, subport_params);
+	cfg_load_subport_profile(file, subport_profile);
 	cfg_load_pipe(file, pipe_profiles);
 
 	rte_cfgfile_close(file);
examples/qos_sched/main.h +1 -0
index 23bc418d9..0d6815ae6 100644
@@ -51,6 +51,7 @@ extern "C" {
 #define MAX_SCHED_SUBPORTS		8
 #define MAX_SCHED_PIPES		4096
 #define MAX_SCHED_PIPE_PROFILES		256
+#define MAX_SCHED_SUBPORT_PROFILES	8
 
 #ifndef APP_COLLECT_STAT
 #define APP_COLLECT_STAT		1
examples/qos_sched/profile.cfg +3 -0
index 61b8b7071..4486d2799 100644
@@ -26,6 +26,9 @@ number of subports per port = 1
 number of pipes per subport = 4096
 queue sizes = 64 64 64 64 64 64 64 64 64 64 64 64 64
 
+subport 0-8 = 0                ; These subports are configured with subport profile 0
+
+[subport profile 0]
 tb rate = 1250000000           ; Bytes per second
 tb size = 1000000              ; Bytes
 
Signature · 1 line
2.17.1
#89 lore raw

PATCH v9 5/8 example/ip_pipeline: update subport rate dynamically

In reply to Savinay Dharmappa

Modify the ip_pipeline application to build the hierarchical scheduler with default subport bandwidth profile. It also allows to update a subport with different subport rates dynamically

---
 examples/ip_pipeline/cli.c  |  68 ++++++++------------
 examples/ip_pipeline/tmgr.c | 121 ++++++++++++++++++++++++++++++------
 examples/ip_pipeline/tmgr.h |   5 +-
 3 files changed, 134 insertions(+), 60 deletions(-)
examples/ip_pipeline/cli.c +27 -41
index dafc95ae9..ec4acf0ac 100644
@@ -393,12 +393,7 @@ static const char cmd_tmgr_subport_profile_help[] =
 "   <tc0_rate> <tc1_rate> <tc2_rate> <tc3_rate> <tc4_rate>"
 "        <tc5_rate> <tc6_rate> <tc7_rate> <tc8_rate>"
 "        <tc9_rate> <tc10_rate> <tc11_rate> <tc12_rate>\n"
-"   <tc_period>\n"
-"   pps <n_pipes_per_subport>\n"
-"   qsize <qsize_tc0> <qsize_tc1> <qsize_tc2>"
-"       <qsize_tc3> <qsize_tc4> <qsize_tc5> <qsize_tc6>"
-"       <qsize_tc7> <qsize_tc8> <qsize_tc9> <qsize_tc10>"
-"       <qsize_tc11> <qsize_tc12>";
+"   <tc_period>\n";
 
 static void
 cmd_tmgr_subport_profile(char **tokens,
@@ -406,57 +401,37 @@ cmd_tmgr_subport_profile(char **tokens,
 	char *out,
 	size_t out_size)
 {
-	struct rte_sched_subport_params p;
+	struct rte_sched_subport_profile_params subport_profile;
 	int status, i;
 
-	if (n_tokens != 35) {
+	if (n_tokens != 19) {
 		snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);
 		return;
 	}
 
-	if (parser_read_uint64(&p.tb_rate, tokens[3]) != 0) {
+	if (parser_read_uint64(&subport_profile.tb_rate, tokens[3]) != 0) {
 		snprintf(out, out_size, MSG_ARG_INVALID, "tb_rate");
 		return;
 	}
 
-	if (parser_read_uint64(&p.tb_size, tokens[4]) != 0) {
+	if (parser_read_uint64(&subport_profile.tb_size, tokens[4]) != 0) {
 		snprintf(out, out_size, MSG_ARG_INVALID, "tb_size");
 		return;
 	}
 
 	for (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++)
-		if (parser_read_uint64(&p.tc_rate[i], tokens[5 + i]) != 0) {
+		if (parser_read_uint64(&subport_profile.tc_rate[i],
+				tokens[5 + i]) != 0) {
 			snprintf(out, out_size, MSG_ARG_INVALID, "tc_rate");
 			return;
 		}
 
-	if (parser_read_uint64(&p.tc_period, tokens[18]) != 0) {
+	if (parser_read_uint64(&subport_profile.tc_period, tokens[18]) != 0) {
 		snprintf(out, out_size, MSG_ARG_INVALID, "tc_period");
 		return;
 	}
 
-	if (strcmp(tokens[19], "pps") != 0) {
-		snprintf(out, out_size, MSG_ARG_NOT_FOUND, "pps");
-		return;
-	}
-
-	if (parser_read_uint32(&p.n_pipes_per_subport_enabled, tokens[20]) != 0) {
-		snprintf(out, out_size, MSG_ARG_INVALID, "n_pipes_per_subport");
-		return;
-	}
-
-	if (strcmp(tokens[21], "qsize") != 0) {
-		snprintf(out, out_size, MSG_ARG_NOT_FOUND, "qsize");
-		return;
-	}
-
-	for (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++)
-		if (parser_read_uint16(&p.qsize[i], tokens[22 + i]) != 0) {
-			snprintf(out, out_size, MSG_ARG_INVALID, "qsize");
-			return;
-		}
-
-	status = tmgr_subport_profile_add(&p);
+	status = tmgr_subport_profile_add(&subport_profile);
 	if (status != 0) {
 		snprintf(out, out_size, MSG_CMD_FAIL, tokens[0]);
 		return;
@@ -530,6 +505,7 @@ static const char cmd_tmgr_help[] =
 "tmgr <tmgr_name>\n"
 "   rate <rate>\n"
 "   spp <n_subports_per_port>\n"
+"   pps <n_pipes_per_subport>\n"
 "   fo <frame_overhead>\n"
 "   mtu <mtu>\n"
 "   cpu <cpu_id>\n";
@@ -544,7 +520,7 @@ cmd_tmgr(char **tokens,
 	char *name;
 	struct tmgr_port *tmgr_port;
 
-	if (n_tokens != 12) {
+	if (n_tokens != 14) {
 		snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);
 		return;
 	}
@@ -571,32 +547,42 @@ cmd_tmgr(char **tokens,
 		return;
 	}
 
-	if (strcmp(tokens[6], "fo") != 0) {
+	if (strcmp(tokens[6], "pps") != 0) {
+		snprintf(out, out_size, MSG_ARG_NOT_FOUND, "spp");
+		return;
+	}
+
+	if (parser_read_uint32(&p.n_pipes_per_subport, tokens[7]) != 0) {
+		snprintf(out, out_size, MSG_ARG_INVALID, "n_pipes_per_subport");
+		return;
+	}
+
+	if (strcmp(tokens[8], "fo") != 0) {
 		snprintf(out, out_size, MSG_ARG_NOT_FOUND, "fo");
 		return;
 	}
 
-	if (parser_read_uint32(&p.frame_overhead, tokens[7]) != 0) {
+	if (parser_read_uint32(&p.frame_overhead, tokens[9]) != 0) {
 		snprintf(out, out_size, MSG_ARG_INVALID, "frame_overhead");
 		return;
 	}
 
-	if (strcmp(tokens[8], "mtu") != 0) {
+	if (strcmp(tokens[10], "mtu") != 0) {
 		snprintf(out, out_size, MSG_ARG_NOT_FOUND, "mtu");
 		return;
 	}
 
-	if (parser_read_uint32(&p.mtu, tokens[9]) != 0) {
+	if (parser_read_uint32(&p.mtu, tokens[11]) != 0) {
 		snprintf(out, out_size, MSG_ARG_INVALID, "mtu");
 		return;
 	}
 
-	if (strcmp(tokens[10], "cpu") != 0) {
+	if (strcmp(tokens[12], "cpu") != 0) {
 		snprintf(out, out_size, MSG_ARG_NOT_FOUND, "cpu");
 		return;
 	}
 
-	if (parser_read_uint32(&p.cpu_id, tokens[11]) != 0) {
+	if (parser_read_uint32(&p.cpu_id, tokens[13]) != 0) {
 		snprintf(out, out_size, MSG_ARG_INVALID, "cpu_id");
 		return;
 	}
examples/ip_pipeline/tmgr.c +103 -18

202 lines not on this page · raw message

examples/ip_pipeline/tmgr.h +4 -1
index ee50cf7cc..1994c55bc 100644
@@ -9,6 +9,7 @@
 #include <sys/queue.h>
 
 #include <rte_sched.h>
+#include <rte_red.h>
 
 #include "common.h"
 
@@ -29,6 +30,7 @@ struct tmgr_port {
 	char name[NAME_SIZE];
 	struct rte_sched_port *s;
 	uint32_t n_subports_per_port;
+	uint32_t n_pipes_per_subport;
 };
 
 TAILQ_HEAD(tmgr_port_list, tmgr_port);
@@ -42,13 +44,14 @@ tmgr_port_find(const char *name);
 struct tmgr_port_params {
 	uint64_t rate;
 	uint32_t n_subports_per_port;
+	uint32_t n_pipes_per_subport;
 	uint32_t frame_overhead;
 	uint32_t mtu;
 	uint32_t cpu_id;
 };
 
 int
-tmgr_subport_profile_add(struct rte_sched_subport_params *p);
+tmgr_subport_profile_add(struct rte_sched_subport_profile_params *sp);
 
 int
 tmgr_pipe_profile_add(struct rte_sched_pipe_params *p);
Signature · 1 line
2.17.1
#90 lore raw

PATCH v9 6/8 drivers/softnic: update subport rate dynamically

In reply to Savinay Dharmappa

Modify the softnic drivers to build the hierarchical scheduler with default subport bandwidth profile. It also allows to update a subport with different subport rates dynamically.

---
 .../net/softnic/rte_eth_softnic_internals.h   |  11 +-
 drivers/net/softnic/rte_eth_softnic_tm.c      | 243 ++++++++++++++----
 2 files changed, 195 insertions(+), 59 deletions(-)
drivers/net/softnic/rte_eth_softnic_internals.h +9 -2
index 6eec43b22..77e0139a6 100644
@@ -164,11 +164,18 @@ TAILQ_HEAD(softnic_link_list, softnic_link);
 #ifndef TM_MAX_PIPE_PROFILE
 #define TM_MAX_PIPE_PROFILE				256
 #endif
+
+#ifndef TM_MAX_SUBPORT_PROFILE
+#define TM_MAX_SUBPORT_PROFILE				256
+#endif
+
 struct tm_params {
 	struct rte_sched_port_params port_params;
-
 	struct rte_sched_subport_params subport_params[TM_MAX_SUBPORTS];
-
+	struct rte_sched_subport_profile_params
+		subport_profile[TM_MAX_SUBPORT_PROFILE];
+	uint32_t n_subport_profiles;
+	uint32_t subport_to_profile[TM_MAX_SUBPORT_PROFILE];
 	struct rte_sched_pipe_params pipe_profiles[TM_MAX_PIPE_PROFILE];
 	uint32_t n_pipe_profiles;
 	uint32_t pipe_to_profile[TM_MAX_SUBPORTS * TM_MAX_PIPES_PER_SUBPORT];
drivers/net/softnic/rte_eth_softnic_tm.c +186 -57

335 lines not on this page · raw message

Signature · 1 line
2.17.1
#91 lore raw

PATCH v9 7/8 app/test_sched: update subport rate dynamically

In reply to Savinay Dharmappa

Modify the test_sched application to build the hierarchical scheduler with default subport bandwidth profile. It also allows to update a subport with different subport rates dynamically

---
 app/test/test_sched.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
app/test/test_sched.c +11 -2
index 5e5c2a59b..958b63114 100644
@@ -21,6 +21,7 @@
 #define PIPE            1
 #define TC              2
 #define QUEUE           0
+#define MAX_SCHED_SUBPORT_PROFILES  8
 
 static struct rte_sched_pipe_params pipe_profile[] = {
 	{ /* Profile #0 */
@@ -36,15 +37,20 @@ static struct rte_sched_pipe_params pipe_profile[] = {
 	},
 };
 
-static struct rte_sched_subport_params subport_param[] = {
+static struct rte_sched_subport_profile_params
+		subport_profile[] = {
 	{
 		.tb_rate = 1250000000,
 		.tb_size = 1000000,
-
 		.tc_rate = {1250000000, 1250000000, 1250000000, 1250000000,
 			1250000000, 1250000000, 1250000000, 1250000000, 1250000000,
 			1250000000, 1250000000, 1250000000, 1250000000},
 		.tc_period = 10,
+	},
+};
+
+static struct rte_sched_subport_params subport_param[] = {
+	{
 		.n_pipes_per_subport_enabled = 1024,
 		.qsize = {32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32},
 		.pipe_profiles = pipe_profile,
@@ -59,6 +65,9 @@ static struct rte_sched_port_params port_param = {
 	.mtu = 1522,
 	.frame_overhead = RTE_SCHED_FRAME_OVERHEAD_DEFAULT,
 	.n_subports_per_port = 1,
+	.n_subport_profiles = 1,
+	.subport_profiles = subport_profile,
+	.n_max_subport_profiles = MAX_SCHED_SUBPORT_PROFILES,
 	.n_pipes_per_subport = 1024,
 };
 
Signature · 1 line
2.17.1
#92 lore raw

PATCH v9 8/8 sched: remove redundant code

In reply to Savinay Dharmappa

Remove redundant data structure fields.

---
 doc/guides/rel_notes/release_20_11.rst |  3 +++
 lib/librte_sched/rte_sched.h           | 12 ------------
 2 files changed, 3 insertions(+), 12 deletions(-)
doc/guides/rel_notes/release_20_11.rst +3 -0
index 85d56d46c..116969d06 100644
@@ -296,6 +296,9 @@ ABI Changes
   * Added ``subport_profile_id`` as a argument to function
     ``rte_sched_subport_config``.
 
+  * ``tb_rate``, ``tc_rate``, ``tc_period`` and
+    ``tb_size`` are removed from ``struct rte_sched_subport_params``.
+
 Known Issues
 ------------
 
lib/librte_sched/rte_sched.h +0 -12
index 1506c6487..c1a772b70 100644
@@ -149,18 +149,6 @@ struct rte_sched_pipe_params {
  * byte.
  */
 struct rte_sched_subport_params {
-	/** Token bucket rate (measured in bytes per second) */
-	uint64_t tb_rate;
-
-	/** Token bucket size (measured in credits) */
-	uint64_t tb_size;
-
-	/** Traffic class rates (measured in bytes per second) */
-	uint64_t tc_rate[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];
-
-	/** Enforcement period for rates (measured in milliseconds) */
-	uint64_t tc_period;
-
 	/** Number of subport pipes.
 	 * The subport can enable/allocate fewer pipes than the maximum
 	 * number set through struct port_params::n_max_pipes_per_subport,
Signature · 1 line
2.17.1
#93 lore raw

Re: [dpdk-dev] [PATCH v9 0/8] Enable dynamic config of subport bandwidth

In reply to Savinay Dharmappa

09/10/2020 14:39, Savinay Dharmappa:

Quoted 22 lines

DPDK sched library allows runtime configuration of the pipe profiles to the pipes of the subport once scheduler hierarchy is constructed. However, to change the subport level bandwidth, existing hierarchy needs to be dismantled and whole process of building hierarchy under subport nodes needs to be repeated which might result in router downtime. Furthermore, due to lack of dynamic configuration of the subport bandwidth profile configuration (shaper and Traffic class rates), the user application is unable to dynamically re-distribute the excess-bandwidth of one subport among other subports in the scheduler hierarchy. Therefore, it is also not possible to adjust the subport bandwidth profile in sync with dynamic changes in pipe profiles of subscribers who want to consume higher bandwidth opportunistically.

This patch series implements dynamic configuration of the subport bandwidth profile to overcome the runtime situation when group of subscribers are not using the allotted bandwidth and dynamic bandwidth re-distribution is needed the without making any structural changes in the hierarchy.

The implementation work includes refactoring the existing api and data structures defined for port and subport level, new APIs for adding subport level bandwidth profiles that can be used in runtime.

Quoted 5 lines

---
v8 -> v9
- updated ABI section in release notes.
- Addressed review comments from patch 8

     of v8.

I was asking a question in my reply to v8 but you didn't hit the "reply" button.

One more question: why don't you keep the ack given by Cristian in v7?

#94 lore raw

Re: [dpdk-dev] [PATCH v9 0/8] Enable dynamic config of subport bandwidth

09/10/2020 14:39, Savinay Dharmappa:

Quoted 22 lines

DPDK sched library allows runtime configuration of the pipe profiles to the pipes of the subport once scheduler hierarchy is constructed. However, to change the subport level bandwidth, existing hierarchy needs to be dismantled and whole process of building hierarchy under subport nodes needs to be repeated which might result in router downtime. Furthermore, due to lack of dynamic configuration of the subport bandwidth profile configuration (shaper and Traffic class rates), the user application is unable to dynamically re-distribute the excess-bandwidth of one subport among other subports in the scheduler hierarchy. Therefore, it is also not possible to adjust the subport bandwidth profile in sync with dynamic changes in pipe profiles of subscribers who want to consume higher bandwidth opportunistically.

This patch series implements dynamic configuration of the subport bandwidth profile to overcome the runtime situation when group of subscribers are not using the allotted bandwidth and dynamic bandwidth re-distribution is needed the without making any structural changes in the hierarchy.

The implementation work includes refactoring the existing api and data structures defined for port and subport level, new APIs for adding subport level bandwidth profiles that can be used in runtime.

Quoted 5 lines

---
v8 -> v9
- updated ABI section in release notes.
- Addressed review comments from patch 8

     of v8.

I was asking a question in my reply to v8 but you didn't hit the "reply" button.

Quoted 1 line
Quoted 1 line

sorry for that. All the question raised by you were relevant so I addressed them and sent out v9.

One more question: why don't you keep the ack given by Cristian in v7?

Quoted 1 line
Quoted 1 line

I am carrying ack given Cristian in v9, but It is at the bottom of cover letter.

#95 lore raw

Re: [dpdk-dev] [PATCH v9 0/8] Enable dynamic config of subport bandwidth

09/10/2020 14:39, Savinay Dharmappa:

Quoted 22 lines

DPDK sched library allows runtime configuration of the pipe profiles to the pipes of the subport once scheduler hierarchy is constructed. However, to change the subport level bandwidth, existing hierarchy needs to be dismantled and whole process of building hierarchy under subport nodes needs to be repeated which might result in router downtime. Furthermore, due to lack of dynamic configuration of the subport bandwidth profile configuration (shaper and Traffic class rates), the user application is unable to dynamically re-distribute the excess-bandwidth of one subport among other subports in the scheduler hierarchy. Therefore, it is also not possible to adjust the subport bandwidth profile in sync with dynamic changes in pipe profiles of subscribers who want to consume higher bandwidth opportunistically.

This patch series implements dynamic configuration of the subport bandwidth profile to overcome the runtime situation when group of subscribers are not using the allotted bandwidth and dynamic bandwidth re-distribution is needed the without making any structural changes in the hierarchy.

The implementation work includes refactoring the existing api and data structures defined for port and subport level, new APIs for adding subport level bandwidth profiles that can be used in runtime.

Quoted 5 lines

---
v8 -> v9
- updated ABI section in release notes.
- Addressed review comments from patch 8

     of v8.

I was asking a question in my reply to v8 but you didn't hit the "reply" button.

Quoted 1 line
Quoted 1 line

sorry for that. All the question raised by you were relevant so I addressed them and sent out v9.

One more question: why don't you keep the ack given by Cristian in v7?

Quoted 2 lines
Quoted 2 lines

I am carrying ack given Cristian in v9, but It is at the bottom of cover letter.
should I resend the patch placing ack just before version changes info?

#96 lore raw

Re: [dpdk-dev] [PATCH v9 0/8] Enable dynamic config of subport bandwidth

-----Original Message-----
From: Dharmappa, Savinay
Sent: Tuesday, October 13, 2020 4:39 AM
To: 'Thomas Monjalon' <[email protected]>
Cc: Dumitrescu, Cristian <[email protected]>; Singh, Jasvinder <[email protected]>; '[email protected]' <[email protected]>
Subject: RE: [dpdk-dev] [PATCH v9 0/8] Enable dynamic config of subport bandwidth

09/10/2020 14:39, Savinay Dharmappa:

Quoted 22 lines

DPDK sched library allows runtime configuration of the pipe profiles to the pipes of the subport once scheduler hierarchy is constructed. However, to change the subport level bandwidth, existing hierarchy needs to be dismantled and whole process of building hierarchy under subport nodes needs to be repeated which might result in router downtime. Furthermore, due to lack of dynamic configuration of the subport bandwidth profile configuration (shaper and Traffic class rates), the user application is unable to dynamically re-distribute the excess-bandwidth of one subport among other subports in the scheduler hierarchy. Therefore, it is also not possible to adjust the subport bandwidth profile in sync with dynamic changes in pipe profiles of subscribers who want to consume higher bandwidth opportunistically.

This patch series implements dynamic configuration of the subport bandwidth profile to overcome the runtime situation when group of subscribers are not using the allotted bandwidth and dynamic bandwidth re-distribution is needed the without making any structural changes in the hierarchy.

The implementation work includes refactoring the existing api and data structures defined for port and subport level, new APIs for adding subport level bandwidth profiles that can be used in runtime.

Quoted 5 lines

---
v8 -> v9
- updated ABI section in release notes.
- Addressed review comments from patch 8

     of v8.

I was asking a question in my reply to v8 but you didn't hit the "reply" button.

Quoted 1 line
Quoted 1 line

sorry for that. All the question raised by you were relevant so I addressed them and sent out v9.

One more question: why don't you keep the ack given by Cristian in v7?

Quoted 2 lines
Quoted 2 lines

I am carrying ack given Cristian in v9, but It is at the bottom of cover letter.
should I resend the patch placing ack just before version changes info?

Hi Thomas,

Could you please let me know regarding resending the patch ?

#97 lore raw

Re: [dpdk-dev] [PATCH v9 0/8] Enable dynamic config of subport bandwidth

13/10/2020 15:56, Dharmappa, Savinay:

Quoted 8 lines

09/10/2020 14:39, Savinay Dharmappa:
One more question: why don't you keep the ack given by Cristian in v7?

Quoted 2 lines
Quoted 2 lines

I am carrying ack given Cristian in v9, but It is at the bottom of cover letter.
should I resend the patch placing ack just before version changes info?

Hi Thomas,

Could you please let me know regarding resending the patch ?

That's fine, I should be able to merge v9.

#98 lore raw

Re: [dpdk-dev] [PATCH v9 0/8] Enable dynamic config of subport bandwidth

In reply to Savinay Dharmappa

09/10/2020 14:39, Savinay Dharmappa:

Quoted 32 lines

DPDK sched library allows runtime configuration of the pipe profiles to the pipes of the subport once scheduler hierarchy is constructed. However, to change the subport level bandwidth, existing hierarchy needs to be dismantled and whole process of building hierarchy under subport nodes needs to be repeated which might result in router downtime. Furthermore, due to lack of dynamic configuration of the subport bandwidth profile configuration (shaper and Traffic class rates), the user application is unable to dynamically re-distribute the excess-bandwidth of one subport among other subports in the scheduler hierarchy. Therefore, it is also not possible to adjust the subport bandwidth profile in sync with dynamic changes in pipe profiles of subscribers who want to consume higher bandwidth opportunistically.

This patch series implements dynamic configuration of the subport bandwidth profile to overcome the runtime situation when group of subscribers are not using the allotted bandwidth and dynamic bandwidth re-distribution is needed the without making any structural changes in the hierarchy.

The implementation work includes refactoring the existing api and data structures defined for port and subport level, new APIs for adding subport level bandwidth profiles that can be used in runtime.

Savinay Dharmappa (8):
sched: add support profile table
sched: introduce subport profile add function
sched: update subport rate dynamically example/qos_sched: update subport rate dynamically example/ip_pipeline: update subport rate dynamically drivers/softnic: update subport rate dynamically app/test_sched: update subport rate dynamically
sched: remove redundant code

Quoted 1 line

Applied with few minor changes in release notes, thanks

#99 lore raw

RFC PATCH 2/2 example/qos_sched: subport bandwidth profile config

In reply to Savinay Dharmappa

qos sched application uses the new apis introduced as part of dynamic configuration of subport bandwidth to configure the deafult subport bandwidth profile while buidling the hirerachical scheduler.

---
 examples/qos_sched/cfg_file.c  | 158 ++++++++++++++++++++++++-----------------
 examples/qos_sched/cfg_file.h  |   4 ++
 examples/qos_sched/init.c      |  24 +++++--
 examples/qos_sched/main.h      |   1 +
 examples/qos_sched/profile.cfg |   3 +
 5 files changed, 120 insertions(+), 70 deletions(-)
examples/qos_sched/cfg_file.c +92 -66
index f078e4f..9e1341c 100644
@@ -53,8 +53,11 @@ cfg_load_pipe(struct rte_cfgfile *cfg, struct rte_sched_pipe_params *pipe_params
 	if (!cfg || !pipe_params)
 		return -1;
 
-	profiles = rte_cfgfile_num_sections(cfg, "pipe profile", sizeof("pipe profile") - 1);
-	subport_params[0].n_pipe_profiles = profiles;
+	profiles = rte_cfgfile_num_sections(cfg, "pipe profile",
+					sizeof("pipe profile") - 1);
+	port_params.n_subport_profiles = profiles;
+
+	printf(" profiles = %d", profiles);
 
 	for (j = 0; j < profiles; j++) {
 		char pipe_name[32];
@@ -143,6 +146,93 @@ cfg_load_pipe(struct rte_cfgfile *cfg, struct rte_sched_pipe_params *pipe_params
 }
 
 int
+cfg_load_subport_profile(struct rte_cfgfile *cfg,
+	struct rte_sched_subport_profile_params *subport_profile)
+{
+	int i;
+	const char *entry;
+	int profiles;
+
+	if (!cfg || !subport_profile)
+		return -1;
+
+	profiles = rte_cfgfile_num_sections(cfg, "subport profile",
+					   sizeof("subport profile") - 1);
+	subport_params[0].n_pipe_profiles = profiles;
+
+	for (i = 0; i < profiles; i++) {
+		char sec_name[32];
+		snprintf(sec_name, sizeof(sec_name), "subport profile %d", i);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tb rate");
+		if (entry)
+			subport_profile[i].tb_rate = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tb size");
+		if (entry)
+			subport_profile[i].tb_size = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc period");
+		if (entry)
+			subport_profile[i].tc_period = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 0 rate");
+		if (entry)
+			subport_profile[i].tc_rate[0] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 1 rate");
+		if (entry)
+			subport_profile[i].tc_rate[1] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 2 rate");
+		if (entry)
+			subport_profile[i].tc_rate[2] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 3 rate");
+		if (entry)
+			subport_profile[i].tc_rate[3] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 4 rate");
+		if (entry)
+			subport_profile[i].tc_rate[4] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 5 rate");
+		if (entry)
+			subport_profile[i].tc_rate[5] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 6 rate");
+		if (entry)
+			subport_profile[i].tc_rate[6] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 7 rate");
+		if (entry)
+			subport_profile[i].tc_rate[7] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 8 rate");
+		if (entry)
+			subport_profile[i].tc_rate[8] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 9 rate");
+		if (entry)
+			subport_profile[i].tc_rate[9] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 10 rate");
+		if (entry)
+			subport_profile[i].tc_rate[10] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 11 rate");
+		if (entry)
+			subport_profile[i].tc_rate[11] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 12 rate");
+		if (entry)
+			subport_profile[i].tc_rate[12] = (uint64_t)atoi(entry);
+	}
+
+	return 0;
+}
+
+int
 cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subport_params)
 {
 	const char *entry;
@@ -267,70 +357,6 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo
 				}
 			}
 
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tb rate");
-			if (entry)
-				subport_params[i].tb_rate = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tb size");
-			if (entry)
-				subport_params[i].tb_size = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc period");
-			if (entry)
-				subport_params[i].tc_period = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 0 rate");
-			if (entry)
-				subport_params[i].tc_rate[0] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 1 rate");
-			if (entry)
-				subport_params[i].tc_rate[1] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 2 rate");
-			if (entry)
-				subport_params[i].tc_rate[2] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 3 rate");
-			if (entry)
-				subport_params[i].tc_rate[3] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 4 rate");
-			if (entry)
-				subport_params[i].tc_rate[4] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 5 rate");
-			if (entry)
-				subport_params[i].tc_rate[5] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 6 rate");
-			if (entry)
-				subport_params[i].tc_rate[6] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 7 rate");
-			if (entry)
-				subport_params[i].tc_rate[7] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 8 rate");
-			if (entry)
-				subport_params[i].tc_rate[8] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 9 rate");
-			if (entry)
-				subport_params[i].tc_rate[9] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 10 rate");
-			if (entry)
-				subport_params[i].tc_rate[10] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 11 rate");
-			if (entry)
-				subport_params[i].tc_rate[11] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 12 rate");
-			if (entry)
-				subport_params[i].tc_rate[12] = (uint64_t)atoi(entry);
-
 			int n_entries = rte_cfgfile_section_num_entries(cfg, sec_name);
 			struct rte_cfgfile_entry entries[n_entries];
 
examples/qos_sched/cfg_file.h +4 -0
index 2eccf1c..0dc458a 100644
@@ -14,4 +14,8 @@ int cfg_load_pipe(struct rte_cfgfile *cfg, struct rte_sched_pipe_params *pipe);
 
 int cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subport);
 
+int cfg_load_subport_profile(struct rte_cfgfile *cfg,
+			     struct rte_sched_subport_profile_params
+			     *subport_profile);
+
 #endif
examples/qos_sched/init.c +20 -4
index 9626c15..541adb7 100644
@@ -196,15 +196,20 @@ static struct rte_sched_pipe_params pipe_profiles[MAX_SCHED_PIPE_PROFILES] = {
 	},
 };
 
-struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = {
+static struct rte_sched_subport_profile_params
+		subport_profile[MAX_SCHED_SUBPORT_PROFILES] = {
 	{
 		.tb_rate = 1250000000,
 		.tb_size = 1000000,
-
 		.tc_rate = {1250000000, 1250000000, 1250000000, 1250000000,
 			1250000000, 1250000000, 1250000000, 1250000000, 1250000000,
 			1250000000, 1250000000, 1250000000, 1250000000},
 		.tc_period = 10,
+	},
+};
+
+struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = {
+	{
 		.n_pipes_per_subport_enabled = 4096,
 		.qsize = {64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64},
 		.pipe_profiles = pipe_profiles,
@@ -289,6 +294,9 @@ struct rte_sched_port_params port_params = {
 	.mtu = 6 + 6 + 4 + 4 + 2 + 1500,
 	.frame_overhead = RTE_SCHED_FRAME_OVERHEAD_DEFAULT,
 	.n_subports_per_port = 1,
+	.n_subport_profiles = 1,
+	.subport_profiles = subport_profile,
+	.n_max_subport_profiles = MAX_SCHED_SUBPORT_PROFILES,
 	.n_pipes_per_subport = MAX_SCHED_PIPES,
 };
 
@@ -320,8 +328,15 @@ app_init_sched_port(uint32_t portid, uint32_t socketid)
 	for (subport = 0; subport < port_params.n_subports_per_port; subport ++) {
 		err = rte_sched_subport_config(port, subport, &subport_params[subport]);
 		if (err) {
-			rte_exit(EXIT_FAILURE, "Unable to config sched subport %u, err=%d\n",
-					subport, err);
+			rte_exit(EXIT_FAILURE, "Unable to config schedi "
+				"subport %u, err=%d\n", subport, err);
+		}
+
+		err = rte_sched_subport_profile_config(port, subport, 0);
+		if (err) {
+			rte_exit(EXIT_FAILURE, "failed to configure "
+				"profile err=%d\n", err);
+
 		}
 
 		uint32_t n_pipes_per_subport =
@@ -354,6 +369,7 @@ app_load_cfg_profile(const char *profile)
 
 	cfg_load_port(file, &port_params);
 	cfg_load_subport(file, subport_params);
+	cfg_load_subport_profile(file, subport_profile);
 	cfg_load_pipe(file, pipe_profiles);
 
 	rte_cfgfile_close(file);
examples/qos_sched/main.h +1 -0
index 23bc418..0d6815a 100644
@@ -51,6 +51,7 @@ extern "C" {
 #define MAX_SCHED_SUBPORTS		8
 #define MAX_SCHED_PIPES		4096
 #define MAX_SCHED_PIPE_PROFILES		256
+#define MAX_SCHED_SUBPORT_PROFILES	8
 
 #ifndef APP_COLLECT_STAT
 #define APP_COLLECT_STAT		1
examples/qos_sched/profile.cfg +3 -0
index 61b8b70..4486d27 100644
@@ -26,6 +26,9 @@ number of subports per port = 1
 number of pipes per subport = 4096
 queue sizes = 64 64 64 64 64 64 64 64 64 64 64 64 64
 
+subport 0-8 = 0                ; These subports are configured with subport profile 0
+
+[subport profile 0]
 tb rate = 1250000000           ; Bytes per second
 tb size = 1000000              ; Bytes
 
Signature · 1 line
2.7.4
#100 lore raw

Re: [dpdk-dev] [RFC PATCH 2/2] example/qos_sched: subport bandwidth profile config

Quoted 356 lines

-----Original Message-----
From: Dharmappa, Savinay <[email protected]>
Sent: Wednesday, July 15, 2020 7:28 PM
To: Dharmappa, Savinay <[email protected]>; Singh, Jasvinder <[email protected]>; [email protected]
Subject: [RFC PATCH 2/2] example/qos_sched: subport bandwidth profile config

qos sched application uses the new apis introduced as part of dynamic configuration of subport bandwidth to configure the deafult subport bandwidth profile while buidling the hirerachical scheduler.

---
 examples/qos_sched/cfg_file.c  | 158 ++++++++++++++++++++++++-------------
----
 examples/qos_sched/cfg_file.h  |   4 ++
 examples/qos_sched/init.c      |  24 +++++--
 examples/qos_sched/main.h      |   1 +
 examples/qos_sched/profile.cfg |   3 +
 5 files changed, 120 insertions(+), 70 deletions(-)
examples/qos_sched/cfg_file.c +0 -0
index f078e4f..9e1341c 100644
@@ -53,8 +53,11 @@ cfg_load_pipe(struct rte_cfgfile *cfg, struct

rte_sched_pipe_params *pipe_params

examples/qos_sched/cfg_file.c +0 -1
 	if (!cfg || !pipe_params)
 		return -1;
 
-	profiles = rte_cfgfile_num_sections(cfg, "pipe profile", sizeof("pipe

profile") - 1);

examples/qos_sched/cfg_file.c +91 -1
-	subport_params[0].n_pipe_profiles = profiles;
+	profiles = rte_cfgfile_num_sections(cfg, "pipe profile",
+					sizeof("pipe profile") - 1);
+	port_params.n_subport_profiles = profiles;
+
+	printf(" profiles = %d", profiles);
 
 	for (j = 0; j < profiles; j++) {
 		char pipe_name[32];
@@ -143,6 +146,93 @@ cfg_load_pipe(struct rte_cfgfile *cfg, struct
 rte_sched_pipe_params *pipe_params  }
 
 int
+cfg_load_subport_profile(struct rte_cfgfile *cfg,
+	struct rte_sched_subport_profile_params *subport_profile) {
+	int i;
+	const char *entry;
+	int profiles;
+
+	if (!cfg || !subport_profile)
+		return -1;
+
+	profiles = rte_cfgfile_num_sections(cfg, "subport profile",
+					   sizeof("subport profile") - 1);
+	subport_params[0].n_pipe_profiles = profiles;
+
+	for (i = 0; i < profiles; i++) {
+		char sec_name[32];
+		snprintf(sec_name, sizeof(sec_name), "subport profile %d",
 i);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tb rate");
+		if (entry)
+			subport_profile[i].tb_rate = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tb size");
+		if (entry)
+			subport_profile[i].tb_size = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc period");
+		if (entry)
+			subport_profile[i].tc_period = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 0 rate");
+		if (entry)
+			subport_profile[i].tc_rate[0] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 1 rate");
+		if (entry)
+			subport_profile[i].tc_rate[1] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 2 rate");
+		if (entry)
+			subport_profile[i].tc_rate[2] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 3 rate");
+		if (entry)
+			subport_profile[i].tc_rate[3] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 4 rate");
+		if (entry)
+			subport_profile[i].tc_rate[4] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 5 rate");
+		if (entry)
+			subport_profile[i].tc_rate[5] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 6 rate");
+		if (entry)
+			subport_profile[i].tc_rate[6] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 7 rate");
+		if (entry)
+			subport_profile[i].tc_rate[7] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 8 rate");
+		if (entry)
+			subport_profile[i].tc_rate[8] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 9 rate");
+		if (entry)
+			subport_profile[i].tc_rate[9] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 10 rate");
+		if (entry)
+			subport_profile[i].tc_rate[10] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 11 rate");
+		if (entry)
+			subport_profile[i].tc_rate[11] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 12 rate");
+		if (entry)
+			subport_profile[i].tc_rate[12] = (uint64_t)atoi(entry);
+	}
+
+	return 0;
+}
+
+int
 cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params
 *subport_params)  {
 	const char *entry;
@@ -267,70 +357,6 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct

rte_sched_subport_params *subpo

examples/qos_sched/cfg_file.c +0 -1
 				}
 			}
 
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tb

rate");

examples/qos_sched/cfg_file.c +0 -2
-			if (entry)
-				subport_params[i].tb_rate =

(uint64_t)atoi(entry);

examples/qos_sched/cfg_file.c +0 -2
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tb

size");

examples/qos_sched/cfg_file.c +0 -2
-			if (entry)
-				subport_params[i].tb_size =

(uint64_t)atoi(entry);

examples/qos_sched/cfg_file.c +0 -2
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc

period");

examples/qos_sched/cfg_file.c +0 -2
-			if (entry)
-				subport_params[i].tc_period =

(uint64_t)atoi(entry);

examples/qos_sched/cfg_file.c +0 -2
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 0

rate");

examples/qos_sched/cfg_file.c +0 -2
-			if (entry)
-				subport_params[i].tc_rate[0] =

(uint64_t)atoi(entry);

examples/qos_sched/cfg_file.c +0 -2
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 1

rate");

examples/qos_sched/cfg_file.c +0 -2
-			if (entry)
-				subport_params[i].tc_rate[1] =

(uint64_t)atoi(entry);

examples/qos_sched/cfg_file.c +0 -2
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 2

rate");

examples/qos_sched/cfg_file.c +0 -2
-			if (entry)
-				subport_params[i].tc_rate[2] =

(uint64_t)atoi(entry);

examples/qos_sched/cfg_file.c +0 -2
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 3

rate");

examples/qos_sched/cfg_file.c +0 -2
-			if (entry)
-				subport_params[i].tc_rate[3] =

(uint64_t)atoi(entry);

examples/qos_sched/cfg_file.c +0 -2
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 4

rate");

examples/qos_sched/cfg_file.c +0 -2
-			if (entry)
-				subport_params[i].tc_rate[4] =

(uint64_t)atoi(entry);

examples/qos_sched/cfg_file.c +0 -2
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 5

rate");

examples/qos_sched/cfg_file.c +0 -2
-			if (entry)
-				subport_params[i].tc_rate[5] =

(uint64_t)atoi(entry);

examples/qos_sched/cfg_file.c +0 -2
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 6

rate");

examples/qos_sched/cfg_file.c +0 -2
-			if (entry)
-				subport_params[i].tc_rate[6] =

(uint64_t)atoi(entry);

examples/qos_sched/cfg_file.c +0 -2
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 7

rate");

examples/qos_sched/cfg_file.c +0 -2
-			if (entry)
-				subport_params[i].tc_rate[7] =

(uint64_t)atoi(entry);

examples/qos_sched/cfg_file.c +0 -2
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 8

rate");

examples/qos_sched/cfg_file.c +0 -2
-			if (entry)
-				subport_params[i].tc_rate[8] =

(uint64_t)atoi(entry);

examples/qos_sched/cfg_file.c +0 -2
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 9

rate");

examples/qos_sched/cfg_file.c +0 -2
-			if (entry)
-				subport_params[i].tc_rate[9] =

(uint64_t)atoi(entry);

examples/qos_sched/cfg_file.c +0 -2
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 10

rate");

examples/qos_sched/cfg_file.c +0 -2
-			if (entry)
-				subport_params[i].tc_rate[10] =

(uint64_t)atoi(entry);

examples/qos_sched/cfg_file.c +0 -2
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 11

rate");

examples/qos_sched/cfg_file.c +0 -2
-			if (entry)
-				subport_params[i].tc_rate[11] =

(uint64_t)atoi(entry);

examples/qos_sched/cfg_file.c +0 -2
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 12

rate");

examples/qos_sched/cfg_file.c +0 -2
-			if (entry)
-				subport_params[i].tc_rate[12] =

(uint64_t)atoi(entry);

examples/qos_sched/cfg_file.c +0 -1
-
 			int n_entries = rte_cfgfile_section_num_entries(cfg,

sec_name);

examples/qos_sched/cfg_file.c +0 -0
 			struct rte_cfgfile_entry entries[n_entries];
examples/qos_sched/cfg_file.h +4 -0
index 2eccf1c..0dc458a 100644
@@ -14,4 +14,8 @@ int cfg_load_pipe(struct rte_cfgfile *cfg, struct
 rte_sched_pipe_params *pipe);
 
 int cfg_load_subport(struct rte_cfgfile *cfg, struct
 rte_sched_subport_params *subport);
 
+int cfg_load_subport_profile(struct rte_cfgfile *cfg,
+			     struct rte_sched_subport_profile_params
+			     *subport_profile);
+
 #endif
examples/qos_sched/init.c index renamed from examples/qos_sched/init.c +0 -0

9626c15..541adb7 100644

examples/qos_sched/init.c +6 -2
@@ -196,15 +196,20 @@ static struct rte_sched_pipe_params
 pipe_profiles[MAX_SCHED_PIPE_PROFILES] = {
 	},
 };
 
-struct rte_sched_subport_params
 subport_params[MAX_SCHED_SUBPORTS] = {
+static struct rte_sched_subport_profile_params
+		subport_profile[MAX_SCHED_SUBPORT_PROFILES] = {
 	{
 		.tb_rate = 1250000000,
 		.tb_size = 1000000,
-
 		.tc_rate = {1250000000, 1250000000, 1250000000,
 1250000000,
 			1250000000, 1250000000, 1250000000, 1250000000,
 1250000000,
 			1250000000, 1250000000, 1250000000, 1250000000},
 		.tc_period = 10,
+	},
+};
+
+struct rte_sched_subport_params

subport_params[MAX_SCHED_SUBPORTS] = {

examples/qos_sched/init.c +14 -2
+	{
 		.n_pipes_per_subport_enabled = 4096,
 		.qsize = {64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64},
 		.pipe_profiles = pipe_profiles,
@@ -289,6 +294,9 @@ struct rte_sched_port_params port_params = {
 	.mtu = 6 + 6 + 4 + 4 + 2 + 1500,
 	.frame_overhead = RTE_SCHED_FRAME_OVERHEAD_DEFAULT,
 	.n_subports_per_port = 1,
+	.n_subport_profiles = 1,
+	.subport_profiles = subport_profile,
+	.n_max_subport_profiles = MAX_SCHED_SUBPORT_PROFILES,
 	.n_pipes_per_subport = MAX_SCHED_PIPES,  };
 
@@ -320,8 +328,15 @@ app_init_sched_port(uint32_t portid, uint32_t
 socketid)
 	for (subport = 0; subport < port_params.n_subports_per_port;
 subport ++) {
 		err = rte_sched_subport_config(port, subport,
 &subport_params[subport]);
 		if (err) {
-			rte_exit(EXIT_FAILURE, "Unable to config sched
 subport %u, err=%d\n",
-					subport, err);
+			rte_exit(EXIT_FAILURE, "Unable to config schedi "
+				"subport %u, err=%d\n", subport, err);
+		}
+
+		err = rte_sched_subport_profile_config(port, subport, 0);
+		if (err) {
+			rte_exit(EXIT_FAILURE, "failed to configure "
+				"profile err=%d\n", err);
+
 		}
 
 		uint32_t n_pipes_per_subport =
@@ -354,6 +369,7 @@ app_load_cfg_profile(const char *profile)
 
 	cfg_load_port(file, &port_params);
 	cfg_load_subport(file, subport_params);
+	cfg_load_subport_profile(file, subport_profile);
 	cfg_load_pipe(file, pipe_profiles);
 
 	rte_cfgfile_close(file);
examples/qos_sched/main.h +1 -0
index 23bc418..0d6815a 100644
@@ -51,6 +51,7 @@ extern "C" {
 #define MAX_SCHED_SUBPORTS		8
 #define MAX_SCHED_PIPES		4096
 #define MAX_SCHED_PIPE_PROFILES		256
+#define MAX_SCHED_SUBPORT_PROFILES	8
 
 #ifndef APP_COLLECT_STAT
 #define APP_COLLECT_STAT		1
(quoted diff) +0 -0

b/examples/qos_sched/profile.cfg index 61b8b70..4486d27 100644

examples/qos_sched/profile.cfg +0 -0
@@ -26,6 +26,9 @@ number of subports per port = 1  number of pipes per

subport = 4096 queue sizes = 64 64 64 64 64 64 64 64 64 64 64 64 64

+subport 0-8 = 0 ; These subports are configured with subport profile
0
+
+[subport profile 0]
tb rate = 1250000000 ; Bytes per second
tb size = 1000000 ; Bytes

Quoted 2 lines

--
2.7.4

+ Cristian

#101 lore raw

PATCH 1/4 example/qos_sched: subport bandwidth dynmaic conf

In reply to Savinay Dharmappa

qos sched application uses the new apis introduced as part of dynamic configuration of subport bandwidth to configure the deafult subport bandwidth profile while buidling the hirerachical scheduler.

---
 examples/qos_sched/cfg_file.c  | 158 ++++++++++++++++++++++++-----------------
 examples/qos_sched/cfg_file.h  |   4 ++
 examples/qos_sched/init.c      |  24 +++++--
 examples/qos_sched/main.h      |   1 +
 examples/qos_sched/profile.cfg |   3 +
 5 files changed, 120 insertions(+), 70 deletions(-)
examples/qos_sched/cfg_file.c +92 -66
index f078e4f..9e1341c 100644
@@ -53,8 +53,11 @@ cfg_load_pipe(struct rte_cfgfile *cfg, struct rte_sched_pipe_params *pipe_params
 	if (!cfg || !pipe_params)
 		return -1;
 
-	profiles = rte_cfgfile_num_sections(cfg, "pipe profile", sizeof("pipe profile") - 1);
-	subport_params[0].n_pipe_profiles = profiles;
+	profiles = rte_cfgfile_num_sections(cfg, "pipe profile",
+					sizeof("pipe profile") - 1);
+	port_params.n_subport_profiles = profiles;
+
+	printf(" profiles = %d", profiles);
 
 	for (j = 0; j < profiles; j++) {
 		char pipe_name[32];
@@ -143,6 +146,93 @@ cfg_load_pipe(struct rte_cfgfile *cfg, struct rte_sched_pipe_params *pipe_params
 }
 
 int
+cfg_load_subport_profile(struct rte_cfgfile *cfg,
+	struct rte_sched_subport_profile_params *subport_profile)
+{
+	int i;
+	const char *entry;
+	int profiles;
+
+	if (!cfg || !subport_profile)
+		return -1;
+
+	profiles = rte_cfgfile_num_sections(cfg, "subport profile",
+					   sizeof("subport profile") - 1);
+	subport_params[0].n_pipe_profiles = profiles;
+
+	for (i = 0; i < profiles; i++) {
+		char sec_name[32];
+		snprintf(sec_name, sizeof(sec_name), "subport profile %d", i);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tb rate");
+		if (entry)
+			subport_profile[i].tb_rate = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tb size");
+		if (entry)
+			subport_profile[i].tb_size = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc period");
+		if (entry)
+			subport_profile[i].tc_period = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 0 rate");
+		if (entry)
+			subport_profile[i].tc_rate[0] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 1 rate");
+		if (entry)
+			subport_profile[i].tc_rate[1] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 2 rate");
+		if (entry)
+			subport_profile[i].tc_rate[2] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 3 rate");
+		if (entry)
+			subport_profile[i].tc_rate[3] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 4 rate");
+		if (entry)
+			subport_profile[i].tc_rate[4] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 5 rate");
+		if (entry)
+			subport_profile[i].tc_rate[5] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 6 rate");
+		if (entry)
+			subport_profile[i].tc_rate[6] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 7 rate");
+		if (entry)
+			subport_profile[i].tc_rate[7] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 8 rate");
+		if (entry)
+			subport_profile[i].tc_rate[8] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 9 rate");
+		if (entry)
+			subport_profile[i].tc_rate[9] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 10 rate");
+		if (entry)
+			subport_profile[i].tc_rate[10] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 11 rate");
+		if (entry)
+			subport_profile[i].tc_rate[11] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 12 rate");
+		if (entry)
+			subport_profile[i].tc_rate[12] = (uint64_t)atoi(entry);
+	}
+
+	return 0;
+}
+
+int
 cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subport_params)
 {
 	const char *entry;
@@ -267,70 +357,6 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo
 				}
 			}
 
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tb rate");
-			if (entry)
-				subport_params[i].tb_rate = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tb size");
-			if (entry)
-				subport_params[i].tb_size = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc period");
-			if (entry)
-				subport_params[i].tc_period = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 0 rate");
-			if (entry)
-				subport_params[i].tc_rate[0] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 1 rate");
-			if (entry)
-				subport_params[i].tc_rate[1] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 2 rate");
-			if (entry)
-				subport_params[i].tc_rate[2] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 3 rate");
-			if (entry)
-				subport_params[i].tc_rate[3] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 4 rate");
-			if (entry)
-				subport_params[i].tc_rate[4] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 5 rate");
-			if (entry)
-				subport_params[i].tc_rate[5] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 6 rate");
-			if (entry)
-				subport_params[i].tc_rate[6] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 7 rate");
-			if (entry)
-				subport_params[i].tc_rate[7] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 8 rate");
-			if (entry)
-				subport_params[i].tc_rate[8] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 9 rate");
-			if (entry)
-				subport_params[i].tc_rate[9] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 10 rate");
-			if (entry)
-				subport_params[i].tc_rate[10] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 11 rate");
-			if (entry)
-				subport_params[i].tc_rate[11] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 12 rate");
-			if (entry)
-				subport_params[i].tc_rate[12] = (uint64_t)atoi(entry);
-
 			int n_entries = rte_cfgfile_section_num_entries(cfg, sec_name);
 			struct rte_cfgfile_entry entries[n_entries];
 
examples/qos_sched/cfg_file.h +4 -0
index 2eccf1c..0dc458a 100644
@@ -14,4 +14,8 @@ int cfg_load_pipe(struct rte_cfgfile *cfg, struct rte_sched_pipe_params *pipe);
 
 int cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subport);
 
+int cfg_load_subport_profile(struct rte_cfgfile *cfg,
+			     struct rte_sched_subport_profile_params
+			     *subport_profile);
+
 #endif
examples/qos_sched/init.c +20 -4
index 9626c15..541adb7 100644
@@ -196,15 +196,20 @@ static struct rte_sched_pipe_params pipe_profiles[MAX_SCHED_PIPE_PROFILES] = {
 	},
 };
 
-struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = {
+static struct rte_sched_subport_profile_params
+		subport_profile[MAX_SCHED_SUBPORT_PROFILES] = {
 	{
 		.tb_rate = 1250000000,
 		.tb_size = 1000000,
-
 		.tc_rate = {1250000000, 1250000000, 1250000000, 1250000000,
 			1250000000, 1250000000, 1250000000, 1250000000, 1250000000,
 			1250000000, 1250000000, 1250000000, 1250000000},
 		.tc_period = 10,
+	},
+};
+
+struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = {
+	{
 		.n_pipes_per_subport_enabled = 4096,
 		.qsize = {64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64},
 		.pipe_profiles = pipe_profiles,
@@ -289,6 +294,9 @@ struct rte_sched_port_params port_params = {
 	.mtu = 6 + 6 + 4 + 4 + 2 + 1500,
 	.frame_overhead = RTE_SCHED_FRAME_OVERHEAD_DEFAULT,
 	.n_subports_per_port = 1,
+	.n_subport_profiles = 1,
+	.subport_profiles = subport_profile,
+	.n_max_subport_profiles = MAX_SCHED_SUBPORT_PROFILES,
 	.n_pipes_per_subport = MAX_SCHED_PIPES,
 };
 
@@ -320,8 +328,15 @@ app_init_sched_port(uint32_t portid, uint32_t socketid)
 	for (subport = 0; subport < port_params.n_subports_per_port; subport ++) {
 		err = rte_sched_subport_config(port, subport, &subport_params[subport]);
 		if (err) {
-			rte_exit(EXIT_FAILURE, "Unable to config sched subport %u, err=%d\n",
-					subport, err);
+			rte_exit(EXIT_FAILURE, "Unable to config schedi "
+				"subport %u, err=%d\n", subport, err);
+		}
+
+		err = rte_sched_subport_profile_config(port, subport, 0);
+		if (err) {
+			rte_exit(EXIT_FAILURE, "failed to configure "
+				"profile err=%d\n", err);
+
 		}
 
 		uint32_t n_pipes_per_subport =
@@ -354,6 +369,7 @@ app_load_cfg_profile(const char *profile)
 
 	cfg_load_port(file, &port_params);
 	cfg_load_subport(file, subport_params);
+	cfg_load_subport_profile(file, subport_profile);
 	cfg_load_pipe(file, pipe_profiles);
 
 	rte_cfgfile_close(file);
examples/qos_sched/main.h +1 -0
index 23bc418..0d6815a 100644
@@ -51,6 +51,7 @@ extern "C" {
 #define MAX_SCHED_SUBPORTS		8
 #define MAX_SCHED_PIPES		4096
 #define MAX_SCHED_PIPE_PROFILES		256
+#define MAX_SCHED_SUBPORT_PROFILES	8
 
 #ifndef APP_COLLECT_STAT
 #define APP_COLLECT_STAT		1
examples/qos_sched/profile.cfg +3 -0
index 61b8b70..4486d27 100644
@@ -26,6 +26,9 @@ number of subports per port = 1
 number of pipes per subport = 4096
 queue sizes = 64 64 64 64 64 64 64 64 64 64 64 64 64
 
+subport 0-8 = 0                ; These subports are configured with subport profile 0
+
+[subport profile 0]
 tb rate = 1250000000           ; Bytes per second
 tb size = 1000000              ; Bytes
 
Signature · 1 line
2.7.4
#102 lore raw

PATCH 2/4 example/ip_pipeline: subport bandwidth dynmaic conf

ip_pipeline application uses the new apis introduced as part of dynamic configuration of subport bandwidth to configure the deafult subport bandwidth profile while buidling the hirerachical scheduler

---
 examples/ip_pipeline/cli.c  | 10 ++++++----
 examples/ip_pipeline/tmgr.c | 28 +++++++++++++++++++++++++---
 examples/ip_pipeline/tmgr.h |  3 ++-
 3 files changed, 33 insertions(+), 8 deletions(-)
examples/ip_pipeline/cli.c +6 -4
index d79699e..e192275 100644
@@ -406,7 +406,8 @@ cmd_tmgr_subport_profile(char **tokens,
 	char *out,
 	size_t out_size)
 {
-	struct rte_sched_subport_params p;
+	struct rte_sched_subport_params params;
+	struct rte_sched_subport_profile_params p;
 	int status, i;
 
 	if (n_tokens != 35) {
@@ -440,7 +441,8 @@ cmd_tmgr_subport_profile(char **tokens,
 		return;
 	}
 
-	if (parser_read_uint32(&p.n_pipes_per_subport_enabled, tokens[20]) != 0) {
+	if (parser_read_uint32(&params.n_pipes_per_subport_enabled,
+		tokens[20]) != 0) {
 		snprintf(out, out_size, MSG_ARG_INVALID, "n_pipes_per_subport");
 		return;
 	}
@@ -451,12 +453,12 @@ cmd_tmgr_subport_profile(char **tokens,
 	}
 
 	for (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++)
-		if (parser_read_uint16(&p.qsize[i], tokens[22 + i]) != 0) {
+		if (parser_read_uint16(&params.qsize[i], tokens[22 + i]) != 0) {
 			snprintf(out, out_size, MSG_ARG_INVALID, "qsize");
 			return;
 		}
 
-	status = tmgr_subport_profile_add(&p);
+	status = tmgr_subport_profile_add(&p, &params);
 	if (status != 0) {
 		snprintf(out, out_size, MSG_CMD_FAIL, tokens[0]);
 		return;
examples/ip_pipeline/tmgr.c +25 -3
index 91ccbf6..c609102 100644
@@ -11,6 +11,9 @@
 static struct rte_sched_subport_params
 	subport_profile[TMGR_SUBPORT_PROFILE_MAX];
 
+static struct rte_sched_subport_profile_params
+		profile_params[TMGR_SUBPORT_PROFILE_MAX];
+
 static uint32_t n_subport_profiles;
 
 static struct rte_sched_pipe_params
@@ -44,15 +47,20 @@ tmgr_port_find(const char *name)
 }
 
 int
-tmgr_subport_profile_add(struct rte_sched_subport_params *p)
+tmgr_subport_profile_add(struct rte_sched_subport_profile_params *p,
+			 struct rte_sched_subport_params *params)
 {
 	/* Check input params */
-	if (p == NULL ||
-		p->n_pipes_per_subport_enabled == 0)
+	if (p == NULL || params == NULL ||
+		params->n_pipes_per_subport_enabled == 0)
 		return -1;
 
 	/* Save profile */
 	memcpy(&subport_profile[n_subport_profiles],
+		params,
+		sizeof(*params));
+
+	memcpy(&profile_params[n_subport_profiles],
 		p,
 		sizeof(*p));
 
@@ -103,6 +111,9 @@ tmgr_port_create(const char *name, struct tmgr_port_params *params)
 	p.mtu = params->mtu;
 	p.frame_overhead = params->frame_overhead;
 	p.n_subports_per_port = params->n_subports_per_port;
+	p.n_subport_profiles = n_subport_profiles;
+	p.subport_profiles = profile_params;
+	p.n_max_subport_profiles = TMGR_SUBPORT_PROFILE_MAX;
 	p.n_pipes_per_subport = TMGR_PIPE_SUBPORT_MAX;
 
 	s = rte_sched_port_config(&p);
@@ -126,6 +137,13 @@ tmgr_port_create(const char *name, struct tmgr_port_params *params)
 			return NULL;
 		}
 
+		status = rte_sched_subport_profile_config(s, i, 0);
+
+		if (status) {
+			rte_sched_port_free(s);
+			return NULL;
+		}
+
 		for (j = 0; j < subport_profile[0].n_pipes_per_subport_enabled; j++) {
 			status = rte_sched_pipe_config(
 				s,
@@ -182,6 +200,10 @@ tmgr_subport_config(const char *port_name,
 		subport_id,
 		&subport_profile[subport_profile_id]);
 
+	if (!status)
+		status = rte_sched_subport_profile_config(port->s, subport_id,
+							subport_profile_id);
+
 	return status;
 }
 
examples/ip_pipeline/tmgr.h +2 -1
index ee50cf7..b19fb23 100644
@@ -48,7 +48,8 @@ struct tmgr_port_params {
 };
 
 int
-tmgr_subport_profile_add(struct rte_sched_subport_params *p);
+tmgr_subport_profile_add(struct rte_sched_subport_profile_params *p,
+			 struct rte_sched_subport_params *params);
 
 int
 tmgr_pipe_profile_add(struct rte_sched_pipe_params *p);
Signature · 1 line
2.7.4
#103 lore raw

PATCH 3/4 drivers/softnic: subport bandwidth profile config

In reply to Savinay Dharmappa

softnic driver uses the new apis introduced as part of dynamic configuration of subport bandwidth to configure the deafult subport bandwidth profile while buidling the hirerachical scheduler.

---
 drivers/net/softnic/rte_eth_softnic_internals.h |   9 +
 drivers/net/softnic/rte_eth_softnic_tm.c        | 222 +++++++++++++++++++-----
 2 files changed, 186 insertions(+), 45 deletions(-)
drivers/net/softnic/rte_eth_softnic_internals.h +9 -0
index 6eec43b..cc50037 100644
@@ -164,10 +164,19 @@ TAILQ_HEAD(softnic_link_list, softnic_link);
 #ifndef TM_MAX_PIPE_PROFILE
 #define TM_MAX_PIPE_PROFILE				256
 #endif
+
+#ifndef TM_MAX_SUBPORT_PROFILE
+#define TM_MAX_SUBPORT_PROFILE				256
+#endif
+
 struct tm_params {
 	struct rte_sched_port_params port_params;
 
 	struct rte_sched_subport_params subport_params[TM_MAX_SUBPORTS];
+	struct rte_sched_subport_profile_params
+				subport_profiles[TM_MAX_SUBPORT_PROFILE];
+	uint32_t n_subport_profiles;
+	uint32_t subport_to_profile[TM_MAX_SUBPORT_PROFILE];
 
 	struct rte_sched_pipe_params pipe_profiles[TM_MAX_PIPE_PROFILE];
 	uint32_t n_pipe_profiles;
drivers/net/softnic/rte_eth_softnic_tm.c +177 -45

300 lines not on this page · raw message

Signature · 1 line
2.7.4
#104 lore raw

PATCH 4/4 app/test_sched: subport bandwidth profile config

In reply to Savinay Dharmappa

test_sched application uses the new apis introduced as part of dynamic configuration of subport bandwidth to configure the deafult subport bandwidth profile while buidling the hirerachical scheduler

---
 app/test/test_sched.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
app/test/test_sched.c +14 -2
index fc31080..99d7f87 100644
@@ -36,15 +36,20 @@ static struct rte_sched_pipe_params pipe_profile[] = {
 	},
 };
 
-static struct rte_sched_subport_params subport_param[] = {
+static struct rte_sched_subport_profile_params
+		subport_profile[] = {
 	{
 		.tb_rate = 1250000000,
 		.tb_size = 1000000,
-
 		.tc_rate = {1250000000, 1250000000, 1250000000, 1250000000,
 			1250000000, 1250000000, 1250000000, 1250000000, 1250000000,
 			1250000000, 1250000000, 1250000000, 1250000000},
 		.tc_period = 10,
+	},
+};
+
+static struct rte_sched_subport_params subport_param[] = {
+	{
 		.n_pipes_per_subport_enabled = 1024,
 		.qsize = {32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32},
 		.pipe_profiles = pipe_profile,
@@ -59,6 +64,8 @@ static struct rte_sched_port_params port_param = {
 	.mtu = 1522,
 	.frame_overhead = RTE_SCHED_FRAME_OVERHEAD_DEFAULT,
 	.n_subports_per_port = 1,
+	.n_subport_profiles = 1,
+	.subport_profiles = subport_profile,
 	.n_pipes_per_subport = 1024,
 };
 
@@ -66,6 +73,7 @@ static struct rte_sched_port_params port_param = {
 #define MBUF_DATA_SZ     (2048 + RTE_PKTMBUF_HEADROOM)
 #define MEMPOOL_CACHE_SZ 0
 #define SOCKET           0
+#define DEFAULT_PROFILE  0
 
 
 static struct rte_mempool *
@@ -141,6 +149,10 @@ test_sched(void)
 	err = rte_sched_subport_config(port, SUBPORT, subport_param);
 	TEST_ASSERT_SUCCESS(err, "Error config sched, err=%d\n", err);
 
+	err = rte_sched_subport_profile_config(port, SUBPORT,
+						DEFAULT_PROFILE);
+	TEST_ASSERT_SUCCESS(err, "Error config sched, err=%d\n", err);
+
 	for (pipe = 0; pipe < subport_param[0].n_pipes_per_subport_enabled; pipe++) {
 		err = rte_sched_pipe_config(port, SUBPORT, pipe, 0);
 		TEST_ASSERT_SUCCESS(err, "Error config sched pipe %u, err=%d\n", pipe, err);
Signature · 1 line
2.7.4
#105 lore raw

Re: [dpdk-dev] [PATCH v1 1/4] example/qos_sched: subport bandwidth dynmaic conf

In reply to Savinay Dharmappa

Self NACK the patch. As I would like to merge the application series changes of patch with previous sent library changes patches series and have single patch series.

Regards
savinay

-----Original Message-----
From: Dharmappa, Savinay <[email protected]>
Sent: Wednesday, September 2, 2020 2:37 PM
To: Dumitrescu, Cristian <[email protected]>; Singh, Jasvinder <[email protected]>; [email protected]
Cc: Dharmappa, Savinay <[email protected]>
Subject: [PATCH v1 1/4] example/qos_sched: subport bandwidth dynmaic conf

qos sched application uses the new apis introduced as part of dynamic configuration of subport bandwidth to configure the deafult subport bandwidth profile while buidling the hirerachical scheduler.

---
 examples/qos_sched/cfg_file.c  | 158 ++++++++++++++++++++++++-----------------
 examples/qos_sched/cfg_file.h  |   4 ++
 examples/qos_sched/init.c      |  24 +++++--
 examples/qos_sched/main.h      |   1 +
 examples/qos_sched/profile.cfg |   3 +
 5 files changed, 120 insertions(+), 70 deletions(-)
examples/qos_sched/cfg_file.c +91 -66
@@ -53,8 +53,11 @@ cfg_load_pipe(struct rte_cfgfile *cfg, struct rte_sched_pipe_params *pipe_params
 	if (!cfg || !pipe_params)
 		return -1;
 
-	profiles = rte_cfgfile_num_sections(cfg, "pipe profile", sizeof("pipe profile") - 1);
-	subport_params[0].n_pipe_profiles = profiles;
+	profiles = rte_cfgfile_num_sections(cfg, "pipe profile",
+					sizeof("pipe profile") - 1);
+	port_params.n_subport_profiles = profiles;
+
+	printf(" profiles = %d", profiles);
 
 	for (j = 0; j < profiles; j++) {
 		char pipe_name[32];
@@ -143,6 +146,93 @@ cfg_load_pipe(struct rte_cfgfile *cfg, struct rte_sched_pipe_params *pipe_params  }
 
 int
+cfg_load_subport_profile(struct rte_cfgfile *cfg,
+	struct rte_sched_subport_profile_params *subport_profile) {
+	int i;
+	const char *entry;
+	int profiles;
+
+	if (!cfg || !subport_profile)
+		return -1;
+
+	profiles = rte_cfgfile_num_sections(cfg, "subport profile",
+					   sizeof("subport profile") - 1);
+	subport_params[0].n_pipe_profiles = profiles;
+
+	for (i = 0; i < profiles; i++) {
+		char sec_name[32];
+		snprintf(sec_name, sizeof(sec_name), "subport profile %d", i);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tb rate");
+		if (entry)
+			subport_profile[i].tb_rate = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tb size");
+		if (entry)
+			subport_profile[i].tb_size = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc period");
+		if (entry)
+			subport_profile[i].tc_period = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 0 rate");
+		if (entry)
+			subport_profile[i].tc_rate[0] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 1 rate");
+		if (entry)
+			subport_profile[i].tc_rate[1] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 2 rate");
+		if (entry)
+			subport_profile[i].tc_rate[2] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 3 rate");
+		if (entry)
+			subport_profile[i].tc_rate[3] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 4 rate");
+		if (entry)
+			subport_profile[i].tc_rate[4] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 5 rate");
+		if (entry)
+			subport_profile[i].tc_rate[5] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 6 rate");
+		if (entry)
+			subport_profile[i].tc_rate[6] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 7 rate");
+		if (entry)
+			subport_profile[i].tc_rate[7] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 8 rate");
+		if (entry)
+			subport_profile[i].tc_rate[8] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 9 rate");
+		if (entry)
+			subport_profile[i].tc_rate[9] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 10 rate");
+		if (entry)
+			subport_profile[i].tc_rate[10] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 11 rate");
+		if (entry)
+			subport_profile[i].tc_rate[11] = (uint64_t)atoi(entry);
+
+		entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 12 rate");
+		if (entry)
+			subport_profile[i].tc_rate[12] = (uint64_t)atoi(entry);
+	}
+
+	return 0;
+}
+
+int
 cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subport_params)  {
 	const char *entry;
@@ -267,70 +357,6 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo
 				}
 			}
 
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tb rate");
-			if (entry)
-				subport_params[i].tb_rate = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tb size");
-			if (entry)
-				subport_params[i].tb_size = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc period");
-			if (entry)
-				subport_params[i].tc_period = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 0 rate");
-			if (entry)
-				subport_params[i].tc_rate[0] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 1 rate");
-			if (entry)
-				subport_params[i].tc_rate[1] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 2 rate");
-			if (entry)
-				subport_params[i].tc_rate[2] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 3 rate");
-			if (entry)
-				subport_params[i].tc_rate[3] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 4 rate");
-			if (entry)
-				subport_params[i].tc_rate[4] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 5 rate");
-			if (entry)
-				subport_params[i].tc_rate[5] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 6 rate");
-			if (entry)
-				subport_params[i].tc_rate[6] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 7 rate");
-			if (entry)
-				subport_params[i].tc_rate[7] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 8 rate");
-			if (entry)
-				subport_params[i].tc_rate[8] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 9 rate");
-			if (entry)
-				subport_params[i].tc_rate[9] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 10 rate");
-			if (entry)
-				subport_params[i].tc_rate[10] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 11 rate");
-			if (entry)
-				subport_params[i].tc_rate[11] = (uint64_t)atoi(entry);
-
-			entry = rte_cfgfile_get_entry(cfg, sec_name, "tc 12 rate");
-			if (entry)
-				subport_params[i].tc_rate[12] = (uint64_t)atoi(entry);
-
 			int n_entries = rte_cfgfile_section_num_entries(cfg, sec_name);
 			struct rte_cfgfile_entry entries[n_entries];
 
examples/qos_sched/cfg_file.h +4 -0
@@ -14,4 +14,8 @@ int cfg_load_pipe(struct rte_cfgfile *cfg, struct rte_sched_pipe_params *pipe);
 
 int cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subport);
 
+int cfg_load_subport_profile(struct rte_cfgfile *cfg,
+			     struct rte_sched_subport_profile_params
+			     *subport_profile);
+
 #endif
examples/qos_sched/init.c +20 -4
@@ -196,15 +196,20 @@ static struct rte_sched_pipe_params pipe_profiles[MAX_SCHED_PIPE_PROFILES] = {
 	},
 };
 
-struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = {
+static struct rte_sched_subport_profile_params
+		subport_profile[MAX_SCHED_SUBPORT_PROFILES] = {
 	{
 		.tb_rate = 1250000000,
 		.tb_size = 1000000,
-
 		.tc_rate = {1250000000, 1250000000, 1250000000, 1250000000,
 			1250000000, 1250000000, 1250000000, 1250000000, 1250000000,
 			1250000000, 1250000000, 1250000000, 1250000000},
 		.tc_period = 10,
+	},
+};
+
+struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = {
+	{
 		.n_pipes_per_subport_enabled = 4096,
 		.qsize = {64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64},
 		.pipe_profiles = pipe_profiles,
@@ -289,6 +294,9 @@ struct rte_sched_port_params port_params = {
 	.mtu = 6 + 6 + 4 + 4 + 2 + 1500,
 	.frame_overhead = RTE_SCHED_FRAME_OVERHEAD_DEFAULT,
 	.n_subports_per_port = 1,
+	.n_subport_profiles = 1,
+	.subport_profiles = subport_profile,
+	.n_max_subport_profiles = MAX_SCHED_SUBPORT_PROFILES,
 	.n_pipes_per_subport = MAX_SCHED_PIPES,  };
 
@@ -320,8 +328,15 @@ app_init_sched_port(uint32_t portid, uint32_t socketid)
 	for (subport = 0; subport < port_params.n_subports_per_port; subport ++) {
 		err = rte_sched_subport_config(port, subport, &subport_params[subport]);
 		if (err) {
-			rte_exit(EXIT_FAILURE, "Unable to config sched subport %u, err=%d\n",
-					subport, err);
+			rte_exit(EXIT_FAILURE, "Unable to config schedi "
+				"subport %u, err=%d\n", subport, err);
+		}
+
+		err = rte_sched_subport_profile_config(port, subport, 0);
+		if (err) {
+			rte_exit(EXIT_FAILURE, "failed to configure "
+				"profile err=%d\n", err);
+
 		}
 
 		uint32_t n_pipes_per_subport =
@@ -354,6 +369,7 @@ app_load_cfg_profile(const char *profile)
 
 	cfg_load_port(file, &port_params);
 	cfg_load_subport(file, subport_params);
+	cfg_load_subport_profile(file, subport_profile);
 	cfg_load_pipe(file, pipe_profiles);
 
 	rte_cfgfile_close(file);
examples/qos_sched/main.h +1 -0
@@ -51,6 +51,7 @@ extern "C" {
 #define MAX_SCHED_SUBPORTS		8
 #define MAX_SCHED_PIPES		4096
 #define MAX_SCHED_PIPE_PROFILES		256
+#define MAX_SCHED_SUBPORT_PROFILES	8
 
 #ifndef APP_COLLECT_STAT
 #define APP_COLLECT_STAT		1
examples/qos_sched/profile.cfg +3 -1
@@ -26,6 +26,9 @@ number of subports per port = 1  number of pipes per subport = 4096  queue sizes = 64 64 64 64 64 64 64 64 64 64 64 64 64
 
+subport 0-8 = 0                ; These subports are configured with subport profile 0
+
+[subport profile 0]
 tb rate = 1250000000           ; Bytes per second
 tb size = 1000000              ; Bytes
 
--

2.7.4

#106 lore raw
In reply to Savinay Dharmappa
Quoted 47 lines

-----Original Message-----
From: Dharmappa, Savinay <[email protected]>
Sent: Wednesday, July 15, 2020 7:28 PM
To: Dharmappa, Savinay <[email protected]>; Singh, Jasvinder <[email protected]>; [email protected]
Subject: [RFC PATCH 0/2] Enable dyynamic configuration of subport bandwidth profile

DPDK sched library allows runtime configuration of the pipe profiles to the pipes of the subport once scheduler hierarchy is constructed. However, to change the subport level bandwidth, existing hierarchy needs to be dismantled and whole process of building hierarchy under subport nodes needs to be repeated which might result in router downtime. Furthermore, due to lack of dynamic configuration of the subport bandwidth profile configuration (shaper and Traffic class rates), the user application is unable to dynamically re-distribute the excess-bandwidth of one subport among other subports in the scheduler hierarchy. Therefore, it is also not possible to adjust the subport bandwidth profile in sync with dynamic changes in pipe profiles of subscribers who want to consume higher bandwidth opportunistically.

This RFC proposes dynamic configuration of the subport bandwidth profile to overcome the runtime situation when group of subscribers are not using the allotted bandwidth and dynamic bandwidth re-distribution is needed the without making any structural changes in the hierarchy.

The implementation work includes refactoring the existing data structures defined for port and subport level, new APIs for adding subport level bandwidth profiles that can be used in runtime which causes API/ABI change. Therefore, deprecation notice will be sent out soon.

Savinay Dharmappa (2):
sched: add dynamic config of subport bandwidth profile example/qos_sched: subport bandwidth dynmaic conf

 examples/qos_sched/cfg_file.c          | 158 ++++++-----
 examples/qos_sched/cfg_file.h          |   4 +
 examples/qos_sched/init.c              |  24 +-
 examples/qos_sched/main.h              |   1 +
 examples/qos_sched/profile.cfg         |   3 +
 lib/librte_sched/rte_sched.c           | 486 ++++++++++++++++++++++++---------
 lib/librte_sched/rte_sched.h           |  82 +++++-
 lib/librte_sched/rte_sched_version.map |   2 +
 8 files changed, 544 insertions(+), 216 deletions(-)
Quoted 2 lines

--
2.7.4

+ Cristian