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 E2C48A045E for ; Tue, 28 May 2019 14:08:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C8BB31B944; Tue, 28 May 2019 14:08:11 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 6926A2C55 for ; Tue, 28 May 2019 14:08:08 +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:07 -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:05 -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:27 +0200 Message-Id: <20190528120553.2992-2-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 01/27] sched: update macros for flexible 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" From: Jasvinder Singh Update existing macros and add new one for best-effort traffic class queues 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 --- doc/guides/rel_notes/deprecation.rst | 6 ----- doc/guides/rel_notes/release_19_08.rst | 7 ++++- lib/librte_sched/Makefile | 2 +- lib/librte_sched/meson.build | 2 +- lib/librte_sched/rte_sched.h | 37 +++++++++++++++++++------- 5 files changed, 35 insertions(+), 19 deletions(-) diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 098d24381..a408270f5 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -99,12 +99,6 @@ Deprecation Notices to one it means it represents IV, when is set to zero it means J0 is used directly, in this case 16 bytes of J0 need to be passed. -* sched: To allow more traffic classes, flexible mapping of pipe queues to - traffic classes, and subport level configuration of pipes and queues - changes will be made to macros, data structures and API functions defined - in "rte_sched.h". These changes are aligned to improvements suggested in the - RFC https://mails.dpdk.org/archives/dev/2018-November/120035.html. - * metrics: The function ``rte_metrics_init`` will have a non-void return in order to notify errors instead of calling ``rte_exit``. diff --git a/doc/guides/rel_notes/release_19_08.rst b/doc/guides/rel_notes/release_19_08.rst index b9510f93a..210f32e7f 100644 --- a/doc/guides/rel_notes/release_19_08.rst +++ b/doc/guides/rel_notes/release_19_08.rst @@ -83,6 +83,11 @@ API Changes Also, make sure to start the actual text at the margin. ========================================================= +* sched: To allow more traffic classes, flexible mapping of pipe queues to + traffic classes, and subport level configuration of pipes and queues + changes are made to public macros, data structures and API functions defined + in "rte_sched.h". + ABI Changes ----------- @@ -170,7 +175,7 @@ The libraries prepended with a plus sign were incremented in this version. librte_rcu.so.1 librte_reorder.so.1 librte_ring.so.2 - librte_sched.so.2 + + librte_sched.so.3 librte_security.so.2 librte_stack.so.1 librte_table.so.3 diff --git a/lib/librte_sched/Makefile b/lib/librte_sched/Makefile index 644fd9d15..3d7f410e1 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 := 2 +LIBABIVER := 3 # # all source are stored in SRCS-y diff --git a/lib/librte_sched/meson.build b/lib/librte_sched/meson.build index 8e989e5f6..59d43c6d8 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 = 2 +version = 3 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 9c55a787d..cf7695f27 100644 --- a/lib/librte_sched/rte_sched.h +++ b/lib/librte_sched/rte_sched.h @@ -52,7 +52,7 @@ extern "C" { * multiple connections of same traffic class belonging to * the same user; * - Weighted Round Robin (WRR) is used to service the - * queues within same pipe traffic class. + * queues within same pipe lowest priority (best-effort) traffic class. * */ @@ -66,26 +66,43 @@ extern "C" { #include "rte_red.h" #endif -/** Number of traffic classes per pipe (as well as subport). - * Cannot be changed. +/** Maximum number of queues per pipe. + * Note that the multiple queues (power of 2) can only be assigned to + * lowest priority (best-effort) traffic class. Other higher priority traffic + * classes can only have one queue. + * + * Can not change. + */ +#define RTE_SCHED_QUEUES_PER_PIPE 16 + +/** Number of WRR queues for lowest priority (best-effort) traffic class per + * pipe. */ -#define RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE 4 +#define RTE_SCHED_WRR_QUEUES_PER_PIPE 8 -/** Number of queues per pipe traffic class. Cannot be changed. */ +/** Number of traffic classes per pipe (as well as subport). */ #define RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS 4 +#define RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE \ +(RTE_SCHED_QUEUES_PER_PIPE - RTE_SCHED_WRR_QUEUES_PER_PIPE + 1) -/** Number of queues per pipe. */ -#define RTE_SCHED_QUEUES_PER_PIPE \ - (RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE * \ - RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS) +/** Maximum number of subports that can be defined per port. + * Compile-time configurable. + */ +#ifndef RTE_SCHED_SUBPORTS_PER_PORT +#define RTE_SCHED_SUBPORTS_PER_PORT 256 +#endif -/** Maximum number of pipe profiles that can be defined per port. +/** Maximum number of pipe profiles that can be defined per subport. * Compile-time configurable. */ #ifndef RTE_SCHED_PIPE_PROFILES_PER_PORT #define RTE_SCHED_PIPE_PROFILES_PER_PORT 256 #endif +#ifndef RTE_SCHED_PIPE_PROFILES_PER_SUBPORT +#define RTE_SCHED_PIPE_PROFILES_PER_SUBPORT 256 +#endif + /* * Ethernet framing overhead. Overhead fields per Ethernet frame: * 1. Preamble: 7 bytes; -- 2.20.1