From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BCD94A0032; Fri, 18 Feb 2022 08:42:31 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 918C541154; Fri, 18 Feb 2022 08:42:21 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 0BEE641156 for ; Fri, 18 Feb 2022 08:42:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645170140; x=1676706140; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=Q3xDG4TjuNQSYFV/0Y3Xal/jo3n/Ey5U7BkOe/KeQvw=; b=AaxlrmdILrUKJEsRgqYH+r7uQaYI+mgnQXLq9V76ZrNxFSIP3n1sRzr4 26t3pkUrZ2mZCvX2XBbPY4wUy0oGSv/gcj2wW2gXhhlr+EYr5ORzWxTsC /mYj5O/ahgVb5VJCXALj12WEEAWWkPbd63V92Jz5Ty4HGJ9y145WkT7sv T1zcPRXraU5YY5w7RjGaAoaP++4eonxBR9wMqrfK8wsV0QIyYvu3PtI6i EbJtkaEkh6HlZn3Gu8kYJ0sJHIViC10fbXkYfNWgGI8fWD6PuQ4fnjKEe I78oN8t8oxZ2qL7uQ1rCGlNqhaSLeFMf2ipsyCKaX7RV7xwp/6mjzYSy1 Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10261"; a="231710956" X-IronPort-AV: E=Sophos;i="5.88,378,1635231600"; d="scan'208";a="231710956" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2022 23:42:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,378,1635231600"; d="scan'208";a="546164979" Received: from silpixa00397515.ir.intel.com (HELO silpixa00397515.ger.corp.intel.com) ([10.237.222.51]) by orsmga008.jf.intel.com with ESMTP; 17 Feb 2022 23:42:18 -0800 From: Megha Ajmera To: dev@dpdk.org, jasvinder.singh@intel.com, cristian.dumitrescu@intel.com, thomas@monjalon.net Subject: [PATCH v1 3/4] sched: Always enable best effort TC oversubscription in HQoS library. Date: Fri, 18 Feb 2022 07:41:47 +0000 Message-Id: <20220218074148.2549134-4-megha.ajmera@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220218074148.2549134-1-megha.ajmera@intel.com> References: <20220218074148.2549134-1-megha.ajmera@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Removed "RTE_SCHED_SUBPORT_TC_OV" flag from HQoS. Signed-off-by: Megha Ajmera --- lib/sched/rte_sched.c | 91 ------------------------------------------- 1 file changed, 91 deletions(-) diff --git a/lib/sched/rte_sched.c b/lib/sched/rte_sched.c index 6f2d85edc0..807134b48d 100644 --- a/lib/sched/rte_sched.c +++ b/lib/sched/rte_sched.c @@ -1329,14 +1329,12 @@ rte_sched_subport_config(struct rte_sched_port *port, for (i = 0; i < RTE_SCHED_PORT_N_GRINDERS; i++) s->grinder_base_bmp_pos[i] = RTE_SCHED_PIPE_INVALID; -#ifdef RTE_SCHED_SUBPORT_TC_OV /* TC oversubscription */ s->tc_ov_wm_min = port->mtu; s->tc_ov_period_id = 0; s->tc_ov = 0; s->tc_ov_n = 0; s->tc_ov_rate = 0; -#endif } { @@ -1356,11 +1354,9 @@ rte_sched_subport_config(struct rte_sched_port *port, else profile->tc_credits_per_period[i] = 0; -#ifdef RTE_SCHED_SUBPORT_TC_OV s->tc_ov_wm_max = rte_sched_time_ms_to_bytes(profile->tc_period, s->pipe_tc_be_rate_max); s->tc_ov_wm = s->tc_ov_wm_max; -#endif s->profile = subport_profile_id; } @@ -2267,50 +2263,6 @@ rte_sched_port_enqueue(struct rte_sched_port *port, struct rte_mbuf **pkts, return result; } -#ifndef RTE_SCHED_SUBPORT_TC_OV - -static inline void -grinder_credits_update(struct rte_sched_port *port, - struct rte_sched_subport *subport, uint32_t pos) -{ - struct rte_sched_grinder *grinder = subport->grinder + pos; - struct rte_sched_pipe *pipe = grinder->pipe; - struct rte_sched_pipe_profile *params = grinder->pipe_params; - struct rte_sched_subport_profile *sp = grinder->subport_params; - uint64_t n_periods; - uint32_t i; - - /* Subport TB */ - n_periods = (port->time - subport->tb_time) / sp->tb_period; - subport->tb_credits += n_periods * sp->tb_credits_per_period; - subport->tb_credits = RTE_MIN(subport->tb_credits, sp->tb_size); - subport->tb_time += n_periods * sp->tb_period; - - /* Pipe TB */ - n_periods = (port->time - pipe->tb_time) / params->tb_period; - pipe->tb_credits += n_periods * params->tb_credits_per_period; - pipe->tb_credits = RTE_MIN(pipe->tb_credits, params->tb_size); - pipe->tb_time += n_periods * params->tb_period; - - /* Subport TCs */ - if (unlikely(port->time >= subport->tc_time)) { - for (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++) - subport->tc_credits[i] = sp->tc_credits_per_period[i]; - - subport->tc_time = port->time + sp->tc_period; - } - - /* Pipe TCs */ - if (unlikely(port->time >= pipe->tc_time)) { - for (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++) - pipe->tc_credits[i] = params->tc_credits_per_period[i]; - - pipe->tc_time = port->time + params->tc_period; - } -} - -#else - static inline uint64_t grinder_tc_ov_credits_update(struct rte_sched_port *port, struct rte_sched_subport *subport, uint32_t pos) @@ -2405,46 +2357,6 @@ grinder_credits_update(struct rte_sched_port *port, } } -#endif /* RTE_SCHED_TS_CREDITS_UPDATE, RTE_SCHED_SUBPORT_TC_OV */ - - -#ifndef RTE_SCHED_SUBPORT_TC_OV - -static inline int -grinder_credits_check(struct rte_sched_port *port, - struct rte_sched_subport *subport, uint32_t pos) -{ - struct rte_sched_grinder *grinder = subport->grinder + pos; - struct rte_sched_pipe *pipe = grinder->pipe; - struct rte_mbuf *pkt = grinder->pkt; - uint32_t tc_index = grinder->tc_index; - uint64_t pkt_len = pkt->pkt_len + port->frame_overhead; - uint64_t subport_tb_credits = subport->tb_credits; - uint64_t subport_tc_credits = subport->tc_credits[tc_index]; - uint64_t pipe_tb_credits = pipe->tb_credits; - uint64_t pipe_tc_credits = pipe->tc_credits[tc_index]; - int enough_credits; - - /* Check queue credits */ - enough_credits = (pkt_len <= subport_tb_credits) && - (pkt_len <= subport_tc_credits) && - (pkt_len <= pipe_tb_credits) && - (pkt_len <= pipe_tc_credits); - - if (!enough_credits) - return 0; - - /* Update port credits */ - subport->tb_credits -= pkt_len; - subport->tc_credits[tc_index] -= pkt_len; - pipe->tb_credits -= pkt_len; - pipe->tc_credits[tc_index] -= pkt_len; - - return 1; -} - -#else - static inline int grinder_credits_check(struct rte_sched_port *port, struct rte_sched_subport *subport, uint32_t pos) @@ -2491,9 +2403,6 @@ grinder_credits_check(struct rte_sched_port *port, return 1; } -#endif /* RTE_SCHED_SUBPORT_TC_OV */ - - static inline int grinder_schedule(struct rte_sched_port *port, struct rte_sched_subport *subport, uint32_t pos) -- 2.25.1