Skip to contentSkip to conversation

Add PIE support for HQoS library

RFC PATCH In review Liguzinski, WojciechX 7 participants 178 messages May 24, 2021 – Nov 4, 2021 Page 2 of 2

Subsystems (2)
lore
Share & tools
lore
#103 lore raw

PATCH v15 1/5 sched: add PIE based congestion management

In reply to Liguzinski, WojciechX

Implement PIE based congestion management based on rfc8033

- Renamed WRED occurences to RED
- Applied __attribute__((unused)) to parameters in rte_sched_port_pie_dequeue()
- Moved rte_sched_cma_params structure before the first usage
- Added the release comment to version.map when new symbols are being introduced
- Removed the statement that RED is obsolete in cover letter

---
 drivers/net/softnic/rte_eth_softnic_tm.c |   6 +-
 lib/sched/meson.build                    |  10 +-
 lib/sched/rte_pie.c                      |  82 +++++
 lib/sched/rte_pie.h                      | 393 +++++++++++++++++++++++
 lib/sched/rte_sched.c                    | 241 +++++++++-----
 lib/sched/rte_sched.h                    |  63 +++-
 lib/sched/version.map                    |   4 +
 7 files changed, 703 insertions(+), 96 deletions(-)
 create mode 100644 lib/sched/rte_pie.c
 create mode 100644 lib/sched/rte_pie.h
drivers/net/softnic/rte_eth_softnic_tm.c +3 -3
index 90baba15ce..e74092ce7f 100644
@@ -420,7 +420,7 @@ pmd_tm_node_type_get(struct rte_eth_dev *dev,
 	return 0;
 }
 
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
 #define WRED_SUPPORTED						1
 #else
 #define WRED_SUPPORTED						0
@@ -2306,7 +2306,7 @@ tm_tc_wred_profile_get(struct rte_eth_dev *dev, uint32_t tc_id)
 	return NULL;
 }
 
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
 
 static void
 wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id)
@@ -2321,7 +2321,7 @@ wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id)
 	for (tc_id = 0; tc_id < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; tc_id++)
 		for (color = RTE_COLOR_GREEN; color < RTE_COLORS; color++) {
 			struct rte_red_params *dst =
-				&pp->red_params[tc_id][color];
+				&pp->cman_params->red_params[tc_id][color];
 			struct tm_wred_profile *src_wp =
 				tm_tc_wred_profile_get(dev, tc_id);
 			struct rte_tm_red_params *src =
lib/sched/meson.build +3 -7
index b24f7b8775..e7ae9bcf19 100644
@@ -1,11 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-sources = files('rte_sched.c', 'rte_red.c', 'rte_approx.c')
-headers = files(
-        'rte_approx.h',
-        'rte_red.h',
-        'rte_sched.h',
-        'rte_sched_common.h',
-)
+sources = files('rte_sched.c', 'rte_red.c', 'rte_approx.c', 'rte_pie.c')
+headers = files('rte_sched.h', 'rte_sched_common.h',
+		'rte_red.h', 'rte_approx.h', 'rte_pie.h')
 deps += ['mbuf', 'meter']
lib/sched/rte_pie.c new file +82 -0

82 lines not on this page · raw message

lib/sched/rte_pie.h new file +393 -0

393 lines not on this page · raw message

lib/sched/rte_sched.c +168 -73

359 lines not on this page · raw message

lib/sched/rte_sched.h +50 -13

100 lines not on this page · raw message

lib/sched/version.map +4 -0
index 53c337b143..ffa5f7b10d 100644
@@ -30,4 +30,8 @@ EXPERIMENTAL {
 	rte_sched_subport_pipe_profile_add;
 	# added in 20.11
 	rte_sched_port_subport_profile_add;
+
+	# added in 21.11
+	rte_pie_rt_data_init;
+	rte_pie_config_init;
 };
Signature · 1 line
2.25.1
#104 lore raw

PATCH v15 2/5 example/qos_sched: add PIE support

In reply to Liguzinski, WojciechX

patch add support enable PIE or RED by
parsing config file.

- Renamed WRED occurences to RED

---
 config/rte_config.h             |   1 -
 examples/qos_sched/app_thread.c |   1 -
 examples/qos_sched/cfg_file.c   | 127 +++++++++++++++------
 examples/qos_sched/cfg_file.h   |   5 +
 examples/qos_sched/init.c       |  27 +++--
 examples/qos_sched/main.h       |   3 +
 examples/qos_sched/profile.cfg  | 196 +++++++++++++++++++++-----------
 7 files changed, 250 insertions(+), 110 deletions(-)
config/rte_config.h +0 -1
index 590903c07d..48132f27df 100644
@@ -89,7 +89,6 @@
 #define RTE_MAX_LCORE_FREQS 64
 
 /* rte_sched defines */
-#undef RTE_SCHED_RED
 #undef RTE_SCHED_COLLECT_STATS
 #undef RTE_SCHED_SUBPORT_TC_OV
 #define RTE_SCHED_PORT_N_GRINDERS 8
examples/qos_sched/app_thread.c +0 -1
index dbc878b553..895c0d3592 100644
@@ -205,7 +205,6 @@ app_worker_thread(struct thread_conf **confs)
 		if (likely(nb_pkt)) {
 			int nb_sent = rte_sched_port_enqueue(conf->sched_port, mbufs,
 					nb_pkt);
-
 			APP_STATS_ADD(conf->stat.nb_drop, nb_pkt - nb_sent);
 			APP_STATS_ADD(conf->stat.nb_rx, nb_pkt);
 		}
examples/qos_sched/cfg_file.c +94 -33

193 lines not on this page · raw message

examples/qos_sched/cfg_file.h +5 -0
index 0dc458aa71..1a9dce9db5 100644
@@ -12,6 +12,11 @@ int cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port);
 
 int cfg_load_pipe(struct rte_cfgfile *cfg, struct rte_sched_pipe_params *pipe);
 
+#ifdef RTE_SCHED_CMAN
+void set_subport_cman_params(struct rte_sched_subport_params *subport_p,
+					struct rte_sched_cman_params cman_p);
+#endif
+
 int cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subport);
 
 int cfg_load_subport_profile(struct rte_cfgfile *cfg,
examples/qos_sched/init.c +17 -10
index 1abe003fc6..d151da5c2d 100644
@@ -204,15 +204,9 @@ static struct rte_sched_subport_profile_params
 	},
 };
 
-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,
-		.n_pipe_profiles = sizeof(pipe_profiles) /
-			sizeof(struct rte_sched_pipe_params),
-		.n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES,
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
+struct rte_sched_cman_params cman_params = {
+	.cman_mode = RTE_SCHED_CMAN_RED,
 	.red_params = {
 		/* Traffic Class 0 Colors Green / Yellow / Red */
 		[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
@@ -279,7 +273,20 @@ struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = {
 		[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
 		[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
 	},
-#endif /* RTE_SCHED_RED */
+};
+#endif /* RTE_SCHED_CMAN */
+
+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,
+		.n_pipe_profiles = sizeof(pipe_profiles) /
+			sizeof(struct rte_sched_pipe_params),
+		.n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES,
+#ifdef RTE_SCHED_CMAN
+		.cman_params = &cman_params,
+#endif /* RTE_SCHED_CMAN */
 	},
 };
 
examples/qos_sched/main.h +3 -0
index 0d6815ae69..915311bac8 100644
@@ -153,6 +153,9 @@ extern uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE];
 extern uint32_t n_active_queues;
 
 extern struct rte_sched_port_params port_params;
+#ifdef RTE_SCHED_CMAN
+extern struct rte_sched_cman_params cman_params;
+#endif
 extern struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS];
 
 int app_parse_args(int argc, char **argv);
examples/qos_sched/profile.cfg +131 -65

199 lines not on this page · raw message

Signature · 1 line
2.25.1
#105 lore raw

PATCH v15 3/5 example/ip_pipeline: add PIE support

In reply to Liguzinski, WojciechX

Adding the PIE support for IP Pipeline

---
 examples/ip_pipeline/tmgr.c | 142 +++++++++++++++++++-----------------
 1 file changed, 74 insertions(+), 68 deletions(-)
examples/ip_pipeline/tmgr.c +74 -68
index e4e364cbc0..b138e885cf 100644
@@ -17,6 +17,77 @@ static uint32_t n_subport_profiles;
 static struct rte_sched_pipe_params
 	pipe_profile[TMGR_PIPE_PROFILE_MAX];
 
+#ifdef RTE_SCHED_CMAN
+static struct rte_sched_cman_params cman_params = {
+	.red_params = {
+		/* Traffic Class 0 Colors Green / Yellow / Red */
+		[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[0][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[0][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 1 - Colors Green / Yellow / Red */
+		[1][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[1][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[1][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 2 - Colors Green / Yellow / Red */
+		[2][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[2][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[2][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 3 - Colors Green / Yellow / Red */
+		[3][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[3][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[3][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 4 - Colors Green / Yellow / Red */
+		[4][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[4][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[4][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 5 - Colors Green / Yellow / Red */
+		[5][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[5][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[5][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 6 - Colors Green / Yellow / Red */
+		[6][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[6][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[6][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 7 - Colors Green / Yellow / Red */
+		[7][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[7][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[7][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 8 - Colors Green / Yellow / Red */
+		[8][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[8][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[8][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 9 - Colors Green / Yellow / Red */
+		[9][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[9][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[9][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 10 - Colors Green / Yellow / Red */
+		[10][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[10][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[10][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 11 - Colors Green / Yellow / Red */
+		[11][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[11][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[11][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 12 - Colors Green / Yellow / Red */
+		[12][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		},
+};
+#endif /* RTE_SCHED_CMAN */
+
 static uint32_t n_pipe_profiles;
 
 static const struct rte_sched_subport_params subport_params_default = {
@@ -25,74 +96,9 @@ static const struct rte_sched_subport_params subport_params_default = {
 	.pipe_profiles = pipe_profile,
 	.n_pipe_profiles = 0, /* filled at run time */
 	.n_max_pipe_profiles = RTE_DIM(pipe_profile),
-#ifdef RTE_SCHED_RED
-.red_params = {
-	/* Traffic Class 0 Colors Green / Yellow / Red */
-	[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[0][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[0][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 1 - Colors Green / Yellow / Red */
-	[1][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[1][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[1][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 2 - Colors Green / Yellow / Red */
-	[2][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[2][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[2][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 3 - Colors Green / Yellow / Red */
-	[3][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[3][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[3][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 4 - Colors Green / Yellow / Red */
-	[4][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[4][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[4][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 5 - Colors Green / Yellow / Red */
-	[5][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[5][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[5][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 6 - Colors Green / Yellow / Red */
-	[6][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[6][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[6][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 7 - Colors Green / Yellow / Red */
-	[7][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[7][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[7][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 8 - Colors Green / Yellow / Red */
-	[8][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[8][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[8][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 9 - Colors Green / Yellow / Red */
-	[9][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[9][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[9][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 10 - Colors Green / Yellow / Red */
-	[10][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[10][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[10][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 11 - Colors Green / Yellow / Red */
-	[11][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[11][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[11][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 12 - Colors Green / Yellow / Red */
-	[12][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	},
-#endif /* RTE_SCHED_RED */
+#ifdef RTE_SCHED_CMAN
+	.cman_params = &cman_params,
+#endif /* RTE_SCHED_CMAN */
 };
 
 static struct tmgr_port_list tmgr_port_list;
Signature · 1 line
2.25.1
#106 lore raw

PATCH v15 4/5 doc/guides/prog_guide: added PIE

In reply to Liguzinski, WojciechX

Added PIE related information to documentation.

---
 doc/guides/prog_guide/glossary.rst           |  3 +
 doc/guides/prog_guide/qos_framework.rst      | 60 +++++++++++++++++---
 doc/guides/prog_guide/traffic_management.rst | 13 ++++-
 3 files changed, 66 insertions(+), 10 deletions(-)
doc/guides/prog_guide/glossary.rst +3 -0
index 7044a7df2a..fb0910ba5b 100644
@@ -158,6 +158,9 @@ PCI
 PHY
    An abbreviation for the physical layer of the OSI model.
 
+PIE
+   Proportional Integral Controller Enhanced (RFC8033)
+
 pktmbuf
    An *mbuf* carrying a network packet.
 
doc/guides/prog_guide/qos_framework.rst +52 -8

107 lines not on this page · raw message

doc/guides/prog_guide/traffic_management.rst +11 -2
index 05b34d93a5..c356791a45 100644
@@ -22,6 +22,7 @@ Main features:
   shared (by multiple nodes) shapers
 * Congestion management for hierarchy leaf nodes: algorithms of tail drop, head
   drop, WRED, private (per node) and shared (by multiple nodes) WRED contexts
+  and PIE.
 * Packet marking: IEEE 802.1q (VLAN DEI), IETF RFC 3168 (IPv4/IPv6 ECN for TCP
   and SCTP), IETF RFC 2597 (IPv4 / IPv6 DSCP)
 
@@ -103,8 +104,9 @@ Congestion Management
 Congestion management is used to control the admission of packets into a packet
 queue or group of packet queues on congestion. The congestion management
 algorithms that are supported are: Tail Drop, Head Drop and Weighted Random
-Early Detection (WRED). They are made available for every leaf node in the
-hierarchy, subject to the specific implementation supporting them.
+Early Detection (WRED), Proportional Integral Controller Enhanced (PIE).
+They are made available for every leaf node in the hierarchy, subject to
+the specific implementation supporting them.
 On request of writing a new packet into the current queue while the queue is
 full, the Tail Drop algorithm drops the new packet while leaving the queue
 unmodified, as opposed to the Head Drop* algorithm, which drops the packet
@@ -128,6 +130,13 @@ The configuration of WRED private and shared contexts is done through the
 definition of WRED profiles. Any WRED profile can be used by one or several
 WRED contexts (either private or shared).
 
+The Proportional Integral Controller Enhanced (PIE) algorithm works by proactively
+dropping packets randomly. Calculated drop probability is updated periodically,
+based on latency measured and desired and whether the queuing latency is currently
+trending up or down. Queuing latency can be obtained using direct measurement or
+on estimations calculated from the queue length and dequeue rate. The random drop
+is triggered by a packet's arrival before enqueuing into a queue.
+
 
 Packet Marking
 --------------
Signature · 1 line
2.25.1
#107 lore raw

PATCH v15 5/5 app/test: add tests for PIE

In reply to Liguzinski, WojciechX

Tests for PIE code added to test application.

---
 app/test/meson.build |    4 +
 app/test/test_pie.c  | 1065 ++++++++++++++++++++++++++++++++++++++++++
 lib/sched/rte_pie.c  |    6 +-
 lib/sched/rte_pie.h  |   17 +-
 4 files changed, 1085 insertions(+), 7 deletions(-)
 create mode 100644 app/test/test_pie.c
app/test/meson.build +4 -0
index a16374b7a1..a189b4ebd3 100644
@@ -114,6 +114,7 @@ test_sources = files(
         'test_reciprocal_division.c',
         'test_reciprocal_division_perf.c',
         'test_red.c',
+        'test_pie.c',
         'test_reorder.c',
         'test_rib.c',
         'test_rib6.c',
@@ -245,6 +246,7 @@ fast_tests = [
         ['prefetch_autotest', true],
         ['rcu_qsbr_autotest', true],
         ['red_autotest', true],
+        ['pie_autotest', true],
         ['rib_autotest', true],
         ['rib6_autotest', true],
         ['ring_autotest', true],
@@ -296,6 +298,7 @@ perf_test_names = [
         'fib_slow_autotest',
         'fib_perf_autotest',
         'red_all',
+        'pie_all',
         'barrier_autotest',
         'hash_multiwriter_autotest',
         'timer_racecond_autotest',
@@ -309,6 +312,7 @@ perf_test_names = [
         'fib6_perf_autotest',
         'rcu_qsbr_perf_autotest',
         'red_perf',
+        'pie_perf',
         'distributor_perf_autotest',
         'pmd_perf_autotest',
         'stack_perf_autotest',
app/test/test_pie.c new file +1065 -0

1,065 lines not on this page · raw message

lib/sched/rte_pie.c +5 -1
index 2fcecb2db4..934e9aee50 100644
@@ -13,7 +13,7 @@
 #pragma warning(disable:2259) /* conversion may lose significant bits */
 #endif
 
-void
+int
 rte_pie_rt_data_init(struct rte_pie *pie)
 {
 	if (pie == NULL) {
@@ -22,6 +22,8 @@ rte_pie_rt_data_init(struct rte_pie *pie)
 
 		if (pie == NULL)
 			RTE_LOG(ERR, SCHED, "%s: Memory allocation fails\n", __func__);
+
+		return -1;
 	}
 
 	pie->active = 0;
@@ -35,6 +37,8 @@ rte_pie_rt_data_init(struct rte_pie *pie)
 	pie->qdelay_old = 0;
 	pie->drop_prob = 0;
 	pie->accu_prob = 0;
+
+	return 0;
 }
 
 int
lib/sched/rte_pie.h +11 -6
index f83c95664f..68f1b96192 100644
@@ -20,6 +20,7 @@ extern "C" {
 
 #include <rte_random.h>
 #include <rte_debug.h>
+#include <rte_cycles.h>
 
 #define RTE_DQ_THRESHOLD   16384   /**< Queue length threshold (2^14)
 				     * to start measurement cycle (bytes)
@@ -53,7 +54,7 @@ struct rte_pie_config {
 };
 
 /**
- * RED run-time data
+ * PIE run-time data
  */
 struct rte_pie {
 	uint16_t active;               /**< Flag for activating/deactivating pie */
@@ -74,8 +75,12 @@ struct rte_pie {
  * @brief Initialises run-time data
  *
  * @param pie [in,out] data pointer to PIE runtime data
+ *
+ * @return Operation status
+ * @retval 0 success
+ * @retval !0 error
  */
-void
+int
 __rte_experimental
 rte_pie_rt_data_init(struct rte_pie *pie);
 
@@ -113,7 +118,7 @@ rte_pie_config_init(struct rte_pie_config *pie_cfg,
  * @retval 0 enqueue the packet
  * @retval !0 drop the packet
  */
-static inline int
+static int
 __rte_experimental
 rte_pie_enqueue_empty(const struct rte_pie_config *pie_cfg,
 	struct rte_pie *pie,
@@ -145,7 +150,7 @@ rte_pie_enqueue_empty(const struct rte_pie_config *pie_cfg,
  * @param pie [in, out] data pointer to PIE runtime data
  * @param time [in] current time (measured in cpu cycles)
  */
-static inline void
+static void
 __rte_experimental
 _calc_drop_probability(const struct rte_pie_config *pie_cfg,
 	struct rte_pie *pie, uint64_t time)
@@ -155,7 +160,7 @@ _calc_drop_probability(const struct rte_pie_config *pie_cfg,
 	/* Note: can be implemented using integer multiply.
 	 * DQ_THRESHOLD is power of 2 value.
 	 */
-	double current_qdelay = pie->qlen * (pie->avg_dq_time / RTE_DQ_THRESHOLD);
+	uint64_t current_qdelay = pie->qlen * (pie->avg_dq_time >> 14);
 
 	double p = RTE_ALPHA * (current_qdelay - qdelay_ref) +
 		RTE_BETA * (current_qdelay - pie->qdelay_old);
@@ -181,7 +186,7 @@ _calc_drop_probability(const struct rte_pie_config *pie_cfg,
 	double qdelay = qdelay_ref * 0.5;
 
 	/*  Exponentially decay drop prob when congestion goes away  */
-	if (current_qdelay < qdelay && pie->qdelay_old < qdelay)
+	if ((double)current_qdelay < qdelay && pie->qdelay_old < qdelay)
 		pie->drop_prob *= 0.98;     /* 1 - 1/64 is sufficient */
 
 	/* Bound drop probability */
Signature · 1 line
2.25.1
#108 lore raw
In reply to Liguzinski, WojciechX
Quoted 65 lines

-----Original Message-----
From: Liguzinski, WojciechX <[email protected]>
Sent: Tuesday, October 19, 2021 9:19 AM
To: [email protected]; Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: Ajmera, Megha <[email protected]>
Subject: [PATCH v15 0/5] Add PIE support for HQoS library

DPDK sched library is equipped with mechanism that secures it from the bufferbloat problem
which is a situation when excess buffers in the network cause high latency and latency
variation. Currently, it supports RED for active queue management. However, more
advanced queue management is required to address this problem and provide desirable
quality of service to users.

This solution (RFC) proposes usage of new algorithm called "PIE" (Proportional Integral
controller Enhanced) that can effectively and directly control queuing latency to address
the bufferbloat problem.

The implementation of mentioned functionality includes modification of existing and
adding a new set of data structures to the library, adding PIE related APIs. This affects structures in public API/ABI. That is why deprecation notice is going
to be prepared and sent.

Liguzinski, WojciechX (5):
sched: add PIE based congestion management
example/qos_sched: add PIE support
example/ip_pipeline: add PIE support
doc/guides/prog_guide: added PIE
app/test: add tests for PIE

 app/test/meson.build                         |    4 +
 app/test/test_pie.c                          | 1065 ++++++++++++++++++
 config/rte_config.h                          |    1 -
 doc/guides/prog_guide/glossary.rst           |    3 +
 doc/guides/prog_guide/qos_framework.rst      |   60 +-
 doc/guides/prog_guide/traffic_management.rst |   13 +-
 drivers/net/softnic/rte_eth_softnic_tm.c     |    6 +-
 examples/ip_pipeline/tmgr.c                  |  142 +--
 examples/qos_sched/app_thread.c              |    1 -
 examples/qos_sched/cfg_file.c                |  127 ++-
 examples/qos_sched/cfg_file.h                |    5 +
 examples/qos_sched/init.c                    |   27 +-
 examples/qos_sched/main.h                    |    3 +
 examples/qos_sched/profile.cfg               |  196 ++--
 lib/sched/meson.build                        |   10 +-
 lib/sched/rte_pie.c                          |   86 ++
 lib/sched/rte_pie.h                          |  398 +++++++
 lib/sched/rte_sched.c                        |  241 ++--
 lib/sched/rte_sched.h                        |   63 +-
 lib/sched/version.map                        |    4 +
 20 files changed, 2171 insertions(+), 284 deletions(-)
 create mode 100644 app/test/test_pie.c
 create mode 100644 lib/sched/rte_pie.c
 create mode 100644 lib/sched/rte_pie.h
Quoted 2 lines

--
2.25.1

#109 lore raw

v16 cover Add PIE support for HQoS library

In reply to Liguzinski, WojciechX

DPDK sched library is equipped with mechanism that secures it from the bufferbloat problem which is a situation when excess buffers in the network cause high latency and latency variation. Currently, it supports RED for active queue management. However, more advanced queue management is required to address this problem and provide desirable quality of service to users.

This solution (RFC) proposes usage of new algorithm called "PIE" (Proportional Integral controller Enhanced) that can effectively and directly control queuing latency to address the bufferbloat problem.

The implementation of mentioned functionality includes modification of existing and adding a new set of data structures to the library, adding PIE related APIs. This affects structures in public API/ABI. That is why deprecation notice is going to be prepared and sent.

Liguzinski, WojciechX (5):
sched: add PIE based congestion management
example/qos_sched: add PIE support
example/ip_pipeline: add PIE support
doc/guides/prog_guide: added PIE
app/test: add tests for PIE

 app/test/meson.build                         |    4 +
 app/test/test_pie.c                          | 1065 ++++++++++++++++++
 config/rte_config.h                          |    1 -
 doc/guides/prog_guide/glossary.rst           |    3 +
 doc/guides/prog_guide/qos_framework.rst      |   62 +-
 doc/guides/prog_guide/traffic_management.rst |   13 +-
 drivers/net/softnic/rte_eth_softnic_tm.c     |    6 +-
 examples/ip_pipeline/tmgr.c                  |  142 +--
 examples/qos_sched/app_thread.c              |    1 -
 examples/qos_sched/cfg_file.c                |  127 ++-
 examples/qos_sched/cfg_file.h                |    5 +
 examples/qos_sched/init.c                    |   27 +-
 examples/qos_sched/main.h                    |    3 +
 examples/qos_sched/profile.cfg               |  196 ++--
 lib/sched/meson.build                        |   10 +-
 lib/sched/rte_pie.c                          |   86 ++
 lib/sched/rte_pie.h                          |  398 +++++++
 lib/sched/rte_sched.c                        |  241 ++--
 lib/sched/rte_sched.h                        |   63 +-
 lib/sched/version.map                        |    4 +
 20 files changed, 2172 insertions(+), 285 deletions(-)
 create mode 100644 app/test/test_pie.c
 create mode 100644 lib/sched/rte_pie.c
 create mode 100644 lib/sched/rte_pie.h
Signature · 1 line
2.25.1
#110 lore raw

PATCH v16 1/5 sched: add PIE based congestion management

Implement PIE based congestion management based on rfc8033

- Renamed WRED occurences to RED
- Applied __rte_unused macro to parameters in rte_sched_port_pie_dequeue()

---
 drivers/net/softnic/rte_eth_softnic_tm.c |   6 +-
 lib/sched/meson.build                    |  10 +-
 lib/sched/rte_pie.c                      |  82 +++++
 lib/sched/rte_pie.h                      | 393 +++++++++++++++++++++++
 lib/sched/rte_sched.c                    | 241 +++++++++-----
 lib/sched/rte_sched.h                    |  63 +++-
 lib/sched/version.map                    |   4 +
 7 files changed, 703 insertions(+), 96 deletions(-)
 create mode 100644 lib/sched/rte_pie.c
 create mode 100644 lib/sched/rte_pie.h
drivers/net/softnic/rte_eth_softnic_tm.c +3 -3
index 90baba15ce..e74092ce7f 100644
@@ -420,7 +420,7 @@ pmd_tm_node_type_get(struct rte_eth_dev *dev,
 	return 0;
 }
 
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
 #define WRED_SUPPORTED						1
 #else
 #define WRED_SUPPORTED						0
@@ -2306,7 +2306,7 @@ tm_tc_wred_profile_get(struct rte_eth_dev *dev, uint32_t tc_id)
 	return NULL;
 }
 
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
 
 static void
 wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id)
@@ -2321,7 +2321,7 @@ wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id)
 	for (tc_id = 0; tc_id < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; tc_id++)
 		for (color = RTE_COLOR_GREEN; color < RTE_COLORS; color++) {
 			struct rte_red_params *dst =
-				&pp->red_params[tc_id][color];
+				&pp->cman_params->red_params[tc_id][color];
 			struct tm_wred_profile *src_wp =
 				tm_tc_wred_profile_get(dev, tc_id);
 			struct rte_tm_red_params *src =
lib/sched/meson.build +3 -7
index b24f7b8775..e7ae9bcf19 100644
@@ -1,11 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-sources = files('rte_sched.c', 'rte_red.c', 'rte_approx.c')
-headers = files(
-        'rte_approx.h',
-        'rte_red.h',
-        'rte_sched.h',
-        'rte_sched_common.h',
-)
+sources = files('rte_sched.c', 'rte_red.c', 'rte_approx.c', 'rte_pie.c')
+headers = files('rte_sched.h', 'rte_sched_common.h',
+		'rte_red.h', 'rte_approx.h', 'rte_pie.h')
 deps += ['mbuf', 'meter']
lib/sched/rte_pie.c new file +82 -0

82 lines not on this page · raw message

lib/sched/rte_pie.h new file +393 -0

393 lines not on this page · raw message

lib/sched/rte_sched.c +168 -73

359 lines not on this page · raw message

lib/sched/rte_sched.h +50 -13

100 lines not on this page · raw message

lib/sched/version.map +4 -0
index 53c337b143..ffa5f7b10d 100644
@@ -30,4 +30,8 @@ EXPERIMENTAL {
 	rte_sched_subport_pipe_profile_add;
 	# added in 20.11
 	rte_sched_port_subport_profile_add;
+
+	# added in 21.11
+	rte_pie_rt_data_init;
+	rte_pie_config_init;
 };
Signature · 1 line
2.25.1
#111 lore raw

PATCH v16 2/5 example/qos_sched: add PIE support

In reply to Liguzinski, WojciechX

patch add support enable PIE or RED by
parsing config file.

---
 config/rte_config.h             |   1 -
 examples/qos_sched/app_thread.c |   1 -
 examples/qos_sched/cfg_file.c   | 127 +++++++++++++++------
 examples/qos_sched/cfg_file.h   |   5 +
 examples/qos_sched/init.c       |  27 +++--
 examples/qos_sched/main.h       |   3 +
 examples/qos_sched/profile.cfg  | 196 +++++++++++++++++++++-----------
 7 files changed, 250 insertions(+), 110 deletions(-)
config/rte_config.h +0 -1
index 590903c07d..48132f27df 100644
@@ -89,7 +89,6 @@
 #define RTE_MAX_LCORE_FREQS 64
 
 /* rte_sched defines */
-#undef RTE_SCHED_RED
 #undef RTE_SCHED_COLLECT_STATS
 #undef RTE_SCHED_SUBPORT_TC_OV
 #define RTE_SCHED_PORT_N_GRINDERS 8
examples/qos_sched/app_thread.c +0 -1
index dbc878b553..895c0d3592 100644
@@ -205,7 +205,6 @@ app_worker_thread(struct thread_conf **confs)
 		if (likely(nb_pkt)) {
 			int nb_sent = rte_sched_port_enqueue(conf->sched_port, mbufs,
 					nb_pkt);
-
 			APP_STATS_ADD(conf->stat.nb_drop, nb_pkt - nb_sent);
 			APP_STATS_ADD(conf->stat.nb_rx, nb_pkt);
 		}
examples/qos_sched/cfg_file.c +94 -33

193 lines not on this page · raw message

examples/qos_sched/cfg_file.h +5 -0
index 0dc458aa71..1a9dce9db5 100644
@@ -12,6 +12,11 @@ int cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port);
 
 int cfg_load_pipe(struct rte_cfgfile *cfg, struct rte_sched_pipe_params *pipe);
 
+#ifdef RTE_SCHED_CMAN
+void set_subport_cman_params(struct rte_sched_subport_params *subport_p,
+					struct rte_sched_cman_params cman_p);
+#endif
+
 int cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subport);
 
 int cfg_load_subport_profile(struct rte_cfgfile *cfg,
examples/qos_sched/init.c +17 -10
index 1abe003fc6..d151da5c2d 100644
@@ -204,15 +204,9 @@ static struct rte_sched_subport_profile_params
 	},
 };
 
-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,
-		.n_pipe_profiles = sizeof(pipe_profiles) /
-			sizeof(struct rte_sched_pipe_params),
-		.n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES,
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
+struct rte_sched_cman_params cman_params = {
+	.cman_mode = RTE_SCHED_CMAN_RED,
 	.red_params = {
 		/* Traffic Class 0 Colors Green / Yellow / Red */
 		[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
@@ -279,7 +273,20 @@ struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = {
 		[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
 		[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
 	},
-#endif /* RTE_SCHED_RED */
+};
+#endif /* RTE_SCHED_CMAN */
+
+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,
+		.n_pipe_profiles = sizeof(pipe_profiles) /
+			sizeof(struct rte_sched_pipe_params),
+		.n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES,
+#ifdef RTE_SCHED_CMAN
+		.cman_params = &cman_params,
+#endif /* RTE_SCHED_CMAN */
 	},
 };
 
examples/qos_sched/main.h +3 -0
index 0d6815ae69..915311bac8 100644
@@ -153,6 +153,9 @@ extern uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE];
 extern uint32_t n_active_queues;
 
 extern struct rte_sched_port_params port_params;
+#ifdef RTE_SCHED_CMAN
+extern struct rte_sched_cman_params cman_params;
+#endif
 extern struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS];
 
 int app_parse_args(int argc, char **argv);
examples/qos_sched/profile.cfg +131 -65

199 lines not on this page · raw message

Signature · 1 line
2.25.1
#112 lore raw

PATCH v16 3/5 example/ip_pipeline: add PIE support

In reply to Liguzinski, WojciechX

Adding the PIE support for IP Pipeline

---
 examples/ip_pipeline/tmgr.c | 142 +++++++++++++++++++-----------------
 1 file changed, 74 insertions(+), 68 deletions(-)
examples/ip_pipeline/tmgr.c +74 -68
index e4e364cbc0..b138e885cf 100644
@@ -17,6 +17,77 @@ static uint32_t n_subport_profiles;
 static struct rte_sched_pipe_params
 	pipe_profile[TMGR_PIPE_PROFILE_MAX];
 
+#ifdef RTE_SCHED_CMAN
+static struct rte_sched_cman_params cman_params = {
+	.red_params = {
+		/* Traffic Class 0 Colors Green / Yellow / Red */
+		[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[0][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[0][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 1 - Colors Green / Yellow / Red */
+		[1][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[1][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[1][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 2 - Colors Green / Yellow / Red */
+		[2][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[2][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[2][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 3 - Colors Green / Yellow / Red */
+		[3][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[3][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[3][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 4 - Colors Green / Yellow / Red */
+		[4][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[4][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[4][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 5 - Colors Green / Yellow / Red */
+		[5][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[5][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[5][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 6 - Colors Green / Yellow / Red */
+		[6][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[6][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[6][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 7 - Colors Green / Yellow / Red */
+		[7][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[7][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[7][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 8 - Colors Green / Yellow / Red */
+		[8][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[8][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[8][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 9 - Colors Green / Yellow / Red */
+		[9][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[9][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[9][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 10 - Colors Green / Yellow / Red */
+		[10][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[10][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[10][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 11 - Colors Green / Yellow / Red */
+		[11][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[11][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[11][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 12 - Colors Green / Yellow / Red */
+		[12][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		},
+};
+#endif /* RTE_SCHED_CMAN */
+
 static uint32_t n_pipe_profiles;
 
 static const struct rte_sched_subport_params subport_params_default = {
@@ -25,74 +96,9 @@ static const struct rte_sched_subport_params subport_params_default = {
 	.pipe_profiles = pipe_profile,
 	.n_pipe_profiles = 0, /* filled at run time */
 	.n_max_pipe_profiles = RTE_DIM(pipe_profile),
-#ifdef RTE_SCHED_RED
-.red_params = {
-	/* Traffic Class 0 Colors Green / Yellow / Red */
-	[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[0][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[0][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 1 - Colors Green / Yellow / Red */
-	[1][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[1][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[1][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 2 - Colors Green / Yellow / Red */
-	[2][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[2][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[2][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 3 - Colors Green / Yellow / Red */
-	[3][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[3][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[3][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 4 - Colors Green / Yellow / Red */
-	[4][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[4][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[4][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 5 - Colors Green / Yellow / Red */
-	[5][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[5][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[5][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 6 - Colors Green / Yellow / Red */
-	[6][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[6][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[6][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 7 - Colors Green / Yellow / Red */
-	[7][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[7][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[7][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 8 - Colors Green / Yellow / Red */
-	[8][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[8][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[8][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 9 - Colors Green / Yellow / Red */
-	[9][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[9][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[9][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 10 - Colors Green / Yellow / Red */
-	[10][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[10][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[10][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 11 - Colors Green / Yellow / Red */
-	[11][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[11][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[11][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 12 - Colors Green / Yellow / Red */
-	[12][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	},
-#endif /* RTE_SCHED_RED */
+#ifdef RTE_SCHED_CMAN
+	.cman_params = &cman_params,
+#endif /* RTE_SCHED_CMAN */
 };
 
 static struct tmgr_port_list tmgr_port_list;
Signature · 1 line
2.25.1
#113 lore raw

PATCH v16 4/5 doc/guides/prog_guide: added PIE

In reply to Liguzinski, WojciechX

Added PIE related information to documentation.

- Corrected marker for Droppers title

---
 doc/guides/prog_guide/glossary.rst           |  3 +
 doc/guides/prog_guide/qos_framework.rst      | 62 +++++++++++++++++---
 doc/guides/prog_guide/traffic_management.rst | 13 +++-
 3 files changed, 67 insertions(+), 11 deletions(-)
doc/guides/prog_guide/glossary.rst +3 -0
index 7044a7df2a..fb0910ba5b 100644
@@ -158,6 +158,9 @@ PCI
 PHY
    An abbreviation for the physical layer of the OSI model.
 
+PIE
+   Proportional Integral Controller Enhanced (RFC8033)
+
 pktmbuf
    An *mbuf* carrying a network packet.
 
doc/guides/prog_guide/qos_framework.rst +53 -9

108 lines not on this page · raw message

doc/guides/prog_guide/traffic_management.rst +11 -2
index 05b34d93a5..c356791a45 100644
@@ -22,6 +22,7 @@ Main features:
   shared (by multiple nodes) shapers
 * Congestion management for hierarchy leaf nodes: algorithms of tail drop, head
   drop, WRED, private (per node) and shared (by multiple nodes) WRED contexts
+  and PIE.
 * Packet marking: IEEE 802.1q (VLAN DEI), IETF RFC 3168 (IPv4/IPv6 ECN for TCP
   and SCTP), IETF RFC 2597 (IPv4 / IPv6 DSCP)
 
@@ -103,8 +104,9 @@ Congestion Management
 Congestion management is used to control the admission of packets into a packet
 queue or group of packet queues on congestion. The congestion management
 algorithms that are supported are: Tail Drop, Head Drop and Weighted Random
-Early Detection (WRED). They are made available for every leaf node in the
-hierarchy, subject to the specific implementation supporting them.
+Early Detection (WRED), Proportional Integral Controller Enhanced (PIE).
+They are made available for every leaf node in the hierarchy, subject to
+the specific implementation supporting them.
 On request of writing a new packet into the current queue while the queue is
 full, the Tail Drop algorithm drops the new packet while leaving the queue
 unmodified, as opposed to the Head Drop* algorithm, which drops the packet
@@ -128,6 +130,13 @@ The configuration of WRED private and shared contexts is done through the
 definition of WRED profiles. Any WRED profile can be used by one or several
 WRED contexts (either private or shared).
 
+The Proportional Integral Controller Enhanced (PIE) algorithm works by proactively
+dropping packets randomly. Calculated drop probability is updated periodically,
+based on latency measured and desired and whether the queuing latency is currently
+trending up or down. Queuing latency can be obtained using direct measurement or
+on estimations calculated from the queue length and dequeue rate. The random drop
+is triggered by a packet's arrival before enqueuing into a queue.
+
 
 Packet Marking
 --------------
Signature · 1 line
2.25.1
#114 lore raw

PATCH v16 5/5 app/test: add tests for PIE

In reply to Liguzinski, WojciechX

Tests for PIE code added to test application.

---
 app/test/meson.build |    4 +
 app/test/test_pie.c  | 1065 ++++++++++++++++++++++++++++++++++++++++++
 lib/sched/rte_pie.c  |    6 +-
 lib/sched/rte_pie.h  |   17 +-
 4 files changed, 1085 insertions(+), 7 deletions(-)
 create mode 100644 app/test/test_pie.c
app/test/meson.build +4 -0
index a16374b7a1..a189b4ebd3 100644
@@ -114,6 +114,7 @@ test_sources = files(
         'test_reciprocal_division.c',
         'test_reciprocal_division_perf.c',
         'test_red.c',
+        'test_pie.c',
         'test_reorder.c',
         'test_rib.c',
         'test_rib6.c',
@@ -245,6 +246,7 @@ fast_tests = [
         ['prefetch_autotest', true],
         ['rcu_qsbr_autotest', true],
         ['red_autotest', true],
+        ['pie_autotest', true],
         ['rib_autotest', true],
         ['rib6_autotest', true],
         ['ring_autotest', true],
@@ -296,6 +298,7 @@ perf_test_names = [
         'fib_slow_autotest',
         'fib_perf_autotest',
         'red_all',
+        'pie_all',
         'barrier_autotest',
         'hash_multiwriter_autotest',
         'timer_racecond_autotest',
@@ -309,6 +312,7 @@ perf_test_names = [
         'fib6_perf_autotest',
         'rcu_qsbr_perf_autotest',
         'red_perf',
+        'pie_perf',
         'distributor_perf_autotest',
         'pmd_perf_autotest',
         'stack_perf_autotest',
app/test/test_pie.c new file +1065 -0

1,065 lines not on this page · raw message

lib/sched/rte_pie.c +5 -1
index 2fcecb2db4..934e9aee50 100644
@@ -13,7 +13,7 @@
 #pragma warning(disable:2259) /* conversion may lose significant bits */
 #endif
 
-void
+int
 rte_pie_rt_data_init(struct rte_pie *pie)
 {
 	if (pie == NULL) {
@@ -22,6 +22,8 @@ rte_pie_rt_data_init(struct rte_pie *pie)
 
 		if (pie == NULL)
 			RTE_LOG(ERR, SCHED, "%s: Memory allocation fails\n", __func__);
+
+		return -1;
 	}
 
 	pie->active = 0;
@@ -35,6 +37,8 @@ rte_pie_rt_data_init(struct rte_pie *pie)
 	pie->qdelay_old = 0;
 	pie->drop_prob = 0;
 	pie->accu_prob = 0;
+
+	return 0;
 }
 
 int
lib/sched/rte_pie.h +11 -6
index f83c95664f..68f1b96192 100644
@@ -20,6 +20,7 @@ extern "C" {
 
 #include <rte_random.h>
 #include <rte_debug.h>
+#include <rte_cycles.h>
 
 #define RTE_DQ_THRESHOLD   16384   /**< Queue length threshold (2^14)
 				     * to start measurement cycle (bytes)
@@ -53,7 +54,7 @@ struct rte_pie_config {
 };
 
 /**
- * RED run-time data
+ * PIE run-time data
  */
 struct rte_pie {
 	uint16_t active;               /**< Flag for activating/deactivating pie */
@@ -74,8 +75,12 @@ struct rte_pie {
  * @brief Initialises run-time data
  *
  * @param pie [in,out] data pointer to PIE runtime data
+ *
+ * @return Operation status
+ * @retval 0 success
+ * @retval !0 error
  */
-void
+int
 __rte_experimental
 rte_pie_rt_data_init(struct rte_pie *pie);
 
@@ -113,7 +118,7 @@ rte_pie_config_init(struct rte_pie_config *pie_cfg,
  * @retval 0 enqueue the packet
  * @retval !0 drop the packet
  */
-static inline int
+static int
 __rte_experimental
 rte_pie_enqueue_empty(const struct rte_pie_config *pie_cfg,
 	struct rte_pie *pie,
@@ -145,7 +150,7 @@ rte_pie_enqueue_empty(const struct rte_pie_config *pie_cfg,
  * @param pie [in, out] data pointer to PIE runtime data
  * @param time [in] current time (measured in cpu cycles)
  */
-static inline void
+static void
 __rte_experimental
 _calc_drop_probability(const struct rte_pie_config *pie_cfg,
 	struct rte_pie *pie, uint64_t time)
@@ -155,7 +160,7 @@ _calc_drop_probability(const struct rte_pie_config *pie_cfg,
 	/* Note: can be implemented using integer multiply.
 	 * DQ_THRESHOLD is power of 2 value.
 	 */
-	double current_qdelay = pie->qlen * (pie->avg_dq_time / RTE_DQ_THRESHOLD);
+	uint64_t current_qdelay = pie->qlen * (pie->avg_dq_time >> 14);
 
 	double p = RTE_ALPHA * (current_qdelay - qdelay_ref) +
 		RTE_BETA * (current_qdelay - pie->qdelay_old);
@@ -181,7 +186,7 @@ _calc_drop_probability(const struct rte_pie_config *pie_cfg,
 	double qdelay = qdelay_ref * 0.5;
 
 	/*  Exponentially decay drop prob when congestion goes away  */
-	if (current_qdelay < qdelay && pie->qdelay_old < qdelay)
+	if ((double)current_qdelay < qdelay && pie->qdelay_old < qdelay)
 		pie->drop_prob *= 0.98;     /* 1 - 1/64 is sufficient */
 
 	/* Bound drop probability */
Signature · 1 line
2.25.1
#115 lore raw

v17 cover Add PIE support for HQoS library

In reply to Liguzinski, WojciechX

DPDK sched library is equipped with mechanism that secures it from the bufferbloat problem which is a situation when excess buffers in the network cause high latency and latency variation. Currently, it supports RED for active queue management. However, more advanced queue management is required to address this problem and provide desirable quality of service to users.

This solution (RFC) proposes usage of new algorithm called "PIE" (Proportional Integral controller Enhanced) that can effectively and directly control queuing latency to address the bufferbloat problem.

The implementation of mentioned functionality includes modification of existing and adding a new set of data structures to the library, adding PIE related APIs. This affects structures in public API/ABI. That is why deprecation notice is going to be prepared and sent.

Liguzinski, WojciechX (5):
sched: add PIE based congestion management
example/qos_sched: add PIE support
example/ip_pipeline: add PIE support
doc/guides/prog_guide: added PIE
app/test: add tests for PIE

 app/test/meson.build                         |    4 +
 app/test/test_pie.c                          | 1065 ++++++++++++++++++
 config/rte_config.h                          |    1 -
 doc/guides/prog_guide/glossary.rst           |    3 +
 doc/guides/prog_guide/qos_framework.rst      |   64 +-
 doc/guides/prog_guide/traffic_management.rst |   13 +-
 drivers/net/softnic/rte_eth_softnic_tm.c     |    6 +-
 examples/ip_pipeline/tmgr.c                  |  142 +--
 examples/qos_sched/app_thread.c              |    1 -
 examples/qos_sched/cfg_file.c                |  127 ++-
 examples/qos_sched/cfg_file.h                |    5 +
 examples/qos_sched/init.c                    |   27 +-
 examples/qos_sched/main.h                    |    3 +
 examples/qos_sched/profile.cfg               |  196 ++--
 lib/sched/meson.build                        |   10 +-
 lib/sched/rte_pie.c                          |   86 ++
 lib/sched/rte_pie.h                          |  398 +++++++
 lib/sched/rte_sched.c                        |  241 ++--
 lib/sched/rte_sched.h                        |   63 +-
 lib/sched/version.map                        |    4 +
 20 files changed, 2173 insertions(+), 286 deletions(-)
 create mode 100644 app/test/test_pie.c
 create mode 100644 lib/sched/rte_pie.c
 create mode 100644 lib/sched/rte_pie.h
Signature · 3 lines
2.25.1

Series-acked-by: Cristian Dumitrescu <[email protected]>
#116 lore raw

PATCH v17 1/5 sched: add PIE based congestion management

Implement PIE based congestion management based on rfc8033

--
Changes in V17:
- Corrected paragraph link naming in qos_framework.rst to fix CI builds

Changes in V16:
- Fixed 'title underline too short' error in qos_framework.rst
- Applied __rte_unused macro to parameters in rte_sched_port_pie_dequeue()

---
 drivers/net/softnic/rte_eth_softnic_tm.c |   6 +-
 lib/sched/meson.build                    |  10 +-
 lib/sched/rte_pie.c                      |  82 +++++
 lib/sched/rte_pie.h                      | 393 +++++++++++++++++++++++
 lib/sched/rte_sched.c                    | 241 +++++++++-----
 lib/sched/rte_sched.h                    |  63 +++-
 lib/sched/version.map                    |   4 +
 7 files changed, 703 insertions(+), 96 deletions(-)
 create mode 100644 lib/sched/rte_pie.c
 create mode 100644 lib/sched/rte_pie.h
drivers/net/softnic/rte_eth_softnic_tm.c +3 -3
index 90baba15ce..e74092ce7f 100644
@@ -420,7 +420,7 @@ pmd_tm_node_type_get(struct rte_eth_dev *dev,
 	return 0;
 }
 
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
 #define WRED_SUPPORTED						1
 #else
 #define WRED_SUPPORTED						0
@@ -2306,7 +2306,7 @@ tm_tc_wred_profile_get(struct rte_eth_dev *dev, uint32_t tc_id)
 	return NULL;
 }
 
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
 
 static void
 wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id)
@@ -2321,7 +2321,7 @@ wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id)
 	for (tc_id = 0; tc_id < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; tc_id++)
 		for (color = RTE_COLOR_GREEN; color < RTE_COLORS; color++) {
 			struct rte_red_params *dst =
-				&pp->red_params[tc_id][color];
+				&pp->cman_params->red_params[tc_id][color];
 			struct tm_wred_profile *src_wp =
 				tm_tc_wred_profile_get(dev, tc_id);
 			struct rte_tm_red_params *src =
lib/sched/meson.build +3 -7
index b24f7b8775..e7ae9bcf19 100644
@@ -1,11 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-sources = files('rte_sched.c', 'rte_red.c', 'rte_approx.c')
-headers = files(
-        'rte_approx.h',
-        'rte_red.h',
-        'rte_sched.h',
-        'rte_sched_common.h',
-)
+sources = files('rte_sched.c', 'rte_red.c', 'rte_approx.c', 'rte_pie.c')
+headers = files('rte_sched.h', 'rte_sched_common.h',
+		'rte_red.h', 'rte_approx.h', 'rte_pie.h')
 deps += ['mbuf', 'meter']
lib/sched/rte_pie.c new file +82 -0

82 lines not on this page · raw message

lib/sched/rte_pie.h new file +393 -0

393 lines not on this page · raw message

lib/sched/rte_sched.c +168 -73

359 lines not on this page · raw message

lib/sched/rte_sched.h +50 -13

100 lines not on this page · raw message

lib/sched/version.map +4 -0
index 53c337b143..ffa5f7b10d 100644
@@ -30,4 +30,8 @@ EXPERIMENTAL {
 	rte_sched_subport_pipe_profile_add;
 	# added in 20.11
 	rte_sched_port_subport_profile_add;
+
+	# added in 21.11
+	rte_pie_rt_data_init;
+	rte_pie_config_init;
 };
Signature · 1 line
2.25.1
#117 lore raw

PATCH v17 2/5 example/qos_sched: add PIE support

In reply to Liguzinski, WojciechX

patch add support enable PIE or RED by
parsing config file.

---
 config/rte_config.h             |   1 -
 examples/qos_sched/app_thread.c |   1 -
 examples/qos_sched/cfg_file.c   | 127 +++++++++++++++------
 examples/qos_sched/cfg_file.h   |   5 +
 examples/qos_sched/init.c       |  27 +++--
 examples/qos_sched/main.h       |   3 +
 examples/qos_sched/profile.cfg  | 196 +++++++++++++++++++++-----------
 7 files changed, 250 insertions(+), 110 deletions(-)
config/rte_config.h +0 -1
index 590903c07d..48132f27df 100644
@@ -89,7 +89,6 @@
 #define RTE_MAX_LCORE_FREQS 64
 
 /* rte_sched defines */
-#undef RTE_SCHED_RED
 #undef RTE_SCHED_COLLECT_STATS
 #undef RTE_SCHED_SUBPORT_TC_OV
 #define RTE_SCHED_PORT_N_GRINDERS 8
examples/qos_sched/app_thread.c +0 -1
index dbc878b553..895c0d3592 100644
@@ -205,7 +205,6 @@ app_worker_thread(struct thread_conf **confs)
 		if (likely(nb_pkt)) {
 			int nb_sent = rte_sched_port_enqueue(conf->sched_port, mbufs,
 					nb_pkt);
-
 			APP_STATS_ADD(conf->stat.nb_drop, nb_pkt - nb_sent);
 			APP_STATS_ADD(conf->stat.nb_rx, nb_pkt);
 		}
examples/qos_sched/cfg_file.c +94 -33

193 lines not on this page · raw message

examples/qos_sched/cfg_file.h +5 -0
index 0dc458aa71..1a9dce9db5 100644
@@ -12,6 +12,11 @@ int cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port);
 
 int cfg_load_pipe(struct rte_cfgfile *cfg, struct rte_sched_pipe_params *pipe);
 
+#ifdef RTE_SCHED_CMAN
+void set_subport_cman_params(struct rte_sched_subport_params *subport_p,
+					struct rte_sched_cman_params cman_p);
+#endif
+
 int cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subport);
 
 int cfg_load_subport_profile(struct rte_cfgfile *cfg,
examples/qos_sched/init.c +17 -10
index 1abe003fc6..d151da5c2d 100644
@@ -204,15 +204,9 @@ static struct rte_sched_subport_profile_params
 	},
 };
 
-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,
-		.n_pipe_profiles = sizeof(pipe_profiles) /
-			sizeof(struct rte_sched_pipe_params),
-		.n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES,
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
+struct rte_sched_cman_params cman_params = {
+	.cman_mode = RTE_SCHED_CMAN_RED,
 	.red_params = {
 		/* Traffic Class 0 Colors Green / Yellow / Red */
 		[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
@@ -279,7 +273,20 @@ struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = {
 		[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
 		[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
 	},
-#endif /* RTE_SCHED_RED */
+};
+#endif /* RTE_SCHED_CMAN */
+
+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,
+		.n_pipe_profiles = sizeof(pipe_profiles) /
+			sizeof(struct rte_sched_pipe_params),
+		.n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES,
+#ifdef RTE_SCHED_CMAN
+		.cman_params = &cman_params,
+#endif /* RTE_SCHED_CMAN */
 	},
 };
 
examples/qos_sched/main.h +3 -0
index 0d6815ae69..915311bac8 100644
@@ -153,6 +153,9 @@ extern uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE];
 extern uint32_t n_active_queues;
 
 extern struct rte_sched_port_params port_params;
+#ifdef RTE_SCHED_CMAN
+extern struct rte_sched_cman_params cman_params;
+#endif
 extern struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS];
 
 int app_parse_args(int argc, char **argv);
examples/qos_sched/profile.cfg +131 -65

199 lines not on this page · raw message

Signature · 1 line
2.25.1
#118 lore raw

Re: [dpdk-dev] [PATCH v17 2/5] example/qos_sched: add PIE support

examples/qos_sched/app_thread.c app_worker_thread(struct thread_conf **confs) · line 210

Quoted 12 lines · WojciechX
examples/qos_sched/app_thread.c +0 -1
index dbc878b553..895c0d3592 100644
@@ -205,7 +205,6 @@ app_worker_thread(struct thread_conf **confs)
 		if (likely(nb_pkt)) {
 			int nb_sent = rte_sched_port_enqueue(conf->sched_port, mbufs,
 					nb_pkt);
-
 			APP_STATS_ADD(conf->stat.nb_drop, nb_pkt - nb_sent);
 			APP_STATS_ADD(conf->stat.nb_rx, nb_pkt);
 		}

Unnecessary whitespace change, drop this in next revision?

#119 lore raw

Re: [dpdk-dev] [PATCH v17 2/5] example/qos_sched: add PIE support

Hi Stephen,

Sure, no problem with that.
I probably changed that line together with something else in some earlier version and didn't notice it now.

Thanks,
Wojtek

-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Wednesday, October 20, 2021 5:11 PM
To: Liguzinski, WojciechX <[email protected]>
Cc: [email protected]; Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>; Ajmera, Megha <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v17 2/5] example/qos_sched: add PIE support

examples/qos_sched/app_thread.c app_worker_thread(struct thread_conf **confs) · line 210

Quoted 12 lines · WojciechX
(quoted diff) +0 -0

b/examples/qos_sched/app_thread.c index dbc878b553..895c0d3592 100644

examples/qos_sched/app_thread.c +0 -1
@@ -205,7 +205,6 @@ app_worker_thread(struct thread_conf **confs)
 		if (likely(nb_pkt)) {
 			int nb_sent = rte_sched_port_enqueue(conf->sched_port, mbufs,
 					nb_pkt);
-
 			APP_STATS_ADD(conf->stat.nb_drop, nb_pkt - nb_sent);
 			APP_STATS_ADD(conf->stat.nb_rx, nb_pkt);
 		}

Unnecessary whitespace change, drop this in next revision?

#120 lore raw

PATCH v17 3/5 example/ip_pipeline: add PIE support

In reply to Liguzinski, WojciechX

Adding the PIE support for IP Pipeline

---
 examples/ip_pipeline/tmgr.c | 142 +++++++++++++++++++-----------------
 1 file changed, 74 insertions(+), 68 deletions(-)
examples/ip_pipeline/tmgr.c +74 -68
index e4e364cbc0..b138e885cf 100644
@@ -17,6 +17,77 @@ static uint32_t n_subport_profiles;
 static struct rte_sched_pipe_params
 	pipe_profile[TMGR_PIPE_PROFILE_MAX];
 
+#ifdef RTE_SCHED_CMAN
+static struct rte_sched_cman_params cman_params = {
+	.red_params = {
+		/* Traffic Class 0 Colors Green / Yellow / Red */
+		[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[0][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[0][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 1 - Colors Green / Yellow / Red */
+		[1][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[1][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[1][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 2 - Colors Green / Yellow / Red */
+		[2][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[2][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[2][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 3 - Colors Green / Yellow / Red */
+		[3][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[3][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[3][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 4 - Colors Green / Yellow / Red */
+		[4][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[4][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[4][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 5 - Colors Green / Yellow / Red */
+		[5][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[5][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[5][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 6 - Colors Green / Yellow / Red */
+		[6][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[6][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[6][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 7 - Colors Green / Yellow / Red */
+		[7][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[7][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[7][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 8 - Colors Green / Yellow / Red */
+		[8][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[8][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[8][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 9 - Colors Green / Yellow / Red */
+		[9][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[9][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[9][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 10 - Colors Green / Yellow / Red */
+		[10][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[10][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[10][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 11 - Colors Green / Yellow / Red */
+		[11][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[11][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[11][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 12 - Colors Green / Yellow / Red */
+		[12][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		},
+};
+#endif /* RTE_SCHED_CMAN */
+
 static uint32_t n_pipe_profiles;
 
 static const struct rte_sched_subport_params subport_params_default = {
@@ -25,74 +96,9 @@ static const struct rte_sched_subport_params subport_params_default = {
 	.pipe_profiles = pipe_profile,
 	.n_pipe_profiles = 0, /* filled at run time */
 	.n_max_pipe_profiles = RTE_DIM(pipe_profile),
-#ifdef RTE_SCHED_RED
-.red_params = {
-	/* Traffic Class 0 Colors Green / Yellow / Red */
-	[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[0][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[0][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 1 - Colors Green / Yellow / Red */
-	[1][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[1][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[1][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 2 - Colors Green / Yellow / Red */
-	[2][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[2][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[2][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 3 - Colors Green / Yellow / Red */
-	[3][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[3][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[3][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 4 - Colors Green / Yellow / Red */
-	[4][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[4][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[4][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 5 - Colors Green / Yellow / Red */
-	[5][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[5][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[5][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 6 - Colors Green / Yellow / Red */
-	[6][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[6][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[6][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 7 - Colors Green / Yellow / Red */
-	[7][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[7][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[7][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 8 - Colors Green / Yellow / Red */
-	[8][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[8][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[8][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 9 - Colors Green / Yellow / Red */
-	[9][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[9][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[9][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 10 - Colors Green / Yellow / Red */
-	[10][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[10][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[10][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 11 - Colors Green / Yellow / Red */
-	[11][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[11][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[11][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 12 - Colors Green / Yellow / Red */
-	[12][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	},
-#endif /* RTE_SCHED_RED */
+#ifdef RTE_SCHED_CMAN
+	.cman_params = &cman_params,
+#endif /* RTE_SCHED_CMAN */
 };
 
 static struct tmgr_port_list tmgr_port_list;
Signature · 1 line
2.25.1
#121 lore raw

PATCH v17 4/5 doc/guides/prog_guide: added PIE

In reply to Liguzinski, WojciechX

Added PIE related information to documentation.

---
 doc/guides/prog_guide/glossary.rst           |  3 +
 doc/guides/prog_guide/qos_framework.rst      | 64 +++++++++++++++++---
 doc/guides/prog_guide/traffic_management.rst | 13 +++-
 3 files changed, 68 insertions(+), 12 deletions(-)
doc/guides/prog_guide/glossary.rst +3 -0
index 7044a7df2a..fb0910ba5b 100644
@@ -158,6 +158,9 @@ PCI
 PHY
    An abbreviation for the physical layer of the OSI model.
 
+PIE
+   Proportional Integral Controller Enhanced (RFC8033)
+
 pktmbuf
    An *mbuf* carrying a network packet.
 
doc/guides/prog_guide/qos_framework.rst +54 -10

116 lines not on this page · raw message

doc/guides/prog_guide/traffic_management.rst +11 -2
index 05b34d93a5..c356791a45 100644
@@ -22,6 +22,7 @@ Main features:
   shared (by multiple nodes) shapers
 * Congestion management for hierarchy leaf nodes: algorithms of tail drop, head
   drop, WRED, private (per node) and shared (by multiple nodes) WRED contexts
+  and PIE.
 * Packet marking: IEEE 802.1q (VLAN DEI), IETF RFC 3168 (IPv4/IPv6 ECN for TCP
   and SCTP), IETF RFC 2597 (IPv4 / IPv6 DSCP)
 
@@ -103,8 +104,9 @@ Congestion Management
 Congestion management is used to control the admission of packets into a packet
 queue or group of packet queues on congestion. The congestion management
 algorithms that are supported are: Tail Drop, Head Drop and Weighted Random
-Early Detection (WRED). They are made available for every leaf node in the
-hierarchy, subject to the specific implementation supporting them.
+Early Detection (WRED), Proportional Integral Controller Enhanced (PIE).
+They are made available for every leaf node in the hierarchy, subject to
+the specific implementation supporting them.
 On request of writing a new packet into the current queue while the queue is
 full, the Tail Drop algorithm drops the new packet while leaving the queue
 unmodified, as opposed to the Head Drop* algorithm, which drops the packet
@@ -128,6 +130,13 @@ The configuration of WRED private and shared contexts is done through the
 definition of WRED profiles. Any WRED profile can be used by one or several
 WRED contexts (either private or shared).
 
+The Proportional Integral Controller Enhanced (PIE) algorithm works by proactively
+dropping packets randomly. Calculated drop probability is updated periodically,
+based on latency measured and desired and whether the queuing latency is currently
+trending up or down. Queuing latency can be obtained using direct measurement or
+on estimations calculated from the queue length and dequeue rate. The random drop
+is triggered by a packet's arrival before enqueuing into a queue.
+
 
 Packet Marking
 --------------
Signature · 1 line
2.25.1
#122 lore raw

PATCH v17 5/5 app/test: add tests for PIE

In reply to Liguzinski, WojciechX

Tests for PIE code added to test application.

---
 app/test/meson.build |    4 +
 app/test/test_pie.c  | 1065 ++++++++++++++++++++++++++++++++++++++++++
 lib/sched/rte_pie.c  |    6 +-
 lib/sched/rte_pie.h  |   17 +-
 4 files changed, 1085 insertions(+), 7 deletions(-)
 create mode 100644 app/test/test_pie.c
app/test/meson.build +4 -0
index a16374b7a1..a189b4ebd3 100644
@@ -114,6 +114,7 @@ test_sources = files(
         'test_reciprocal_division.c',
         'test_reciprocal_division_perf.c',
         'test_red.c',
+        'test_pie.c',
         'test_reorder.c',
         'test_rib.c',
         'test_rib6.c',
@@ -245,6 +246,7 @@ fast_tests = [
         ['prefetch_autotest', true],
         ['rcu_qsbr_autotest', true],
         ['red_autotest', true],
+        ['pie_autotest', true],
         ['rib_autotest', true],
         ['rib6_autotest', true],
         ['ring_autotest', true],
@@ -296,6 +298,7 @@ perf_test_names = [
         'fib_slow_autotest',
         'fib_perf_autotest',
         'red_all',
+        'pie_all',
         'barrier_autotest',
         'hash_multiwriter_autotest',
         'timer_racecond_autotest',
@@ -309,6 +312,7 @@ perf_test_names = [
         'fib6_perf_autotest',
         'rcu_qsbr_perf_autotest',
         'red_perf',
+        'pie_perf',
         'distributor_perf_autotest',
         'pmd_perf_autotest',
         'stack_perf_autotest',
app/test/test_pie.c new file +1065 -0

1,065 lines not on this page · raw message

lib/sched/rte_pie.c +5 -1
index 2fcecb2db4..934e9aee50 100644
@@ -13,7 +13,7 @@
 #pragma warning(disable:2259) /* conversion may lose significant bits */
 #endif
 
-void
+int
 rte_pie_rt_data_init(struct rte_pie *pie)
 {
 	if (pie == NULL) {
@@ -22,6 +22,8 @@ rte_pie_rt_data_init(struct rte_pie *pie)
 
 		if (pie == NULL)
 			RTE_LOG(ERR, SCHED, "%s: Memory allocation fails\n", __func__);
+
+		return -1;
 	}
 
 	pie->active = 0;
@@ -35,6 +37,8 @@ rte_pie_rt_data_init(struct rte_pie *pie)
 	pie->qdelay_old = 0;
 	pie->drop_prob = 0;
 	pie->accu_prob = 0;
+
+	return 0;
 }
 
 int
lib/sched/rte_pie.h +11 -6
index f83c95664f..68f1b96192 100644
@@ -20,6 +20,7 @@ extern "C" {
 
 #include <rte_random.h>
 #include <rte_debug.h>
+#include <rte_cycles.h>
 
 #define RTE_DQ_THRESHOLD   16384   /**< Queue length threshold (2^14)
 				     * to start measurement cycle (bytes)
@@ -53,7 +54,7 @@ struct rte_pie_config {
 };
 
 /**
- * RED run-time data
+ * PIE run-time data
  */
 struct rte_pie {
 	uint16_t active;               /**< Flag for activating/deactivating pie */
@@ -74,8 +75,12 @@ struct rte_pie {
  * @brief Initialises run-time data
  *
  * @param pie [in,out] data pointer to PIE runtime data
+ *
+ * @return Operation status
+ * @retval 0 success
+ * @retval !0 error
  */
-void
+int
 __rte_experimental
 rte_pie_rt_data_init(struct rte_pie *pie);
 
@@ -113,7 +118,7 @@ rte_pie_config_init(struct rte_pie_config *pie_cfg,
  * @retval 0 enqueue the packet
  * @retval !0 drop the packet
  */
-static inline int
+static int
 __rte_experimental
 rte_pie_enqueue_empty(const struct rte_pie_config *pie_cfg,
 	struct rte_pie *pie,
@@ -145,7 +150,7 @@ rte_pie_enqueue_empty(const struct rte_pie_config *pie_cfg,
  * @param pie [in, out] data pointer to PIE runtime data
  * @param time [in] current time (measured in cpu cycles)
  */
-static inline void
+static void
 __rte_experimental
 _calc_drop_probability(const struct rte_pie_config *pie_cfg,
 	struct rte_pie *pie, uint64_t time)
@@ -155,7 +160,7 @@ _calc_drop_probability(const struct rte_pie_config *pie_cfg,
 	/* Note: can be implemented using integer multiply.
 	 * DQ_THRESHOLD is power of 2 value.
 	 */
-	double current_qdelay = pie->qlen * (pie->avg_dq_time / RTE_DQ_THRESHOLD);
+	uint64_t current_qdelay = pie->qlen * (pie->avg_dq_time >> 14);
 
 	double p = RTE_ALPHA * (current_qdelay - qdelay_ref) +
 		RTE_BETA * (current_qdelay - pie->qdelay_old);
@@ -181,7 +186,7 @@ _calc_drop_probability(const struct rte_pie_config *pie_cfg,
 	double qdelay = qdelay_ref * 0.5;
 
 	/*  Exponentially decay drop prob when congestion goes away  */
-	if (current_qdelay < qdelay && pie->qdelay_old < qdelay)
+	if ((double)current_qdelay < qdelay && pie->qdelay_old < qdelay)
 		pie->drop_prob *= 0.98;     /* 1 - 1/64 is sufficient */
 
 	/* Bound drop probability */
Signature · 1 line
2.25.1
#123 lore raw

v18 cover Add PIE support for HQoS library

In reply to Liguzinski, WojciechX

DPDK sched library is equipped with mechanism that secures it from the bufferbloat problem which is a situation when excess buffers in the network cause high latency and latency variation. Currently, it supports RED for active queue management. However, more advanced queue management is required to address this problem and provide desirable quality of service to users.

This solution (RFC) proposes usage of new algorithm called "PIE" (Proportional Integral controller Enhanced) that can effectively and directly control queuing latency to address the bufferbloat problem.

The implementation of mentioned functionality includes modification of existing and adding a new set of data structures to the library, adding PIE related APIs. This affects structures in public API/ABI. That is why deprecation notice is going to be prepared and sent.

Liguzinski, WojciechX (5):
sched: add PIE based congestion management
example/qos_sched: add PIE support
example/ip_pipeline: add PIE support
doc/guides/prog_guide: added PIE
app/test: add tests for PIE

 app/test/meson.build                         |    4 +
 app/test/test_pie.c                          | 1065 ++++++++++++++++++
 config/rte_config.h                          |    1 -
 doc/guides/prog_guide/glossary.rst           |    3 +
 doc/guides/prog_guide/qos_framework.rst      |   64 +-
 doc/guides/prog_guide/traffic_management.rst |   13 +-
 drivers/net/softnic/rte_eth_softnic_tm.c     |    6 +-
 examples/ip_pipeline/tmgr.c                  |  142 +--
 examples/qos_sched/cfg_file.c                |  127 ++-
 examples/qos_sched/cfg_file.h                |    5 +
 examples/qos_sched/init.c                    |   27 +-
 examples/qos_sched/main.h                    |    3 +
 examples/qos_sched/profile.cfg               |  196 ++--
 lib/sched/meson.build                        |    3 +-
 lib/sched/rte_pie.c                          |   86 ++
 lib/sched/rte_pie.h                          |  398 +++++++
 lib/sched/rte_sched.c                        |  241 ++--
 lib/sched/rte_sched.h                        |   63 +-
 lib/sched/version.map                        |    4 +
 19 files changed, 2172 insertions(+), 279 deletions(-)
 create mode 100644 app/test/test_pie.c
 create mode 100644 lib/sched/rte_pie.c
 create mode 100644 lib/sched/rte_pie.h
Signature · 3 lines
2.25.1

Series-acked-by: Cristian Dumitrescu <[email protected]>
#124 lore raw

PATCH v18 1/5 sched: add PIE based congestion management

Implement PIE based congestion management based on rfc8033

--
Changes in V18:
- Resolved merge conflict in lib/sched/meson.build after rebasing ontop of main
- Reverted whitespace change in app_thread.c - comment from Stephen Hemminger

Changes in V17:
- Corrected paragraph link naming in qos_framework.rst to fix CI builds

Changes in V16:
- Fixed 'title underline too short' error in qos_framework.rst
- Applied __rte_unused macro to parameters in rte_sched_port_pie_dequeue()

---
 drivers/net/softnic/rte_eth_softnic_tm.c |   6 +-
 lib/sched/meson.build                    |   3 +-
 lib/sched/rte_pie.c                      |  82 +++++
 lib/sched/rte_pie.h                      | 393 +++++++++++++++++++++++
 lib/sched/rte_sched.c                    | 241 +++++++++-----
 lib/sched/rte_sched.h                    |  63 +++-
 lib/sched/version.map                    |   4 +
 7 files changed, 702 insertions(+), 90 deletions(-)
 create mode 100644 lib/sched/rte_pie.c
 create mode 100644 lib/sched/rte_pie.h
drivers/net/softnic/rte_eth_softnic_tm.c +3 -3
index 90baba15ce..e74092ce7f 100644
@@ -420,7 +420,7 @@ pmd_tm_node_type_get(struct rte_eth_dev *dev,
 	return 0;
 }
 
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
 #define WRED_SUPPORTED						1
 #else
 #define WRED_SUPPORTED						0
@@ -2306,7 +2306,7 @@ tm_tc_wred_profile_get(struct rte_eth_dev *dev, uint32_t tc_id)
 	return NULL;
 }
 
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
 
 static void
 wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id)
@@ -2321,7 +2321,7 @@ wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id)
 	for (tc_id = 0; tc_id < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; tc_id++)
 		for (color = RTE_COLOR_GREEN; color < RTE_COLORS; color++) {
 			struct rte_red_params *dst =
-				&pp->red_params[tc_id][color];
+				&pp->cman_params->red_params[tc_id][color];
 			struct tm_wred_profile *src_wp =
 				tm_tc_wred_profile_get(dev, tc_id);
 			struct rte_tm_red_params *src =
lib/sched/meson.build +2 -1
index 8ced4547aa..df75db51ed 100644
@@ -7,11 +7,12 @@ if is_windows
     subdir_done()
 endif
 
-sources = files('rte_sched.c', 'rte_red.c', 'rte_approx.c')
+sources = files('rte_sched.c', 'rte_red.c', 'rte_approx.c', 'rte_pie.c')
 headers = files(
         'rte_approx.h',
         'rte_red.h',
         'rte_sched.h',
         'rte_sched_common.h',
+        'rte_pie.h',
 )
 deps += ['mbuf', 'meter']
lib/sched/rte_pie.c new file +82 -0

82 lines not on this page · raw message

lib/sched/rte_pie.h new file +393 -0

393 lines not on this page · raw message

lib/sched/rte_sched.c +168 -73

359 lines not on this page · raw message

lib/sched/rte_sched.h +50 -13

100 lines not on this page · raw message

lib/sched/version.map +4 -0
index 53c337b143..ffa5f7b10d 100644
@@ -30,4 +30,8 @@ EXPERIMENTAL {
 	rte_sched_subport_pipe_profile_add;
 	# added in 20.11
 	rte_sched_port_subport_profile_add;
+
+	# added in 21.11
+	rte_pie_rt_data_init;
+	rte_pie_config_init;
 };
Signature · 1 line
2.25.1
Acked-by on v18 1/5
#125 lore raw

Re: [dpdk-dev] [PATCH v18 1/5] sched: add PIE based congestion management

Quoted 37 lines

-----Original Message-----
From: Liguzinski, WojciechX <[email protected]>
Sent: Monday, October 25, 2021 12:32 PM
To: [email protected]; Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: Ajmera, Megha <[email protected]>
Subject: [PATCH v18 1/5] sched: add PIE based congestion management

Implement PIE based congestion management based on rfc8033

--
Changes in V18:
- Resolved merge conflict in lib/sched/meson.build after rebasing ontop of main
- Reverted whitespace change in app_thread.c - comment from Stephen Hemminger

Changes in V17:
- Corrected paragraph link naming in qos_framework.rst to fix CI builds

Changes in V16:
- Fixed 'title underline too short' error in qos_framework.rst
- Applied __rte_unused macro to parameters in rte_sched_port_pie_dequeue()

---
 drivers/net/softnic/rte_eth_softnic_tm.c |   6 +-
 lib/sched/meson.build                    |   3 +-
 lib/sched/rte_pie.c                      |  82 +++++
 lib/sched/rte_pie.h                      | 393 +++++++++++++++++++++++
 lib/sched/rte_sched.c                    | 241 +++++++++-----
 lib/sched/rte_sched.h                    |  63 +++-
 lib/sched/version.map                    |   4 +
 7 files changed, 702 insertions(+), 90 deletions(-)  create mode 100644
Quoted 2 lines

lib/sched/rte_pie.c create mode 100644 lib/sched/rte_pie.h

#126 lore raw

PATCH v18 2/5 example/qos_sched: add PIE support

In reply to Liguzinski, WojciechX

patch add support enable PIE or RED by
parsing config file.

---
 config/rte_config.h            |   1 -
 examples/qos_sched/cfg_file.c  | 127 +++++++++++++++------
 examples/qos_sched/cfg_file.h  |   5 +
 examples/qos_sched/init.c      |  27 +++--
 examples/qos_sched/main.h      |   3 +
 examples/qos_sched/profile.cfg | 196 ++++++++++++++++++++++-----------
 6 files changed, 250 insertions(+), 109 deletions(-)
config/rte_config.h +0 -1
index e0ead8b251..740f42c7e9 100644
@@ -90,7 +90,6 @@
 #define RTE_MAX_LCORE_FREQS 64
 
 /* rte_sched defines */
-#undef RTE_SCHED_RED
 #undef RTE_SCHED_COLLECT_STATS
 #undef RTE_SCHED_SUBPORT_TC_OV
 #define RTE_SCHED_PORT_N_GRINDERS 8
examples/qos_sched/cfg_file.c +94 -33

193 lines not on this page · raw message

examples/qos_sched/cfg_file.h +5 -0
index 0dc458aa71..1a9dce9db5 100644
@@ -12,6 +12,11 @@ int cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port);
 
 int cfg_load_pipe(struct rte_cfgfile *cfg, struct rte_sched_pipe_params *pipe);
 
+#ifdef RTE_SCHED_CMAN
+void set_subport_cman_params(struct rte_sched_subport_params *subport_p,
+					struct rte_sched_cman_params cman_p);
+#endif
+
 int cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subport);
 
 int cfg_load_subport_profile(struct rte_cfgfile *cfg,
examples/qos_sched/init.c +17 -10
index 9b34e4a76b..3c1f0bc680 100644
@@ -203,15 +203,9 @@ static struct rte_sched_subport_profile_params
 	},
 };
 
-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,
-		.n_pipe_profiles = sizeof(pipe_profiles) /
-			sizeof(struct rte_sched_pipe_params),
-		.n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES,
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
+struct rte_sched_cman_params cman_params = {
+	.cman_mode = RTE_SCHED_CMAN_RED,
 	.red_params = {
 		/* Traffic Class 0 Colors Green / Yellow / Red */
 		[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
@@ -278,7 +272,20 @@ struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = {
 		[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
 		[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
 	},
-#endif /* RTE_SCHED_RED */
+};
+#endif /* RTE_SCHED_CMAN */
+
+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,
+		.n_pipe_profiles = sizeof(pipe_profiles) /
+			sizeof(struct rte_sched_pipe_params),
+		.n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES,
+#ifdef RTE_SCHED_CMAN
+		.cman_params = &cman_params,
+#endif /* RTE_SCHED_CMAN */
 	},
 };
 
examples/qos_sched/main.h +3 -0
index 0d6815ae69..915311bac8 100644
@@ -153,6 +153,9 @@ extern uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE];
 extern uint32_t n_active_queues;
 
 extern struct rte_sched_port_params port_params;
+#ifdef RTE_SCHED_CMAN
+extern struct rte_sched_cman_params cman_params;
+#endif
 extern struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS];
 
 int app_parse_args(int argc, char **argv);
examples/qos_sched/profile.cfg +131 -65

199 lines not on this page · raw message

Signature · 1 line
2.25.1
Acked-by on v18 2/5
#127 lore raw

Re: [dpdk-dev] [PATCH v18 2/5] example/qos_sched: add PIE support

Quoted 14 lines

-----Original Message-----
From: Liguzinski, WojciechX <[email protected]>
Sent: Monday, October 25, 2021 12:32 PM
To: [email protected]; Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: Ajmera, Megha <[email protected]>
Subject: [PATCH v18 2/5] example/qos_sched: add PIE support

patch add support enable PIE or RED by
parsing config file.

Quoted 9 lines
---
 config/rte_config.h            |   1 -
 examples/qos_sched/cfg_file.c  | 127 +++++++++++++++------
 examples/qos_sched/cfg_file.h  |   5 +
 examples/qos_sched/init.c      |  27 +++--
 examples/qos_sched/main.h      |   3 +
 examples/qos_sched/profile.cfg | 196 ++++++++++++++++++++++-----------
 6 files changed, 250 insertions(+), 109 deletions(-)
#128 lore raw

PATCH v18 3/5 example/ip_pipeline: add PIE support

In reply to Liguzinski, WojciechX

Adding the PIE support for IP Pipeline

---
 examples/ip_pipeline/tmgr.c | 142 +++++++++++++++++++-----------------
 1 file changed, 74 insertions(+), 68 deletions(-)
examples/ip_pipeline/tmgr.c +74 -68
index e4e364cbc0..b138e885cf 100644
@@ -17,6 +17,77 @@ static uint32_t n_subport_profiles;
 static struct rte_sched_pipe_params
 	pipe_profile[TMGR_PIPE_PROFILE_MAX];
 
+#ifdef RTE_SCHED_CMAN
+static struct rte_sched_cman_params cman_params = {
+	.red_params = {
+		/* Traffic Class 0 Colors Green / Yellow / Red */
+		[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[0][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[0][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 1 - Colors Green / Yellow / Red */
+		[1][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[1][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[1][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 2 - Colors Green / Yellow / Red */
+		[2][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[2][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[2][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 3 - Colors Green / Yellow / Red */
+		[3][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[3][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[3][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 4 - Colors Green / Yellow / Red */
+		[4][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[4][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[4][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 5 - Colors Green / Yellow / Red */
+		[5][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[5][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[5][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 6 - Colors Green / Yellow / Red */
+		[6][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[6][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[6][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 7 - Colors Green / Yellow / Red */
+		[7][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[7][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[7][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 8 - Colors Green / Yellow / Red */
+		[8][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[8][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[8][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 9 - Colors Green / Yellow / Red */
+		[9][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[9][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[9][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 10 - Colors Green / Yellow / Red */
+		[10][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[10][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[10][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 11 - Colors Green / Yellow / Red */
+		[11][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[11][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[11][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 12 - Colors Green / Yellow / Red */
+		[12][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		},
+};
+#endif /* RTE_SCHED_CMAN */
+
 static uint32_t n_pipe_profiles;
 
 static const struct rte_sched_subport_params subport_params_default = {
@@ -25,74 +96,9 @@ static const struct rte_sched_subport_params subport_params_default = {
 	.pipe_profiles = pipe_profile,
 	.n_pipe_profiles = 0, /* filled at run time */
 	.n_max_pipe_profiles = RTE_DIM(pipe_profile),
-#ifdef RTE_SCHED_RED
-.red_params = {
-	/* Traffic Class 0 Colors Green / Yellow / Red */
-	[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[0][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[0][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 1 - Colors Green / Yellow / Red */
-	[1][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[1][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[1][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 2 - Colors Green / Yellow / Red */
-	[2][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[2][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[2][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 3 - Colors Green / Yellow / Red */
-	[3][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[3][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[3][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 4 - Colors Green / Yellow / Red */
-	[4][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[4][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[4][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 5 - Colors Green / Yellow / Red */
-	[5][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[5][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[5][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 6 - Colors Green / Yellow / Red */
-	[6][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[6][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[6][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 7 - Colors Green / Yellow / Red */
-	[7][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[7][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[7][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 8 - Colors Green / Yellow / Red */
-	[8][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[8][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[8][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 9 - Colors Green / Yellow / Red */
-	[9][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[9][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[9][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 10 - Colors Green / Yellow / Red */
-	[10][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[10][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[10][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 11 - Colors Green / Yellow / Red */
-	[11][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[11][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[11][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 12 - Colors Green / Yellow / Red */
-	[12][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	},
-#endif /* RTE_SCHED_RED */
+#ifdef RTE_SCHED_CMAN
+	.cman_params = &cman_params,
+#endif /* RTE_SCHED_CMAN */
 };
 
 static struct tmgr_port_list tmgr_port_list;
Signature · 1 line
2.25.1
Acked-by on v18 3/5
#129 lore raw

Re: [dpdk-dev] [PATCH v18 3/5] example/ip_pipeline: add PIE support

Quoted 10 lines

-----Original Message-----
From: Liguzinski, WojciechX <[email protected]>
Sent: Monday, October 25, 2021 12:32 PM
To: [email protected]; Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: Ajmera, Megha <[email protected]>
Subject: [PATCH v18 3/5] example/ip_pipeline: add PIE support

Quoted 7 lines

Adding the PIE support for IP Pipeline

---
 examples/ip_pipeline/tmgr.c | 142 +++++++++++++++++++-----------------
 1 file changed, 74 insertions(+), 68 deletions(-)
#130 lore raw

PATCH v18 4/5 doc/guides/prog_guide: added PIE

In reply to Liguzinski, WojciechX

Added PIE related information to documentation.

---
 doc/guides/prog_guide/glossary.rst           |  3 +
 doc/guides/prog_guide/qos_framework.rst      | 64 +++++++++++++++++---
 doc/guides/prog_guide/traffic_management.rst | 13 +++-
 3 files changed, 68 insertions(+), 12 deletions(-)
doc/guides/prog_guide/glossary.rst +3 -0
index 7044a7df2a..fb0910ba5b 100644
@@ -158,6 +158,9 @@ PCI
 PHY
    An abbreviation for the physical layer of the OSI model.
 
+PIE
+   Proportional Integral Controller Enhanced (RFC8033)
+
 pktmbuf
    An *mbuf* carrying a network packet.
 
doc/guides/prog_guide/qos_framework.rst +54 -10

116 lines not on this page · raw message

doc/guides/prog_guide/traffic_management.rst +11 -2
index 05b34d93a5..c356791a45 100644
@@ -22,6 +22,7 @@ Main features:
   shared (by multiple nodes) shapers
 * Congestion management for hierarchy leaf nodes: algorithms of tail drop, head
   drop, WRED, private (per node) and shared (by multiple nodes) WRED contexts
+  and PIE.
 * Packet marking: IEEE 802.1q (VLAN DEI), IETF RFC 3168 (IPv4/IPv6 ECN for TCP
   and SCTP), IETF RFC 2597 (IPv4 / IPv6 DSCP)
 
@@ -103,8 +104,9 @@ Congestion Management
 Congestion management is used to control the admission of packets into a packet
 queue or group of packet queues on congestion. The congestion management
 algorithms that are supported are: Tail Drop, Head Drop and Weighted Random
-Early Detection (WRED). They are made available for every leaf node in the
-hierarchy, subject to the specific implementation supporting them.
+Early Detection (WRED), Proportional Integral Controller Enhanced (PIE).
+They are made available for every leaf node in the hierarchy, subject to
+the specific implementation supporting them.
 On request of writing a new packet into the current queue while the queue is
 full, the Tail Drop algorithm drops the new packet while leaving the queue
 unmodified, as opposed to the Head Drop* algorithm, which drops the packet
@@ -128,6 +130,13 @@ The configuration of WRED private and shared contexts is done through the
 definition of WRED profiles. Any WRED profile can be used by one or several
 WRED contexts (either private or shared).
 
+The Proportional Integral Controller Enhanced (PIE) algorithm works by proactively
+dropping packets randomly. Calculated drop probability is updated periodically,
+based on latency measured and desired and whether the queuing latency is currently
+trending up or down. Queuing latency can be obtained using direct measurement or
+on estimations calculated from the queue length and dequeue rate. The random drop
+is triggered by a packet's arrival before enqueuing into a queue.
+
 
 Packet Marking
 --------------
Signature · 1 line
2.25.1
Acked-by on v18 4/5
#131 lore raw

Re: [dpdk-dev] [PATCH v18 4/5] doc/guides/prog_guide: added PIE

Quoted 10 lines

-----Original Message-----
From: Liguzinski, WojciechX <[email protected]>
Sent: Monday, October 25, 2021 12:32 PM
To: [email protected]; Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: Ajmera, Megha <[email protected]>
Subject: [PATCH v18 4/5] doc/guides/prog_guide: added PIE

Quoted 9 lines

Added PIE related information to documentation.

---
 doc/guides/prog_guide/glossary.rst           |  3 +
 doc/guides/prog_guide/qos_framework.rst      | 64 +++++++++++++++++---
 doc/guides/prog_guide/traffic_management.rst | 13 +++-
 3 files changed, 68 insertions(+), 12 deletions(-)
#132 lore raw

PATCH v18 5/5 app/test: add tests for PIE

In reply to Liguzinski, WojciechX

Tests for PIE code added to test application.

---
 app/test/meson.build |    4 +
 app/test/test_pie.c  | 1065 ++++++++++++++++++++++++++++++++++++++++++
 lib/sched/rte_pie.c  |    6 +-
 lib/sched/rte_pie.h  |   17 +-
 4 files changed, 1085 insertions(+), 7 deletions(-)
 create mode 100644 app/test/test_pie.c
app/test/meson.build +4 -0
index 20f36a1803..2ac716629b 100644
@@ -115,6 +115,7 @@ test_sources = files(
         'test_reciprocal_division.c',
         'test_reciprocal_division_perf.c',
         'test_red.c',
+        'test_pie.c',
         'test_reorder.c',
         'test_rib.c',
         'test_rib6.c',
@@ -249,6 +250,7 @@ fast_tests = [
         ['prefetch_autotest', true],
         ['rcu_qsbr_autotest', true],
         ['red_autotest', true],
+        ['pie_autotest', true],
         ['rib_autotest', true],
         ['rib6_autotest', true],
         ['ring_autotest', true],
@@ -300,6 +302,7 @@ perf_test_names = [
         'fib_slow_autotest',
         'fib_perf_autotest',
         'red_all',
+        'pie_all',
         'barrier_autotest',
         'hash_multiwriter_autotest',
         'timer_racecond_autotest',
@@ -313,6 +316,7 @@ perf_test_names = [
         'fib6_perf_autotest',
         'rcu_qsbr_perf_autotest',
         'red_perf',
+        'pie_perf',
         'distributor_perf_autotest',
         'pmd_perf_autotest',
         'stack_perf_autotest',
app/test/test_pie.c new file +1065 -0

1,065 lines not on this page · raw message

lib/sched/rte_pie.c +5 -1
index 2fcecb2db4..934e9aee50 100644
@@ -13,7 +13,7 @@
 #pragma warning(disable:2259) /* conversion may lose significant bits */
 #endif
 
-void
+int
 rte_pie_rt_data_init(struct rte_pie *pie)
 {
 	if (pie == NULL) {
@@ -22,6 +22,8 @@ rte_pie_rt_data_init(struct rte_pie *pie)
 
 		if (pie == NULL)
 			RTE_LOG(ERR, SCHED, "%s: Memory allocation fails\n", __func__);
+
+		return -1;
 	}
 
 	pie->active = 0;
@@ -35,6 +37,8 @@ rte_pie_rt_data_init(struct rte_pie *pie)
 	pie->qdelay_old = 0;
 	pie->drop_prob = 0;
 	pie->accu_prob = 0;
+
+	return 0;
 }
 
 int
lib/sched/rte_pie.h +11 -6
index f83c95664f..68f1b96192 100644
@@ -20,6 +20,7 @@ extern "C" {
 
 #include <rte_random.h>
 #include <rte_debug.h>
+#include <rte_cycles.h>
 
 #define RTE_DQ_THRESHOLD   16384   /**< Queue length threshold (2^14)
 				     * to start measurement cycle (bytes)
@@ -53,7 +54,7 @@ struct rte_pie_config {
 };
 
 /**
- * RED run-time data
+ * PIE run-time data
  */
 struct rte_pie {
 	uint16_t active;               /**< Flag for activating/deactivating pie */
@@ -74,8 +75,12 @@ struct rte_pie {
  * @brief Initialises run-time data
  *
  * @param pie [in,out] data pointer to PIE runtime data
+ *
+ * @return Operation status
+ * @retval 0 success
+ * @retval !0 error
  */
-void
+int
 __rte_experimental
 rte_pie_rt_data_init(struct rte_pie *pie);
 
@@ -113,7 +118,7 @@ rte_pie_config_init(struct rte_pie_config *pie_cfg,
  * @retval 0 enqueue the packet
  * @retval !0 drop the packet
  */
-static inline int
+static int
 __rte_experimental
 rte_pie_enqueue_empty(const struct rte_pie_config *pie_cfg,
 	struct rte_pie *pie,
@@ -145,7 +150,7 @@ rte_pie_enqueue_empty(const struct rte_pie_config *pie_cfg,
  * @param pie [in, out] data pointer to PIE runtime data
  * @param time [in] current time (measured in cpu cycles)
  */
-static inline void
+static void
 __rte_experimental
 _calc_drop_probability(const struct rte_pie_config *pie_cfg,
 	struct rte_pie *pie, uint64_t time)
@@ -155,7 +160,7 @@ _calc_drop_probability(const struct rte_pie_config *pie_cfg,
 	/* Note: can be implemented using integer multiply.
 	 * DQ_THRESHOLD is power of 2 value.
 	 */
-	double current_qdelay = pie->qlen * (pie->avg_dq_time / RTE_DQ_THRESHOLD);
+	uint64_t current_qdelay = pie->qlen * (pie->avg_dq_time >> 14);
 
 	double p = RTE_ALPHA * (current_qdelay - qdelay_ref) +
 		RTE_BETA * (current_qdelay - pie->qdelay_old);
@@ -181,7 +186,7 @@ _calc_drop_probability(const struct rte_pie_config *pie_cfg,
 	double qdelay = qdelay_ref * 0.5;
 
 	/*  Exponentially decay drop prob when congestion goes away  */
-	if (current_qdelay < qdelay && pie->qdelay_old < qdelay)
+	if ((double)current_qdelay < qdelay && pie->qdelay_old < qdelay)
 		pie->drop_prob *= 0.98;     /* 1 - 1/64 is sufficient */
 
 	/* Bound drop probability */
Signature · 1 line
2.25.1
Acked-by on v18 5/5
#133 lore raw

Re: [dpdk-dev] [PATCH v18 5/5] app/test: add tests for PIE

Quoted 13 lines

-----Original Message-----
From: Liguzinski, WojciechX <[email protected]>
Sent: Monday, October 25, 2021 12:32 PM
To: [email protected]; Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: Ajmera, Megha <[email protected]>
Subject: [PATCH v18 5/5] app/test: add tests for PIE

Tests for PIE code added to test application.

Quoted 9 lines
---
 app/test/meson.build |    4 +
 app/test/test_pie.c  | 1065
++++++++++++++++++++++++++++++++++++++++++
 lib/sched/rte_pie.c  |    6 +-
 lib/sched/rte_pie.h  |   17 +-
 4 files changed, 1085 insertions(+), 7 deletions(-)  create mode 100644

app/test/test_pie.c

#134 lore raw
In reply to Liguzinski, WojciechX

Hi Thomas,

Would you merge this patch as the series is acked by Cristian as below?
https://patchwork.dpdk.org/project/dpdk/cover/[email protected]/

Thanks & Regards,
Yu Liu

-----Original Message-----
From: dev <[email protected]> On Behalf Of Liguzinski, WojciechX
Sent: Monday, October 25, 2021 7:32 PM
To: [email protected]; Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: Ajmera, Megha <[email protected]>
Subject: [dpdk-dev] [PATCH v18 0/5] Add PIE support for HQoS library

DPDK sched library is equipped with mechanism that secures it from the bufferbloat problem which is a situation when excess buffers in the network cause high latency and latency variation. Currently, it supports RED for active queue management. However, more advanced queue management is required to address this problem and provide desirable quality of service to users.

This solution (RFC) proposes usage of new algorithm called "PIE" (Proportional Integral controller Enhanced) that can effectively and directly control queuing latency to address the bufferbloat problem.

The implementation of mentioned functionality includes modification of existing and adding a new set of data structures to the library, adding PIE related APIs. This affects structures in public API/ABI. That is why deprecation notice is going to be prepared and sent.

Liguzinski, WojciechX (5):
sched: add PIE based congestion management
example/qos_sched: add PIE support
example/ip_pipeline: add PIE support
doc/guides/prog_guide: added PIE
app/test: add tests for PIE

 app/test/meson.build                         |    4 +
 app/test/test_pie.c                          | 1065 ++++++++++++++++++
 config/rte_config.h                          |    1 -
 doc/guides/prog_guide/glossary.rst           |    3 +
 doc/guides/prog_guide/qos_framework.rst      |   64 +-
 doc/guides/prog_guide/traffic_management.rst |   13 +-
 drivers/net/softnic/rte_eth_softnic_tm.c     |    6 +-
 examples/ip_pipeline/tmgr.c                  |  142 +--
 examples/qos_sched/cfg_file.c                |  127 ++-
 examples/qos_sched/cfg_file.h                |    5 +
 examples/qos_sched/init.c                    |   27 +-
 examples/qos_sched/main.h                    |    3 +
 examples/qos_sched/profile.cfg               |  196 ++--
 lib/sched/meson.build                        |    3 +-
 lib/sched/rte_pie.c                          |   86 ++
 lib/sched/rte_pie.h                          |  398 +++++++
 lib/sched/rte_sched.c                        |  241 ++--
 lib/sched/rte_sched.h                        |   63 +-
 lib/sched/version.map                        |    4 +
 19 files changed, 2172 insertions(+), 279 deletions(-)  create mode 100644 app/test/test_pie.c  create mode 100644 lib/sched/rte_pie.c  create mode 100644 lib/sched/rte_pie.h

--
2.25.1

#135 lore raw

26/10/2021 10:24, Liu, Yu Y:

Quoted 4 lines

Hi Thomas,

Would you merge this patch as the series is acked by Cristian as below?
https://patchwork.dpdk.org/project/dpdk/cover/[email protected]/

I didn't see any email from Cristian.
It seems you just added this ack silently at the bottom of the cover letter.

1/ an email from Cristian is far better
2/ when integrating ack, it must be done in patches, not cover letter

Quoted 51 lines

Thanks & Regards,
Yu Liu

-----Original Message-----
From: dev <[email protected]> On Behalf Of Liguzinski, WojciechX
Sent: Monday, October 25, 2021 7:32 PM
To: [email protected]; Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: Ajmera, Megha <[email protected]>
Subject: [dpdk-dev] [PATCH v18 0/5] Add PIE support for HQoS library

DPDK sched library is equipped with mechanism that secures it from the bufferbloat problem which is a situation when excess buffers in the network cause high latency and latency variation. Currently, it supports RED for active queue management. However, more advanced queue management is required to address this problem and provide desirable quality of service to users.

This solution (RFC) proposes usage of new algorithm called "PIE" (Proportional Integral controller Enhanced) that can effectively and directly control queuing latency to address the bufferbloat problem.

The implementation of mentioned functionality includes modification of existing and adding a new set of data structures to the library, adding PIE related APIs. This affects structures in public API/ABI. That is why deprecation notice is going to be prepared and sent.

Liguzinski, WojciechX (5):
sched: add PIE based congestion management
example/qos_sched: add PIE support
example/ip_pipeline: add PIE support
doc/guides/prog_guide: added PIE
app/test: add tests for PIE

 app/test/meson.build                         |    4 +
 app/test/test_pie.c                          | 1065 ++++++++++++++++++
 config/rte_config.h                          |    1 -
 doc/guides/prog_guide/glossary.rst           |    3 +
 doc/guides/prog_guide/qos_framework.rst      |   64 +-
 doc/guides/prog_guide/traffic_management.rst |   13 +-
 drivers/net/softnic/rte_eth_softnic_tm.c     |    6 +-
 examples/ip_pipeline/tmgr.c                  |  142 +--
 examples/qos_sched/cfg_file.c                |  127 ++-
 examples/qos_sched/cfg_file.h                |    5 +
 examples/qos_sched/init.c                    |   27 +-
 examples/qos_sched/main.h                    |    3 +
 examples/qos_sched/profile.cfg               |  196 ++--
 lib/sched/meson.build                        |    3 +-
 lib/sched/rte_pie.c                          |   86 ++
 lib/sched/rte_pie.h                          |  398 +++++++
 lib/sched/rte_sched.c                        |  241 ++--
 lib/sched/rte_sched.h                        |   63 +-
 lib/sched/version.map                        |    4 +
 19 files changed, 2172 insertions(+), 279 deletions(-)  create mode 100644 app/test/test_pie.c  create mode 100644 lib/sched/rte_pie.c  create mode 100644 lib/sched/rte_pie.h

--
2.25.1

#136 lore raw
Quoted 17 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Tuesday, October 26, 2021 9:33 AM
To: Liguzinski, WojciechX <[email protected]>; Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>; Liu, Yu Y <[email protected]>
Cc: [email protected]; Ajmera, Megha <[email protected]>; Liu, Yu Y <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH v18 0/5] Add PIE support for HQoS library

26/10/2021 10:24, Liu, Yu Y:

Quoted 4 lines

Hi Thomas,

Would you merge this patch as the series is acked by Cristian as below?

Quoted 9 lines

https://patchwork.dpdk.org/project/dpdk/cover/20211019081902.3514841-
[email protected]/

I didn't see any email from Cristian.
It seems you just added this ack silently at the bottom of the cover letter.

1/ an email from Cristian is far better
2/ when integrating ack, it must be done in patches, not cover letter

Hi Thomas,

I did ack this set in a previous version (V15) by replying with "Series-acked-by" on the cover letter email, which does not show in patchwork. Is there a better way to do this?

It would be good to have Jasvinder's ack as well on this series, as he is looking into some other aspects of the sched library.

Regards,
Cristian

Quoted 69 lines
Quoted 9 lines

Thanks & Regards,
Yu Liu

-----Original Message-----
From: dev <[email protected]> On Behalf Of Liguzinski, WojciechX
Sent: Monday, October 25, 2021 7:32 PM
To: [email protected]; Singh, Jasvinder <[email protected]>;

Dumitrescu, Cristian <[email protected]>

Quoted 4 lines

Cc: Ajmera, Megha <[email protected]>
Subject: [dpdk-dev] [PATCH v18 0/5] Add PIE support for HQoS library

DPDK sched library is equipped with mechanism that secures it from the

bufferbloat problem which is a situation when excess buffers in the network cause high latency and latency variation. Currently, it supports RED for active queue management. However, more advanced queue management is required to address this problem and provide desirable quality of service to users.

Quoted 2 lines

This solution (RFC) proposes usage of new algorithm called "PIE"

(Proportional Integral controller Enhanced) that can effectively and directly control queuing latency to address the bufferbloat problem.

Quoted 2 lines

The implementation of mentioned functionality includes modification of

existing and adding a new set of data structures to the library, adding PIE related APIs.

Quoted 1 line

This affects structures in public API/ABI. That is why deprecation notice is

going to be prepared and sent.

Quoted 20 lines

Liguzinski, WojciechX (5):
sched: add PIE based congestion management
example/qos_sched: add PIE support
example/ip_pipeline: add PIE support
doc/guides/prog_guide: added PIE
app/test: add tests for PIE

 app/test/meson.build                         |    4 +
 app/test/test_pie.c                          | 1065 ++++++++++++++++++
 config/rte_config.h                          |    1 -
 doc/guides/prog_guide/glossary.rst           |    3 +
 doc/guides/prog_guide/qos_framework.rst      |   64 +-
 doc/guides/prog_guide/traffic_management.rst |   13 +-
 drivers/net/softnic/rte_eth_softnic_tm.c     |    6 +-
 examples/ip_pipeline/tmgr.c                  |  142 +--
 examples/qos_sched/cfg_file.c                |  127 ++-
 examples/qos_sched/cfg_file.h                |    5 +
 examples/qos_sched/init.c                    |   27 +-
 examples/qos_sched/main.h                    |    3 +
Quoted 8 lines
 examples/qos_sched/profile.cfg               |  196 ++--
 lib/sched/meson.build                        |    3 +-
 lib/sched/rte_pie.c                          |   86 ++
 lib/sched/rte_pie.h                          |  398 +++++++
 lib/sched/rte_sched.c                        |  241 ++--
 lib/sched/rte_sched.h                        |   63 +-
 lib/sched/version.map                        |    4 +
 19 files changed, 2172 insertions(+), 279 deletions(-)  create mode 100644

app/test/test_pie.c create mode 100644 lib/sched/rte_pie.c create mode 100644 lib/sched/rte_pie.h

Quoted 6 lines

--
2.25.1

#137 lore raw

26/10/2021 12:02, Dumitrescu, Cristian:

Quoted 12 lines

From: Thomas Monjalon <[email protected]>

Quoted 11 lines

26/10/2021 10:24, Liu, Yu Y:

Quoted 4 lines

Hi Thomas,

Would you merge this patch as the series is acked by Cristian as below?

https://patchwork.dpdk.org/project/dpdk/cover/20211019081902.3514841-
[email protected]/

I didn't see any email from Cristian.
It seems you just added this ack silently at the bottom of the cover letter.

Quoted 7 lines
Quoted 3 lines

1/ an email from Cristian is far better
2/ when integrating ack, it must be done in patches, not cover letter

Hi Thomas,

I did ack this set in a previous version (V15) by replying with "Series-acked-by" on the cover letter email, which does not show in patchwork. Is there a better way to do this?

No you did the right thing (I missed this email on v15).
But v16 did not show your ack.
And v17 added it only in the cover letter instead of reporting it in all patches.

Quoted 1 line

It would be good to have Jasvinder's ack as well on this series, as he is looking into some other aspects of the sched library.

Yes

#138 lore raw

Hi,

V16 - My bad, probably I haven't copied it correctly when preparing cover letter
V17 - I understood Cristian's comment as to copy the Series ACK to next versions of patches, and not to "split it" for each one. If that was the correct way I had no knowledge about it.

Wojtek

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Tuesday, October 26, 2021 12:10 PM
To: Liguzinski, WojciechX <[email protected]>; Singh, Jasvinder <[email protected]>; Liu, Yu Y <[email protected]>; Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: [email protected]; Ajmera, Megha <[email protected]>; Liu, Yu Y <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH v18 0/5] Add PIE support for HQoS library

26/10/2021 12:02, Dumitrescu, Cristian:

Quoted 13 lines

From: Thomas Monjalon <[email protected]>

Quoted 12 lines

26/10/2021 10:24, Liu, Yu Y:

Quoted 4 lines

Hi Thomas,

Would you merge this patch as the series is acked by Cristian as below?

https://patchwork.dpdk.org/project/dpdk/cover/20211019081902.3514841
-
[email protected]/

I didn't see any email from Cristian.
It seems you just added this ack silently at the bottom of the cover letter.

Quoted 7 lines
Quoted 3 lines

1/ an email from Cristian is far better 2/ when integrating ack, it must be done in patches, not cover letter

Hi Thomas,

I did ack this set in a previous version (V15) by replying with "Series-acked-by" on the cover letter email, which does not show in patchwork. Is there a better way to do this?

No you did the right thing (I missed this email on v15).
But v16 did not show your ack.
And v17 added it only in the cover letter instead of reporting it in all patches.

Quoted 1 line

It would be good to have Jasvinder's ack as well on this series, as he is looking into some other aspects of the sched library.

Yes

#139 lore raw

26/10/2021 12:20, Liguzinski, WojciechX:

Quoted 4 lines

Hi,

V16 - My bad, probably I haven't copied it correctly when preparing cover letter
V17 - I understood Cristian's comment as to copy the Series ACK to next versions of patches, and not to "split it" for each one. If that was the correct way I had no knowledge about it.

Yes you had to reproduce it in each patch. Otherwise who would do it to make it appear in patchwork and in the git history when merged? I understand you did not have that knowledge.
For future, I hope the Intel team will better track features patches of newcomers so they don't miss something knew by others.

John, I know knowledge sharing is not an easy task, we always have to improve :)

Quoted 34 lines

From: Thomas Monjalon <[email protected]>
26/10/2021 12:02, Dumitrescu, Cristian:

Quoted 13 lines

From: Thomas Monjalon <[email protected]>

Quoted 12 lines

26/10/2021 10:24, Liu, Yu Y:

Quoted 4 lines

Hi Thomas,

Would you merge this patch as the series is acked by Cristian as below?

https://patchwork.dpdk.org/project/dpdk/cover/20211019081902.3514841
-
[email protected]/

I didn't see any email from Cristian.
It seems you just added this ack silently at the bottom of the cover letter.

Quoted 7 lines
Quoted 3 lines

1/ an email from Cristian is far better 2/ when integrating ack, it must be done in patches, not cover letter

Hi Thomas,

I did ack this set in a previous version (V15) by replying with "Series-acked-by" on the cover letter email, which does not show in patchwork. Is there a better way to do this?

No you did the right thing (I missed this email on v15).
But v16 did not show your ack.
And v17 added it only in the cover letter instead of reporting it in all patches.

Quoted 1 line

It would be good to have Jasvinder's ack as well on this series, as he is looking into some other aspects of the sched library.

Yes

#140 lore raw

v19 cover Add PIE support for HQoS library

In reply to Liguzinski, WojciechX

DPDK sched library is equipped with mechanism that secures it from the bufferbloat problem which is a situation when excess buffers in the network cause high latency and latency variation. Currently, it supports RED for active queue management. However, more advanced queue management is required to address this problem and provide desirable quality of service to users.

This solution (RFC) proposes usage of new algorithm called "PIE" (Proportional Integral controller Enhanced) that can effectively and directly control queuing latency to address the bufferbloat problem.

The implementation of mentioned functionality includes modification of existing and adding a new set of data structures to the library, adding PIE related APIs. This affects structures in public API/ABI. That is why deprecation notice is going to be prepared and sent.

Liguzinski, WojciechX (5):
sched: add PIE based congestion management
example/qos_sched: add PIE support
example/ip_pipeline: add PIE support
doc/guides/prog_guide: added PIE
app/test: add tests for PIE

 app/test/meson.build                         |    4 +
 app/test/test_pie.c                          | 1065 ++++++++++++++++++
 config/rte_config.h                          |    1 -
 doc/guides/prog_guide/glossary.rst           |    3 +
 doc/guides/prog_guide/qos_framework.rst      |   64 +-
 doc/guides/prog_guide/traffic_management.rst |   13 +-
 drivers/net/softnic/rte_eth_softnic_tm.c     |    6 +-
 examples/ip_pipeline/tmgr.c                  |  142 +--
 examples/qos_sched/cfg_file.c                |  127 ++-
 examples/qos_sched/cfg_file.h                |    5 +
 examples/qos_sched/init.c                    |   27 +-
 examples/qos_sched/main.h                    |    3 +
 examples/qos_sched/profile.cfg               |  196 ++--
 lib/sched/meson.build                        |    3 +-
 lib/sched/rte_pie.c                          |   86 ++
 lib/sched/rte_pie.h                          |  398 +++++++
 lib/sched/rte_sched.c                        |  241 ++--
 lib/sched/rte_sched.h                        |   63 +-
 lib/sched/version.map                        |    4 +
 19 files changed, 2172 insertions(+), 279 deletions(-)
 create mode 100644 app/test/test_pie.c
 create mode 100644 lib/sched/rte_pie.c
 create mode 100644 lib/sched/rte_pie.h
Signature · 1 line
2.25.1
#141 lore raw

PATCH v19 1/5 sched: add PIE based congestion management

Implement PIE based congestion management based on rfc8033

--
Changes in V19:
- ACKs included in patches

Changes in V18:
- Resolved merge conflict in lib/sched/meson.build after rebasing ontop of main
- Reverted whitespace change in app_thread.c - comment from Stephen Hemminger

Changes in V17:
- Corrected paragraph link naming in qos_framework.rst to fix CI builds

Changes in V16:
- Fixed 'title underline too short' error in qos_framework.rst
- Applied __rte_unused macro to parameters in rte_sched_port_pie_dequeue()

---
 drivers/net/softnic/rte_eth_softnic_tm.c |   6 +-
 lib/sched/meson.build                    |   3 +-
 lib/sched/rte_pie.c                      |  82 +++++
 lib/sched/rte_pie.h                      | 393 +++++++++++++++++++++++
 lib/sched/rte_sched.c                    | 241 +++++++++-----
 lib/sched/rte_sched.h                    |  63 +++-
 lib/sched/version.map                    |   4 +
 7 files changed, 702 insertions(+), 90 deletions(-)
 create mode 100644 lib/sched/rte_pie.c
 create mode 100644 lib/sched/rte_pie.h
drivers/net/softnic/rte_eth_softnic_tm.c +3 -3
index 90baba15ce..e74092ce7f 100644
@@ -420,7 +420,7 @@ pmd_tm_node_type_get(struct rte_eth_dev *dev,
 	return 0;
 }
 
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
 #define WRED_SUPPORTED						1
 #else
 #define WRED_SUPPORTED						0
@@ -2306,7 +2306,7 @@ tm_tc_wred_profile_get(struct rte_eth_dev *dev, uint32_t tc_id)
 	return NULL;
 }
 
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
 
 static void
 wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id)
@@ -2321,7 +2321,7 @@ wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id)
 	for (tc_id = 0; tc_id < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; tc_id++)
 		for (color = RTE_COLOR_GREEN; color < RTE_COLORS; color++) {
 			struct rte_red_params *dst =
-				&pp->red_params[tc_id][color];
+				&pp->cman_params->red_params[tc_id][color];
 			struct tm_wred_profile *src_wp =
 				tm_tc_wred_profile_get(dev, tc_id);
 			struct rte_tm_red_params *src =
lib/sched/meson.build +2 -1
index 8ced4547aa..df75db51ed 100644
@@ -7,11 +7,12 @@ if is_windows
     subdir_done()
 endif
 
-sources = files('rte_sched.c', 'rte_red.c', 'rte_approx.c')
+sources = files('rte_sched.c', 'rte_red.c', 'rte_approx.c', 'rte_pie.c')
 headers = files(
         'rte_approx.h',
         'rte_red.h',
         'rte_sched.h',
         'rte_sched_common.h',
+        'rte_pie.h',
 )
 deps += ['mbuf', 'meter']
lib/sched/rte_pie.c new file +82 -0

82 lines not on this page · raw message

lib/sched/rte_pie.h new file +393 -0

393 lines not on this page · raw message

lib/sched/rte_sched.c +168 -73

359 lines not on this page · raw message

lib/sched/rte_sched.h +50 -13

100 lines not on this page · raw message

lib/sched/version.map +4 -0
index a6e505c8ac..d22c07fc9f 100644
@@ -30,4 +30,8 @@ EXPERIMENTAL {
 
 	# added in 20.11
 	rte_sched_port_subport_profile_add;
+
+	# added in 21.11
+	rte_pie_rt_data_init;
+	rte_pie_config_init;
 };
Signature · 1 line
2.25.1
#142 lore raw

Re: [dpdk-dev] [PATCH v19 1/5] sched: add PIE based congestion management

28/10/2021 12:17, Liguzinski, WojciechX:

Quoted 9 lines

Implement PIE based congestion management based on rfc8033

--
Changes in V19:
- ACKs included in patches

Would be good to fix your own name as well.
I guess your first name is not WojciechX but Wojciech. And we put first name first without a comma.

Also the related doc change should be in this patch.

It's OK that you don't have all knowledge of the process, I am just disappointed that you don't get more help from those adding your acks, so it falls on me to fix.

#143 lore raw

Re: [dpdk-dev] [PATCH v19 1/5] sched: add PIE based congestion management

Sure, I will correct the name.
As I can see from a distance that some things could be resolved/corrected from the very beginning (like e.g. the name and its format).

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Friday, October 29, 2021 3:44 PM
To: Liguzinski, WojciechX <[email protected]>
Cc: [email protected]; Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>; Ajmera, Megha <[email protected]>; Mcnamara, John <[email protected]>; Yigit, Ferruh <[email protected]>; Richardson, Bruce <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v19 1/5] sched: add PIE based congestion management

28/10/2021 12:17, Liguzinski, WojciechX:

Quoted 9 lines

Implement PIE based congestion management based on rfc8033

--
Changes in V19:
- ACKs included in patches

Would be good to fix your own name as well.
I guess your first name is not WojciechX but Wojciech. And we put first name first without a comma.

Also the related doc change should be in this patch.

It's OK that you don't have all knowledge of the process, I am just disappointed that you don't get more help from those adding your acks, so it falls on me to fix.

#144 lore raw

Re: [dpdk-dev] [PATCH v19 1/5] sched: add PIE based congestion management

In reply to Liguzinski, WojciechX

28/10/2021 12:17, Liguzinski, WojciechX:

Quoted 1 line

Implement PIE based congestion management based on rfc8033

An explanation is missing about why RED code is removed.
I don't know whether it deserves a separate commit,
but at least it should be removed consisently in lib and example code in the same patch.

Cristian, please make efforts to help this patchset be properly organized. A blind ack is not enough.

#145 lore raw

Re: [dpdk-dev] [PATCH v19 1/5] sched: add PIE based congestion management

Quoted 16 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Friday, October 29, 2021 2:58 PM
To: Dumitrescu, Cristian <[email protected]>
Cc: [email protected]; Singh, Jasvinder <[email protected]>; Ajmera, Megha <[email protected]>; Liguzinski, WojciechX <[email protected]>; [email protected]; Mcnamara, John <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v19 1/5] sched: add PIE based congestion management

28/10/2021 12:17, Liguzinski, WojciechX:

Quoted 1 line

Implement PIE based congestion management based on rfc8033

Quoted 8 lines

An explanation is missing about why RED code is removed.
I don't know whether it deserves a separate commit,
but at least it should be removed consisently in lib and example code in the same patch.

Cristian, please make efforts to help this patchset be properly organized. A blind ack is not enough.

The RED code is not removed. It is simply the macro renamed to CMAN (Congestion Management) to include both RED and PIE.

#146 lore raw

Re: [dpdk-dev] [PATCH v19 1/5] sched: add PIE based congestion management

29/10/2021 16:06, Dumitrescu, Cristian:

Quoted 9 lines

From: Thomas Monjalon <[email protected]>

Quoted 8 lines

28/10/2021 12:17, Liguzinski, WojciechX:

Quoted 1 line

Implement PIE based congestion management based on rfc8033

An explanation is missing about why RED code is removed.
I don't know whether it deserves a separate commit,
but at least it should be removed consisently in lib and example code in the same patch.

Quoted 5 lines
Quoted 3 lines

Cristian, please make efforts to help this patchset be properly organized. A blind ack is not enough.

The RED code is not removed. It is simply the macro renamed to CMAN (Congestion Management) to include both RED and PIE.

OK, and where this macro is defined?
Why is there such #ifdef?
Even the API is conditionally compiled!

#147 lore raw

PATCH v19 2/5 example/qos_sched: add PIE support

In reply to Liguzinski, WojciechX

patch add support enable PIE or RED by
parsing config file.

---
 config/rte_config.h            |   1 -
 examples/qos_sched/cfg_file.c  | 127 +++++++++++++++------
 examples/qos_sched/cfg_file.h  |   5 +
 examples/qos_sched/init.c      |  27 +++--
 examples/qos_sched/main.h      |   3 +
 examples/qos_sched/profile.cfg | 196 ++++++++++++++++++++++-----------
 6 files changed, 250 insertions(+), 109 deletions(-)
config/rte_config.h +0 -1
index 1a66b42fcc..6ec687a555 100644
@@ -89,7 +89,6 @@
 #define RTE_MAX_LCORE_FREQS 64
 
 /* rte_sched defines */
-#undef RTE_SCHED_RED
 #undef RTE_SCHED_COLLECT_STATS
 #undef RTE_SCHED_SUBPORT_TC_OV
 #define RTE_SCHED_PORT_N_GRINDERS 8
examples/qos_sched/cfg_file.c +94 -33

193 lines not on this page · raw message

examples/qos_sched/cfg_file.h +5 -0
index 0dc458aa71..1a9dce9db5 100644
@@ -12,6 +12,11 @@ int cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port);
 
 int cfg_load_pipe(struct rte_cfgfile *cfg, struct rte_sched_pipe_params *pipe);
 
+#ifdef RTE_SCHED_CMAN
+void set_subport_cman_params(struct rte_sched_subport_params *subport_p,
+					struct rte_sched_cman_params cman_p);
+#endif
+
 int cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subport);
 
 int cfg_load_subport_profile(struct rte_cfgfile *cfg,
examples/qos_sched/init.c +17 -10
index 9b34e4a76b..3c1f0bc680 100644
@@ -203,15 +203,9 @@ static struct rte_sched_subport_profile_params
 	},
 };
 
-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,
-		.n_pipe_profiles = sizeof(pipe_profiles) /
-			sizeof(struct rte_sched_pipe_params),
-		.n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES,
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
+struct rte_sched_cman_params cman_params = {
+	.cman_mode = RTE_SCHED_CMAN_RED,
 	.red_params = {
 		/* Traffic Class 0 Colors Green / Yellow / Red */
 		[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
@@ -278,7 +272,20 @@ struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = {
 		[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
 		[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
 	},
-#endif /* RTE_SCHED_RED */
+};
+#endif /* RTE_SCHED_CMAN */
+
+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,
+		.n_pipe_profiles = sizeof(pipe_profiles) /
+			sizeof(struct rte_sched_pipe_params),
+		.n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES,
+#ifdef RTE_SCHED_CMAN
+		.cman_params = &cman_params,
+#endif /* RTE_SCHED_CMAN */
 	},
 };
 
examples/qos_sched/main.h +3 -0
index 0d6815ae69..915311bac8 100644
@@ -153,6 +153,9 @@ extern uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE];
 extern uint32_t n_active_queues;
 
 extern struct rte_sched_port_params port_params;
+#ifdef RTE_SCHED_CMAN
+extern struct rte_sched_cman_params cman_params;
+#endif
 extern struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS];
 
 int app_parse_args(int argc, char **argv);
examples/qos_sched/profile.cfg +131 -65

199 lines not on this page · raw message

Signature · 1 line
2.25.1
#148 lore raw

PATCH v19 3/5 example/ip_pipeline: add PIE support

In reply to Liguzinski, WojciechX

Adding the PIE support for IP Pipeline

---
 examples/ip_pipeline/tmgr.c | 142 +++++++++++++++++++-----------------
 1 file changed, 74 insertions(+), 68 deletions(-)
examples/ip_pipeline/tmgr.c +74 -68
index e4e364cbc0..b138e885cf 100644
@@ -17,6 +17,77 @@ static uint32_t n_subport_profiles;
 static struct rte_sched_pipe_params
 	pipe_profile[TMGR_PIPE_PROFILE_MAX];
 
+#ifdef RTE_SCHED_CMAN
+static struct rte_sched_cman_params cman_params = {
+	.red_params = {
+		/* Traffic Class 0 Colors Green / Yellow / Red */
+		[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[0][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[0][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 1 - Colors Green / Yellow / Red */
+		[1][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[1][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[1][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 2 - Colors Green / Yellow / Red */
+		[2][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[2][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[2][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 3 - Colors Green / Yellow / Red */
+		[3][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[3][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[3][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 4 - Colors Green / Yellow / Red */
+		[4][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[4][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[4][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 5 - Colors Green / Yellow / Red */
+		[5][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[5][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[5][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 6 - Colors Green / Yellow / Red */
+		[6][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[6][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[6][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 7 - Colors Green / Yellow / Red */
+		[7][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[7][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[7][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 8 - Colors Green / Yellow / Red */
+		[8][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[8][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[8][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 9 - Colors Green / Yellow / Red */
+		[9][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[9][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[9][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 10 - Colors Green / Yellow / Red */
+		[10][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[10][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[10][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 11 - Colors Green / Yellow / Red */
+		[11][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[11][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[11][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 12 - Colors Green / Yellow / Red */
+		[12][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		},
+};
+#endif /* RTE_SCHED_CMAN */
+
 static uint32_t n_pipe_profiles;
 
 static const struct rte_sched_subport_params subport_params_default = {
@@ -25,74 +96,9 @@ static const struct rte_sched_subport_params subport_params_default = {
 	.pipe_profiles = pipe_profile,
 	.n_pipe_profiles = 0, /* filled at run time */
 	.n_max_pipe_profiles = RTE_DIM(pipe_profile),
-#ifdef RTE_SCHED_RED
-.red_params = {
-	/* Traffic Class 0 Colors Green / Yellow / Red */
-	[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[0][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[0][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 1 - Colors Green / Yellow / Red */
-	[1][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[1][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[1][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 2 - Colors Green / Yellow / Red */
-	[2][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[2][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[2][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 3 - Colors Green / Yellow / Red */
-	[3][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[3][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[3][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 4 - Colors Green / Yellow / Red */
-	[4][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[4][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[4][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 5 - Colors Green / Yellow / Red */
-	[5][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[5][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[5][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 6 - Colors Green / Yellow / Red */
-	[6][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[6][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[6][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 7 - Colors Green / Yellow / Red */
-	[7][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[7][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[7][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 8 - Colors Green / Yellow / Red */
-	[8][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[8][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[8][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 9 - Colors Green / Yellow / Red */
-	[9][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[9][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[9][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 10 - Colors Green / Yellow / Red */
-	[10][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[10][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[10][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 11 - Colors Green / Yellow / Red */
-	[11][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[11][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[11][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 12 - Colors Green / Yellow / Red */
-	[12][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	},
-#endif /* RTE_SCHED_RED */
+#ifdef RTE_SCHED_CMAN
+	.cman_params = &cman_params,
+#endif /* RTE_SCHED_CMAN */
 };
 
 static struct tmgr_port_list tmgr_port_list;
Signature · 1 line
2.25.1
#149 lore raw

PATCH v19 4/5 doc/guides/prog_guide: added PIE

In reply to Liguzinski, WojciechX

Added PIE related information to documentation.

---
 doc/guides/prog_guide/glossary.rst           |  3 +
 doc/guides/prog_guide/qos_framework.rst      | 64 +++++++++++++++++---
 doc/guides/prog_guide/traffic_management.rst | 13 +++-
 3 files changed, 68 insertions(+), 12 deletions(-)
doc/guides/prog_guide/glossary.rst +3 -0
index 7044a7df2a..fb0910ba5b 100644
@@ -158,6 +158,9 @@ PCI
 PHY
    An abbreviation for the physical layer of the OSI model.
 
+PIE
+   Proportional Integral Controller Enhanced (RFC8033)
+
 pktmbuf
    An *mbuf* carrying a network packet.
 
doc/guides/prog_guide/qos_framework.rst +54 -10

116 lines not on this page · raw message

doc/guides/prog_guide/traffic_management.rst +11 -2
index 05b34d93a5..c356791a45 100644
@@ -22,6 +22,7 @@ Main features:
   shared (by multiple nodes) shapers
 * Congestion management for hierarchy leaf nodes: algorithms of tail drop, head
   drop, WRED, private (per node) and shared (by multiple nodes) WRED contexts
+  and PIE.
 * Packet marking: IEEE 802.1q (VLAN DEI), IETF RFC 3168 (IPv4/IPv6 ECN for TCP
   and SCTP), IETF RFC 2597 (IPv4 / IPv6 DSCP)
 
@@ -103,8 +104,9 @@ Congestion Management
 Congestion management is used to control the admission of packets into a packet
 queue or group of packet queues on congestion. The congestion management
 algorithms that are supported are: Tail Drop, Head Drop and Weighted Random
-Early Detection (WRED). They are made available for every leaf node in the
-hierarchy, subject to the specific implementation supporting them.
+Early Detection (WRED), Proportional Integral Controller Enhanced (PIE).
+They are made available for every leaf node in the hierarchy, subject to
+the specific implementation supporting them.
 On request of writing a new packet into the current queue while the queue is
 full, the Tail Drop algorithm drops the new packet while leaving the queue
 unmodified, as opposed to the Head Drop* algorithm, which drops the packet
@@ -128,6 +130,13 @@ The configuration of WRED private and shared contexts is done through the
 definition of WRED profiles. Any WRED profile can be used by one or several
 WRED contexts (either private or shared).
 
+The Proportional Integral Controller Enhanced (PIE) algorithm works by proactively
+dropping packets randomly. Calculated drop probability is updated periodically,
+based on latency measured and desired and whether the queuing latency is currently
+trending up or down. Queuing latency can be obtained using direct measurement or
+on estimations calculated from the queue length and dequeue rate. The random drop
+is triggered by a packet's arrival before enqueuing into a queue.
+
 
 Packet Marking
 --------------
Signature · 1 line
2.25.1
#150 lore raw

PATCH v19 5/5 app/test: add tests for PIE

In reply to Liguzinski, WojciechX

Tests for PIE code added to test application.

---
 app/test/meson.build |    4 +
 app/test/test_pie.c  | 1065 ++++++++++++++++++++++++++++++++++++++++++
 lib/sched/rte_pie.c  |    6 +-
 lib/sched/rte_pie.h  |   17 +-
 4 files changed, 1085 insertions(+), 7 deletions(-)
 create mode 100644 app/test/test_pie.c
app/test/meson.build +4 -0
index 20f36a1803..2ac716629b 100644
@@ -115,6 +115,7 @@ test_sources = files(
         'test_reciprocal_division.c',
         'test_reciprocal_division_perf.c',
         'test_red.c',
+        'test_pie.c',
         'test_reorder.c',
         'test_rib.c',
         'test_rib6.c',
@@ -249,6 +250,7 @@ fast_tests = [
         ['prefetch_autotest', true],
         ['rcu_qsbr_autotest', true],
         ['red_autotest', true],
+        ['pie_autotest', true],
         ['rib_autotest', true],
         ['rib6_autotest', true],
         ['ring_autotest', true],
@@ -300,6 +302,7 @@ perf_test_names = [
         'fib_slow_autotest',
         'fib_perf_autotest',
         'red_all',
+        'pie_all',
         'barrier_autotest',
         'hash_multiwriter_autotest',
         'timer_racecond_autotest',
@@ -313,6 +316,7 @@ perf_test_names = [
         'fib6_perf_autotest',
         'rcu_qsbr_perf_autotest',
         'red_perf',
+        'pie_perf',
         'distributor_perf_autotest',
         'pmd_perf_autotest',
         'stack_perf_autotest',
app/test/test_pie.c new file +1065 -0

1,065 lines not on this page · raw message

lib/sched/rte_pie.c +5 -1
index 2fcecb2db4..934e9aee50 100644
@@ -13,7 +13,7 @@
 #pragma warning(disable:2259) /* conversion may lose significant bits */
 #endif
 
-void
+int
 rte_pie_rt_data_init(struct rte_pie *pie)
 {
 	if (pie == NULL) {
@@ -22,6 +22,8 @@ rte_pie_rt_data_init(struct rte_pie *pie)
 
 		if (pie == NULL)
 			RTE_LOG(ERR, SCHED, "%s: Memory allocation fails\n", __func__);
+
+		return -1;
 	}
 
 	pie->active = 0;
@@ -35,6 +37,8 @@ rte_pie_rt_data_init(struct rte_pie *pie)
 	pie->qdelay_old = 0;
 	pie->drop_prob = 0;
 	pie->accu_prob = 0;
+
+	return 0;
 }
 
 int
lib/sched/rte_pie.h +11 -6
index f83c95664f..68f1b96192 100644
@@ -20,6 +20,7 @@ extern "C" {
 
 #include <rte_random.h>
 #include <rte_debug.h>
+#include <rte_cycles.h>
 
 #define RTE_DQ_THRESHOLD   16384   /**< Queue length threshold (2^14)
 				     * to start measurement cycle (bytes)
@@ -53,7 +54,7 @@ struct rte_pie_config {
 };
 
 /**
- * RED run-time data
+ * PIE run-time data
  */
 struct rte_pie {
 	uint16_t active;               /**< Flag for activating/deactivating pie */
@@ -74,8 +75,12 @@ struct rte_pie {
  * @brief Initialises run-time data
  *
  * @param pie [in,out] data pointer to PIE runtime data
+ *
+ * @return Operation status
+ * @retval 0 success
+ * @retval !0 error
  */
-void
+int
 __rte_experimental
 rte_pie_rt_data_init(struct rte_pie *pie);
 
@@ -113,7 +118,7 @@ rte_pie_config_init(struct rte_pie_config *pie_cfg,
  * @retval 0 enqueue the packet
  * @retval !0 drop the packet
  */
-static inline int
+static int
 __rte_experimental
 rte_pie_enqueue_empty(const struct rte_pie_config *pie_cfg,
 	struct rte_pie *pie,
@@ -145,7 +150,7 @@ rte_pie_enqueue_empty(const struct rte_pie_config *pie_cfg,
  * @param pie [in, out] data pointer to PIE runtime data
  * @param time [in] current time (measured in cpu cycles)
  */
-static inline void
+static void
 __rte_experimental
 _calc_drop_probability(const struct rte_pie_config *pie_cfg,
 	struct rte_pie *pie, uint64_t time)
@@ -155,7 +160,7 @@ _calc_drop_probability(const struct rte_pie_config *pie_cfg,
 	/* Note: can be implemented using integer multiply.
 	 * DQ_THRESHOLD is power of 2 value.
 	 */
-	double current_qdelay = pie->qlen * (pie->avg_dq_time / RTE_DQ_THRESHOLD);
+	uint64_t current_qdelay = pie->qlen * (pie->avg_dq_time >> 14);
 
 	double p = RTE_ALPHA * (current_qdelay - qdelay_ref) +
 		RTE_BETA * (current_qdelay - pie->qdelay_old);
@@ -181,7 +186,7 @@ _calc_drop_probability(const struct rte_pie_config *pie_cfg,
 	double qdelay = qdelay_ref * 0.5;
 
 	/*  Exponentially decay drop prob when congestion goes away  */
-	if (current_qdelay < qdelay && pie->qdelay_old < qdelay)
+	if ((double)current_qdelay < qdelay && pie->qdelay_old < qdelay)
 		pie->drop_prob *= 0.98;     /* 1 - 1/64 is sufficient */
 
 	/* Bound drop probability */
Signature · 1 line
2.25.1
#151 lore raw

v20 cover Add PIE support for HQoS library

In reply to Liguzinski, WojciechX

From: Wojciech Liguzinski <[email protected]>

DPDK sched library is equipped with mechanism that secures it from the bufferbloat problem which is a situation when excess buffers in the network cause high latency and latency variation. Currently, it supports RED for active queue management. However, more advanced queue management is required to address this problem and provide desirable quality of service to users.

This solution (RFC) proposes usage of new algorithm called "PIE" (Proportional Integral controller Enhanced) that can effectively and directly control queuing latency to address the bufferbloat problem.

The implementation of mentioned functionality includes modification of existing and adding a new set of data structures to the library, adding PIE related APIs. This affects structures in public API/ABI. That is why deprecation notice is going to be prepared and sent.

Wojciech Liguzinski (5):
sched: add PIE based congestion management
example/qos_sched: add PIE support
example/ip_pipeline: add PIE support
doc/guides/prog_guide: added PIE
app/test: add tests for PIE

 app/test/meson.build                         |    4 +
 app/test/test_pie.c                          | 1065 ++++++++++++++++++
 config/rte_config.h                          |    1 -
 doc/guides/prog_guide/glossary.rst           |    3 +
 doc/guides/prog_guide/qos_framework.rst      |   64 +-
 doc/guides/prog_guide/traffic_management.rst |   13 +-
 drivers/net/softnic/rte_eth_softnic_tm.c     |    6 +-
 examples/ip_pipeline/tmgr.c                  |  142 +--
 examples/qos_sched/cfg_file.c                |  127 ++-
 examples/qos_sched/cfg_file.h                |    5 +
 examples/qos_sched/init.c                    |   27 +-
 examples/qos_sched/main.h                    |    3 +
 examples/qos_sched/profile.cfg               |  196 ++--
 lib/sched/meson.build                        |    3 +-
 lib/sched/rte_pie.c                          |   86 ++
 lib/sched/rte_pie.h                          |  398 +++++++
 lib/sched/rte_sched.c                        |  259 +++--
 lib/sched/rte_sched.h                        |   64 +-
 lib/sched/version.map                        |    4 +
 19 files changed, 2189 insertions(+), 281 deletions(-)
 create mode 100644 app/test/test_pie.c
 create mode 100644 lib/sched/rte_pie.c
 create mode 100644 lib/sched/rte_pie.h
Signature · 1 line
2.25.1
#152 lore raw

PATCH v20 1/5 sched: add PIE based congestion management

From: Wojciech Liguzinski <[email protected]>

Implement PIE based congestion management based on rfc8033

--
Changes in V20:
- Removed API conditional compilation
- Added flag to indicate cman enabled/disabled
- Fixed submitter data in patches

Changes in V19:
- ACKs included in patches

Changes in V18:
- Resolved merge conflict in lib/sched/meson.build after rebasing ontop of main
- Reverted whitespace change in app_thread.c - comment from Stephen Hemminger

Changes in V17:
- Corrected paragraph link naming in qos_framework.rst to fix CI builds

Changes in V16:
- Fixed 'title underline too short' error in qos_framework.rst
- Applied __rte_unused macro to parameters in rte_sched_port_pie_dequeue()

---
 drivers/net/softnic/rte_eth_softnic_tm.c |   6 +-
 lib/sched/meson.build                    |   3 +-
 lib/sched/rte_pie.c                      |  82 +++++
 lib/sched/rte_pie.h                      | 393 +++++++++++++++++++++++
 lib/sched/rte_sched.c                    | 259 ++++++++++-----
 lib/sched/rte_sched.h                    |  64 +++-
 lib/sched/version.map                    |   4 +
 7 files changed, 719 insertions(+), 92 deletions(-)
 create mode 100644 lib/sched/rte_pie.c
 create mode 100644 lib/sched/rte_pie.h
drivers/net/softnic/rte_eth_softnic_tm.c +3 -3
index 90baba15ce..e74092ce7f 100644
@@ -420,7 +420,7 @@ pmd_tm_node_type_get(struct rte_eth_dev *dev,
 	return 0;
 }
 
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
 #define WRED_SUPPORTED						1
 #else
 #define WRED_SUPPORTED						0
@@ -2306,7 +2306,7 @@ tm_tc_wred_profile_get(struct rte_eth_dev *dev, uint32_t tc_id)
 	return NULL;
 }
 
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
 
 static void
 wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id)
@@ -2321,7 +2321,7 @@ wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id)
 	for (tc_id = 0; tc_id < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; tc_id++)
 		for (color = RTE_COLOR_GREEN; color < RTE_COLORS; color++) {
 			struct rte_red_params *dst =
-				&pp->red_params[tc_id][color];
+				&pp->cman_params->red_params[tc_id][color];
 			struct tm_wred_profile *src_wp =
 				tm_tc_wred_profile_get(dev, tc_id);
 			struct rte_tm_red_params *src =
lib/sched/meson.build +2 -1
index 8ced4547aa..df75db51ed 100644
@@ -7,11 +7,12 @@ if is_windows
     subdir_done()
 endif
 
-sources = files('rte_sched.c', 'rte_red.c', 'rte_approx.c')
+sources = files('rte_sched.c', 'rte_red.c', 'rte_approx.c', 'rte_pie.c')
 headers = files(
         'rte_approx.h',
         'rte_red.h',
         'rte_sched.h',
         'rte_sched_common.h',
+        'rte_pie.h',
 )
 deps += ['mbuf', 'meter']
lib/sched/rte_pie.c new file +82 -0

82 lines not on this page · raw message

lib/sched/rte_pie.h new file +393 -0

393 lines not on this page · raw message

lib/sched/rte_sched.c +186 -73

378 lines not on this page · raw message

lib/sched/rte_sched.h +49 -15

101 lines not on this page · raw message

lib/sched/version.map +4 -0
index a6e505c8ac..d22c07fc9f 100644
@@ -30,4 +30,8 @@ EXPERIMENTAL {
 
 	# added in 20.11
 	rte_sched_port_subport_profile_add;
+
+	# added in 21.11
+	rte_pie_rt_data_init;
+	rte_pie_config_init;
 };
Signature · 1 line
2.25.1
#153 lore raw

PATCH v20 2/5 example/qos_sched: add PIE support

In reply to Liguzinski, WojciechX

From: Wojciech Liguzinski <[email protected]>

patch add support enable PIE or RED by
parsing config file.

---
 config/rte_config.h            |   1 -
 examples/qos_sched/cfg_file.c  | 127 +++++++++++++++------
 examples/qos_sched/cfg_file.h  |   5 +
 examples/qos_sched/init.c      |  27 +++--
 examples/qos_sched/main.h      |   3 +
 examples/qos_sched/profile.cfg | 196 ++++++++++++++++++++++-----------
 6 files changed, 250 insertions(+), 109 deletions(-)
config/rte_config.h +0 -1
index 1a66b42fcc..6ec687a555 100644
@@ -89,7 +89,6 @@
 #define RTE_MAX_LCORE_FREQS 64
 
 /* rte_sched defines */
-#undef RTE_SCHED_RED
 #undef RTE_SCHED_COLLECT_STATS
 #undef RTE_SCHED_SUBPORT_TC_OV
 #define RTE_SCHED_PORT_N_GRINDERS 8
examples/qos_sched/cfg_file.c +94 -33

193 lines not on this page · raw message

examples/qos_sched/cfg_file.h +5 -0
index 0dc458aa71..1a9dce9db5 100644
@@ -12,6 +12,11 @@ int cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port);
 
 int cfg_load_pipe(struct rte_cfgfile *cfg, struct rte_sched_pipe_params *pipe);
 
+#ifdef RTE_SCHED_CMAN
+void set_subport_cman_params(struct rte_sched_subport_params *subport_p,
+					struct rte_sched_cman_params cman_p);
+#endif
+
 int cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subport);
 
 int cfg_load_subport_profile(struct rte_cfgfile *cfg,
examples/qos_sched/init.c +17 -10
index 9b34e4a76b..3c1f0bc680 100644
@@ -203,15 +203,9 @@ static struct rte_sched_subport_profile_params
 	},
 };
 
-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,
-		.n_pipe_profiles = sizeof(pipe_profiles) /
-			sizeof(struct rte_sched_pipe_params),
-		.n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES,
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
+struct rte_sched_cman_params cman_params = {
+	.cman_mode = RTE_SCHED_CMAN_RED,
 	.red_params = {
 		/* Traffic Class 0 Colors Green / Yellow / Red */
 		[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
@@ -278,7 +272,20 @@ struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = {
 		[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
 		[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
 	},
-#endif /* RTE_SCHED_RED */
+};
+#endif /* RTE_SCHED_CMAN */
+
+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,
+		.n_pipe_profiles = sizeof(pipe_profiles) /
+			sizeof(struct rte_sched_pipe_params),
+		.n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES,
+#ifdef RTE_SCHED_CMAN
+		.cman_params = &cman_params,
+#endif /* RTE_SCHED_CMAN */
 	},
 };
 
examples/qos_sched/main.h +3 -0
index 0d6815ae69..915311bac8 100644
@@ -153,6 +153,9 @@ extern uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE];
 extern uint32_t n_active_queues;
 
 extern struct rte_sched_port_params port_params;
+#ifdef RTE_SCHED_CMAN
+extern struct rte_sched_cman_params cman_params;
+#endif
 extern struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS];
 
 int app_parse_args(int argc, char **argv);
examples/qos_sched/profile.cfg +131 -65

199 lines not on this page · raw message

Signature · 1 line
2.25.1
#154 lore raw

PATCH v20 3/5 example/ip_pipeline: add PIE support

In reply to Liguzinski, WojciechX

From: Wojciech Liguzinski <[email protected]>

Adding the PIE support for IP Pipeline

---
 examples/ip_pipeline/tmgr.c | 142 +++++++++++++++++++-----------------
 1 file changed, 74 insertions(+), 68 deletions(-)
examples/ip_pipeline/tmgr.c +74 -68
index e4e364cbc0..b138e885cf 100644
@@ -17,6 +17,77 @@ static uint32_t n_subport_profiles;
 static struct rte_sched_pipe_params
 	pipe_profile[TMGR_PIPE_PROFILE_MAX];
 
+#ifdef RTE_SCHED_CMAN
+static struct rte_sched_cman_params cman_params = {
+	.red_params = {
+		/* Traffic Class 0 Colors Green / Yellow / Red */
+		[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[0][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[0][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 1 - Colors Green / Yellow / Red */
+		[1][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[1][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[1][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 2 - Colors Green / Yellow / Red */
+		[2][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[2][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[2][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 3 - Colors Green / Yellow / Red */
+		[3][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[3][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[3][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 4 - Colors Green / Yellow / Red */
+		[4][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[4][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[4][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 5 - Colors Green / Yellow / Red */
+		[5][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[5][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[5][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 6 - Colors Green / Yellow / Red */
+		[6][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[6][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[6][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 7 - Colors Green / Yellow / Red */
+		[7][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[7][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[7][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 8 - Colors Green / Yellow / Red */
+		[8][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[8][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[8][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 9 - Colors Green / Yellow / Red */
+		[9][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[9][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[9][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 10 - Colors Green / Yellow / Red */
+		[10][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[10][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[10][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 11 - Colors Green / Yellow / Red */
+		[11][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[11][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[11][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 12 - Colors Green / Yellow / Red */
+		[12][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		},
+};
+#endif /* RTE_SCHED_CMAN */
+
 static uint32_t n_pipe_profiles;
 
 static const struct rte_sched_subport_params subport_params_default = {
@@ -25,74 +96,9 @@ static const struct rte_sched_subport_params subport_params_default = {
 	.pipe_profiles = pipe_profile,
 	.n_pipe_profiles = 0, /* filled at run time */
 	.n_max_pipe_profiles = RTE_DIM(pipe_profile),
-#ifdef RTE_SCHED_RED
-.red_params = {
-	/* Traffic Class 0 Colors Green / Yellow / Red */
-	[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[0][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[0][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 1 - Colors Green / Yellow / Red */
-	[1][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[1][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[1][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 2 - Colors Green / Yellow / Red */
-	[2][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[2][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[2][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 3 - Colors Green / Yellow / Red */
-	[3][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[3][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[3][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 4 - Colors Green / Yellow / Red */
-	[4][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[4][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[4][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 5 - Colors Green / Yellow / Red */
-	[5][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[5][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[5][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 6 - Colors Green / Yellow / Red */
-	[6][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[6][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[6][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 7 - Colors Green / Yellow / Red */
-	[7][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[7][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[7][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 8 - Colors Green / Yellow / Red */
-	[8][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[8][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[8][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 9 - Colors Green / Yellow / Red */
-	[9][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[9][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[9][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 10 - Colors Green / Yellow / Red */
-	[10][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[10][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[10][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 11 - Colors Green / Yellow / Red */
-	[11][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[11][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[11][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 12 - Colors Green / Yellow / Red */
-	[12][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	},
-#endif /* RTE_SCHED_RED */
+#ifdef RTE_SCHED_CMAN
+	.cman_params = &cman_params,
+#endif /* RTE_SCHED_CMAN */
 };
 
 static struct tmgr_port_list tmgr_port_list;
Signature · 1 line
2.25.1
#155 lore raw

PATCH v20 4/5 doc/guides/prog_guide: added PIE

In reply to Liguzinski, WojciechX

From: Wojciech Liguzinski <[email protected]>

Added PIE related information to documentation.

---
 doc/guides/prog_guide/glossary.rst           |  3 +
 doc/guides/prog_guide/qos_framework.rst      | 64 +++++++++++++++++---
 doc/guides/prog_guide/traffic_management.rst | 13 +++-
 3 files changed, 68 insertions(+), 12 deletions(-)
doc/guides/prog_guide/glossary.rst +3 -0
index 7044a7df2a..fb0910ba5b 100644
@@ -158,6 +158,9 @@ PCI
 PHY
    An abbreviation for the physical layer of the OSI model.
 
+PIE
+   Proportional Integral Controller Enhanced (RFC8033)
+
 pktmbuf
    An *mbuf* carrying a network packet.
 
doc/guides/prog_guide/qos_framework.rst +54 -10

116 lines not on this page · raw message

doc/guides/prog_guide/traffic_management.rst +11 -2
index 05b34d93a5..c356791a45 100644
@@ -22,6 +22,7 @@ Main features:
   shared (by multiple nodes) shapers
 * Congestion management for hierarchy leaf nodes: algorithms of tail drop, head
   drop, WRED, private (per node) and shared (by multiple nodes) WRED contexts
+  and PIE.
 * Packet marking: IEEE 802.1q (VLAN DEI), IETF RFC 3168 (IPv4/IPv6 ECN for TCP
   and SCTP), IETF RFC 2597 (IPv4 / IPv6 DSCP)
 
@@ -103,8 +104,9 @@ Congestion Management
 Congestion management is used to control the admission of packets into a packet
 queue or group of packet queues on congestion. The congestion management
 algorithms that are supported are: Tail Drop, Head Drop and Weighted Random
-Early Detection (WRED). They are made available for every leaf node in the
-hierarchy, subject to the specific implementation supporting them.
+Early Detection (WRED), Proportional Integral Controller Enhanced (PIE).
+They are made available for every leaf node in the hierarchy, subject to
+the specific implementation supporting them.
 On request of writing a new packet into the current queue while the queue is
 full, the Tail Drop algorithm drops the new packet while leaving the queue
 unmodified, as opposed to the Head Drop* algorithm, which drops the packet
@@ -128,6 +130,13 @@ The configuration of WRED private and shared contexts is done through the
 definition of WRED profiles. Any WRED profile can be used by one or several
 WRED contexts (either private or shared).
 
+The Proportional Integral Controller Enhanced (PIE) algorithm works by proactively
+dropping packets randomly. Calculated drop probability is updated periodically,
+based on latency measured and desired and whether the queuing latency is currently
+trending up or down. Queuing latency can be obtained using direct measurement or
+on estimations calculated from the queue length and dequeue rate. The random drop
+is triggered by a packet's arrival before enqueuing into a queue.
+
 
 Packet Marking
 --------------
Signature · 1 line
2.25.1
#156 lore raw

PATCH v20 5/5 app/test: add tests for PIE

In reply to Liguzinski, WojciechX

From: Wojciech Liguzinski <[email protected]>

Tests for PIE code added to test application.

---
 app/test/meson.build |    4 +
 app/test/test_pie.c  | 1065 ++++++++++++++++++++++++++++++++++++++++++
 lib/sched/rte_pie.c  |    6 +-
 lib/sched/rte_pie.h  |   17 +-
 4 files changed, 1085 insertions(+), 7 deletions(-)
 create mode 100644 app/test/test_pie.c
app/test/meson.build +4 -0
index 3d9470df23..fe2ceee42a 100644
@@ -115,6 +115,7 @@ test_sources = files(
         'test_reciprocal_division.c',
         'test_reciprocal_division_perf.c',
         'test_red.c',
+        'test_pie.c',
         'test_reorder.c',
         'test_rib.c',
         'test_rib6.c',
@@ -249,6 +250,7 @@ fast_tests = [
         ['prefetch_autotest', true],
         ['rcu_qsbr_autotest', true],
         ['red_autotest', true],
+        ['pie_autotest', true],
         ['rib_autotest', true],
         ['rib6_autotest', true],
         ['ring_autotest', true],
@@ -300,6 +302,7 @@ perf_test_names = [
         'fib_slow_autotest',
         'fib_perf_autotest',
         'red_all',
+        'pie_all',
         'barrier_autotest',
         'hash_multiwriter_autotest',
         'timer_racecond_autotest',
@@ -313,6 +316,7 @@ perf_test_names = [
         'fib6_perf_autotest',
         'rcu_qsbr_perf_autotest',
         'red_perf',
+        'pie_perf',
         'distributor_perf_autotest',
         'pmd_perf_autotest',
         'stack_perf_autotest',
app/test/test_pie.c new file +1065 -0

1,065 lines not on this page · raw message

lib/sched/rte_pie.c +5 -1
index 2fcecb2db4..934e9aee50 100644
@@ -13,7 +13,7 @@
 #pragma warning(disable:2259) /* conversion may lose significant bits */
 #endif
 
-void
+int
 rte_pie_rt_data_init(struct rte_pie *pie)
 {
 	if (pie == NULL) {
@@ -22,6 +22,8 @@ rte_pie_rt_data_init(struct rte_pie *pie)
 
 		if (pie == NULL)
 			RTE_LOG(ERR, SCHED, "%s: Memory allocation fails\n", __func__);
+
+		return -1;
 	}
 
 	pie->active = 0;
@@ -35,6 +37,8 @@ rte_pie_rt_data_init(struct rte_pie *pie)
 	pie->qdelay_old = 0;
 	pie->drop_prob = 0;
 	pie->accu_prob = 0;
+
+	return 0;
 }
 
 int
lib/sched/rte_pie.h +11 -6
index f83c95664f..68f1b96192 100644
@@ -20,6 +20,7 @@ extern "C" {
 
 #include <rte_random.h>
 #include <rte_debug.h>
+#include <rte_cycles.h>
 
 #define RTE_DQ_THRESHOLD   16384   /**< Queue length threshold (2^14)
 				     * to start measurement cycle (bytes)
@@ -53,7 +54,7 @@ struct rte_pie_config {
 };
 
 /**
- * RED run-time data
+ * PIE run-time data
  */
 struct rte_pie {
 	uint16_t active;               /**< Flag for activating/deactivating pie */
@@ -74,8 +75,12 @@ struct rte_pie {
  * @brief Initialises run-time data
  *
  * @param pie [in,out] data pointer to PIE runtime data
+ *
+ * @return Operation status
+ * @retval 0 success
+ * @retval !0 error
  */
-void
+int
 __rte_experimental
 rte_pie_rt_data_init(struct rte_pie *pie);
 
@@ -113,7 +118,7 @@ rte_pie_config_init(struct rte_pie_config *pie_cfg,
  * @retval 0 enqueue the packet
  * @retval !0 drop the packet
  */
-static inline int
+static int
 __rte_experimental
 rte_pie_enqueue_empty(const struct rte_pie_config *pie_cfg,
 	struct rte_pie *pie,
@@ -145,7 +150,7 @@ rte_pie_enqueue_empty(const struct rte_pie_config *pie_cfg,
  * @param pie [in, out] data pointer to PIE runtime data
  * @param time [in] current time (measured in cpu cycles)
  */
-static inline void
+static void
 __rte_experimental
 _calc_drop_probability(const struct rte_pie_config *pie_cfg,
 	struct rte_pie *pie, uint64_t time)
@@ -155,7 +160,7 @@ _calc_drop_probability(const struct rte_pie_config *pie_cfg,
 	/* Note: can be implemented using integer multiply.
 	 * DQ_THRESHOLD is power of 2 value.
 	 */
-	double current_qdelay = pie->qlen * (pie->avg_dq_time / RTE_DQ_THRESHOLD);
+	uint64_t current_qdelay = pie->qlen * (pie->avg_dq_time >> 14);
 
 	double p = RTE_ALPHA * (current_qdelay - qdelay_ref) +
 		RTE_BETA * (current_qdelay - pie->qdelay_old);
@@ -181,7 +186,7 @@ _calc_drop_probability(const struct rte_pie_config *pie_cfg,
 	double qdelay = qdelay_ref * 0.5;
 
 	/*  Exponentially decay drop prob when congestion goes away  */
-	if (current_qdelay < qdelay && pie->qdelay_old < qdelay)
+	if ((double)current_qdelay < qdelay && pie->qdelay_old < qdelay)
 		pie->drop_prob *= 0.98;     /* 1 - 1/64 is sufficient */
 
 	/* Bound drop probability */
Signature · 1 line
2.25.1
#157 lore raw
In reply to Liguzinski, WojciechX

03/11/2021 00:57, Liguzinski, WojciechX:

Quoted 12 lines

From: Wojciech Liguzinski <[email protected]>

DPDK sched library is equipped with mechanism that secures it from the bufferbloat problem which is a situation when excess buffers in the network cause high latency and latency variation. Currently, it supports RED for active queue management. However, more advanced queue management is required to address this problem and provide desirable quality of service to users.

This solution (RFC) proposes usage of new algorithm called "PIE" (Proportional Integral controller Enhanced) that can effectively and directly control queuing latency to address the bufferbloat problem.

Quoted 7 lines

The implementation of mentioned functionality includes modification of existing and adding a new set of data structures to the library, adding PIE related APIs. This affects structures in public API/ABI. That is why deprecation notice is going to be prepared and sent.

Wojciech Liguzinski (5):
sched: add PIE based congestion management

Did you see the checkpatch issues on this patch?
http://mails.dpdk.org/archives/test-report/2021-November/238253.html

Quoted 1 line

example/qos_sched: add PIE support

The strict minimum is to explain why you add PIE and what the acronym means, inside the commit log.

Quoted 1 line

example/ip_pipeline: add PIE support

Title should follow same convention as history.
For examples, it start with "examples/" as the directory name.

Quoted 1 line

doc/guides/prog_guide: added PIE

doc should be squashed with code patches
Is there any doc update related to the examples? If not, it should be fully squashed with lib changes.

Quoted 1 line

app/test: add tests for PIE

If there is nothing special, it can be squashed with the lib patch.

#158 lore raw

Hi Thomas,

Thanks, I will apply your suggestions asap.

Wojtek

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Wednesday, November 3, 2021 6:53 PM
To: Liguzinski, WojciechX <[email protected]>
Cc: [email protected]; Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>; Ajmera, Megha <[email protected]>; Mcnamara, John <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v20 0/5] Add PIE support for HQoS library

03/11/2021 00:57, Liguzinski, WojciechX:

Quoted 12 lines

From: Wojciech Liguzinski <[email protected]>

DPDK sched library is equipped with mechanism that secures it from the bufferbloat problem which is a situation when excess buffers in the
network cause high latency and latency variation. Currently, it
supports RED for active queue management. However, more advanced queue
management is required to address this problem and provide desirable quality of service to users.

This solution (RFC) proposes usage of new algorithm called "PIE" (Proportional Integral controller Enhanced) that can effectively and directly control queuing latency to address the bufferbloat problem.

Quoted 7 lines

The implementation of mentioned functionality includes modification of existing and adding a new set of data structures to the library, adding PIE related APIs. This affects structures in public API/ABI. That is why deprecation
notice is going to be prepared and sent.

Wojciech Liguzinski (5):
sched: add PIE based congestion management

Did you see the checkpatch issues on this patch?
http://mails.dpdk.org/archives/test-report/2021-November/238253.html

Quoted 1 line

example/qos_sched: add PIE support

The strict minimum is to explain why you add PIE and what the acronym means, inside the commit log.

Quoted 1 line

example/ip_pipeline: add PIE support

Title should follow same convention as history.
For examples, it start with "examples/" as the directory name.

Quoted 1 line

doc/guides/prog_guide: added PIE

doc should be squashed with code patches Is there any doc update related to the examples? If not, it should be fully squashed with lib changes.

Quoted 1 line

app/test: add tests for PIE

If there is nothing special, it can be squashed with the lib patch.

#159 lore raw

v21 cover Add PIE support for HQoS library

In reply to Liguzinski, WojciechX

From: Wojciech Liguzinski <[email protected]>

DPDK sched library is equipped with mechanism that secures it from the bufferbloat problem which is a situation when excess buffers in the network cause high latency and latency variation. Currently, it supports RED for active queue management. However, more advanced queue management is required to address this problem and provide desirable quality of service to users.

This solution (RFC) proposes usage of new algorithm called "PIE" (Proportional Integral controller Enhanced) that can effectively and directly control queuing latency to address the bufferbloat problem.

The implementation of mentioned functionality includes modification of existing and adding a new set of data structures to the library, adding PIE related APIs. This affects structures in public API/ABI. That is why deprecation notice is going to be prepared and sent.

Wojciech Liguzinski (3):
sched: add PIE based congestion management
examples/qos_sched: add PIE support
examples/ip_pipeline: add PIE support

 app/test/meson.build                         |    4 +
 app/test/test_pie.c                          | 1065 ++++++++++++++++++
 config/rte_config.h                          |    1 -
 doc/guides/prog_guide/glossary.rst           |    3 +
 doc/guides/prog_guide/qos_framework.rst      |   64 +-
 doc/guides/prog_guide/traffic_management.rst |   13 +-
 drivers/net/softnic/rte_eth_softnic_tm.c     |    6 +-
 examples/ip_pipeline/tmgr.c                  |  142 +--
 examples/qos_sched/cfg_file.c                |  127 ++-
 examples/qos_sched/cfg_file.h                |    5 +
 examples/qos_sched/init.c                    |   27 +-
 examples/qos_sched/main.h                    |    3 +
 examples/qos_sched/profile.cfg               |  196 ++--
 lib/sched/meson.build                        |    3 +-
 lib/sched/rte_pie.c                          |   86 ++
 lib/sched/rte_pie.h                          |  398 +++++++
 lib/sched/rte_sched.c                        |  255 +++--
 lib/sched/rte_sched.h                        |   64 +-
 lib/sched/version.map                        |    4 +
 19 files changed, 2185 insertions(+), 281 deletions(-)
 create mode 100644 app/test/test_pie.c
 create mode 100644 lib/sched/rte_pie.c
 create mode 100644 lib/sched/rte_pie.h
Signature · 1 line
2.25.1
#160 lore raw

PATCH v21 1/3 sched: add PIE based congestion management

Implement PIE based congestion management based on rfc8033.

The Proportional Integral Controller Enhanced (PIE) algorithm works by proactively dropping packets randomly.
PIE is implemented as more advanced queue management is required to address the bufferbloat problem and provide desirable quality of service to users.

Tests for PIE code added to test application.
Added PIE related information to documentation.

--
Changes in V21:
- Coding style fixed
- Patches reorganized according to comments

Changes in V20:
- Removed API conditional compilation
- Added flag to indicate cman enabled/disabled
- Fixed submitter data in patches

Changes in V19:
- ACKs included in patches

Changes in V18:
- Resolved merge conflict in lib/sched/meson.build after rebasing ontop of main
- Reverted whitespace change in app_thread.c - comment from Stephen Hemminger

Changes in V17:
- Corrected paragraph link naming in qos_framework.rst to fix CI builds

Changes in V16:
- Fixed 'title underline too short' error in qos_framework.rst
- Applied __rte_unused macro to parameters in rte_sched_port_pie_dequeue()

---
 app/test/meson.build                         |    4 +
 app/test/test_pie.c                          | 1065 ++++++++++++++++++
 doc/guides/prog_guide/glossary.rst           |    3 +
 doc/guides/prog_guide/qos_framework.rst      |   64 +-
 doc/guides/prog_guide/traffic_management.rst |   13 +-
 drivers/net/softnic/rte_eth_softnic_tm.c     |    6 +-
 lib/sched/meson.build                        |    3 +-
 lib/sched/rte_pie.c                          |   86 ++
 lib/sched/rte_pie.h                          |  398 +++++++
 lib/sched/rte_sched.c                        |  255 +++--
 lib/sched/rte_sched.h                        |   64 +-
 lib/sched/version.map                        |    4 +
 12 files changed, 1861 insertions(+), 104 deletions(-)
 create mode 100644 app/test/test_pie.c
 create mode 100644 lib/sched/rte_pie.c
 create mode 100644 lib/sched/rte_pie.h
app/test/meson.build +4 -0
index 3d9470df23..fe2ceee42a 100644
@@ -115,6 +115,7 @@ test_sources = files(
         'test_reciprocal_division.c',
         'test_reciprocal_division_perf.c',
         'test_red.c',
+        'test_pie.c',
         'test_reorder.c',
         'test_rib.c',
         'test_rib6.c',
@@ -249,6 +250,7 @@ fast_tests = [
         ['prefetch_autotest', true],
         ['rcu_qsbr_autotest', true],
         ['red_autotest', true],
+        ['pie_autotest', true],
         ['rib_autotest', true],
         ['rib6_autotest', true],
         ['ring_autotest', true],
@@ -300,6 +302,7 @@ perf_test_names = [
         'fib_slow_autotest',
         'fib_perf_autotest',
         'red_all',
+        'pie_all',
         'barrier_autotest',
         'hash_multiwriter_autotest',
         'timer_racecond_autotest',
@@ -313,6 +316,7 @@ perf_test_names = [
         'fib6_perf_autotest',
         'rcu_qsbr_perf_autotest',
         'red_perf',
+        'pie_perf',
         'distributor_perf_autotest',
         'pmd_perf_autotest',
         'stack_perf_autotest',
app/test/test_pie.c new file +1065 -0

1,065 lines not on this page · raw message

doc/guides/prog_guide/glossary.rst +3 -0
index 7044a7df2a..fb0910ba5b 100644
@@ -158,6 +158,9 @@ PCI
 PHY
    An abbreviation for the physical layer of the OSI model.
 
+PIE
+   Proportional Integral Controller Enhanced (RFC8033)
+
 pktmbuf
    An *mbuf* carrying a network packet.
 
doc/guides/prog_guide/qos_framework.rst +54 -10

116 lines not on this page · raw message

doc/guides/prog_guide/traffic_management.rst +11 -2
index 05b34d93a5..c356791a45 100644
@@ -22,6 +22,7 @@ Main features:
   shared (by multiple nodes) shapers
 * Congestion management for hierarchy leaf nodes: algorithms of tail drop, head
   drop, WRED, private (per node) and shared (by multiple nodes) WRED contexts
+  and PIE.
 * Packet marking: IEEE 802.1q (VLAN DEI), IETF RFC 3168 (IPv4/IPv6 ECN for TCP
   and SCTP), IETF RFC 2597 (IPv4 / IPv6 DSCP)
 
@@ -103,8 +104,9 @@ Congestion Management
 Congestion management is used to control the admission of packets into a packet
 queue or group of packet queues on congestion. The congestion management
 algorithms that are supported are: Tail Drop, Head Drop and Weighted Random
-Early Detection (WRED). They are made available for every leaf node in the
-hierarchy, subject to the specific implementation supporting them.
+Early Detection (WRED), Proportional Integral Controller Enhanced (PIE).
+They are made available for every leaf node in the hierarchy, subject to
+the specific implementation supporting them.
 On request of writing a new packet into the current queue while the queue is
 full, the Tail Drop algorithm drops the new packet while leaving the queue
 unmodified, as opposed to the Head Drop* algorithm, which drops the packet
@@ -128,6 +130,13 @@ The configuration of WRED private and shared contexts is done through the
 definition of WRED profiles. Any WRED profile can be used by one or several
 WRED contexts (either private or shared).
 
+The Proportional Integral Controller Enhanced (PIE) algorithm works by proactively
+dropping packets randomly. Calculated drop probability is updated periodically,
+based on latency measured and desired and whether the queuing latency is currently
+trending up or down. Queuing latency can be obtained using direct measurement or
+on estimations calculated from the queue length and dequeue rate. The random drop
+is triggered by a packet's arrival before enqueuing into a queue.
+
 
 Packet Marking
 --------------
drivers/net/softnic/rte_eth_softnic_tm.c +3 -3
index 90baba15ce..e74092ce7f 100644
@@ -420,7 +420,7 @@ pmd_tm_node_type_get(struct rte_eth_dev *dev,
 	return 0;
 }
 
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
 #define WRED_SUPPORTED						1
 #else
 #define WRED_SUPPORTED						0
@@ -2306,7 +2306,7 @@ tm_tc_wred_profile_get(struct rte_eth_dev *dev, uint32_t tc_id)
 	return NULL;
 }
 
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
 
 static void
 wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id)
@@ -2321,7 +2321,7 @@ wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id)
 	for (tc_id = 0; tc_id < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; tc_id++)
 		for (color = RTE_COLOR_GREEN; color < RTE_COLORS; color++) {
 			struct rte_red_params *dst =
-				&pp->red_params[tc_id][color];
+				&pp->cman_params->red_params[tc_id][color];
 			struct tm_wred_profile *src_wp =
 				tm_tc_wred_profile_get(dev, tc_id);
 			struct rte_tm_red_params *src =
lib/sched/meson.build +2 -1
index 8ced4547aa..df75db51ed 100644
@@ -7,11 +7,12 @@ if is_windows
     subdir_done()
 endif
 
-sources = files('rte_sched.c', 'rte_red.c', 'rte_approx.c')
+sources = files('rte_sched.c', 'rte_red.c', 'rte_approx.c', 'rte_pie.c')
 headers = files(
         'rte_approx.h',
         'rte_red.h',
         'rte_sched.h',
         'rte_sched_common.h',
+        'rte_pie.h',
 )
 deps += ['mbuf', 'meter']
lib/sched/rte_pie.c new file +86 -0

86 lines not on this page · raw message

lib/sched/rte_pie.h new file +398 -0

398 lines not on this page · raw message

lib/sched/rte_sched.c +182 -73

373 lines not on this page · raw message

lib/sched/rte_sched.h +49 -15

101 lines not on this page · raw message

lib/sched/version.map +4 -0
index a6e505c8ac..d22c07fc9f 100644
@@ -30,4 +30,8 @@ EXPERIMENTAL {
 
 	# added in 20.11
 	rte_sched_port_subport_profile_add;
+
+	# added in 21.11
+	rte_pie_rt_data_init;
+	rte_pie_config_init;
 };
Signature · 1 line
2.25.1
#161 lore raw

PATCH v21 2/3 examples/qos_sched: add PIE support

In reply to Liguzinski, WojciechX

From: Wojciech Liguzinski <[email protected]>

patch add support enable PIE or RED by
parsing config file.

---
 config/rte_config.h            |   1 -
 examples/qos_sched/cfg_file.c  | 127 +++++++++++++++------
 examples/qos_sched/cfg_file.h  |   5 +
 examples/qos_sched/init.c      |  27 +++--
 examples/qos_sched/main.h      |   3 +
 examples/qos_sched/profile.cfg | 196 ++++++++++++++++++++++-----------
 6 files changed, 250 insertions(+), 109 deletions(-)
config/rte_config.h +0 -1
index 1a66b42fcc..6ec687a555 100644
@@ -89,7 +89,6 @@
 #define RTE_MAX_LCORE_FREQS 64
 
 /* rte_sched defines */
-#undef RTE_SCHED_RED
 #undef RTE_SCHED_COLLECT_STATS
 #undef RTE_SCHED_SUBPORT_TC_OV
 #define RTE_SCHED_PORT_N_GRINDERS 8
examples/qos_sched/cfg_file.c +94 -33

193 lines not on this page · raw message

examples/qos_sched/cfg_file.h +5 -0
index 0dc458aa71..1a9dce9db5 100644
@@ -12,6 +12,11 @@ int cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port);
 
 int cfg_load_pipe(struct rte_cfgfile *cfg, struct rte_sched_pipe_params *pipe);
 
+#ifdef RTE_SCHED_CMAN
+void set_subport_cman_params(struct rte_sched_subport_params *subport_p,
+					struct rte_sched_cman_params cman_p);
+#endif
+
 int cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subport);
 
 int cfg_load_subport_profile(struct rte_cfgfile *cfg,
examples/qos_sched/init.c +17 -10
index 9b34e4a76b..3c1f0bc680 100644
@@ -203,15 +203,9 @@ static struct rte_sched_subport_profile_params
 	},
 };
 
-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,
-		.n_pipe_profiles = sizeof(pipe_profiles) /
-			sizeof(struct rte_sched_pipe_params),
-		.n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES,
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
+struct rte_sched_cman_params cman_params = {
+	.cman_mode = RTE_SCHED_CMAN_RED,
 	.red_params = {
 		/* Traffic Class 0 Colors Green / Yellow / Red */
 		[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
@@ -278,7 +272,20 @@ struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = {
 		[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
 		[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
 	},
-#endif /* RTE_SCHED_RED */
+};
+#endif /* RTE_SCHED_CMAN */
+
+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,
+		.n_pipe_profiles = sizeof(pipe_profiles) /
+			sizeof(struct rte_sched_pipe_params),
+		.n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES,
+#ifdef RTE_SCHED_CMAN
+		.cman_params = &cman_params,
+#endif /* RTE_SCHED_CMAN */
 	},
 };
 
examples/qos_sched/main.h +3 -0
index 0d6815ae69..915311bac8 100644
@@ -153,6 +153,9 @@ extern uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE];
 extern uint32_t n_active_queues;
 
 extern struct rte_sched_port_params port_params;
+#ifdef RTE_SCHED_CMAN
+extern struct rte_sched_cman_params cman_params;
+#endif
 extern struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS];
 
 int app_parse_args(int argc, char **argv);
examples/qos_sched/profile.cfg +131 -65

199 lines not on this page · raw message

Signature · 1 line
2.25.1
#162 lore raw

PATCH v21 3/3 examples/ip_pipeline: add PIE support

In reply to Liguzinski, WojciechX

From: Wojciech Liguzinski <[email protected]>

Adding the PIE support for IP Pipeline

---
 examples/ip_pipeline/tmgr.c | 142 +++++++++++++++++++-----------------
 1 file changed, 74 insertions(+), 68 deletions(-)
examples/ip_pipeline/tmgr.c +74 -68
index e4e364cbc0..b138e885cf 100644
@@ -17,6 +17,77 @@ static uint32_t n_subport_profiles;
 static struct rte_sched_pipe_params
 	pipe_profile[TMGR_PIPE_PROFILE_MAX];
 
+#ifdef RTE_SCHED_CMAN
+static struct rte_sched_cman_params cman_params = {
+	.red_params = {
+		/* Traffic Class 0 Colors Green / Yellow / Red */
+		[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[0][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[0][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 1 - Colors Green / Yellow / Red */
+		[1][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[1][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[1][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 2 - Colors Green / Yellow / Red */
+		[2][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[2][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[2][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 3 - Colors Green / Yellow / Red */
+		[3][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[3][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[3][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 4 - Colors Green / Yellow / Red */
+		[4][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[4][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[4][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 5 - Colors Green / Yellow / Red */
+		[5][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[5][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[5][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 6 - Colors Green / Yellow / Red */
+		[6][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[6][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[6][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 7 - Colors Green / Yellow / Red */
+		[7][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[7][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[7][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 8 - Colors Green / Yellow / Red */
+		[8][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[8][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[8][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 9 - Colors Green / Yellow / Red */
+		[9][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[9][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[9][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 10 - Colors Green / Yellow / Red */
+		[10][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[10][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[10][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 11 - Colors Green / Yellow / Red */
+		[11][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[11][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[11][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 12 - Colors Green / Yellow / Red */
+		[12][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		},
+};
+#endif /* RTE_SCHED_CMAN */
+
 static uint32_t n_pipe_profiles;
 
 static const struct rte_sched_subport_params subport_params_default = {
@@ -25,74 +96,9 @@ static const struct rte_sched_subport_params subport_params_default = {
 	.pipe_profiles = pipe_profile,
 	.n_pipe_profiles = 0, /* filled at run time */
 	.n_max_pipe_profiles = RTE_DIM(pipe_profile),
-#ifdef RTE_SCHED_RED
-.red_params = {
-	/* Traffic Class 0 Colors Green / Yellow / Red */
-	[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[0][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[0][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 1 - Colors Green / Yellow / Red */
-	[1][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[1][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[1][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 2 - Colors Green / Yellow / Red */
-	[2][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[2][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[2][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 3 - Colors Green / Yellow / Red */
-	[3][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[3][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[3][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 4 - Colors Green / Yellow / Red */
-	[4][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[4][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[4][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 5 - Colors Green / Yellow / Red */
-	[5][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[5][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[5][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 6 - Colors Green / Yellow / Red */
-	[6][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[6][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[6][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 7 - Colors Green / Yellow / Red */
-	[7][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[7][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[7][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 8 - Colors Green / Yellow / Red */
-	[8][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[8][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[8][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 9 - Colors Green / Yellow / Red */
-	[9][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[9][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[9][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 10 - Colors Green / Yellow / Red */
-	[10][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[10][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[10][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 11 - Colors Green / Yellow / Red */
-	[11][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[11][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[11][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 12 - Colors Green / Yellow / Red */
-	[12][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	},
-#endif /* RTE_SCHED_RED */
+#ifdef RTE_SCHED_CMAN
+	.cman_params = &cman_params,
+#endif /* RTE_SCHED_CMAN */
 };
 
 static struct tmgr_port_list tmgr_port_list;
Signature · 1 line
2.25.1
#163 lore raw

v22 cover Add PIE support for HQoS library

In reply to Liguzinski, WojciechX

From: Wojciech Liguzinski <[email protected]>

DPDK sched library is equipped with mechanism that secures it from the bufferbloat problem which is a situation when excess buffers in the network cause high latency and latency variation. Currently, it supports RED for active queue management. However, more advanced queue management is required to address this problem and provide desirable quality of service to users.

This solution (RFC) proposes usage of new algorithm called "PIE" (Proportional Integral controller Enhanced) that can effectively and directly control queuing latency to address the bufferbloat problem.

The implementation of mentioned functionality includes modification of existing and adding a new set of data structures to the library, adding PIE related APIs. This affects structures in public API/ABI. That is why deprecation notice is going to be prepared and sent.

Wojciech Liguzinski (3):
sched: add PIE based congestion management
examples/qos_sched: add PIE support
examples/ip_pipeline: add PIE support

 app/test/meson.build                         |    4 +
 app/test/test_pie.c                          | 1065 ++++++++++++++++++
 config/rte_config.h                          |    1 -
 doc/guides/prog_guide/glossary.rst           |    3 +
 doc/guides/prog_guide/qos_framework.rst      |   64 +-
 doc/guides/prog_guide/traffic_management.rst |   13 +-
 drivers/net/softnic/rte_eth_softnic_tm.c     |    6 +-
 examples/ip_pipeline/tmgr.c                  |  142 +--
 examples/qos_sched/cfg_file.c                |  127 ++-
 examples/qos_sched/cfg_file.h                |    5 +
 examples/qos_sched/init.c                    |   27 +-
 examples/qos_sched/main.h                    |    3 +
 examples/qos_sched/profile.cfg               |  196 ++--
 lib/sched/meson.build                        |    3 +-
 lib/sched/rte_pie.c                          |   86 ++
 lib/sched/rte_pie.h                          |  398 +++++++
 lib/sched/rte_sched.c                        |  255 +++--
 lib/sched/rte_sched.h                        |   64 +-
 lib/sched/version.map                        |    4 +
 19 files changed, 2185 insertions(+), 281 deletions(-)
 create mode 100644 app/test/test_pie.c
 create mode 100644 lib/sched/rte_pie.c
 create mode 100644 lib/sched/rte_pie.h
Signature · 1 line
2.25.1
#164 lore raw

PATCH v22 1/3 sched: add PIE based congestion management

From: Wojciech Liguzinski <[email protected]>

Implement PIE based congestion management based on rfc8033.

The Proportional Integral Controller Enhanced (PIE) algorithm works by proactively dropping packets randomly.
PIE is implemented as more advanced queue management is required to address the bufferbloat problem and provide desirable quality of service to users.

Tests for PIE code added to test application.
Added PIE related information to documentation.

--
Changes in V22:
- Coding style fixed

Changes in V21:
- Coding style fixed
- Patches reorganized according to comments

Changes in V20:
- Removed API conditional compilation
- Added flag to indicate cman enabled/disabled
- Fixed submitter data in patches

Changes in V19:
- ACKs included in patches

Changes in V18:
- Resolved merge conflict in lib/sched/meson.build after rebasing ontop of main
- Reverted whitespace change in app_thread.c - comment from Stephen Hemminger

Changes in V17:
- Corrected paragraph link naming in qos_framework.rst to fix CI builds

Changes in V16:
- Fixed 'title underline too short' error in qos_framework.rst
- Applied __rte_unused macro to parameters in rte_sched_port_pie_dequeue()

---
 app/test/meson.build                         |    4 +
 app/test/test_pie.c                          | 1065 ++++++++++++++++++
 doc/guides/prog_guide/glossary.rst           |    3 +
 doc/guides/prog_guide/qos_framework.rst      |   64 +-
 doc/guides/prog_guide/traffic_management.rst |   13 +-
 drivers/net/softnic/rte_eth_softnic_tm.c     |    6 +-
 lib/sched/meson.build                        |    3 +-
 lib/sched/rte_pie.c                          |   86 ++
 lib/sched/rte_pie.h                          |  398 +++++++
 lib/sched/rte_sched.c                        |  255 +++--
 lib/sched/rte_sched.h                        |   64 +-
 lib/sched/version.map                        |    4 +
 12 files changed, 1861 insertions(+), 104 deletions(-)
 create mode 100644 app/test/test_pie.c
 create mode 100644 lib/sched/rte_pie.c
 create mode 100644 lib/sched/rte_pie.h
app/test/meson.build +4 -0
index 3d9470df23..fe2ceee42a 100644
@@ -115,6 +115,7 @@ test_sources = files(
         'test_reciprocal_division.c',
         'test_reciprocal_division_perf.c',
         'test_red.c',
+        'test_pie.c',
         'test_reorder.c',
         'test_rib.c',
         'test_rib6.c',
@@ -249,6 +250,7 @@ fast_tests = [
         ['prefetch_autotest', true],
         ['rcu_qsbr_autotest', true],
         ['red_autotest', true],
+        ['pie_autotest', true],
         ['rib_autotest', true],
         ['rib6_autotest', true],
         ['ring_autotest', true],
@@ -300,6 +302,7 @@ perf_test_names = [
         'fib_slow_autotest',
         'fib_perf_autotest',
         'red_all',
+        'pie_all',
         'barrier_autotest',
         'hash_multiwriter_autotest',
         'timer_racecond_autotest',
@@ -313,6 +316,7 @@ perf_test_names = [
         'fib6_perf_autotest',
         'rcu_qsbr_perf_autotest',
         'red_perf',
+        'pie_perf',
         'distributor_perf_autotest',
         'pmd_perf_autotest',
         'stack_perf_autotest',
app/test/test_pie.c new file +1065 -0

1,065 lines not on this page · raw message

doc/guides/prog_guide/glossary.rst +3 -0
index 7044a7df2a..fb0910ba5b 100644
@@ -158,6 +158,9 @@ PCI
 PHY
    An abbreviation for the physical layer of the OSI model.
 
+PIE
+   Proportional Integral Controller Enhanced (RFC8033)
+
 pktmbuf
    An *mbuf* carrying a network packet.
 
doc/guides/prog_guide/qos_framework.rst +54 -10

116 lines not on this page · raw message

doc/guides/prog_guide/traffic_management.rst +11 -2
index 05b34d93a5..c356791a45 100644
@@ -22,6 +22,7 @@ Main features:
   shared (by multiple nodes) shapers
 * Congestion management for hierarchy leaf nodes: algorithms of tail drop, head
   drop, WRED, private (per node) and shared (by multiple nodes) WRED contexts
+  and PIE.
 * Packet marking: IEEE 802.1q (VLAN DEI), IETF RFC 3168 (IPv4/IPv6 ECN for TCP
   and SCTP), IETF RFC 2597 (IPv4 / IPv6 DSCP)
 
@@ -103,8 +104,9 @@ Congestion Management
 Congestion management is used to control the admission of packets into a packet
 queue or group of packet queues on congestion. The congestion management
 algorithms that are supported are: Tail Drop, Head Drop and Weighted Random
-Early Detection (WRED). They are made available for every leaf node in the
-hierarchy, subject to the specific implementation supporting them.
+Early Detection (WRED), Proportional Integral Controller Enhanced (PIE).
+They are made available for every leaf node in the hierarchy, subject to
+the specific implementation supporting them.
 On request of writing a new packet into the current queue while the queue is
 full, the Tail Drop algorithm drops the new packet while leaving the queue
 unmodified, as opposed to the Head Drop* algorithm, which drops the packet
@@ -128,6 +130,13 @@ The configuration of WRED private and shared contexts is done through the
 definition of WRED profiles. Any WRED profile can be used by one or several
 WRED contexts (either private or shared).
 
+The Proportional Integral Controller Enhanced (PIE) algorithm works by proactively
+dropping packets randomly. Calculated drop probability is updated periodically,
+based on latency measured and desired and whether the queuing latency is currently
+trending up or down. Queuing latency can be obtained using direct measurement or
+on estimations calculated from the queue length and dequeue rate. The random drop
+is triggered by a packet's arrival before enqueuing into a queue.
+
 
 Packet Marking
 --------------
drivers/net/softnic/rte_eth_softnic_tm.c +3 -3
index 90baba15ce..e74092ce7f 100644
@@ -420,7 +420,7 @@ pmd_tm_node_type_get(struct rte_eth_dev *dev,
 	return 0;
 }
 
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
 #define WRED_SUPPORTED						1
 #else
 #define WRED_SUPPORTED						0
@@ -2306,7 +2306,7 @@ tm_tc_wred_profile_get(struct rte_eth_dev *dev, uint32_t tc_id)
 	return NULL;
 }
 
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
 
 static void
 wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id)
@@ -2321,7 +2321,7 @@ wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id)
 	for (tc_id = 0; tc_id < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; tc_id++)
 		for (color = RTE_COLOR_GREEN; color < RTE_COLORS; color++) {
 			struct rte_red_params *dst =
-				&pp->red_params[tc_id][color];
+				&pp->cman_params->red_params[tc_id][color];
 			struct tm_wred_profile *src_wp =
 				tm_tc_wred_profile_get(dev, tc_id);
 			struct rte_tm_red_params *src =
lib/sched/meson.build +2 -1
index 8ced4547aa..df75db51ed 100644
@@ -7,11 +7,12 @@ if is_windows
     subdir_done()
 endif
 
-sources = files('rte_sched.c', 'rte_red.c', 'rte_approx.c')
+sources = files('rte_sched.c', 'rte_red.c', 'rte_approx.c', 'rte_pie.c')
 headers = files(
         'rte_approx.h',
         'rte_red.h',
         'rte_sched.h',
         'rte_sched_common.h',
+        'rte_pie.h',
 )
 deps += ['mbuf', 'meter']
lib/sched/rte_pie.c new file +86 -0

86 lines not on this page · raw message

lib/sched/rte_pie.h new file +398 -0

398 lines not on this page · raw message

lib/sched/rte_sched.c +182 -73

373 lines not on this page · raw message

lib/sched/rte_sched.h +49 -15

101 lines not on this page · raw message

lib/sched/version.map +4 -0
index a6e505c8ac..d22c07fc9f 100644
@@ -30,4 +30,8 @@ EXPERIMENTAL {
 
 	# added in 20.11
 	rte_sched_port_subport_profile_add;
+
+	# added in 21.11
+	rte_pie_rt_data_init;
+	rte_pie_config_init;
 };
Signature · 1 line
2.25.1
#165 lore raw

PATCH v22 2/3 examples/qos_sched: add PIE support

In reply to Liguzinski, WojciechX

From: Wojciech Liguzinski <[email protected]>

patch add support enable PIE or RED by
parsing config file.

---
 config/rte_config.h            |   1 -
 examples/qos_sched/cfg_file.c  | 127 +++++++++++++++------
 examples/qos_sched/cfg_file.h  |   5 +
 examples/qos_sched/init.c      |  27 +++--
 examples/qos_sched/main.h      |   3 +
 examples/qos_sched/profile.cfg | 196 ++++++++++++++++++++++-----------
 6 files changed, 250 insertions(+), 109 deletions(-)
config/rte_config.h +0 -1
index 1a66b42fcc..6ec687a555 100644
@@ -89,7 +89,6 @@
 #define RTE_MAX_LCORE_FREQS 64
 
 /* rte_sched defines */
-#undef RTE_SCHED_RED
 #undef RTE_SCHED_COLLECT_STATS
 #undef RTE_SCHED_SUBPORT_TC_OV
 #define RTE_SCHED_PORT_N_GRINDERS 8
examples/qos_sched/cfg_file.c +94 -33

193 lines not on this page · raw message

examples/qos_sched/cfg_file.h +5 -0
index 0dc458aa71..1a9dce9db5 100644
@@ -12,6 +12,11 @@ int cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port);
 
 int cfg_load_pipe(struct rte_cfgfile *cfg, struct rte_sched_pipe_params *pipe);
 
+#ifdef RTE_SCHED_CMAN
+void set_subport_cman_params(struct rte_sched_subport_params *subport_p,
+					struct rte_sched_cman_params cman_p);
+#endif
+
 int cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subport);
 
 int cfg_load_subport_profile(struct rte_cfgfile *cfg,
examples/qos_sched/init.c +17 -10
index 9b34e4a76b..3c1f0bc680 100644
@@ -203,15 +203,9 @@ static struct rte_sched_subport_profile_params
 	},
 };
 
-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,
-		.n_pipe_profiles = sizeof(pipe_profiles) /
-			sizeof(struct rte_sched_pipe_params),
-		.n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES,
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
+struct rte_sched_cman_params cman_params = {
+	.cman_mode = RTE_SCHED_CMAN_RED,
 	.red_params = {
 		/* Traffic Class 0 Colors Green / Yellow / Red */
 		[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
@@ -278,7 +272,20 @@ struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = {
 		[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
 		[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
 	},
-#endif /* RTE_SCHED_RED */
+};
+#endif /* RTE_SCHED_CMAN */
+
+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,
+		.n_pipe_profiles = sizeof(pipe_profiles) /
+			sizeof(struct rte_sched_pipe_params),
+		.n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES,
+#ifdef RTE_SCHED_CMAN
+		.cman_params = &cman_params,
+#endif /* RTE_SCHED_CMAN */
 	},
 };
 
examples/qos_sched/main.h +3 -0
index 0d6815ae69..915311bac8 100644
@@ -153,6 +153,9 @@ extern uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE];
 extern uint32_t n_active_queues;
 
 extern struct rte_sched_port_params port_params;
+#ifdef RTE_SCHED_CMAN
+extern struct rte_sched_cman_params cman_params;
+#endif
 extern struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS];
 
 int app_parse_args(int argc, char **argv);
examples/qos_sched/profile.cfg +131 -65

199 lines not on this page · raw message

Signature · 1 line
2.25.1
#166 lore raw

PATCH v22 3/3 examples/ip_pipeline: add PIE support

In reply to Liguzinski, WojciechX

From: Wojciech Liguzinski <[email protected]>

Adding the PIE support for IP Pipeline

---
 examples/ip_pipeline/tmgr.c | 142 +++++++++++++++++++-----------------
 1 file changed, 74 insertions(+), 68 deletions(-)
examples/ip_pipeline/tmgr.c +74 -68
index e4e364cbc0..b138e885cf 100644
@@ -17,6 +17,77 @@ static uint32_t n_subport_profiles;
 static struct rte_sched_pipe_params
 	pipe_profile[TMGR_PIPE_PROFILE_MAX];
 
+#ifdef RTE_SCHED_CMAN
+static struct rte_sched_cman_params cman_params = {
+	.red_params = {
+		/* Traffic Class 0 Colors Green / Yellow / Red */
+		[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[0][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[0][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 1 - Colors Green / Yellow / Red */
+		[1][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[1][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[1][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 2 - Colors Green / Yellow / Red */
+		[2][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[2][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[2][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 3 - Colors Green / Yellow / Red */
+		[3][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[3][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[3][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 4 - Colors Green / Yellow / Red */
+		[4][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[4][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[4][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 5 - Colors Green / Yellow / Red */
+		[5][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[5][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[5][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 6 - Colors Green / Yellow / Red */
+		[6][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[6][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[6][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 7 - Colors Green / Yellow / Red */
+		[7][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[7][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[7][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 8 - Colors Green / Yellow / Red */
+		[8][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[8][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[8][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 9 - Colors Green / Yellow / Red */
+		[9][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[9][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[9][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 10 - Colors Green / Yellow / Red */
+		[10][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[10][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[10][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 11 - Colors Green / Yellow / Red */
+		[11][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[11][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[11][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 12 - Colors Green / Yellow / Red */
+		[12][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		},
+};
+#endif /* RTE_SCHED_CMAN */
+
 static uint32_t n_pipe_profiles;
 
 static const struct rte_sched_subport_params subport_params_default = {
@@ -25,74 +96,9 @@ static const struct rte_sched_subport_params subport_params_default = {
 	.pipe_profiles = pipe_profile,
 	.n_pipe_profiles = 0, /* filled at run time */
 	.n_max_pipe_profiles = RTE_DIM(pipe_profile),
-#ifdef RTE_SCHED_RED
-.red_params = {
-	/* Traffic Class 0 Colors Green / Yellow / Red */
-	[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[0][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[0][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 1 - Colors Green / Yellow / Red */
-	[1][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[1][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[1][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 2 - Colors Green / Yellow / Red */
-	[2][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[2][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[2][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 3 - Colors Green / Yellow / Red */
-	[3][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[3][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[3][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 4 - Colors Green / Yellow / Red */
-	[4][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[4][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[4][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 5 - Colors Green / Yellow / Red */
-	[5][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[5][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[5][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 6 - Colors Green / Yellow / Red */
-	[6][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[6][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[6][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 7 - Colors Green / Yellow / Red */
-	[7][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[7][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[7][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 8 - Colors Green / Yellow / Red */
-	[8][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[8][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[8][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 9 - Colors Green / Yellow / Red */
-	[9][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[9][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[9][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 10 - Colors Green / Yellow / Red */
-	[10][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[10][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[10][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 11 - Colors Green / Yellow / Red */
-	[11][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[11][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[11][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 12 - Colors Green / Yellow / Red */
-	[12][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	},
-#endif /* RTE_SCHED_RED */
+#ifdef RTE_SCHED_CMAN
+	.cman_params = &cman_params,
+#endif /* RTE_SCHED_CMAN */
 };
 
 static struct tmgr_port_list tmgr_port_list;
Signature · 1 line
2.25.1
#167 lore raw

v23 cover Add PIE support for HQoS library

In reply to Liguzinski, WojciechX

From: Wojciech Liguzinski <[email protected]>

DPDK sched library is equipped with mechanism that secures it from the bufferbloat problem which is a situation when excess buffers in the network cause high latency and latency variation. Currently, it supports RED for active queue management. However, more advanced queue management is required to address this problem and provide desirable quality of service to users.

This solution (RFC) proposes usage of new algorithm called "PIE" (Proportional Integral controller Enhanced) that can effectively and directly control queuing latency to address the bufferbloat problem.

The implementation of mentioned functionality includes modification of existing and adding a new set of data structures to the library, adding PIE related APIs. This affects structures in public API/ABI. That is why deprecation notice is going to be prepared and sent.

Wojciech Liguzinski (3):
sched: add PIE based congestion management
examples/qos_sched: add PIE support
examples/ip_pipeline: add PIE support

 app/test/meson.build                         |    4 +
 app/test/test_pie.c                          | 1065 ++++++++++++++++++
 config/rte_config.h                          |    1 -
 doc/guides/prog_guide/glossary.rst           |    3 +
 doc/guides/prog_guide/qos_framework.rst      |   64 +-
 doc/guides/prog_guide/traffic_management.rst |   13 +-
 drivers/net/softnic/rte_eth_softnic_tm.c     |    6 +-
 examples/ip_pipeline/tmgr.c                  |  142 +--
 examples/qos_sched/cfg_file.c                |  127 ++-
 examples/qos_sched/cfg_file.h                |    5 +
 examples/qos_sched/init.c                    |   27 +-
 examples/qos_sched/main.h                    |    3 +
 examples/qos_sched/profile.cfg               |  196 ++--
 lib/sched/meson.build                        |    3 +-
 lib/sched/rte_pie.c                          |   86 ++
 lib/sched/rte_pie.h                          |  398 +++++++
 lib/sched/rte_sched.c                        |  254 +++--
 lib/sched/rte_sched.h                        |   64 +-
 lib/sched/version.map                        |    4 +
 19 files changed, 2184 insertions(+), 281 deletions(-)
 create mode 100644 app/test/test_pie.c
 create mode 100644 lib/sched/rte_pie.c
 create mode 100644 lib/sched/rte_pie.h
Signature · 1 line
2.25.1
#168 lore raw

PATCH v23 1/3 sched: add PIE based congestion management

From: Wojciech Liguzinski <[email protected]>

Implement PIE based congestion management based on rfc8033.

The Proportional Integral Controller Enhanced (PIE) algorithm works by proactively dropping packets randomly.
PIE is implemented as more advanced queue management is required to address the bufferbloat problem and provide desirable quality of service to users.

Tests for PIE code added to test application.
Added PIE related information to documentation.

--
Changes in V23:
- Coding style fixed

Changes in V22:
- Coding style fixed

Changes in V21:
- Coding style fixed
- Patches reorganized according to comments

Changes in V20:
- Removed API conditional compilation
- Added flag to indicate cman enabled/disabled
- Fixed submitter data in patches

Changes in V19:
- ACKs included in patches

Changes in V18:
- Resolved merge conflict in lib/sched/meson.build after rebasing ontop of main
- Reverted whitespace change in app_thread.c - comment from Stephen Hemminger

Changes in V17:
- Corrected paragraph link naming in qos_framework.rst to fix CI builds

Changes in V16:
- Fixed 'title underline too short' error in qos_framework.rst
- Applied __rte_unused macro to parameters in rte_sched_port_pie_dequeue()

---
 app/test/meson.build                         |    4 +
 app/test/test_pie.c                          | 1065 ++++++++++++++++++
 doc/guides/prog_guide/glossary.rst           |    3 +
 doc/guides/prog_guide/qos_framework.rst      |   64 +-
 doc/guides/prog_guide/traffic_management.rst |   13 +-
 drivers/net/softnic/rte_eth_softnic_tm.c     |    6 +-
 lib/sched/meson.build                        |    3 +-
 lib/sched/rte_pie.c                          |   86 ++
 lib/sched/rte_pie.h                          |  398 +++++++
 lib/sched/rte_sched.c                        |  254 +++--
 lib/sched/rte_sched.h                        |   64 +-
 lib/sched/version.map                        |    4 +
 12 files changed, 1860 insertions(+), 104 deletions(-)
 create mode 100644 app/test/test_pie.c
 create mode 100644 lib/sched/rte_pie.c
 create mode 100644 lib/sched/rte_pie.h
app/test/meson.build +4 -0
index 0c46cb064e..96670c3504 100644
@@ -115,6 +115,7 @@ test_sources = files(
         'test_reciprocal_division.c',
         'test_reciprocal_division_perf.c',
         'test_red.c',
+        'test_pie.c',
         'test_reorder.c',
         'test_rib.c',
         'test_rib6.c',
@@ -250,6 +251,7 @@ fast_tests = [
         ['prefetch_autotest', true],
         ['rcu_qsbr_autotest', true],
         ['red_autotest', true],
+        ['pie_autotest', true],
         ['rib_autotest', true],
         ['rib6_autotest', true],
         ['ring_autotest', true],
@@ -301,6 +303,7 @@ perf_test_names = [
         'fib_slow_autotest',
         'fib_perf_autotest',
         'red_all',
+        'pie_all',
         'barrier_autotest',
         'hash_multiwriter_autotest',
         'timer_racecond_autotest',
@@ -314,6 +317,7 @@ perf_test_names = [
         'fib6_perf_autotest',
         'rcu_qsbr_perf_autotest',
         'red_perf',
+        'pie_perf',
         'distributor_perf_autotest',
         'pmd_perf_autotest',
         'stack_perf_autotest',
app/test/test_pie.c new file +1065 -0

1,065 lines not on this page · raw message

doc/guides/prog_guide/glossary.rst +3 -0
index 7044a7df2a..fb0910ba5b 100644
@@ -158,6 +158,9 @@ PCI
 PHY
    An abbreviation for the physical layer of the OSI model.
 
+PIE
+   Proportional Integral Controller Enhanced (RFC8033)
+
 pktmbuf
    An *mbuf* carrying a network packet.
 
doc/guides/prog_guide/qos_framework.rst +54 -10

116 lines not on this page · raw message

doc/guides/prog_guide/traffic_management.rst +11 -2
index 05b34d93a5..c356791a45 100644
@@ -22,6 +22,7 @@ Main features:
   shared (by multiple nodes) shapers
 * Congestion management for hierarchy leaf nodes: algorithms of tail drop, head
   drop, WRED, private (per node) and shared (by multiple nodes) WRED contexts
+  and PIE.
 * Packet marking: IEEE 802.1q (VLAN DEI), IETF RFC 3168 (IPv4/IPv6 ECN for TCP
   and SCTP), IETF RFC 2597 (IPv4 / IPv6 DSCP)
 
@@ -103,8 +104,9 @@ Congestion Management
 Congestion management is used to control the admission of packets into a packet
 queue or group of packet queues on congestion. The congestion management
 algorithms that are supported are: Tail Drop, Head Drop and Weighted Random
-Early Detection (WRED). They are made available for every leaf node in the
-hierarchy, subject to the specific implementation supporting them.
+Early Detection (WRED), Proportional Integral Controller Enhanced (PIE).
+They are made available for every leaf node in the hierarchy, subject to
+the specific implementation supporting them.
 On request of writing a new packet into the current queue while the queue is
 full, the Tail Drop algorithm drops the new packet while leaving the queue
 unmodified, as opposed to the Head Drop* algorithm, which drops the packet
@@ -128,6 +130,13 @@ The configuration of WRED private and shared contexts is done through the
 definition of WRED profiles. Any WRED profile can be used by one or several
 WRED contexts (either private or shared).
 
+The Proportional Integral Controller Enhanced (PIE) algorithm works by proactively
+dropping packets randomly. Calculated drop probability is updated periodically,
+based on latency measured and desired and whether the queuing latency is currently
+trending up or down. Queuing latency can be obtained using direct measurement or
+on estimations calculated from the queue length and dequeue rate. The random drop
+is triggered by a packet's arrival before enqueuing into a queue.
+
 
 Packet Marking
 --------------
drivers/net/softnic/rte_eth_softnic_tm.c +3 -3
index 90baba15ce..e74092ce7f 100644
@@ -420,7 +420,7 @@ pmd_tm_node_type_get(struct rte_eth_dev *dev,
 	return 0;
 }
 
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
 #define WRED_SUPPORTED						1
 #else
 #define WRED_SUPPORTED						0
@@ -2306,7 +2306,7 @@ tm_tc_wred_profile_get(struct rte_eth_dev *dev, uint32_t tc_id)
 	return NULL;
 }
 
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
 
 static void
 wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id)
@@ -2321,7 +2321,7 @@ wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id)
 	for (tc_id = 0; tc_id < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; tc_id++)
 		for (color = RTE_COLOR_GREEN; color < RTE_COLORS; color++) {
 			struct rte_red_params *dst =
-				&pp->red_params[tc_id][color];
+				&pp->cman_params->red_params[tc_id][color];
 			struct tm_wred_profile *src_wp =
 				tm_tc_wred_profile_get(dev, tc_id);
 			struct rte_tm_red_params *src =
lib/sched/meson.build +2 -1
index 8ced4547aa..df75db51ed 100644
@@ -7,11 +7,12 @@ if is_windows
     subdir_done()
 endif
 
-sources = files('rte_sched.c', 'rte_red.c', 'rte_approx.c')
+sources = files('rte_sched.c', 'rte_red.c', 'rte_approx.c', 'rte_pie.c')
 headers = files(
         'rte_approx.h',
         'rte_red.h',
         'rte_sched.h',
         'rte_sched_common.h',
+        'rte_pie.h',
 )
 deps += ['mbuf', 'meter']
lib/sched/rte_pie.c new file +86 -0

86 lines not on this page · raw message

lib/sched/rte_pie.h new file +398 -0

398 lines not on this page · raw message

lib/sched/rte_sched.c +181 -73

372 lines not on this page · raw message

lib/sched/rte_sched.h +49 -15

101 lines not on this page · raw message

lib/sched/version.map +4 -0
index a6e505c8ac..d22c07fc9f 100644
@@ -30,4 +30,8 @@ EXPERIMENTAL {
 
 	# added in 20.11
 	rte_sched_port_subport_profile_add;
+
+	# added in 21.11
+	rte_pie_rt_data_init;
+	rte_pie_config_init;
 };
Signature · 1 line
2.25.1
#169 lore raw

Re: [dpdk-dev] [PATCH v23 1/3] sched: add PIE based congestion management

04/11/2021 12:03, Liguzinski, WojciechX:

Quoted 10 lines

From: Wojciech Liguzinski <[email protected]>

Implement PIE based congestion management based on rfc8033.

The Proportional Integral Controller Enhanced (PIE) algorithm works by proactively dropping packets randomly.
PIE is implemented as more advanced queue management is required to address the bufferbloat problem and provide desirable quality of service to users.

Quoted 8 lines

Tests for PIE code added to test application.
Added PIE related information to documentation.

--

It should be 3 dashes to make the below hidden in git.

Quoted 38 lines

Changes in V23:
- Coding style fixed

Changes in V22:
- Coding style fixed

Changes in V21:
- Coding style fixed
- Patches reorganized according to comments

Changes in V20:
- Removed API conditional compilation
- Added flag to indicate cman enabled/disabled
- Fixed submitter data in patches

Changes in V19:
- ACKs included in patches

Changes in V18:
- Resolved merge conflict in lib/sched/meson.build after rebasing ontop of main
- Reverted whitespace change in app_thread.c - comment from Stephen Hemminger

Changes in V17:
- Corrected paragraph link naming in qos_framework.rst to fix CI builds

Changes in V16:
- Fixed 'title underline too short' error in qos_framework.rst
- Applied __rte_unused macro to parameters in rte_sched_port_pie_dequeue()

---
 app/test/meson.build                         |    4 +
 app/test/test_pie.c                          | 1065 ++++++++++++++++++
 doc/guides/prog_guide/glossary.rst           |    3 +
 doc/guides/prog_guide/qos_framework.rst      |   64 +-
 doc/guides/prog_guide/traffic_management.rst |   13 +-
 drivers/net/softnic/rte_eth_softnic_tm.c     |    6 +-
 lib/sched/meson.build                        |    3 +-
 lib/sched/rte_pie.c                          |   86 ++
Quoted 8 lines
 lib/sched/rte_pie.h                          |  398 +++++++
 lib/sched/rte_sched.c                        |  254 +++--
 lib/sched/rte_sched.h                        |   64 +-
 lib/sched/version.map                        |    4 +
 12 files changed, 1860 insertions(+), 104 deletions(-)
 create mode 100644 app/test/test_pie.c
 create mode 100644 lib/sched/rte_pie.c
 create mode 100644 lib/sched/rte_pie.h

Adding this change to include the new test in sched library maintainership:

MAINTAINERS +1 -0
@@ -1428,6 +1428,7 @@ M: Cristian Dumitrescu <[email protected]>
 M: Jasvinder Singh <[email protected]>
 F: lib/sched/
 F: doc/guides/prog_guide/qos_framework.rst
+F: app/test/test_pie.c
 F: app/test/test_red.c
 F: app/test/test_sched.c
 F: examples/qos_sched/

Cristian, Jasvinder, I didn't see a lot of comments from you on this patch, so I assume you are OK with this change.

#170 lore raw

Re: [dpdk-dev] [PATCH v23 1/3] sched: add PIE based congestion management

Quoted 99 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Thursday, November 4, 2021 1:58 PM
To: Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>; Liguzinski, WojciechX <[email protected]>
Cc: [email protected]; Ajmera, Megha <[email protected]>; Liguzinski, WojciechX <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v23 1/3] sched: add PIE based congestion management

04/11/2021 12:03, Liguzinski, WojciechX:

Quoted 10 lines

From: Wojciech Liguzinski <[email protected]>

Implement PIE based congestion management based on rfc8033.

The Proportional Integral Controller Enhanced (PIE) algorithm works by proactively dropping packets randomly.
PIE is implemented as more advanced queue management is required to address the bufferbloat problem and provide desirable quality of service to users.

Quoted 8 lines

Tests for PIE code added to test application.
Added PIE related information to documentation.

--

It should be 3 dashes to make the below hidden in git.

Quoted 15 lines

Changes in V23:
- Coding style fixed

Changes in V22:
- Coding style fixed

Changes in V21:
- Coding style fixed
- Patches reorganized according to comments

Changes in V20:
- Removed API conditional compilation
- Added flag to indicate cman enabled/disabled
- Fixed submitter data in patches

Quoted 5 lines

Changes in V19:
- ACKs included in patches

Changes in V18:
- Resolved merge conflict in lib/sched/meson.build after rebasing ontop of

main

Quoted 1 line

- Reverted whitespace change in app_thread.c - comment from Stephen

Hemminger

Quoted 7 lines

Changes in V17:
- Corrected paragraph link naming in qos_framework.rst to fix CI builds

Changes in V16:
- Fixed 'title underline too short' error in qos_framework.rst
- Applied __rte_unused macro to parameters in

rte_sched_port_pie_dequeue()

Quoted 10 lines
---
 app/test/meson.build                         |    4 +
 app/test/test_pie.c                          | 1065 ++++++++++++++++++
 doc/guides/prog_guide/glossary.rst           |    3 +
 doc/guides/prog_guide/qos_framework.rst      |   64 +-
 doc/guides/prog_guide/traffic_management.rst |   13 +-
 drivers/net/softnic/rte_eth_softnic_tm.c     |    6 +-
 lib/sched/meson.build                        |    3 +-
 lib/sched/rte_pie.c                          |   86 ++
Quoted 8 lines
 lib/sched/rte_pie.h                          |  398 +++++++
 lib/sched/rte_sched.c                        |  254 +++--
 lib/sched/rte_sched.h                        |   64 +-
 lib/sched/version.map                        |    4 +
 12 files changed, 1860 insertions(+), 104 deletions(-)
 create mode 100644 app/test/test_pie.c
 create mode 100644 lib/sched/rte_pie.c
 create mode 100644 lib/sched/rte_pie.h

Adding this change to include the new test in sched library maintainership:

MAINTAINERS +0 -0
@@ -1428,6 +1428,7 @@ M: Cristian Dumitrescu

<[email protected]>
M: Jasvinder Singh <[email protected]>
F: lib/sched/
F: doc/guides/prog_guide/qos_framework.rst
+F: app/test/test_pie.c
F: app/test/test_red.c
F: app/test/test_sched.c
F: examples/qos_sched/

Quoted 3 lines

Cristian, Jasvinder, I didn't see a lot of comments from you on this patch, so I assume you are OK with this change.

Hi Thomas,

Yes, I am.

Regards,
Cristian

#171 lore raw

PATCH v23 2/3 examples/qos_sched: add PIE support

In reply to Liguzinski, WojciechX

From: Wojciech Liguzinski <[email protected]>

patch add support enable PIE or RED by
parsing config file.

---
 config/rte_config.h            |   1 -
 examples/qos_sched/cfg_file.c  | 127 +++++++++++++++------
 examples/qos_sched/cfg_file.h  |   5 +
 examples/qos_sched/init.c      |  27 +++--
 examples/qos_sched/main.h      |   3 +
 examples/qos_sched/profile.cfg | 196 ++++++++++++++++++++++-----------
 6 files changed, 250 insertions(+), 109 deletions(-)
config/rte_config.h +0 -1
index 1a66b42fcc..6ec687a555 100644
@@ -89,7 +89,6 @@
 #define RTE_MAX_LCORE_FREQS 64
 
 /* rte_sched defines */
-#undef RTE_SCHED_RED
 #undef RTE_SCHED_COLLECT_STATS
 #undef RTE_SCHED_SUBPORT_TC_OV
 #define RTE_SCHED_PORT_N_GRINDERS 8
examples/qos_sched/cfg_file.c +94 -33

193 lines not on this page · raw message

examples/qos_sched/cfg_file.h +5 -0
index 0dc458aa71..1a9dce9db5 100644
@@ -12,6 +12,11 @@ int cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port);
 
 int cfg_load_pipe(struct rte_cfgfile *cfg, struct rte_sched_pipe_params *pipe);
 
+#ifdef RTE_SCHED_CMAN
+void set_subport_cman_params(struct rte_sched_subport_params *subport_p,
+					struct rte_sched_cman_params cman_p);
+#endif
+
 int cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subport);
 
 int cfg_load_subport_profile(struct rte_cfgfile *cfg,
examples/qos_sched/init.c +17 -10
index 9b34e4a76b..3c1f0bc680 100644
@@ -203,15 +203,9 @@ static struct rte_sched_subport_profile_params
 	},
 };
 
-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,
-		.n_pipe_profiles = sizeof(pipe_profiles) /
-			sizeof(struct rte_sched_pipe_params),
-		.n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES,
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
+struct rte_sched_cman_params cman_params = {
+	.cman_mode = RTE_SCHED_CMAN_RED,
 	.red_params = {
 		/* Traffic Class 0 Colors Green / Yellow / Red */
 		[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
@@ -278,7 +272,20 @@ struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = {
 		[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
 		[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
 	},
-#endif /* RTE_SCHED_RED */
+};
+#endif /* RTE_SCHED_CMAN */
+
+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,
+		.n_pipe_profiles = sizeof(pipe_profiles) /
+			sizeof(struct rte_sched_pipe_params),
+		.n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES,
+#ifdef RTE_SCHED_CMAN
+		.cman_params = &cman_params,
+#endif /* RTE_SCHED_CMAN */
 	},
 };
 
examples/qos_sched/main.h +3 -0
index 0d6815ae69..915311bac8 100644
@@ -153,6 +153,9 @@ extern uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE];
 extern uint32_t n_active_queues;
 
 extern struct rte_sched_port_params port_params;
+#ifdef RTE_SCHED_CMAN
+extern struct rte_sched_cman_params cman_params;
+#endif
 extern struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS];
 
 int app_parse_args(int argc, char **argv);
examples/qos_sched/profile.cfg +131 -65

199 lines not on this page · raw message

Signature · 1 line
2.25.1
#172 lore raw

PATCH v23 3/3 examples/ip_pipeline: add PIE support

In reply to Liguzinski, WojciechX

From: Wojciech Liguzinski <[email protected]>

Adding the PIE support for IP Pipeline

---
 examples/ip_pipeline/tmgr.c | 142 +++++++++++++++++++-----------------
 1 file changed, 74 insertions(+), 68 deletions(-)
examples/ip_pipeline/tmgr.c +74 -68
index e4e364cbc0..b138e885cf 100644
@@ -17,6 +17,77 @@ static uint32_t n_subport_profiles;
 static struct rte_sched_pipe_params
 	pipe_profile[TMGR_PIPE_PROFILE_MAX];
 
+#ifdef RTE_SCHED_CMAN
+static struct rte_sched_cman_params cman_params = {
+	.red_params = {
+		/* Traffic Class 0 Colors Green / Yellow / Red */
+		[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[0][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[0][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 1 - Colors Green / Yellow / Red */
+		[1][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[1][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[1][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 2 - Colors Green / Yellow / Red */
+		[2][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[2][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[2][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 3 - Colors Green / Yellow / Red */
+		[3][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[3][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[3][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 4 - Colors Green / Yellow / Red */
+		[4][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[4][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[4][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 5 - Colors Green / Yellow / Red */
+		[5][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[5][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[5][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 6 - Colors Green / Yellow / Red */
+		[6][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[6][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[6][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 7 - Colors Green / Yellow / Red */
+		[7][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[7][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[7][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 8 - Colors Green / Yellow / Red */
+		[8][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[8][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[8][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 9 - Colors Green / Yellow / Red */
+		[9][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[9][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[9][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 10 - Colors Green / Yellow / Red */
+		[10][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[10][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[10][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 11 - Colors Green / Yellow / Red */
+		[11][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[11][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[11][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 12 - Colors Green / Yellow / Red */
+		[12][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		},
+};
+#endif /* RTE_SCHED_CMAN */
+
 static uint32_t n_pipe_profiles;
 
 static const struct rte_sched_subport_params subport_params_default = {
@@ -25,74 +96,9 @@ static const struct rte_sched_subport_params subport_params_default = {
 	.pipe_profiles = pipe_profile,
 	.n_pipe_profiles = 0, /* filled at run time */
 	.n_max_pipe_profiles = RTE_DIM(pipe_profile),
-#ifdef RTE_SCHED_RED
-.red_params = {
-	/* Traffic Class 0 Colors Green / Yellow / Red */
-	[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[0][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[0][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 1 - Colors Green / Yellow / Red */
-	[1][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[1][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[1][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 2 - Colors Green / Yellow / Red */
-	[2][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[2][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[2][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 3 - Colors Green / Yellow / Red */
-	[3][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[3][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[3][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 4 - Colors Green / Yellow / Red */
-	[4][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[4][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[4][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 5 - Colors Green / Yellow / Red */
-	[5][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[5][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[5][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 6 - Colors Green / Yellow / Red */
-	[6][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[6][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[6][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 7 - Colors Green / Yellow / Red */
-	[7][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[7][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[7][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 8 - Colors Green / Yellow / Red */
-	[8][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[8][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[8][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 9 - Colors Green / Yellow / Red */
-	[9][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[9][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[9][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 10 - Colors Green / Yellow / Red */
-	[10][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[10][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[10][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 11 - Colors Green / Yellow / Red */
-	[11][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[11][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[11][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 12 - Colors Green / Yellow / Red */
-	[12][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	},
-#endif /* RTE_SCHED_RED */
+#ifdef RTE_SCHED_CMAN
+	.cman_params = &cman_params,
+#endif /* RTE_SCHED_CMAN */
 };
 
 static struct tmgr_port_list tmgr_port_list;
Signature · 1 line
2.25.1
#173 lore raw

v24 cover Add PIE support for HQoS library

In reply to Liguzinski, WojciechX

last changes to make this series "more acceptable":
- RTE_SCHED_CMAN in rte_config.h, replacing RTE_SCHED_RED
- test file listed in MAINTAINERS
- few whitespaces fixed

From: Wojciech Liguzinski <[email protected]>

DPDK sched library is equipped with mechanism that secures it from the bufferbloat problem which is a situation when excess buffers in the network cause high latency and latency variation. Currently, it supports RED for active queue management. However, more advanced queue management is required to address this problem and provide desirable quality of service to users.

This solution (RFC) proposes usage of new algorithm called "PIE" (Proportional Integral controller Enhanced) that can effectively and directly control queuing latency to address the bufferbloat problem.

The implementation of mentioned functionality includes modification of existing and adding a new set of data structures to the library, adding PIE related APIs. This affects structures in public API/ABI. That is why deprecation notice is going to be prepared and sent.

Wojciech Liguzinski (3):
sched: add PIE based congestion management examples/qos_sched: support PIE congestion management examples/ip_pipeline: support PIE congestion management

 MAINTAINERS                                  |    1 +
 app/test/meson.build                         |    4 +
 app/test/test_pie.c                          | 1065 ++++++++++++++++++
 config/rte_config.h                          |    2 +-
 doc/guides/prog_guide/glossary.rst           |    3 +
 doc/guides/prog_guide/qos_framework.rst      |   64 +-
 doc/guides/prog_guide/traffic_management.rst |   13 +-
 drivers/net/softnic/rte_eth_softnic_tm.c     |    6 +-
 examples/ip_pipeline/tmgr.c                  |  142 +--
 examples/qos_sched/cfg_file.c                |  127 ++-
 examples/qos_sched/cfg_file.h                |    5 +
 examples/qos_sched/init.c                    |   27 +-
 examples/qos_sched/main.h                    |    3 +
 examples/qos_sched/profile.cfg               |  196 ++--
 lib/sched/meson.build                        |    3 +-
 lib/sched/rte_pie.c                          |   86 ++
 lib/sched/rte_pie.h                          |  396 +++++++
 lib/sched/rte_sched.c                        |  256 +++--
 lib/sched/rte_sched.h                        |   64 +-
 lib/sched/version.map                        |    4 +
 20 files changed, 2185 insertions(+), 282 deletions(-)
 create mode 100644 app/test/test_pie.c
 create mode 100644 lib/sched/rte_pie.c
 create mode 100644 lib/sched/rte_pie.h
Signature · 1 line
2.33.0
#174 lore raw

PATCH v24 1/3 sched: add PIE based congestion management

From: Wojciech Liguzinski <[email protected]>

Implement PIE based congestion management based on rfc8033.

The Proportional Integral Controller Enhanced (PIE) algorithm works by proactively dropping packets randomly.
PIE is implemented as more advanced queue management is required to address the bufferbloat problem and provide desirable quality of service to users.

Tests for PIE code added to test application.
Added PIE related information to documentation.

---
 MAINTAINERS                                  |    1 +
 app/test/meson.build                         |    4 +
 app/test/test_pie.c                          | 1065 ++++++++++++++++++
 config/rte_config.h                          |    2 +-
 doc/guides/prog_guide/glossary.rst           |    3 +
 doc/guides/prog_guide/qos_framework.rst      |   64 +-
 doc/guides/prog_guide/traffic_management.rst |   13 +-
 drivers/net/softnic/rte_eth_softnic_tm.c     |    6 +-
 examples/ip_pipeline/tmgr.c                  |    4 +-
 examples/qos_sched/cfg_file.c                |    6 +-
 examples/qos_sched/init.c                    |    4 +-
 lib/sched/meson.build                        |    3 +-
 lib/sched/rte_pie.c                          |   86 ++
 lib/sched/rte_pie.h                          |  396 +++++++
 lib/sched/rte_sched.c                        |  256 +++--
 lib/sched/rte_sched.h                        |   64 +-
 lib/sched/version.map                        |    4 +
 17 files changed, 1868 insertions(+), 113 deletions(-)
 create mode 100644 app/test/test_pie.c
 create mode 100644 lib/sched/rte_pie.c
 create mode 100644 lib/sched/rte_pie.h
MAINTAINERS +1 -0
index 0e5951f8f1..2629960df0 100644
@@ -1428,6 +1428,7 @@ M: Cristian Dumitrescu <[email protected]>
 M: Jasvinder Singh <[email protected]>
 F: lib/sched/
 F: doc/guides/prog_guide/qos_framework.rst
+F: app/test/test_pie.c
 F: app/test/test_red.c
 F: app/test/test_sched.c
 F: examples/qos_sched/
app/test/meson.build +4 -0
index 0c46cb064e..96670c3504 100644
@@ -115,6 +115,7 @@ test_sources = files(
         'test_reciprocal_division.c',
         'test_reciprocal_division_perf.c',
         'test_red.c',
+        'test_pie.c',
         'test_reorder.c',
         'test_rib.c',
         'test_rib6.c',
@@ -250,6 +251,7 @@ fast_tests = [
         ['prefetch_autotest', true],
         ['rcu_qsbr_autotest', true],
         ['red_autotest', true],
+        ['pie_autotest', true],
         ['rib_autotest', true],
         ['rib6_autotest', true],
         ['ring_autotest', true],
@@ -301,6 +303,7 @@ perf_test_names = [
         'fib_slow_autotest',
         'fib_perf_autotest',
         'red_all',
+        'pie_all',
         'barrier_autotest',
         'hash_multiwriter_autotest',
         'timer_racecond_autotest',
@@ -314,6 +317,7 @@ perf_test_names = [
         'fib6_perf_autotest',
         'rcu_qsbr_perf_autotest',
         'red_perf',
+        'pie_perf',
         'distributor_perf_autotest',
         'pmd_perf_autotest',
         'stack_perf_autotest',
app/test/test_pie.c new file +1065 -0

1,065 lines not on this page · raw message

config/rte_config.h +1 -1
index 1a66b42fcc..4ab1d86fdf 100644
@@ -89,7 +89,7 @@
 #define RTE_MAX_LCORE_FREQS 64
 
 /* rte_sched defines */
-#undef RTE_SCHED_RED
+#undef RTE_SCHED_CMAN
 #undef RTE_SCHED_COLLECT_STATS
 #undef RTE_SCHED_SUBPORT_TC_OV
 #define RTE_SCHED_PORT_N_GRINDERS 8
doc/guides/prog_guide/glossary.rst +3 -0
index 7044a7df2a..fb0910ba5b 100644
@@ -158,6 +158,9 @@ PCI
 PHY
    An abbreviation for the physical layer of the OSI model.
 
+PIE
+   Proportional Integral Controller Enhanced (RFC8033)
+
 pktmbuf
    An *mbuf* carrying a network packet.
 
doc/guides/prog_guide/qos_framework.rst +54 -10

116 lines not on this page · raw message

doc/guides/prog_guide/traffic_management.rst +11 -2
index 05b34d93a5..c356791a45 100644
@@ -22,6 +22,7 @@ Main features:
   shared (by multiple nodes) shapers
 * Congestion management for hierarchy leaf nodes: algorithms of tail drop, head
   drop, WRED, private (per node) and shared (by multiple nodes) WRED contexts
+  and PIE.
 * Packet marking: IEEE 802.1q (VLAN DEI), IETF RFC 3168 (IPv4/IPv6 ECN for TCP
   and SCTP), IETF RFC 2597 (IPv4 / IPv6 DSCP)
 
@@ -103,8 +104,9 @@ Congestion Management
 Congestion management is used to control the admission of packets into a packet
 queue or group of packet queues on congestion. The congestion management
 algorithms that are supported are: Tail Drop, Head Drop and Weighted Random
-Early Detection (WRED). They are made available for every leaf node in the
-hierarchy, subject to the specific implementation supporting them.
+Early Detection (WRED), Proportional Integral Controller Enhanced (PIE).
+They are made available for every leaf node in the hierarchy, subject to
+the specific implementation supporting them.
 On request of writing a new packet into the current queue while the queue is
 full, the Tail Drop algorithm drops the new packet while leaving the queue
 unmodified, as opposed to the Head Drop* algorithm, which drops the packet
@@ -128,6 +130,13 @@ The configuration of WRED private and shared contexts is done through the
 definition of WRED profiles. Any WRED profile can be used by one or several
 WRED contexts (either private or shared).
 
+The Proportional Integral Controller Enhanced (PIE) algorithm works by proactively
+dropping packets randomly. Calculated drop probability is updated periodically,
+based on latency measured and desired and whether the queuing latency is currently
+trending up or down. Queuing latency can be obtained using direct measurement or
+on estimations calculated from the queue length and dequeue rate. The random drop
+is triggered by a packet's arrival before enqueuing into a queue.
+
 
 Packet Marking
 --------------
drivers/net/softnic/rte_eth_softnic_tm.c +3 -3
index 90baba15ce..e74092ce7f 100644
@@ -420,7 +420,7 @@ pmd_tm_node_type_get(struct rte_eth_dev *dev,
 	return 0;
 }
 
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
 #define WRED_SUPPORTED						1
 #else
 #define WRED_SUPPORTED						0
@@ -2306,7 +2306,7 @@ tm_tc_wred_profile_get(struct rte_eth_dev *dev, uint32_t tc_id)
 	return NULL;
 }
 
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
 
 static void
 wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id)
@@ -2321,7 +2321,7 @@ wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id)
 	for (tc_id = 0; tc_id < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; tc_id++)
 		for (color = RTE_COLOR_GREEN; color < RTE_COLORS; color++) {
 			struct rte_red_params *dst =
-				&pp->red_params[tc_id][color];
+				&pp->cman_params->red_params[tc_id][color];
 			struct tm_wred_profile *src_wp =
 				tm_tc_wred_profile_get(dev, tc_id);
 			struct rte_tm_red_params *src =
examples/ip_pipeline/tmgr.c +2 -2
index e4e364cbc0..406184e760 100644
@@ -25,7 +25,7 @@ static const struct rte_sched_subport_params subport_params_default = {
 	.pipe_profiles = pipe_profile,
 	.n_pipe_profiles = 0, /* filled at run time */
 	.n_max_pipe_profiles = RTE_DIM(pipe_profile),
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
 .red_params = {
 	/* Traffic Class 0 Colors Green / Yellow / Red */
 	[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
@@ -92,7 +92,7 @@ static const struct rte_sched_subport_params subport_params_default = {
 	[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
 	[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
 	},
-#endif /* RTE_SCHED_RED */
+#endif /* RTE_SCHED_CMAN */
 };
 
 static struct tmgr_port_list tmgr_port_list;
examples/qos_sched/cfg_file.c +3 -3
index cd167bd8e6..4bef887099 100644
@@ -242,7 +242,7 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo
 	memset(active_queues, 0, sizeof(active_queues));
 	n_active_queues = 0;
 
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
 	char sec_name[CFG_NAME_LEN];
 	struct rte_red_params red_params[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE][RTE_COLORS];
 
@@ -315,7 +315,7 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo
 			}
 		}
 	}
-#endif /* RTE_SCHED_RED */
+#endif /* RTE_SCHED_CMAN */
 
 	for (i = 0; i < MAX_SCHED_SUBPORTS; i++) {
 		char sec_name[CFG_NAME_LEN];
@@ -393,7 +393,7 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo
 					}
 				}
 			}
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
 			for (j = 0; j < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; j++) {
 				for (k = 0; k < RTE_COLORS; k++) {
 					subport_params[i].red_params[j][k].min_th =
examples/qos_sched/init.c +2 -2
index 9b34e4a76b..3bdc653c69 100644
@@ -211,7 +211,7 @@ struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = {
 		.n_pipe_profiles = sizeof(pipe_profiles) /
 			sizeof(struct rte_sched_pipe_params),
 		.n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES,
-#ifdef RTE_SCHED_RED
+#ifdef RTE_SCHED_CMAN
 	.red_params = {
 		/* Traffic Class 0 Colors Green / Yellow / Red */
 		[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
@@ -278,7 +278,7 @@ struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = {
 		[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
 		[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
 	},
-#endif /* RTE_SCHED_RED */
+#endif /* RTE_SCHED_CMAN */
 	},
 };
 
lib/sched/meson.build +2 -1
index 8ced4547aa..df75db51ed 100644
@@ -7,11 +7,12 @@ if is_windows
     subdir_done()
 endif
 
-sources = files('rte_sched.c', 'rte_red.c', 'rte_approx.c')
+sources = files('rte_sched.c', 'rte_red.c', 'rte_approx.c', 'rte_pie.c')
 headers = files(
         'rte_approx.h',
         'rte_red.h',
         'rte_sched.h',
         'rte_sched_common.h',
+        'rte_pie.h',
 )
 deps += ['mbuf', 'meter']
lib/sched/rte_pie.c new file +86 -0

86 lines not on this page · raw message

lib/sched/rte_pie.h new file +396 -0

396 lines not on this page · raw message

lib/sched/rte_sched.c +182 -74

373 lines not on this page · raw message

lib/sched/rte_sched.h +49 -15

101 lines not on this page · raw message

lib/sched/version.map +4 -0
index a6e505c8ac..d22c07fc9f 100644
@@ -30,4 +30,8 @@ EXPERIMENTAL {
 
 	# added in 20.11
 	rte_sched_port_subport_profile_add;
+
+	# added in 21.11
+	rte_pie_rt_data_init;
+	rte_pie_config_init;
 };
Signature · 1 line
2.33.0
#175 lore raw

PATCH v24 2/3 examples/qos_sched: support PIE congestion management

In reply to Thomas Monjalon

From: Wojciech Liguzinski <[email protected]>

patch add support enable PIE or RED by
parsing config file.

---
 examples/qos_sched/cfg_file.c  | 121 +++++++++++++++-----
 examples/qos_sched/cfg_file.h  |   5 +
 examples/qos_sched/init.c      |  23 ++--
 examples/qos_sched/main.h      |   3 +
 examples/qos_sched/profile.cfg | 196 ++++++++++++++++++++++-----------
 5 files changed, 245 insertions(+), 103 deletions(-)
examples/qos_sched/cfg_file.c +91 -30
index 4bef887099..450482f07d 100644
@@ -229,6 +229,40 @@ cfg_load_subport_profile(struct rte_cfgfile *cfg,
 	return 0;
 }
 
+#ifdef RTE_SCHED_CMAN
+void set_subport_cman_params(struct rte_sched_subport_params *subport_p,
+					struct rte_sched_cman_params cman_p)
+{
+	int j, k;
+	subport_p->cman_params->cman_mode = cman_p.cman_mode;
+
+	for (j = 0; j < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; j++) {
+		if (subport_p->cman_params->cman_mode ==
+					RTE_SCHED_CMAN_RED) {
+			for (k = 0; k < RTE_COLORS; k++) {
+				subport_p->cman_params->red_params[j][k].min_th =
+					cman_p.red_params[j][k].min_th;
+				subport_p->cman_params->red_params[j][k].max_th =
+					cman_p.red_params[j][k].max_th;
+				subport_p->cman_params->red_params[j][k].maxp_inv =
+					cman_p.red_params[j][k].maxp_inv;
+				subport_p->cman_params->red_params[j][k].wq_log2 =
+					cman_p.red_params[j][k].wq_log2;
+			}
+		} else {
+			subport_p->cman_params->pie_params[j].qdelay_ref =
+				cman_p.pie_params[j].qdelay_ref;
+			subport_p->cman_params->pie_params[j].dp_update_interval =
+				cman_p.pie_params[j].dp_update_interval;
+			subport_p->cman_params->pie_params[j].max_burst =
+				cman_p.pie_params[j].max_burst;
+			subport_p->cman_params->pie_params[j].tailq_th =
+				cman_p.pie_params[j].tailq_th;
+		}
+	}
+}
+#endif
+
 int
 cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subport_params)
 {
@@ -243,24 +277,25 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo
 	n_active_queues = 0;
 
 #ifdef RTE_SCHED_CMAN
-	char sec_name[CFG_NAME_LEN];
-	struct rte_red_params red_params[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE][RTE_COLORS];
+	struct rte_sched_cman_params cman_params = {
+		.cman_mode = RTE_SCHED_CMAN_RED,
+		.red_params = { },
+	};
 
-	snprintf(sec_name, sizeof(sec_name), "red");
-
-	if (rte_cfgfile_has_section(cfg, sec_name)) {
+	if (rte_cfgfile_has_section(cfg, "red")) {
+		cman_params.cman_mode = RTE_SCHED_CMAN_RED;
 
 		for (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++) {
 			char str[32];
 
-			/* Parse WRED min thresholds */
-			snprintf(str, sizeof(str), "tc %d wred min", i);
-			entry = rte_cfgfile_get_entry(cfg, sec_name, str);
+			/* Parse RED min thresholds */
+			snprintf(str, sizeof(str), "tc %d red min", i);
+			entry = rte_cfgfile_get_entry(cfg, "red", str);
 			if (entry) {
 				char *next;
 				/* for each packet colour (green, yellow, red) */
 				for (j = 0; j < RTE_COLORS; j++) {
-					red_params[i][j].min_th
+					cman_params.red_params[i][j].min_th
 						= (uint16_t)strtol(entry, &next, 10);
 					if (next == NULL)
 						break;
@@ -268,14 +303,14 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo
 				}
 			}
 
-			/* Parse WRED max thresholds */
-			snprintf(str, sizeof(str), "tc %d wred max", i);
+			/* Parse RED max thresholds */
+			snprintf(str, sizeof(str), "tc %d red max", i);
 			entry = rte_cfgfile_get_entry(cfg, "red", str);
 			if (entry) {
 				char *next;
 				/* for each packet colour (green, yellow, red) */
 				for (j = 0; j < RTE_COLORS; j++) {
-					red_params[i][j].max_th
+					cman_params.red_params[i][j].max_th
 						= (uint16_t)strtol(entry, &next, 10);
 					if (next == NULL)
 						break;
@@ -283,14 +318,14 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo
 				}
 			}
 
-			/* Parse WRED inverse mark probabilities */
-			snprintf(str, sizeof(str), "tc %d wred inv prob", i);
+			/* Parse RED inverse mark probabilities */
+			snprintf(str, sizeof(str), "tc %d red inv prob", i);
 			entry = rte_cfgfile_get_entry(cfg, "red", str);
 			if (entry) {
 				char *next;
 				/* for each packet colour (green, yellow, red) */
 				for (j = 0; j < RTE_COLORS; j++) {
-					red_params[i][j].maxp_inv
+					cman_params.red_params[i][j].maxp_inv
 						= (uint8_t)strtol(entry, &next, 10);
 
 					if (next == NULL)
@@ -299,14 +334,14 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo
 				}
 			}
 
-			/* Parse WRED EWMA filter weights */
-			snprintf(str, sizeof(str), "tc %d wred weight", i);
+			/* Parse RED EWMA filter weights */
+			snprintf(str, sizeof(str), "tc %d red weight", i);
 			entry = rte_cfgfile_get_entry(cfg, "red", str);
 			if (entry) {
 				char *next;
 				/* for each packet colour (green, yellow, red) */
 				for (j = 0; j < RTE_COLORS; j++) {
-					red_params[i][j].wq_log2
+					cman_params.red_params[i][j].wq_log2
 						= (uint8_t)strtol(entry, &next, 10);
 					if (next == NULL)
 						break;
@@ -315,6 +350,43 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo
 			}
 		}
 	}
+
+	if (rte_cfgfile_has_section(cfg, "pie")) {
+		cman_params.cman_mode = RTE_SCHED_CMAN_PIE;
+
+		for (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++) {
+			char str[32];
+
+			/* Parse Queue Delay Ref value */
+			snprintf(str, sizeof(str), "tc %d qdelay ref", i);
+			entry = rte_cfgfile_get_entry(cfg, "pie", str);
+			if (entry)
+				cman_params.pie_params[i].qdelay_ref =
+					(uint16_t) atoi(entry);
+
+			/* Parse Max Burst value */
+			snprintf(str, sizeof(str), "tc %d max burst", i);
+			entry = rte_cfgfile_get_entry(cfg, "pie", str);
+			if (entry)
+				cman_params.pie_params[i].max_burst =
+					(uint16_t) atoi(entry);
+
+			/* Parse Update Interval Value */
+			snprintf(str, sizeof(str), "tc %d update interval", i);
+			entry = rte_cfgfile_get_entry(cfg, "pie", str);
+			if (entry)
+				cman_params.pie_params[i].dp_update_interval =
+					(uint16_t) atoi(entry);
+
+			/* Parse Tailq Threshold Value */
+			snprintf(str, sizeof(str), "tc %d tailq th", i);
+			entry = rte_cfgfile_get_entry(cfg, "pie", str);
+			if (entry)
+				cman_params.pie_params[i].tailq_th =
+					(uint16_t) atoi(entry);
+
+		}
+	}
 #endif /* RTE_SCHED_CMAN */
 
 	for (i = 0; i < MAX_SCHED_SUBPORTS; i++) {
@@ -394,18 +466,7 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo
 				}
 			}
 #ifdef RTE_SCHED_CMAN
-			for (j = 0; j < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; j++) {
-				for (k = 0; k < RTE_COLORS; k++) {
-					subport_params[i].red_params[j][k].min_th =
-						red_params[j][k].min_th;
-					subport_params[i].red_params[j][k].max_th =
-						red_params[j][k].max_th;
-					subport_params[i].red_params[j][k].maxp_inv =
-						red_params[j][k].maxp_inv;
-					subport_params[i].red_params[j][k].wq_log2 =
-						red_params[j][k].wq_log2;
-				}
-			}
+			set_subport_cman_params(subport_params+i, cman_params);
 #endif
 		}
 	}
examples/qos_sched/cfg_file.h +5 -0
index 0dc458aa71..1a9dce9db5 100644
@@ -12,6 +12,11 @@ int cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port);
 
 int cfg_load_pipe(struct rte_cfgfile *cfg, struct rte_sched_pipe_params *pipe);
 
+#ifdef RTE_SCHED_CMAN
+void set_subport_cman_params(struct rte_sched_subport_params *subport_p,
+					struct rte_sched_cman_params cman_p);
+#endif
+
 int cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subport);
 
 int cfg_load_subport_profile(struct rte_cfgfile *cfg,
examples/qos_sched/init.c +15 -8
index 3bdc653c69..3c1f0bc680 100644
@@ -203,15 +203,9 @@ static struct rte_sched_subport_profile_params
 	},
 };
 
-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,
-		.n_pipe_profiles = sizeof(pipe_profiles) /
-			sizeof(struct rte_sched_pipe_params),
-		.n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES,
 #ifdef RTE_SCHED_CMAN
+struct rte_sched_cman_params cman_params = {
+	.cman_mode = RTE_SCHED_CMAN_RED,
 	.red_params = {
 		/* Traffic Class 0 Colors Green / Yellow / Red */
 		[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
@@ -278,6 +272,19 @@ struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = {
 		[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
 		[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
 	},
+};
+#endif /* RTE_SCHED_CMAN */
+
+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,
+		.n_pipe_profiles = sizeof(pipe_profiles) /
+			sizeof(struct rte_sched_pipe_params),
+		.n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES,
+#ifdef RTE_SCHED_CMAN
+		.cman_params = &cman_params,
 #endif /* RTE_SCHED_CMAN */
 	},
 };
examples/qos_sched/main.h +3 -0
index 0d6815ae69..915311bac8 100644
@@ -153,6 +153,9 @@ extern uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE];
 extern uint32_t n_active_queues;
 
 extern struct rte_sched_port_params port_params;
+#ifdef RTE_SCHED_CMAN
+extern struct rte_sched_cman_params cman_params;
+#endif
 extern struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS];
 
 int app_parse_args(int argc, char **argv);
examples/qos_sched/profile.cfg +131 -65

199 lines not on this page · raw message

Signature · 1 line
2.33.0
#176 lore raw

PATCH v24 3/3 examples/ip_pipeline: support PIE congestion management

In reply to Thomas Monjalon

From: Wojciech Liguzinski <[email protected]>

Adding the PIE support for IP Pipeline

---
 examples/ip_pipeline/tmgr.c | 138 +++++++++++++++++++-----------------
 1 file changed, 72 insertions(+), 66 deletions(-)
examples/ip_pipeline/tmgr.c +72 -66
index 406184e760..b138e885cf 100644
@@ -17,6 +17,77 @@ static uint32_t n_subport_profiles;
 static struct rte_sched_pipe_params
 	pipe_profile[TMGR_PIPE_PROFILE_MAX];
 
+#ifdef RTE_SCHED_CMAN
+static struct rte_sched_cman_params cman_params = {
+	.red_params = {
+		/* Traffic Class 0 Colors Green / Yellow / Red */
+		[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[0][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[0][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 1 - Colors Green / Yellow / Red */
+		[1][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[1][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[1][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 2 - Colors Green / Yellow / Red */
+		[2][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[2][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[2][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 3 - Colors Green / Yellow / Red */
+		[3][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[3][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[3][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 4 - Colors Green / Yellow / Red */
+		[4][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[4][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[4][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 5 - Colors Green / Yellow / Red */
+		[5][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[5][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[5][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 6 - Colors Green / Yellow / Red */
+		[6][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[6][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[6][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 7 - Colors Green / Yellow / Red */
+		[7][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[7][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[7][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 8 - Colors Green / Yellow / Red */
+		[8][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[8][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[8][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 9 - Colors Green / Yellow / Red */
+		[9][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[9][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[9][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 10 - Colors Green / Yellow / Red */
+		[10][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[10][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[10][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 11 - Colors Green / Yellow / Red */
+		[11][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[11][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[11][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+
+		/* Traffic Class 12 - Colors Green / Yellow / Red */
+		[12][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
+		},
+};
+#endif /* RTE_SCHED_CMAN */
+
 static uint32_t n_pipe_profiles;
 
 static const struct rte_sched_subport_params subport_params_default = {
@@ -26,72 +97,7 @@ static const struct rte_sched_subport_params subport_params_default = {
 	.n_pipe_profiles = 0, /* filled at run time */
 	.n_max_pipe_profiles = RTE_DIM(pipe_profile),
 #ifdef RTE_SCHED_CMAN
-.red_params = {
-	/* Traffic Class 0 Colors Green / Yellow / Red */
-	[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[0][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[0][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 1 - Colors Green / Yellow / Red */
-	[1][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[1][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[1][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 2 - Colors Green / Yellow / Red */
-	[2][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[2][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[2][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 3 - Colors Green / Yellow / Red */
-	[3][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[3][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[3][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 4 - Colors Green / Yellow / Red */
-	[4][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[4][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[4][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 5 - Colors Green / Yellow / Red */
-	[5][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[5][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[5][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 6 - Colors Green / Yellow / Red */
-	[6][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[6][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[6][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 7 - Colors Green / Yellow / Red */
-	[7][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[7][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[7][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 8 - Colors Green / Yellow / Red */
-	[8][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[8][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[8][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 9 - Colors Green / Yellow / Red */
-	[9][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[9][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[9][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 10 - Colors Green / Yellow / Red */
-	[10][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[10][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[10][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 11 - Colors Green / Yellow / Red */
-	[11][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[11][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[11][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-
-	/* Traffic Class 12 - Colors Green / Yellow / Red */
-	[12][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},
-	},
+	.cman_params = &cman_params,
 #endif /* RTE_SCHED_CMAN */
 };
 
Signature · 1 line
2.33.0
#177 lore raw
In reply to Thomas Monjalon

04/11/2021 15:55, Thomas Monjalon:

Quoted 4 lines

last changes to make this series "more acceptable":
- RTE_SCHED_CMAN in rte_config.h, replacing RTE_SCHED_RED
- test file listed in MAINTAINERS
- few whitespaces fixed

Applied this last version.

The maintainers of this library didn't help really.
Review of basic stuff and process well known by maintainers were not done. Even after doing these last changes myself, this library is still in a poor state. The most problematic is the big amount of dead code disabled in config/rte_config.h:

	#undef RTE_SCHED_CMAN
	#undef RTE_SCHED_COLLECT_STATS
	#undef RTE_SCHED_SUBPORT_TC_OV
	#define RTE_SCHED_PORT_N_GRINDERS 8
	#undef RTE_SCHED_VECTOR

I think the most appropriate going forward is to stop merging any feature in the libraries and examples related to sched and pipeline, until a proper resolution is done for this dead code.
Tips: make runtime options and properly document them.

Note: I probably won't reply to this thread until 21.11 is done, because I have other priorities and I don't want to hear about this for some time.