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 5212FA0350; Tue, 22 Feb 2022 13:58:14 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 595274115D; Tue, 22 Feb 2022 13:58:00 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id B86F241150 for ; Tue, 22 Feb 2022 13:57:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645534677; x=1677070677; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=aHQe7JQ8xpDhteQSsvr74SB4J8D6bnSB5KWwBLiPNgo=; b=cxULLfhGwUqdqMXbpg0uMAHBSkzIOYINNe54INEhPcX4sqNYfUo3FU61 IRkHzmJVTH4UoWEjpecfZPyBGrRelt88MAKYWCrDtraZ96x3I4wTHGZEp CeYuC5CRP/xs8CZi9oStpsPlAseFxzBXM21StQVrF5Cck/Bb3+HzqDrqK Zkjjef4UT7vq2l5p0B9ClpATFZFdj3xrkoVsGQxn3m6r3b+DADJX35uWI dIAql+NAgguRYMyasJtkDnliV9y1aw0xVY6rHCpHmX/v7F9mnEdocA4WQ mT8HKxMjxs/36BDshm3vfLJ0zI1yiqsslMg8fdJrvgODaudeGRlL53nhy A==; X-IronPort-AV: E=McAfee;i="6200,9189,10265"; a="251627061" X-IronPort-AV: E=Sophos;i="5.88,387,1635231600"; d="scan'208";a="251627061" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Feb 2022 04:57:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,387,1635231600"; d="scan'208";a="542926666" Received: from silpixa00397515.ir.intel.com (HELO silpixa00397515.ger.corp.intel.com) ([10.237.222.51]) by fmsmga007.fm.intel.com with ESMTP; 22 Feb 2022 04:57:55 -0800 From: Megha Ajmera To: dev@dpdk.org, jasvinder.singh@intel.com, cristian.dumitrescu@intel.com, thomas@monjalon.net, david.marchand@redhat.com, sham.singh.thakur@intel.com Subject: [PATCH v3 4/4] sched: enable traffic class oversubscription unconditionally Date: Tue, 22 Feb 2022 12:57:45 +0000 Message-Id: <20220222125745.2944462-5-megha.ajmera@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220222125745.2944462-1-megha.ajmera@intel.com> References: <20220218093650.2549927-1-megha.ajmera@intel.com> <20220222125745.2944462-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 from rte_config.h. Best effort traffic class oversubscription is always enabled. Signed-off-by: Megha Ajmera --- config/rte_config.h | 1 - drivers/net/softnic/rte_eth_softnic_tm.c | 18 ----- examples/qos_sched/init.c | 2 - lib/sched/rte_sched.c | 90 ------------------------ 4 files changed, 111 deletions(-) diff --git a/config/rte_config.h b/config/rte_config.h index de6fea5b67..8eb29c1525 100644 --- a/config/rte_config.h +++ b/config/rte_config.h @@ -90,7 +90,6 @@ /* rte_sched defines */ #undef RTE_SCHED_CMAN -#undef RTE_SCHED_SUBPORT_TC_OV /* rte_graph defines */ #define RTE_GRAPH_BURST_SIZE 256 diff --git a/drivers/net/softnic/rte_eth_softnic_tm.c b/drivers/net/softnic/rte_eth_softnic_tm.c index e74092ce7f..6a7766ba1c 100644 --- a/drivers/net/softnic/rte_eth_softnic_tm.c +++ b/drivers/net/softnic/rte_eth_softnic_tm.c @@ -595,15 +595,9 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = { .sched_sp_n_priorities_max = 1, .sched_wfq_n_children_per_group_max = UINT32_MAX, .sched_wfq_n_groups_max = 1, -#ifdef RTE_SCHED_SUBPORT_TC_OV .sched_wfq_weight_max = UINT32_MAX, .sched_wfq_packet_mode_supported = 0, .sched_wfq_byte_mode_supported = 1, -#else - .sched_wfq_weight_max = 1, - .sched_wfq_packet_mode_supported = 0, - .sched_wfq_byte_mode_supported = 1, -#endif .stats_mask = STATS_MASK_DEFAULT, } }, @@ -2828,8 +2822,6 @@ pmd_tm_hierarchy_commit(struct rte_eth_dev *dev, return 0; } -#ifdef RTE_SCHED_SUBPORT_TC_OV - static int update_pipe_weight(struct rte_eth_dev *dev, struct tm_node *np, uint32_t weight) { @@ -2867,8 +2859,6 @@ update_pipe_weight(struct rte_eth_dev *dev, struct tm_node *np, uint32_t weight) return 0; } -#endif - static int update_queue_weight(struct rte_eth_dev *dev, struct tm_node *nq, uint32_t weight) @@ -2983,7 +2973,6 @@ pmd_tm_node_parent_update(struct rte_eth_dev *dev, rte_strerror(EINVAL)); /* fall-through */ case TM_NODE_LEVEL_PIPE: -#ifdef RTE_SCHED_SUBPORT_TC_OV if (update_pipe_weight(dev, n, weight)) return -rte_tm_error_set(error, EINVAL, @@ -2991,13 +2980,6 @@ pmd_tm_node_parent_update(struct rte_eth_dev *dev, NULL, rte_strerror(EINVAL)); return 0; -#else - return -rte_tm_error_set(error, - EINVAL, - RTE_TM_ERROR_TYPE_NODE_WEIGHT, - NULL, - rte_strerror(EINVAL)); -#endif /* fall-through */ case TM_NODE_LEVEL_TC: return -rte_tm_error_set(error, diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c index 3c1f0bc680..8a0fb8a374 100644 --- a/examples/qos_sched/init.c +++ b/examples/qos_sched/init.c @@ -183,9 +183,7 @@ static struct rte_sched_pipe_params pipe_profiles[MAX_SCHED_PIPE_PROFILES] = { .tc_rate = {305175, 305175, 305175, 305175, 305175, 305175, 305175, 305175, 305175, 305175, 305175, 305175, 305175}, .tc_period = 40, -#ifdef RTE_SCHED_SUBPORT_TC_OV .tc_ov_weight = 1, -#endif .wrr_weights = {1, 1, 1, 1}, }, diff --git a/lib/sched/rte_sched.c b/lib/sched/rte_sched.c index 8a051049de..328b82c051 100644 --- a/lib/sched/rte_sched.c +++ b/lib/sched/rte_sched.c @@ -1318,14 +1318,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 } { @@ -1345,11 +1343,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; } @@ -2256,50 +2252,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) @@ -2394,46 +2346,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) @@ -2480,8 +2392,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, -- 2.25.1