From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id CEB98A04B5;
	Wed, 30 Sep 2020 21:28:34 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 735E71D5D6;
	Wed, 30 Sep 2020 21:26:20 +0200 (CEST)
Received: from mga12.intel.com (mga12.intel.com [192.55.52.136])
 by dpdk.org (Postfix) with ESMTP id B81541D43F
 for <dev@dpdk.org>; Wed, 30 Sep 2020 21:26:02 +0200 (CEST)
IronPort-SDR: xg465v8TcUw4dDdEfkcc6SkQaQIjim83z7sMGeYoX0vgj0jqyOHOspSYTn1r4gjEVfmfA259pG
 iDzePi90WjQQ==
X-IronPort-AV: E=McAfee;i="6000,8403,9760"; a="141933469"
X-IronPort-AV: E=Sophos;i="5.77,322,1596524400"; d="scan'208";a="141933469"
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga003.jf.intel.com ([10.7.209.27])
 by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 30 Sep 2020 12:26:02 -0700
IronPort-SDR: r+fl6XPPNGE1FJ6Aokefmv+scHa7abjO8FBSzhDBExgqgugD7zf8KrddGGtVGhsi5VdymEdOzj
 s3pjBUw4k4kQ==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.77,322,1596524400"; d="scan'208";a="308273041"
Received: from silpixa00400629.ir.intel.com ([10.237.214.112])
 by orsmga003.jf.intel.com with ESMTP; 30 Sep 2020 12:26:00 -0700
From: Savinay Dharmappa <savinay.dharmappa@intel.com>
To: cristian.dumitrescu@intel.com,
	jasvinder.singh@intel.com,
	dev@dpdk.org
Cc: savinay.dharmappa@intel.com
Date: Wed, 30 Sep 2020 20:24:33 +0100
Message-Id: <20200930192434.47793-9-savinay.dharmappa@intel.com>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20200930192434.47793-1-savinay.dharmappa@intel.com>
References: <1600332159-26018-1-git-send-email-savinay.dharmappa@intel.com>
 <20200930192434.47793-1-savinay.dharmappa@intel.com>
Subject: [dpdk-dev] [PATCH v5 8/9] app/test_sched: add dynamic config of
	subport
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

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

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

diff --git a/app/test/test_sched.c b/app/test/test_sched.c
index fc31080ef..92d2b12fc 100644
--- a/app/test/test_sched.c
+++ b/app/test/test_sched.c
@@ -21,6 +21,7 @@
 #define PIPE            1
 #define TC              2
 #define QUEUE           0
+#define MAX_SCHED_SUBPORT_PROFILES  8
 
 static struct rte_sched_pipe_params pipe_profile[] = {
 	{ /* Profile #0 */
@@ -36,15 +37,20 @@ static struct rte_sched_pipe_params pipe_profile[] = {
 	},
 };
 
-static struct rte_sched_subport_params subport_param[] = {
+static struct rte_sched_subport_profile_params
+		subport_profile[] = {
 	{
 		.tb_rate = 1250000000,
 		.tb_size = 1000000,
-
 		.tc_rate = {1250000000, 1250000000, 1250000000, 1250000000,
 			1250000000, 1250000000, 1250000000, 1250000000, 1250000000,
 			1250000000, 1250000000, 1250000000, 1250000000},
 		.tc_period = 10,
+	},
+};
+
+static struct rte_sched_subport_params subport_param[] = {
+	{
 		.n_pipes_per_subport_enabled = 1024,
 		.qsize = {32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32},
 		.pipe_profiles = pipe_profile,
@@ -59,6 +65,9 @@ static struct rte_sched_port_params port_param = {
 	.mtu = 1522,
 	.frame_overhead = RTE_SCHED_FRAME_OVERHEAD_DEFAULT,
 	.n_subports_per_port = 1,
+	.n_subport_profiles = 1,
+	.subport_profiles = subport_profile,
+	.n_max_subport_profiles = MAX_SCHED_SUBPORT_PROFILES,
 	.n_pipes_per_subport = 1024,
 };
 
@@ -66,6 +75,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 *
@@ -138,7 +148,8 @@ test_sched(void)
 	port = rte_sched_port_config(&port_param);
 	TEST_ASSERT_NOT_NULL(port, "Error config sched port\n");
 
-	err = rte_sched_subport_config(port, SUBPORT, subport_param);
+	err = rte_dynamic_sched_subport_config(port, SUBPORT, subport_param,
+						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++) {
-- 
2.17.1