From patchwork Wed Sep 2 09:07:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Savinay Dharmappa X-Patchwork-Id: 76304 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 675C2A04B7; Wed, 2 Sep 2020 11:07:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B18831C0AC; Wed, 2 Sep 2020 11:07:25 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 37D484C99 for ; Wed, 2 Sep 2020 11:07:23 +0200 (CEST) IronPort-SDR: ivt82F8evfzI9a1leF1+x6G85352j5JR9xD10sqKTqi61GU1q6CLZRejqdf/xrvCrQ7s3zR6hI okuX+pg7Czug== X-IronPort-AV: E=McAfee;i="6000,8403,9731"; a="154857643" X-IronPort-AV: E=Sophos;i="5.76,381,1592895600"; d="scan'208";a="154857643" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2020 02:07:22 -0700 IronPort-SDR: mQfE+4Ux3P4HkUNOqLVtBnXka1R9on/mqc14djEoKdMj4oKMpvb4XAsZygkGAT31/505DJmXkn tD7DS9verImQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,381,1592895600"; d="scan'208";a="301757201" Received: from unknown (HELO silpixa00400629.ir.intel.com) ([10.237.214.135]) by orsmga006.jf.intel.com with ESMTP; 02 Sep 2020 02:07:21 -0700 From: Savinay Dharmappa To: cristian.dumitrescu@intel.com, jasvinder.singh@intel.com, dev@dpdk.org Cc: savinay.dharmappa@intel.com Date: Wed, 2 Sep 2020 10:07:11 +0100 Message-Id: <1599037631-199836-4-git-send-email-savinay.dharmappa@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1599037631-199836-1-git-send-email-savinay.dharmappa@intel.com> References: <1594837677-313175-3-git-send-email-savinay.dharmappa@intel.com> <1599037631-199836-1-git-send-email-savinay.dharmappa@intel.com> Subject: [dpdk-dev] [PATCH v1 4/4] app/test_sched: subport bandwidth profile config X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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);