[v2,15/15] sched: remove redundant code

Message ID 20190909100530.86020-16-jasvinder.singh@intel.com
State New
Delegated to: Cristian Dumitrescu
Headers show
Series
  • sched: subport level configuration of pipe nodes
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Jasvinder Singh Sept. 9, 2019, 10:05 a.m.
Remove redundant data structure fields from port level data
structures and update release notes.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
---
 doc/guides/rel_notes/release_19_11.rst |  6 +++-
 lib/librte_sched/rte_sched.c           | 43 +-------------------------
 lib/librte_sched/rte_sched.h           | 22 -------------
 3 files changed, 6 insertions(+), 65 deletions(-)

Patch

diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 8490d897c..746aeb0ea 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -85,6 +85,10 @@  API Changes
    Also, make sure to start the actual text at the margin.
    =========================================================
 
+* sched: The pipe nodes configuration parameters such as number of pipes,
+  pipe queue sizes, pipe profiles, etc., are moved from port level structure
+  to subport level. This allows different subports of the same port to
+  have different configuration for the pipe nodes.
 
 ABI Changes
 -----------
@@ -172,7 +176,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.3
+   + librte_sched.so.4
      librte_security.so.2
      librte_stack.so.1
      librte_table.so.3
diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c
index 8a7727286..ba504da1e 100644
--- a/lib/librte_sched/rte_sched.c
+++ b/lib/librte_sched/rte_sched.c
@@ -207,10 +207,8 @@  struct rte_sched_subport {
 struct rte_sched_port {
 	/* User parameters */
 	uint32_t n_subports_per_port;
-	uint32_t n_pipes_per_subport;
 	uint32_t n_max_pipes_per_subport;
 	uint32_t n_max_pipes_per_subport_log2;
-	uint32_t n_pipes_per_subport_log2;
 	uint16_t pipe_queue[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];
 	uint8_t pipe_tc[RTE_SCHED_QUEUES_PER_PIPE];
 	uint8_t tc_queue[RTE_SCHED_QUEUES_PER_PIPE];
@@ -218,13 +216,7 @@  struct rte_sched_port {
 	uint32_t mtu;
 	uint32_t frame_overhead;
 	int socket;
-	uint16_t qsize[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];
-	uint32_t n_pipe_profiles;
 	uint32_t n_max_pipe_profiles;
-	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
 
 	/* Timing */
 	uint64_t time_cpu_cycles;     /* Current CPU time measured in CPU cyles */
@@ -232,48 +224,15 @@  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;
 
-	/* Queue base calculation */
-	uint32_t qsize_add[RTE_SCHED_QUEUES_PER_PIPE];
-	uint32_t qsize_sum;
-
 	/* Large data structures */
-	struct rte_sched_subport *subports[0];
-	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;
-	uint8_t memory[0] __rte_cache_aligned;
+	struct rte_sched_subport *subports[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 ea2b07448..db1b0232f 100644
--- a/lib/librte_sched/rte_sched.h
+++ b/lib/librte_sched/rte_sched.h
@@ -246,33 +246,11 @@  struct rte_sched_port_params {
 	/** Number of subports */
 	uint32_t n_subports_per_port;
 
-	/** Number of subport_pipes */
-	uint32_t n_pipes_per_subport;
-
 	/** Maximum number of subport_pipes */
 	uint32_t n_max_pipes_per_subport;
 
-	/** Packet queue size for each traffic class.
-	 * All the pipes within the same subport share the similar
-	 * configuration for the queues.
-	 */
-	uint16_t qsize[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];
-
-	/** Pipe profile table.
-	 * Every pipe is configured using one of the profiles from this table.
-	 */
-	struct rte_sched_pipe_params *pipe_profiles;
-
-	/** Profiles in the pipe profile table */
-	uint32_t n_pipe_profiles;
-
 	/** Max profiles allowed in the pipe profile table */
 	uint32_t n_max_pipe_profiles;
-
-#ifdef RTE_SCHED_RED
-	/** RED parameters */
-	struct rte_red_params red_params[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE][RTE_COLORS];
-#endif
 };
 
 /*