[dpdk-dev] [PATCH 23/27] test/sched: update unit test

Lukasz Krakowiak lukaszx.krakowiak at intel.com
Tue May 28 14:05:49 CEST 2019


From: Jasvinder Singh <jasvinder.singh at intel.com>

Update unit test to allow configuration flexiblity for pipe traffic
classes and queues, and subport level configuration of the pipe
parameters.

Signed-off-by: Jasvinder Singh <jasvinder.singh at intel.com>
Signed-off-by: Abraham Tovar <abrahamx.tovar at intel.com>
Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak at intel.com>
---
 app/test/test_sched.c | 37 ++++++++++++++++++++-----------------
 1 file changed, 20 insertions(+), 17 deletions(-)

diff --git a/app/test/test_sched.c b/app/test/test_sched.c
index 460eb53ec..ec94861da 100644
--- a/app/test/test_sched.c
+++ b/app/test/test_sched.c
@@ -20,40 +20,43 @@
 #define SUBPORT         0
 #define PIPE            1
 #define TC              2
-#define QUEUE           3
-
-static struct rte_sched_subport_params subport_param[] = {
-	{
-		.tb_rate = 1250000000,
-		.tb_size = 1000000,
-
-		.tc_rate = {1250000000, 1250000000, 1250000000, 1250000000},
-		.tc_period = 10,
-	},
-};
+#define QUEUE           2
 
 static struct rte_sched_pipe_params pipe_profile[] = {
 	{ /* Profile #0 */
 		.tb_rate = 305175,
 		.tb_size = 1000000,
 
-		.tc_rate = {305175, 305175, 305175, 305175},
+		.tc_rate = {305175, 305175, 305175, 305175,
+				305175, 305175, 305175, 305175, 305175},
 		.tc_period = 40,
 
 		.wrr_weights = {1, 1, 1, 1,  1, 1, 1, 1},
 	},
 };
 
+static struct rte_sched_subport_params subport_param[] = {
+	{
+		.tb_rate = 1250000000,
+		.tb_size = 1000000,
+
+		.tc_rate = {1250000000, 1250000000, 1250000000, 1250000000,
+			1250000000, 1250000000, 1250000000, 1250000000, 1250000000},
+		.tc_period = 10,
+		.n_subport_pipes = 1024,
+		.qsize = {32, 32, 32, 32, 32, 32, 32, 32,
+			32, 32, 32, 32, 32, 32, 32, 32},
+		.pipe_profiles = pipe_profile,
+		.n_pipe_profiles = 1,
+	},
+};
+
 static struct rte_sched_port_params port_param = {
 	.socket = 0, /* computed */
 	.rate = 0, /* computed */
 	.mtu = 1522,
 	.frame_overhead = RTE_SCHED_FRAME_OVERHEAD_DEFAULT,
 	.n_subports_per_port = 1,
-	.n_pipes_per_subport = 1024,
-	.qsize = {32, 32, 32, 32},
-	.pipe_profiles = pipe_profile,
-	.n_pipe_profiles = 1,
 };
 
 #define NB_MBUF          32
@@ -131,7 +134,7 @@ test_sched(void)
 	err = rte_sched_subport_config(port, SUBPORT, subport_param);
 	TEST_ASSERT_SUCCESS(err, "Error config sched, err=%d\n", err);
 
-	for (pipe = 0; pipe < port_param.n_pipes_per_subport; pipe ++) {
+	for (pipe = 0; pipe < subport_param[0].n_subport_pipes; pipe++) {
 		err = rte_sched_pipe_config(port, SUBPORT, pipe, 0);
 		TEST_ASSERT_SUCCESS(err, "Error config sched pipe %u, err=%d\n", pipe, err);
 	}
-- 
2.20.1



More information about the dev mailing list