summaryrefslogtreecommitdiff
path: root/lib/librte_sched
diff options
context:
space:
mode:
authorJasvinder Singh <jasvinder.singh@intel.com>2019-10-25 11:51:10 +0100
committerThomas Monjalon <thomas@monjalon.net>2019-10-25 17:49:45 +0200
commit85f52aa422d6d0822c76f02a5d3452f900db17b5 (patch)
treea53c162dc5a62792b5c1bca91e28e5a040d25da7 /lib/librte_sched
parent927a0e20e2415f718ceb346cd94bbf930ad9f29a (diff)
downloaddpdk-85f52aa422d6d0822c76f02a5d3452f900db17b5.zip
dpdk-85f52aa422d6d0822c76f02a5d3452f900db17b5.tar.gz
dpdk-85f52aa422d6d0822c76f02a5d3452f900db17b5.tar.xz
sched: add pipe config params to subport struct
Add pipe configuration parameters to subport level structure to allow different subports of the same port to have different configuration in terms of number of pipes, pipe queue sizes, etc. Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com> Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
Diffstat (limited to 'lib/librte_sched')
-rw-r--r--lib/librte_sched/Makefile2
-rw-r--r--lib/librte_sched/meson.build2
-rw-r--r--lib/librte_sched/rte_sched.h92
3 files changed, 65 insertions, 31 deletions
diff --git a/lib/librte_sched/Makefile b/lib/librte_sched/Makefile
index 3d7f410..6e4a72d 100644
--- a/lib/librte_sched/Makefile
+++ b/lib/librte_sched/Makefile
@@ -18,7 +18,7 @@ LDLIBS += -lrte_timer
EXPORT_MAP := rte_sched_version.map
-LIBABIVER := 3
+LIBABIVER := 4
#
# all source are stored in SRCS-y
diff --git a/lib/librte_sched/meson.build b/lib/librte_sched/meson.build
index 59d43c6..9f40a23 100644
--- a/lib/librte_sched/meson.build
+++ b/lib/librte_sched/meson.build
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2017 Intel Corporation
-version = 3
+version = 4
sources = files('rte_sched.c', 'rte_red.c', 'rte_approx.c')
headers = files('rte_sched.h', 'rte_sched_common.h',
'rte_red.h', 'rte_approx.h')
diff --git a/lib/librte_sched/rte_sched.h b/lib/librte_sched/rte_sched.h
index eac6db2..fbb0e23 100644
--- a/lib/librte_sched/rte_sched.h
+++ b/lib/librte_sched/rte_sched.h
@@ -111,7 +111,7 @@ extern "C" {
#endif
/*
- * Subport configuration parameters. The period and credits_per_period
+ * Pipe configuration parameters. The period and credits_per_period
* parameters are measured in bytes, with one byte meaning the time
* duration associated with the transmission of one byte on the
* physical medium of the output port, with pipe or pipe traffic class
@@ -119,7 +119,7 @@ extern "C" {
* credits_per_period divided by period. One credit represents one
* byte.
*/
-struct rte_sched_subport_params {
+struct rte_sched_pipe_params {
/** Token bucket rate (measured in bytes per second) */
uint32_t tb_rate;
@@ -129,32 +129,18 @@ struct rte_sched_subport_params {
/** Traffic class rates (measured in bytes per second) */
uint32_t tc_rate[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];
- /** Enforcement period for rates (measured in milliseconds) */
+ /** Enforcement period (measured in milliseconds) */
uint32_t tc_period;
-};
-
-/** Subport statistics */
-struct rte_sched_subport_stats {
- /** Number of packets successfully written */
- uint32_t n_pkts_tc[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];
-
- /** Number of packets dropped */
- uint32_t n_pkts_tc_dropped[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];
- /** Number of bytes successfully written for each traffic class */
- uint32_t n_bytes_tc[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];
-
- /** Number of bytes dropped for each traffic class */
- uint32_t n_bytes_tc_dropped[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];
+ /** Best-effort traffic class oversubscription weight */
+ uint8_t tc_ov_weight;
-#ifdef RTE_SCHED_RED
- /** Number of packets dropped by red */
- uint32_t n_pkts_red_dropped[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];
-#endif
+ /** WRR weights of best-effort traffic class queues */
+ uint8_t wrr_weights[RTE_SCHED_BE_QUEUES_PER_PIPE];
};
/*
- * Pipe configuration parameters. The period and credits_per_period
+ * Subport configuration parameters. The period and credits_per_period
* parameters are measured in bytes, with one byte meaning the time
* duration associated with the transmission of one byte on the
* physical medium of the output port, with pipe or pipe traffic class
@@ -162,7 +148,7 @@ struct rte_sched_subport_stats {
* credits_per_period divided by period. One credit represents one
* byte.
*/
-struct rte_sched_pipe_params {
+struct rte_sched_subport_params {
/** Token bucket rate (measured in bytes per second) */
uint32_t tb_rate;
@@ -172,14 +158,58 @@ struct rte_sched_pipe_params {
/** Traffic class rates (measured in bytes per second) */
uint32_t tc_rate[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];
- /** Enforcement period (measured in milliseconds) */
+ /** Enforcement period for rates (measured in milliseconds) */
uint32_t tc_period;
- /** Best-effort traffic class oversubscription weight */
- uint8_t tc_ov_weight;
+ /** Number of subport pipes.
+ * The subport can enable/allocate fewer pipes than the maximum
+ * number set through struct port_params::n_max_pipes_per_subport,
+ * as needed, to avoid memory allocation for the queues of the
+ * pipes that are not really needed.
+ */
+ uint32_t n_pipes_per_subport_enabled;
- /** WRR weights of best-effort traffic class queues */
- uint8_t wrr_weights[RTE_SCHED_BE_QUEUES_PER_PIPE];
+ /** 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 allowed profiles 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
+};
+
+/** Subport statistics */
+struct rte_sched_subport_stats {
+ /** Number of packets successfully written */
+ uint32_t n_pkts_tc[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];
+
+ /** Number of packets dropped */
+ uint32_t n_pkts_tc_dropped[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];
+
+ /** Number of bytes successfully written for each traffic class */
+ uint32_t n_bytes_tc[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];
+
+ /** Number of bytes dropped for each traffic class */
+ uint32_t n_bytes_tc_dropped[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];
+
+#ifdef RTE_SCHED_RED
+ /** Number of packets dropped by red */
+ uint32_t n_pkts_red_dropped[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];
+#endif
};
/** Queue statistics */
@@ -224,7 +254,11 @@ struct rte_sched_port_params {
/** Number of subports */
uint32_t n_subports_per_port;
- /** Number of subport_pipes */
+ /** Maximum number of subport pipes.
+ * This parameter is used to reserve a fixed number of bits
+ * in struct rte_mbuf::sched.queue_id for the pipe_id for all
+ * the subports of the same port.
+ */
uint32_t n_pipes_per_subport;
/** Packet queue size for each traffic class.