[dpdk-dev] [PATCH v1 4/4] app/test_sched: subport bandwidth profile config

Savinay Dharmappa savinay.dharmappa at intel.com
Wed Sep 2 11:07:11 CEST 2020


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

Signed-off-by: Savinay Dharmappa <savinay.dharmappa at intel.com>
---
 app/test/test_sched.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

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



More information about the dev mailing list