From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 0FEFDA045E for ; Tue, 28 May 2019 14:08:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CCCEE1B953; Tue, 28 May 2019 14:08:16 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id D177A4C9D for ; Tue, 28 May 2019 14:08:09 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 May 2019 05:08:08 -0700 X-ExtLoop1: 1 Received: from lkrakowx-mobl.ger.corp.intel.com ([10.103.104.99]) by fmsmga001.fm.intel.com with ESMTP; 28 May 2019 05:08:07 -0700 From: Lukasz Krakowiak To: cristian.dumitrescu@intel.com Cc: dev@dpdk.org, Jasvinder Singh , Abraham Tovar , Lukasz Krakowiak Date: Tue, 28 May 2019 14:05:28 +0200 Message-Id: <20190528120553.2992-3-lukaszx.krakowiak@intel.com> X-Mailer: git-send-email 2.19.2.windows.1 In-Reply-To: <20190528120553.2992-1-lukaszx.krakowiak@intel.com> References: <20190528120553.2992-1-lukaszx.krakowiak@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 02/27] sched: update subport and pipe data structures 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" From: Jasvinder Singh Update public data structures for subport and pipe to allow configuration flexiblity for pipe traffic classes and queues, and subport level configuration of the pipe parameters. Signed-off-by: Jasvinder Singh Signed-off-by: Abraham Tovar Signed-off-by: Lukasz Krakowiak --- app/test/test_sched.c | 2 +- examples/qos_sched/init.c | 2 +- lib/librte_sched/rte_sched.h | 76 ++++++++++++++++++++++-------------- 3 files changed, 49 insertions(+), 31 deletions(-) diff --git a/app/test/test_sched.c b/app/test/test_sched.c index 4eed8dbde..460eb53ec 100644 --- a/app/test/test_sched.c +++ b/app/test/test_sched.c @@ -40,7 +40,7 @@ static struct rte_sched_pipe_params pipe_profile[] = { .tc_rate = {305175, 305175, 305175, 305175}, .tc_period = 40, - .wrr_weights = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + .wrr_weights = {1, 1, 1, 1, 1, 1, 1, 1}, }, }; diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c index 37c2b95fd..f44a07cd6 100644 --- a/examples/qos_sched/init.c +++ b/examples/qos_sched/init.c @@ -186,7 +186,7 @@ static struct rte_sched_pipe_params pipe_profiles[RTE_SCHED_PIPE_PROFILES_PER_PO .tc_ov_weight = 1, #endif - .wrr_weights = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + .wrr_weights = {1, 1, 1, 1, 1, 1, 1, 1}, }, }; diff --git a/lib/librte_sched/rte_sched.h b/lib/librte_sched/rte_sched.h index cf7695f27..71728f725 100644 --- a/lib/librte_sched/rte_sched.h +++ b/lib/librte_sched/rte_sched.h @@ -117,6 +117,33 @@ extern "C" { #define RTE_SCHED_FRAME_OVERHEAD_DEFAULT 24 #endif +/* + * Pipe configuration parameters. The period and credits_per_period + * parameters are measured in bytes, with one byte meaning the time + * duration associated with the transmission of one byte on the + * physical medium of the output port, with pipe or pipe traffic class + * rate (measured as percentage of output port rate) determined as + * credits_per_period divided by period. One credit represents one + * byte. + */ +struct rte_sched_pipe_params { + /* Pipe token bucket */ + uint32_t tb_rate; /**< Rate (measured in bytes per second) */ + uint32_t tb_size; /**< Size (measured in credits) */ + + /* Pipe traffic classes */ + uint32_t tc_rate[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; + /**< Traffic class rates (measured in bytes per second) */ + uint32_t tc_period; + /**< Enforcement period (measured in milliseconds) */ +#ifdef RTE_SCHED_SUBPORT_TC_OV + uint8_t tc_ov_weight; /**< Weight Traffic class 3 oversubscription */ +#endif + + /* Pipe queues */ + uint8_t wrr_weights[RTE_SCHED_WRR_QUEUES_PER_PIPE]; /**< WRR weights */ +}; + /* * Subport configuration parameters. The period and credits_per_period * parameters are measured in bytes, with one byte meaning the time @@ -128,14 +155,32 @@ extern "C" { */ struct rte_sched_subport_params { /* Subport token bucket */ - uint32_t tb_rate; /**< Rate (measured in bytes per second) */ - uint32_t tb_size; /**< Size (measured in credits) */ + uint32_t tb_rate; /**< Rate (measured in bytes per second) */ + uint32_t tb_size; /**< Size (measured in credits) */ /* Subport traffic classes */ uint32_t tc_rate[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; /**< Traffic class rates (measured in bytes per second) */ uint32_t tc_period; /**< Enforcement period for rates (measured in milliseconds) */ + + uint32_t n_subport_pipes; /**< Number of subport_pipes */ + uint16_t qsize[RTE_SCHED_QUEUES_PER_PIPE]; + /**< Packet queue size for each traffic class. + * All queues which are not needed, have zero size. All the pipes + * within the same subport share the similar configuration for the + * queues. + */ + struct rte_sched_pipe_params *pipe_profiles; + /**< Pipe profile table. + * Every pipe is configured using one of the profiles from this table. + */ + uint32_t n_pipe_profiles; /**< Profiles in the pipe profile table */ +#ifdef RTE_SCHED_RED + struct rte_red_params + red_params[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE][RTE_COLORS]; + /**< RED parameters */ +#endif }; /** Subport statistics */ @@ -158,33 +203,6 @@ struct rte_sched_subport_stats { #endif }; -/* - * Pipe configuration parameters. The period and credits_per_period - * parameters are measured in bytes, with one byte meaning the time - * duration associated with the transmission of one byte on the - * physical medium of the output port, with pipe or pipe traffic class - * rate (measured as percentage of output port rate) determined as - * credits_per_period divided by period. One credit represents one - * byte. - */ -struct rte_sched_pipe_params { - /* Pipe token bucket */ - uint32_t tb_rate; /**< Rate (measured in bytes per second) */ - uint32_t tb_size; /**< Size (measured in credits) */ - - /* Pipe traffic classes */ - uint32_t tc_rate[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; - /**< Traffic class rates (measured in bytes per second) */ - uint32_t tc_period; - /**< Enforcement period (measured in milliseconds) */ -#ifdef RTE_SCHED_SUBPORT_TC_OV - uint8_t tc_ov_weight; /**< Weight Traffic class 3 oversubscription */ -#endif - - /* Pipe queues */ - uint8_t wrr_weights[RTE_SCHED_QUEUES_PER_PIPE]; /**< WRR weights */ -}; - /** Queue statistics */ struct rte_sched_queue_stats { /* Packets */ -- 2.20.1