[v1,4/4] app/test_sched: subport bandwidth profile config
diff mbox series

Message ID 1599037631-199836-4-git-send-email-savinay.dharmappa@intel.com
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show
Series
  • [v1,1/4] example/qos_sched: subport bandwidth dynmaic conf
Related show

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation fail Compilation issues
ci/travis-robot warning Travis build: failed

Commit Message

Savinay Dharmappa Sept. 2, 2020, 9:07 a.m. UTC
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@intel.com>
---
 app/test/test_sched.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

Patch
diff mbox series

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);