From patchwork Fri Aug 23 14:45:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jasvinder Singh X-Patchwork-Id: 57866 X-Patchwork-Delegate: cristian.dumitrescu@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AD9271BF44; Fri, 23 Aug 2019 16:46:07 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 716011BE86 for ; Fri, 23 Aug 2019 16:46:03 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Aug 2019 07:46:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,421,1559545200"; d="scan'208";a="263211205" Received: from silpixa00381635.ir.intel.com (HELO silpixa00381635.ger.corp.intel.com) ([10.237.223.4]) by orsmga001.jf.intel.com with ESMTP; 23 Aug 2019 07:46:01 -0700 From: Jasvinder Singh To: dev@dpdk.org Cc: cristian.dumitrescu@intel.com, Lukasz Krakowiak Date: Fri, 23 Aug 2019 15:45:48 +0100 Message-Id: <20190823144602.58213-2-jasvinder.singh@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190823144602.58213-1-jasvinder.singh@intel.com> References: <20190823144602.58213-1-jasvinder.singh@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 01/15] sched: add pipe config params to subport struct 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" Add pipe configuration parameters to subport level structure to allow different subports of the same port to have different configuration in terms of number of pipes, pipe queue sizes, etc. Signed-off-by: Jasvinder Singh Signed-off-by: Lukasz Krakowiak --- lib/librte_sched/Makefile | 2 +- lib/librte_sched/meson.build | 2 +- lib/librte_sched/rte_sched.h | 81 +++++++++++++++++++++++------------- 3 files changed, 55 insertions(+), 30 deletions(-) diff --git a/lib/librte_sched/Makefile b/lib/librte_sched/Makefile index 3d7f410e1..6e4a72d89 100644 --- a/lib/librte_sched/Makefile +++ b/lib/librte_sched/Makefile @@ -18,7 +18,7 @@ LDLIBS += -lrte_timer EXPORT_MAP := rte_sched_version.map -LIBABIVER := 3 +LIBABIVER := 4 # # all source are stored in SRCS-y diff --git a/lib/librte_sched/meson.build b/lib/librte_sched/meson.build index 59d43c6d8..9f40a2368 100644 --- a/lib/librte_sched/meson.build +++ b/lib/librte_sched/meson.build @@ -1,7 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017 Intel Corporation -version = 3 +version = 4 sources = files('rte_sched.c', 'rte_red.c', 'rte_approx.c') headers = files('rte_sched.h', 'rte_sched_common.h', 'rte_red.h', 'rte_approx.h') diff --git a/lib/librte_sched/rte_sched.h b/lib/librte_sched/rte_sched.h index eac6db274..48be702bc 100644 --- a/lib/librte_sched/rte_sched.h +++ b/lib/librte_sched/rte_sched.h @@ -111,7 +111,7 @@ extern "C" { #endif /* - * Subport configuration parameters. The period and credits_per_period + * 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 @@ -119,7 +119,7 @@ extern "C" { * credits_per_period divided by period. One credit represents one * byte. */ -struct rte_sched_subport_params { +struct rte_sched_pipe_params { /** Token bucket rate (measured in bytes per second) */ uint32_t tb_rate; @@ -129,32 +129,18 @@ struct rte_sched_subport_params { /** Traffic class rates (measured in bytes per second) */ uint32_t tc_rate[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; - /** Enforcement period for rates (measured in milliseconds) */ + /** Enforcement period (measured in milliseconds) */ uint32_t tc_period; -}; - -/** Subport statistics */ -struct rte_sched_subport_stats { - /** Number of packets successfully written */ - uint32_t n_pkts_tc[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; - - /** Number of packets dropped */ - uint32_t n_pkts_tc_dropped[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; - /** Number of bytes successfully written for each traffic class */ - uint32_t n_bytes_tc[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; - - /** Number of bytes dropped for each traffic class */ - uint32_t n_bytes_tc_dropped[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; + /** Best-effort traffic class oversubscription weight */ + uint8_t tc_ov_weight; -#ifdef RTE_SCHED_RED - /** Number of packets dropped by red */ - uint32_t n_pkts_red_dropped[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; -#endif + /** WRR weights of best-effort traffic class queues */ + uint8_t wrr_weights[RTE_SCHED_BE_QUEUES_PER_PIPE]; }; /* - * Pipe configuration parameters. The period and credits_per_period + * Subport 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 @@ -162,7 +148,7 @@ struct rte_sched_subport_stats { * credits_per_period divided by period. One credit represents one * byte. */ -struct rte_sched_pipe_params { +struct rte_sched_subport_params { /** Token bucket rate (measured in bytes per second) */ uint32_t tb_rate; @@ -172,14 +158,50 @@ struct rte_sched_pipe_params { /** Traffic class rates (measured in bytes per second) */ uint32_t tc_rate[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; - /** Enforcement period (measured in milliseconds) */ + /** Enforcement period for rates (measured in milliseconds) */ uint32_t tc_period; - /** Best-effort traffic class oversubscription weight */ - uint8_t tc_ov_weight; + /** Number of subport_pipes */ + uint32_t n_pipes_per_subport; - /** WRR weights of best-effort traffic class queues */ - uint8_t wrr_weights[RTE_SCHED_BE_QUEUES_PER_PIPE]; + /** Packet queue size for each traffic class. + * All the pipes within the same subport share the similar + * configuration for the queues. + */ + uint16_t qsize[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; + + /** Pipe profile table. + * Every pipe is configured using one of the profiles from this table. + */ + struct rte_sched_pipe_params *pipe_profiles; + + /** Profiles in the pipe profile table */ + uint32_t n_pipe_profiles; + +#ifdef RTE_SCHED_RED + /** RED parameters */ + struct rte_red_params red_params[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE][RTE_COLORS]; +#endif +}; + +/** Subport statistics */ +struct rte_sched_subport_stats { + /** Number of packets successfully written */ + uint32_t n_pkts_tc[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; + + /** Number of packets dropped */ + uint32_t n_pkts_tc_dropped[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; + + /** Number of bytes successfully written for each traffic class */ + uint32_t n_bytes_tc[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; + + /** Number of bytes dropped for each traffic class */ + uint32_t n_bytes_tc_dropped[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; + +#ifdef RTE_SCHED_RED + /** Number of packets dropped by red */ + uint32_t n_pkts_red_dropped[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; +#endif }; /** Queue statistics */ @@ -227,6 +249,9 @@ struct rte_sched_port_params { /** Number of subport_pipes */ uint32_t n_pipes_per_subport; + /** Maximum number of subport_pipes */ + uint32_t n_max_pipes_per_subport; + /** Packet queue size for each traffic class. * All the pipes within the same subport share the similar * configuration for the queues.