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 35D4DA045E for ; Tue, 28 May 2019 14:16:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D57051BAB6; Tue, 28 May 2019 14:09:02 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 320071B9C4 for ; Tue, 28 May 2019 14:08:55 +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:54 -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:53 -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:53 +0200 Message-Id: <20190528120553.2992-28-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 27/27] sched: code cleanup 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 Remove redundant macros and fields from the data structures. Signed-off-by: Jasvinder Singh Signed-off-by: Abraham Tovar Signed-off-by: Lukasz Krakowiak --- lib/librte_sched/rte_sched.c | 53 ------------------------------------ lib/librte_sched/rte_sched.h | 18 ------------ 2 files changed, 71 deletions(-) diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c index 563161713..79731af8e 100644 --- a/lib/librte_sched/rte_sched.c +++ b/lib/librte_sched/rte_sched.c @@ -100,18 +100,7 @@ struct rte_sched_grinder { uint32_t tc_index; struct rte_sched_strict_priority_class sp; struct rte_sched_best_effort_class be; - struct rte_sched_queue *queue[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; - struct rte_mbuf **qbase[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; - uint32_t qindex[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; - uint16_t qsize; - uint32_t qmask; - uint32_t qpos; struct rte_mbuf *pkt; - - /* WRR */ - uint16_t wrr_tokens[RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS]; - uint16_t wrr_mask[RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS]; - uint8_t wrr_cost[RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS]; }; struct rte_sched_subport { @@ -215,7 +204,6 @@ struct rte_sched_pipe { /* TC oversubscription */ uint32_t tc_ov_credits; uint8_t tc_ov_period_id; - uint8_t reserved[3]; } __rte_cache_aligned; struct rte_sched_queue { @@ -233,18 +221,10 @@ struct rte_sched_queue_extra { struct rte_sched_port { /* User parameters */ uint32_t n_subports_per_port; - uint32_t n_pipes_per_subport; - uint32_t n_pipes_per_subport_log2; int socket; uint32_t rate; uint32_t mtu; uint32_t frame_overhead; - uint16_t qsize[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; - uint32_t n_pipe_profiles; - uint32_t pipe_tc3_rate_max; -#ifdef RTE_SCHED_RED - struct rte_red_config red_config[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE][RTE_COLORS]; -#endif /* Timing */ uint64_t time_cpu_cycles; /* Current CPU time measured in CPU cyles */ @@ -252,50 +232,17 @@ struct rte_sched_port { uint64_t time; /* Current NIC TX time measured in bytes */ struct rte_reciprocal inv_cycles_per_byte; /* CPU cycles per byte */ - /* Scheduling loop detection */ - uint32_t pipe_loop; - uint32_t pipe_exhaustion; - - /* Bitmap */ - struct rte_bitmap *bmp; - uint32_t grinder_base_bmp_pos[RTE_SCHED_PORT_N_GRINDERS] __rte_aligned_16; - /* Grinders */ - struct rte_sched_grinder grinder[RTE_SCHED_PORT_N_GRINDERS]; - uint32_t busy_grinders; struct rte_mbuf **pkts_out; uint32_t n_pkts_out; uint32_t subport_id; uint32_t n_max_subport_pipes_log2; /* Max number of subport pipes */ - /* Queue base calculation */ - uint32_t qsize_add[RTE_SCHED_QUEUES_PER_PIPE]; - uint32_t qsize_sum; - /* Large data structures */ - struct rte_sched_subport *subport; - struct rte_sched_pipe *pipe; - struct rte_sched_queue *queue; - struct rte_sched_queue_extra *queue_extra; - struct rte_sched_pipe_profile *pipe_profiles; - uint8_t *bmp_array; - struct rte_mbuf **queue_array; struct rte_sched_subport *subports[RTE_SCHED_SUBPORTS_PER_PORT]; - uint8_t memory[0] __rte_cache_aligned; } __rte_cache_aligned; -enum rte_sched_port_array { - e_RTE_SCHED_PORT_ARRAY_SUBPORT = 0, - e_RTE_SCHED_PORT_ARRAY_PIPE, - e_RTE_SCHED_PORT_ARRAY_QUEUE, - e_RTE_SCHED_PORT_ARRAY_QUEUE_EXTRA, - e_RTE_SCHED_PORT_ARRAY_PIPE_PROFILES, - e_RTE_SCHED_PORT_ARRAY_BMP_ARRAY, - e_RTE_SCHED_PORT_ARRAY_QUEUE_ARRAY, - e_RTE_SCHED_PORT_ARRAY_TOTAL, -}; - enum rte_sched_subport_array { e_RTE_SCHED_SUBPORT_ARRAY_PIPE = 0, e_RTE_SCHED_SUBPORT_ARRAY_QUEUE, diff --git a/lib/librte_sched/rte_sched.h b/lib/librte_sched/rte_sched.h index 28b589309..5d6828e2e 100644 --- a/lib/librte_sched/rte_sched.h +++ b/lib/librte_sched/rte_sched.h @@ -81,7 +81,6 @@ extern "C" { #define RTE_SCHED_WRR_QUEUES_PER_PIPE 8 /** 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) @@ -95,10 +94,6 @@ extern "C" { /** 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 @@ -229,19 +224,6 @@ struct rte_sched_port_params { uint32_t frame_overhead; /**< Framing overhead per packet * (measured in bytes) */ uint32_t n_subports_per_port; /**< Number of subports */ - uint32_t n_pipes_per_subport; /**< Number of pipes per subport */ - uint16_t qsize[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; - /**< Packet queue size for each traffic class. - * All queues within the same pipe traffic class have the same - * size. Queues from different pipes serving the same traffic - * class have the same size. */ - struct rte_sched_pipe_params *pipe_profiles; - /**< Pipe profile table. - * Every pipe is configured using one of the profiles from this table. */ - uint32_t n_pipe_profiles; /**< Profiles in the pipe profile table */ -#ifdef RTE_SCHED_RED - struct rte_red_params red_params[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE][RTE_COLORS]; /**< RED parameters */ -#endif }; /* -- 2.20.1