From patchwork Fri Jul 19 14:18:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jasvinder Singh X-Patchwork-Id: 56789 X-Patchwork-Delegate: thomas@monjalon.net 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 C779F1B959; Fri, 19 Jul 2019 16:18:32 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 544632C17 for ; Fri, 19 Jul 2019 16:18:23 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jul 2019 07:18:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,282,1559545200"; d="scan'208";a="162417184" Received: from silpixa00381635.ir.intel.com (HELO silpixa00381635.ger.corp.intel.com) ([10.237.223.4]) by orsmga008.jf.intel.com with ESMTP; 19 Jul 2019 07:18:20 -0700 From: Jasvinder Singh To: dev@dpdk.org Cc: cristian.dumitrescu@intel.com, Abraham Tovar , Lukasz Krakowiak Date: Fri, 19 Jul 2019 15:18:18 +0100 Message-Id: <20190719141825.101844-5-jasvinder.singh@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190719141825.101844-1-jasvinder.singh@intel.com> References: <20190717144245.138876-2-jasvinder.singh@intel.com> <20190719141825.101844-1-jasvinder.singh@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 04/11] sched: rename tc3 params to best-effort tc 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" Change the traffic class 3 related params name to best-effort(be) traffic class. Signed-off-by: Jasvinder Singh Signed-off-by: Abraham Tovar Signed-off-by: Lukasz Krakowiak --- lib/librte_sched/rte_sched.c | 56 ++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c index e8614ba4c..7e000c249 100644 --- a/lib/librte_sched/rte_sched.c +++ b/lib/librte_sched/rte_sched.c @@ -180,7 +180,7 @@ struct rte_sched_port { uint16_t qsize[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; uint32_t n_pipe_profiles; uint32_t n_max_pipe_profiles; - uint32_t pipe_tc3_rate_max; + uint32_t pipe_tc_be_rate_max; #ifdef RTE_SCHED_RED struct rte_red_config red_config[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE][RTE_COLORS]; #endif @@ -323,7 +323,7 @@ pipe_profile_check(struct rte_sched_pipe_params *params, if (params->tc_period == 0) return -14; - /* TC3 oversubscription weight: non-zero */ + /* Best effort tc oversubscription weight: non-zero */ if (params->tc_ov_weight == 0) return -15; @@ -540,7 +540,7 @@ rte_sched_port_log_pipe_profile(struct rte_sched_port *port, uint32_t i) p->tc_credits_per_period[11], p->tc_credits_per_period[12], - /* Traffic class 3 oversubscription */ + /* Best-effort traffic class oversubscription */ p->tc_ov_weight, /* WRR */ @@ -629,13 +629,13 @@ rte_sched_port_config_pipe_profile_table(struct rte_sched_port *port, rte_sched_port_log_pipe_profile(port, i); } - port->pipe_tc3_rate_max = 0; + port->pipe_tc_be_rate_max = 0; for (i = 0; i < port->n_pipe_profiles; i++) { struct rte_sched_pipe_params *src = params->pipe_profiles + i; - uint32_t pipe_tc3_rate = src->tc_rate[RTE_SCHED_TRAFFIC_CLASS_BE]; + uint32_t pipe_tc_be_rate = src->tc_rate[RTE_SCHED_TRAFFIC_CLASS_BE]; - if (port->pipe_tc3_rate_max < pipe_tc3_rate) - port->pipe_tc3_rate_max = pipe_tc3_rate; + if (port->pipe_tc_be_rate_max < pipe_tc_be_rate) + port->pipe_tc_be_rate_max = pipe_tc_be_rate; } } @@ -839,7 +839,7 @@ rte_sched_port_log_subport_config(struct rte_sched_port *port, uint32_t i) s->tc_credits_per_period[11], s->tc_credits_per_period[12], - /* Traffic class 3 oversubscription */ + /* Best effort traffic class oversubscription */ s->tc_ov_wm_min, s->tc_ov_wm_max); } @@ -915,7 +915,7 @@ rte_sched_subport_config(struct rte_sched_port *port, /* TC oversubscription */ s->tc_ov_wm_min = port->mtu; s->tc_ov_wm_max = rte_sched_time_ms_to_bytes(params->tc_period, - port->pipe_tc3_rate_max); + port->pipe_tc_be_rate_max); s->tc_ov_wm = s->tc_ov_wm_max; s->tc_ov_period_id = 0; s->tc_ov = 0; @@ -960,21 +960,21 @@ rte_sched_pipe_config(struct rte_sched_port *port, if (p->tb_time) { params = port->pipe_profiles + p->profile; - double subport_tc3_rate = (double) s->tc_credits_per_period[RTE_SCHED_TRAFFIC_CLASS_BE] + double subport_tc_be_rate = (double) s->tc_credits_per_period[RTE_SCHED_TRAFFIC_CLASS_BE] / (double) s->tc_period; - double pipe_tc3_rate = (double) params->tc_credits_per_period[RTE_SCHED_TRAFFIC_CLASS_BE] + double pipe_tc_be_rate = (double) params->tc_credits_per_period[RTE_SCHED_TRAFFIC_CLASS_BE] / (double) params->tc_period; - uint32_t tc3_ov = s->tc_ov; + uint32_t tc_be_ov = s->tc_ov; /* Unplug pipe from its subport */ s->tc_ov_n -= params->tc_ov_weight; - s->tc_ov_rate -= pipe_tc3_rate; - s->tc_ov = s->tc_ov_rate > subport_tc3_rate; + s->tc_ov_rate -= pipe_tc_be_rate; + s->tc_ov = s->tc_ov_rate > subport_tc_be_rate; - if (s->tc_ov != tc3_ov) { + if (s->tc_ov != tc_be_ov) { RTE_LOG(DEBUG, SCHED, - "Subport %u TC3 oversubscription is OFF (%.4lf >= %.4lf)\n", - subport_id, subport_tc3_rate, s->tc_ov_rate); + "Subport %u Best effort TC oversubscription is OFF (%.4lf >= %.4lf)\n", + subport_id, subport_tc_be_rate, s->tc_ov_rate); } /* Reset the pipe */ @@ -1000,23 +1000,23 @@ rte_sched_pipe_config(struct rte_sched_port *port, p->tc_credits[i] = params->tc_credits_per_period[i]; { - /* Subport TC3 oversubscription */ - double subport_tc3_rate = + /* Subport best effort tc oversubscription */ + double subport_tc_be_rate = (double) s->tc_credits_per_period[RTE_SCHED_TRAFFIC_CLASS_BE] / (double) s->tc_period; - double pipe_tc3_rate = + double pipe_tc_be_rate = (double) params->tc_credits_per_period[RTE_SCHED_TRAFFIC_CLASS_BE] / (double) params->tc_period; - uint32_t tc3_ov = s->tc_ov; + uint32_t tc_be_ov = s->tc_ov; s->tc_ov_n += params->tc_ov_weight; - s->tc_ov_rate += pipe_tc3_rate; - s->tc_ov = s->tc_ov_rate > subport_tc3_rate; + s->tc_ov_rate += pipe_tc_be_rate; + s->tc_ov = s->tc_ov_rate > subport_tc_be_rate; - if (s->tc_ov != tc3_ov) { + if (s->tc_ov != tc_be_ov) { RTE_LOG(DEBUG, SCHED, - "Subport %u TC3 oversubscription is ON (%.4lf < %.4lf)\n", - subport_id, subport_tc3_rate, s->tc_ov_rate); + "Subport %u Best effort TC oversubscription is ON (%.4lf < %.4lf)\n", + subport_id, subport_tc_be_rate, s->tc_ov_rate); } p->tc_ov_period_id = s->tc_ov_period_id; p->tc_ov_credits = s->tc_ov_wm; @@ -1059,8 +1059,8 @@ rte_sched_port_pipe_profile_add(struct rte_sched_port *port, *pipe_profile_id = port->n_pipe_profiles; port->n_pipe_profiles++; - if (port->pipe_tc3_rate_max < params->tc_rate[RTE_SCHED_TRAFFIC_CLASS_BE]) - port->pipe_tc3_rate_max = params->tc_rate[RTE_SCHED_TRAFFIC_CLASS_BE]; + if (port->pipe_tc_be_rate_max < params->tc_rate[RTE_SCHED_TRAFFIC_CLASS_BE]) + port->pipe_tc_be_rate_max = params->tc_rate[RTE_SCHED_TRAFFIC_CLASS_BE]; rte_sched_port_log_pipe_profile(port, *pipe_profile_id);